diff options
42 files changed, 753 insertions, 309 deletions
diff --git a/INSTALL-WIN32.md b/INSTALL-WIN32.md index 8640ee3b51..1e5e1f45fa 100644 --- a/INSTALL-WIN32.md +++ b/INSTALL-WIN32.md @@ -6,29 +6,31 @@ Introduction This file describes how to build the Erlang emulator and the OTP libraries on Windows. The instructions apply to versions of Windows -supporting the Cygwin emulated gnuish environment for Windows. We've -built on the following platforms: Windows 2000 Professional, Windows -2003 server, Windows XP Home/Professional, and Windows Vista. Any -Windows95'ish platform will surely get you into trouble, what I'm not -sure of, but it certainly will... - -The procedure described uses Cygwin as a build environment, you run -the bash shell in Cygwin and uses gnu make/configure/autoconf etc to -do the build. The emulator C-source code is, however, mostly compiled -with Microsoft Visual C++™, producing a native Windows binary. This -is the same procedure as we use to build the pre-built binaries. The -fact that we use VC++ and not gcc is explained further in the FAQ -section. +supporting the Cygwin emulated gnuish environment for Windows or the +Msys ditto. We've built on the following platforms: Windows 2003 +server, Windows XP Home/Professional, Windows Vista and Windows 7 (32 +and 64 bit). You can probably build on Windows 2000, but you will not +be able to install the latest Microsoft SDK, so you have to go back to +some earlier compiler. Any Windows95'ish platform will surely get you +into trouble, what I'm not sure of, but it certainly will... + +The procedure described uses either Cygwin or Msys as a build +environment, you run the bash shell in Cygwin/Msys and use gnu +make/configure/autoconf etc to do the build. The emulator C-source +code is, however, mostly compiled with Microsoft Visual C++™, +producing a native Windows binary. This is the same procedure as we +use to build the pre-built binaries. The fact that we use VC++ and not +gcc is explained further in the FAQ section. I describe the build procedure to make it possible for open source customers to build the emulator, given that they have the needed tools. The binary Windows releases is still a preferred alternative if one does not have Microsoft's development tools and/or don't want to -install Cygwin. +install Cygwin or Msys. -To use Cygwin, one needs basic experience from a Unix environment, if +To use Cygwin/Msys, one needs basic experience from a Unix environment, if one does not know how to set environment variables, run programs etc -in a Unix environment, one will be quite lost in the Cygwin +in a Unix environment, one will be quite lost in the Cygwin os Msys ditto. I can unfortunately not teach all the world how to use Cygwin and bash, neither how to install Cygwin nor perform basic tasks on a computer. Please refer to other documentation on the net for @@ -41,11 +43,11 @@ to make the Erlang/OTP distribution for Windows better. Please submit any suggestions and patches to the appropriate [mailing lists] [1] to let them find their way into the next version of Erlang. If making changes to the build system (like makefiles etc) please bear in mind that the -same makefiles are used on Unix/VxWorks/OSEDelta, so that your changes +same makefiles are used on Unix/VxWorks, so that your changes don't break other platforms. That of course goes for C-code too, system specific code resides in the `$ERL_TOP/erts/emulator/sys/win32` and `$ERL_TOP/erts/etc/win32` directories mostly. The -`$ERL_TOP/erts/emulator/beam directory` is for common code. +`$ERL_TOP/erts/emulator/beam` directory is for common code. Before the R9C release of Erlang/OTP, the Windows release was built partly on a Unix (Solaris) box and partly on a Windows box, using Perl @@ -61,6 +63,21 @@ their problems, please try to solve the problems and submit solutions/workarounds. Remember, it's all about sharing, not about demanding... +Starting with R15B, our build system runs both on Cygwin and Msys +(MinGW's fork of an early cygwin version). Msys is a smaller package +to install and may on some machines run slightly faster. If Cygwin +gives you trouble, try Msys instead, and v.v. Beginning with R15B +there is also a native 64bit version of Erlang for 64bit Windows 7 +(only). These instructions apply to both the 32bit VM and the 64bit +ditto. + +Note that even if you build a 64bit VM, most of the directories and +files involved are still named win32. You can view the name win32 as +meaning any windows version not beeing 16bit. A few occurences of the +name Win64 are however present in the system, for example the +installation file for a 64 bit windows version of Erlang is by default +named `otp_win64_<version>.exe`. + Lets go then, I'll start with a little FAQ, based on in house questions and misunderstandings. @@ -70,10 +87,13 @@ Frequently Asked Questions * Q: So, now I can build Erlang using GCC on Windows? - A: No, unfortunately not. You'll need Microsoft's Visual C++ still, a - Bourne-shell script (cc.sh) wraps the Visual C++ compiler and runs it - from within the Cygwin environment. All other tools needed to build - Erlang are free-ware/open source, but not the C compiler. + A: No, unfortunately not. You'll need Microsoft's Visual C++ + still, a Bourne-shell script (cc.sh) wraps the Visual C++ compiler + and runs it from within the Cygwin environment. All other tools + needed to build Erlang are free-ware/open source, but not the C + compiler. The Windows SDK is however enough to build Erlang, you + do not need to buy Visual C++, just download the SDK (SDK version + 7.1 == Visual studio 2010). * Q: Why haven't you got rid of VC++ then, you \*\*\*\*\*\*? @@ -83,18 +103,22 @@ Frequently Asked Questions directories). Unfortunately the development of the SMP version for Windows broke the mingw build and we chose to focus on the VC++ build as the performance has been much better in the VC++ versions. The - mingw build will be back, but as long as VC++ gives better + mingw build will possibly be back, but as long as VC++ gives better performance, the commercial build will be a VC++ one. -* Q: OK, VC++ you need, but now you've started to demand a very recent +* Q: OK, you need VC++, but now you've started to demand a very recent (and expensive) version of Visual studio, not the old and stable VC++ 6.0 that was used in earlier versions. Why? - A: The SMP version of Erlang needs features in the Visual Studio 2005. - Can't live without them. Besides the new compiler gives the Erlang - emulator a ~40% performance boost(!). Alternatively you can build Erlang - successfully using the free (proprietary) Visual Studio 2008 Express - edition C++ compiler. + A: Well, it's not expensive, it's free (as in free beer). Just + download and install the latest Windows SDK from Microsoft and all + the tools you need are there. The included debugger (WinDbg) is + also quite usable, it's what I used when porting Erlang to 64bit + Windows. Another reason to use the latest Microsoft compilers is + DLL compatibility. DLL's using a new version of the standard + library might not load if the VM is compiled with an old VC++ + version, why we should aim to use the latest freely available SDK + and compiler. * Q: Can/will I build a Cygwin binary with the procedure you describe? @@ -112,15 +136,15 @@ Frequently Asked Questions * Q: Hah, I saw you, you used GCC even though you said you didn't! - A: OK, I admit, one of the files is compiled using Cygwin's GCC and - the resulting object code is then converted to MS VC++ compatible coff - using a small C hack. It's because that particular file, `beam_emu.c` - benefits immensely from being able to use the GCC labels-as-values - extension, which boosts emulator performance by up to 50%. That does - unfortunately not (yet) mean that all of OTP could be compiled using - GCC, that particular source code does not do anything system specific - and actually is adopted to the fact that GCC is used to compile it on - Windows. + A: OK, I admit, one of the files is compiled using Cygwin's or + MinGW's GCC and the resulting object code is then converted to MS + VC++ compatible coff using a small C hack. It's because that + particular file, `beam_emu.c` benefits immensely from being able + to use the GCC labels-as-values extension, which boosts emulator + performance by up to 50%. That does unfortunately not (yet) mean + that all of OTP could be compiled using GCC, that particular + source code does not do anything system specific and actually is + adopted to the fact that GCC is used to compile it on Windows. * Q: So now there's a MS VC++ project file somewhere and I can build OTP using the nifty VC++ GUI? @@ -135,31 +159,36 @@ Frequently Asked Questions * Q: So how does it all work then? - A: Cygwin is the environment, which closely resembles the environments - found on any Unix machine. It's almost like you had a virtual Unix - machine inside Windows. Configure, given certain parameters, then - creates makefiles that are used by the Cygwin gnu-make to built the - system. Most of the actual compilers etc are not, however, Cygwin - tools, so I've written a couple of wrappers (Bourne-shell scripts), - which reside in `$ERL_TOP/etc/win32/cygwin_tools` and they all do - conversion of parameters and switches common in the Unix environment - to fit the native Windows tools. Most notable is of course the paths, - which in Cygwin are Unix-like paths with "forward slashes" (/) and no - drive letters, the Cygwin specific command `cygpath` is used for most - of the path conversions. Luckily most compilers accept forward slashes - instead of backslashes as path separators, one still have to get the - drive letters etc right, though. The wrapper scripts are not general - in the sense that, for example, cc.sh would understand and translates - every possible gcc option and passes correct options to cl.exe. The - principle is that the scripts are powerful enough to allow building of - Erlang/OTP, no more, no less. They might need extensions to cope with - changes during the development of Erlang, that's one of the reasons I - made them into shell-scripts and not Perl-scripts, I believe they are - easier to understand and change that way. I might be wrong though, - cause another reason I didn't write them in Perl is because I've never - liked Perl and my Perl code is no pleasant reading... - - In `$ERL_TOP`, there is a script called `otp_build`, that script handles + A: Cygwin or Msys is the environment, which closely resembles the + environments found on any Unix machine. It's almost like you had a + virtual Unix machine inside Windows. Configure, given certain + parameters, then creates makefiles that are used by the + Cygwin/Msys gnu-make to built the system. Most of the actual + compilers etc are not, however, Cygwin/Msys tools, so I've written + a couple of wrappers (Bourne-shell scripts), which reside in + `$ERL_TOP/etc/win32/cygwin_tools` and + `$ERL_TOP/etc/win32/msys_tools`. They all do conversion of + parameters and switches common in the Unix environment to fit the + native Windows tools. Most notable is of course the paths, which + in Cygwin/Msys are Unix-like paths with "forward slashes" (/) and + no drive letters, the Cygwin specific command `cygpath` is used + for most of the path conversions in a Cygwin environment, other + tools are used (when needed) in the corresponding Msys + environment. Luckily most compilers accept forward slashes instead + of backslashes as path separators, but one still have to get the drive + letters etc right, though. The wrapper scripts are not general in + the sense that, for example, cc.sh would understand and translates + every possible gcc option and passes correct options to + cl.exe. The principle is that the scripts are powerful enough to + allow building of Erlang/OTP, no more, no less. They might need + extensions to cope with changes during the development of Erlang, + that's one of the reasons I made them into shell-scripts and not + Perl-scripts, I believe they are easier to understand and change + that way. I might be wrong though, cause another reason I didn't + write them in Perl is because I've never liked Perl and my Perl + code is no pleasant reading... + + In `$ERL_TOP`, there is a script called `otp_build`. That script handles the hassle of giving all the right parameters to `configure`/`make` and also helps you set up the correct environment variables to work with the Erlang source under Cygwin. @@ -177,17 +206,19 @@ Frequently Asked Questions A: Yes, we use the exactly same build procedure. -* Q: Which version of Cygwin and other tools do you use then? +* Q: Which version of Cygwin/Msys and other tools do you use then? - A: For Cygwin we try to use the latest releases available when - building. What versions you use shouldn't really matter, I try to - include workarounds for the bugs I've found in different Cygwin - releases, please help me to add workarounds for new Cygwin-related - bugs as soon as you encounter them. Also please do submit bug reports - to the appropriate Cygwin developers. The Cygwin GCC we used for %OTP-REL% - was version 3.4.4. We used VC++ 8.0 (i.e. Visual studio 2005 SP1), - Sun's JDK 1.5.0\_17, NSIS 2.37, and Win32 OpenSSL 0.9.8e. Please read - the next section for details on what you need. + A: For Cygwin and Msys alike, we try to use the latest releases + available when building. What versions you use shouldn't really + matter, I try to include workarounds for the bugs I've found in + different Cygwin/Msys releases, please help me to add workarounds + for new Cygwin/Msys-related bugs as soon as you encounter + them. Also please do submit bug reports to the appropriate Cygwin + adn/or Msys developers. The GCC we used for %OTP-REL% was version + 4.7.0 (MinGW 64bit) and 4.3.4 (Cygwin 32bit). We used VC++ 10.0 + (i.e. Visual studio 2010), Sun's JDK 1.5.0\_17 (32bit) and Sun's + JDK 1.7.0\_1 (64bit), NSIS 2.46, and Win32 OpenSSL 0.9.8r. Please + read the next section for details on what you need. * Q: Can you help me setup X in Cygwin? @@ -201,24 +232,21 @@ Frequently Asked Questions described as much as I could about the installation of the needed tools. Once the tools are installed, building is quite easy. I also have tried to make this instruction understandable for people with - limited Unix experience. Cygwin is a whole new environment to some + limited Unix experience. Cygwin/Msys is a whole new environment to some Windows users, why careful explanation of environment variables etc seemed to be in place. The short story, for the experienced and impatient is: - * Get and install complete Cygwin (latest) - - * (Buy and) Install Microsoft Visual studio 2005 and SP1 (or higher) + * Get and install complete Cygwin (latest) or complete MinGW with msys - * Alternatively install the free MS Visual Studio 2008 Express [msvc++] - and the Windows SDK [32bit-SDK] or [64bit-SDK] depending on the Windows - platform you are running. + * Install Microsofts Windows SDK 7.1 (and .Net 4) - * Get and install Sun's JDK 1.4.2 + * Get and install Sun's JDK 1.5.0 or higher * Get and install NSIS 2.01 or higher (up to 2.46 tried and working) - * Get and install OpenSSL 0.9.7c or higher (up to 1.0.0a tried & working) + * Get, build and install OpenSSL 0.9.8r or higher (up to 1.0.0a + tried & working) with static libs. * Get the Erlang source distribution (from <http://www.erlang.org/download.html>) and unpack with Cygwin's `tar`. @@ -251,10 +279,9 @@ Tools you Need and Their Environment ------------------------------------ You need some tools to be able to build Erlang/OTP on Windows. Most -notably you'll need Cygwin and Microsoft VC++, but you also might want -a Java compiler, the NSIS install system and OpenSSL. Only VC++ costs -money, but then again it costs a lot of money, I know... -Well' here's the list: +notably you'll need Cygwin or Msys and Microsofts Windows SDK, but +you also might want a Java compiler, the NSIS install system and +OpenSSL. Well' here's the list: * Cygwin, the very latest is usually best. Get all the development tools and of course all the basic ditto. In fact getting the complete @@ -263,6 +290,10 @@ Well' here's the list: sure *not* to install a Cygwin'ish Java... The Cygwin jar command is used but Sun's Java compiler and virtual machine... + If you are going to build a 64bit Windows version, you should make + sure to get MinGWs 64bit gcc installed with cygwin. It's in one of + the development packages. + URL: <http://www.cygwin.com> Get the installer from the web site and use that to install @@ -302,72 +333,205 @@ Well' here's the list: haven't tried and know of no one that has. I expect that you use bash in all shell examples. -* Microsoft Visual Studio 2005 SP1. Please don't skip the service - pack! The installer might update your environment so that you can run - the `cl` command from the bash prompt, then again it might - not... There is always a BAT file in VC\Bin under the installation - directory (default `C:\Program Files\Microsoft Visual Studio 8`) called - `VCVARS32.BAT`. Either add the environment settings in that file to the - global environment settings in Windows or add the corresponding BASH - environment settings to your `.profile`/`.bashrc`. For example, in my case - I could add the following to `.profile` - - #Visual C++ Root directory as Cygwin style pathname - VCROOT=/cygdrive/c/Program\ Files/Microsoft\ Visual\ Studio 8 - - # Visual C++ Root directory as Windows style pathname - WIN_VCROOT="C:\\Program Files\\Microsoft Visual Studio 8" - - # The PATH variable should be Cygwin'ish - PATH=$VCROOT/Common7/IDE:$VCROOT/VC/BIN:$VCROOT/Common7/Tools:\ - $VCROOT/Common7/Tools/bin:$VCROOT/VC/PlatformSDK/bin:$VCROOT/SDK/v2.0/bin:\ - $VCROOT/VC/VCPackages:$PATH - - # Lib and INCLUDE should be Windows'ish - # Note that semicolon (;) is used to separate Windows style paths but - # colon (:) to separate Cygwin ditto! - - LIBPATH=$WIN_VCROOT\\VC\\ATLMFC\\LIB - - LIB=$WIN_VCROOT\\VC\\ATLMFC\\LIB\;$WIN_VCROOT\\VC\\LIB\;\ - $WIN_VCROOT\\VC\\PlatformSDK\\lib\;$WIN_VCROOT\\SDK\\v2.0\\lib - - INCLUDE=$WIN_VCROOT\\VC\\ATLMFC\\INCLUDE\;$WIN_VCROOT\\VC\\INCLUDE\;\ - $WIN_VCROOT\\VC\\PlatformSDK\\include - - export PATH LIB INCLUDE - - Make a simple hello world and try to compile it with the `cl` command - from within bash. If that does not work, your environment needs - fixing. Also remember to fix up the PATH environment, especially old - Erlang installations might have inserted quoted paths that Cygwin does - not understand. Remove or correct such paths. There should be no - backslashes in your path environment variable in Cygwin bash, but LIB - and INCLUDE should contain Windows style paths with semicolon, - drive letters and backslashes. - - If you wish to use Visual Studio 2008, a couple things need to be tweaked, - namely the fact that some of the SDK stuff is installed in (by default) - `C:\Program Files\Microsoft SDKs\v6.0A` . Just ensure that that - `C:\Program Files\Microsoft SDKs\v6.0A\Lib` is in `LIB` and - `C:\Program Files\Microsoft SDKs\v6.0A\Include` is in `INCLUDE`. A symptom - of not doing this is errors about finding kernel32.lib and windows.h. - - Additionally, if you encounter errors about mc.exe not being found, you must - install the entire Windows SDK (the partial SDK included in visual studio - apparently does not include it). After installing it you'll want to add - something like: `/c/cygdrive/Program\ Files/Microsoft\ SDKs/v7.0/bin` to - your `PATH` to allow the environment to find mc.exe. The next Visual Studio - (2010) is expected to include this tool. - - Alternatively install the free MS Visual Studio 2008 Express [msvc++] and - the Windows SDK [32bit-SDK] or [64bit-SDK] depending on the Windows - platform you are running, which includes the missing mc.exe message - compiler. - -[msvc++]: http://download.microsoft.com/download/E/8/E/E8EEB394-7F42-4963-A2D8-29559B738298/VS2008ExpressWithSP1ENUX1504728.iso -[32bit-SDK]: http://download.microsoft.com/download/2/E/9/2E911956-F90F-4BFB-8231-E292A7B6F287/GRMSDK_EN_DVD.iso -[64bit-SDK]: http://download.microsoft.com/download/2/E/9/2E911956-F90F-4BFB-8231-E292A7B6F287/GRMSDKX_EN_DVD.iso +* Alternatively you download MinGW and Msys. You'll find the latest + installer at: + + URL: <http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/> + + Make sure to install everything they've got. + + To be able to build the 64bit VM, you will also need the 64bit + MinGW compiler from: + + URL: <http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/> + + The latest version should do it. Make sure you download the + `mingw-w64-bin_i686-mingw_<something>.zip`, not a linux + version. You unzip the package on top of your MinGW installation + (`c:\MinGW`) and that's it. + + Setting up your environment in Msys is similar to setting it up in + Cygwin. + +* Microsofts Windows SDK version 7.1 (corresponding to VC++ 10.0 and + Visual Studio 2010). You'll find it here: + + URL: <http://www.microsoft.com/download/en/details.aspx?id=8279> + + but before you install that, you need to have .Net 4 installed, + you'll find that here: + + URL: <http://www.microsoft.com/download/en/details.aspx?id=17851> + + Use the web installer for the SDK, at least when I tried + downloading the whole package as an image, I got SDK 7.0 instead, + which is not what you want... + + There will be a Windows command file in `%PROGRAMFILES%\Mirosoft + SDKs\Windows\v7.1\Bin\SetEnv.cmd` that set's the appropriate + environment for a Windows command prompt. This is not appropriate + for bash, so you'll need to convert it to bash-style environments + by editing your `.bash_profile`. In my case, where the SDK is + installed in the default directory and `%PROGRAMFILES%` is + `C:\Program Files`, the commands for setting up a 32bit build + environment (on a 64bit or 32bit machine) look like this (in cygwin): + + # Some common paths + C_DRV=/cygdrive/c + PRG_FLS=$C_DRV/Program\ Files + + # nsis + NSIS_BIN=$PRG_FLS/NSIS + # java + JAVA_BIN=$PRG_FLS/Java/jdk1.6.0_16/bin + + ## + ## MS SDK + ## + + CYGWIN=nowinsymlinks + MVS10="$PRG_FILES/Microsoft Visual Studio 10.0" + WIN_MVS10="C:\\Program Files\\Microsoft Visual Studio 10.0" + SDK10="$PRG_FILES/Microsoft SDKs/Windows/v7.1" + WIN_SDK10="C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1" + + PATH="$NSIS_BIN:\ + $MVS10/Common7/IDE:\ + $MVS10/Common7/Tools:\ + $MVS10/VC/Bin:\ + $MVS10/VC/Bin/VCPackages:\ + $SDK10/Bin/NETFX 4.0 Tools:\ + $SDK10/Bin:\ + /usr/local/bin:/usr/bin:/bin:\ + /cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:\ + /cygdrive/c/WINDOWS/system32/Wbem:\ + $JAVA_BIN" + + LIBPATH="$WIN_MVS10\\VC\\LIB" + + LIB="$WIN_MVS10\\VC\\LIB;$WIN_SDK10\\LIB" + + INCLUDE="$WIN_MVS10\\VC\\INCLUDE;$WIN_SDK10\\INCLUDE;$WIN_SDK10\\INCLUDE\\gl" + + export CYGWIN PATH LIBPATH LIB INCLUDE + + If you're using Msys instead, the only thing you need to change is + the `C_DRV` setting, which would read: + + C_DRV=/c + + And of course you might need to change `C:\Program Files` etc if + you're using a non-english version of Windows (XP). Note that in + later versions of Windows, the national adoptions of the program + files directories etc are not on the file system but only in the + explorer, so even if explorer says that your programs reside in + e.g. `C:\Program`, they might still reside in `C:\Program Files` + in reality... + + If you are building a 64 bit verision of Erlang, you should set up + PATHs etc a little differently. I use the following script to + make things work in both Cygwin and Msys: + + make_winpath() + { + P=$1 + if [ "$IN_CYGWIN" = "true" ]; then + cygpath -d "$P" + else + (cd "$P" && /bin/cmd //C "for %i in (".") do @echo %~fsi") + fi + } + + make_upath() + { + P=$1 + if [ "$IN_CYGWIN" = "true" ]; then + cygpath "$P" + else + echo "$P" | /bin/sed 's,^\([a-zA-Z]\):\\,/\L\1/,;s,\\,/,g' + fi + } + + # Some common paths + if [ -x /usr/bin/msysinfo ]; then + # Without this the path conversion won't work + COMSPEC='C:\Windows\SysWOW64\cmd.exe' + MSYSTEM=MINGW32 + export MSYSTEM COMSPEC + IN_CYGWIN=false + else + CYGWIN=nowinsymlinks + export CYGWIN + IN_CYGWIN=true + fi + + if [ "$IN_CYGWIN" = "true" ]; then + PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:\ + /cygdrive/c/windows/system32:/cygdrive/c/windows:/cygdrive/c/windows/system32/Wbem + else + PATH=/usr/local/bin:/mingw/bin:/bin:/c/Windows/system32:/c/Windows:\ + /c/Windows/System32/Wbem + fi + + if [ "$IN_CYGWIN" = "true" ]; then + C_DRV=/cygdrive/c + else + C_DRV=/c + fi + + PRG_FLS64=$C_DRV/Program\ Files + PRG_FLS32=$C_DRV/Program\ Files\ \(x86\) + VISUAL_STUDIO_ROOT32=$PRG_FLS32/Microsoft\ Visual\ Studio\ 10.0 + MS_SDK_ROOT64=$PRG_FLS64/Microsoft\ SDKs/Windows/v7.1 + + # Okay, now mangle the paths and get rid of spaces by using short names + WIN_VCROOT32=`make_winpath "$VISUAL_STUDIO_ROOT32"` + VCROOT32=`make_upath $WIN_VCROOT32` + WIN_SDKROOT64=`make_winpath "$MS_SDK_ROOT64"` + SDKROOT64=`make_upath $WIN_SDKROOT64` + WIN_PROGRAMFILES32=`make_winpath "$PRG_FLS32"` + PROGRAMFILES32=`make_upath $WIN_PROGRAMFILES32` + + WIN_PROGRAMFILES64=`make_winpath "$PRG_FLS64"` + PROGRAMFILES64=`make_upath $WIN_PROGRAMFILES64` + + # nsis + NSIS_BIN=$PROGRAMFILES32/NSIS + # java + JAVA_BIN=$PROGRAMFILES64/Java/jdk1.7.0_01/bin + + ## The PATH variable should be Unix'ish + VCPATH=$VCROOT32/Common7/IDE:$VCROOT32/VC/BIN/amd64:$VCROOT32/Common7/Tools:\ + $VCROOT32/VC/VCPackages:$SDKROOT64/bin/NETFX4~1.0TO/x64:$SDKROOT64/bin/x64:\ + $SDKROOT64/bin + + ## Microsoft SDK libs + + LIBPATH=$WIN_VCROOT32\\VC\\LIB\\amd64 + LIB=$WIN_VCROOT32\\VC\\LIB\\amd64\;$WIN_SDKROOT64\\LIB\\X64 + INCLUDE=$WIN_VCROOT32\\VC\\INCLUDE\;$WIN_SDKROOT64\\include\;\ + $WIN_SDKROOT64\\include\\gl + + # Put nsis, c compiler and java in path + PATH=$NSIS_BIN:$VCPATH:$PATH:$JAVA_BIN + + # Make sure LIB and INCLUDE is available for others + export PATH LIBPATH LIB INCLUDE + + All this is derived from the SetEnv.cmd command file mentioned + earlier. The bottom line is to set the PATH so that NSIS and + Microsoft SDK is found before the Msys/Cygwin tools and that Java + is last in the PATH. + + Make a simple hello world (maybe one that prints out + `sizeof(void *)`) and try to compile it with the `cl` command from within + bash. If that does not work, your environment needs fixing. Also + remember to fix up the PATH environment, especially old Erlang + installations might have inserted quoted paths that Cygwin/Msys + does not understand. Remove or correct such paths. There should be + no backslashes in your path environment variable in Cygwin bash, + but LIB and INCLUDE should contain Windows style paths with + semicolon, drive letters and backslashes. * Sun's Java JDK 1.5.0 or higher. Our Java code (jinterface, ic) is written for JDK 1.5.0. Get it for Windows and install it, the JRE is @@ -378,11 +542,11 @@ Well' here's the list: Add javac *LAST* to your path environment in bash, in my case this means: - PATH="$PATH:/cygdrive/c/Program Files/Java/jdk1.5.0_17/bin" + `PATH="$PATH:/cygdrive/c/Program Files/Java/jdk1.5.0_17/bin"` No `CLASSPATH` or anything is needed. Type `javac` at the bash prompt and you should get a list of available Java options. Make sure by - typing `which java` that you use the Java you installed. Note however that + typing `type java` that you use the Java you installed. Note however that Cygwin's `jar.exe` is used, that's why the JDK bin-directory should be added last in the `PATH`. @@ -402,29 +566,75 @@ Well' here's the list: type makensis at the bash prompt and you should get a list of options if everything is OK. -* OpenSSL for Windows. This is if you want the SSL and crypto - applications to compile (and run). Go to <http://www.openssl.org>, click - on the `Related` link and then on the `Binaries` link (upper right - corner of the page last time I looked), you can then reach the - "Shining Lights Productions" Web site for Windows binaries - distributions. Get the latest 32-bit installer, or use 0.9.7c if you get - trouble with the latest, and install to C:\OpenSSL which is where the - Makefiles are expecting to find it. It's a nifty installer. The rest should - be handled by `configure`, you needn't put anything in the path or anything. - - If you want to build openssl for windows yourself (which might be - possible, as you wouldn't be reading this if you weren't a - compile-it-yourself person), you either have to put the resulting - DLL's in your path or in the windows system directory and either - specify where you put the includes etc with the configure-parameter - `--with-ssl=<cygwin path to the root>` or put your installation directly - under `c:\OpenSSL`. The directory structure under the installation root - for OpenSSL is expected to be one with subdirectories named `include`, - `bin` and `lib`, possibly with a `VC` subdirectory of `lib` containing - the actual `.lib` files. Note that the cygwin distributed OpenSSL cannot be - used, it results in cygwin depending binaries and it has unix style - archives (`.a`, not `.lib`). +* OpenSSL. This is if you want the SSL and crypto applications to + compile (and run). There are prebuilt binaries available, but I + strongly recommend building this yourself. It's quite easy. + + First get the source from + + URL: <http://openssl.org/source/> + + I would recommend using 0.9.8r. + + Download the tar file and unpack it (using your bash prompt) into + a directory of your choise. + + You will need a Windowish Perl for the build. ActiveState has one: + + URL: <http://www.activestate.com/activeperl/downloads> + + Download and install that. Disable options to associate it with + the .pl suffix and/or adding things to PATH, they are not needed. + + Now fire up the Microsoft Windows SDK command prompt in RELEASE + mode for the architecture you are going to build. The easiest is + to copy the shortcut from the SDKs start menu item and edit the + command line in the shortcut (Right click->Properties) to end with + `/Release`. Make sure the banner when you double click your + shortcut (the text in the resulting command window) says + `Targeting Windows XP x64 Release` if you are going to do a 64 bit + build and `Targeting Windows XP x86 Release` if you are building a + 32 bit version. + + Now cd to where you unpacked the OpenSSL source using your Release + Windows command prompt (it should be on the same drive as where + you are going to install it if everything is to work smothly). + + `C:\> cd <some dir>` + + Add ActiveState (or some other windows perl, not cygwins) to your PATH: + + `C:\...\> set PATH=C:\Perl\bin;%PATH%` + + Configure OpenSSL for 32 bit: + `C:\...\> perl Configure VC-WIN32 --prefix=/OpenSSL` + + Or for 64 bit: + + `C:\...\> perl Configure VC-WIN64A --prefix=/OpenSSL-Win64` + + Do some setup (for 32 bit): + + `C:\...\> ms\do_win32` + + The same for 64 bit: + + `C:\...\> ms\do_win64a` + + Then build static libraries and install: + + `C:\...\> nmake -f ms\nt.mak` + `C:\...\> nmake -f ms\nt.mak install` + + That's it - you now have your perfectly consistent static build of + openssl. If you want to get rid of any possibly patented + algorithms in the lib, just read up on the OpenSSL FAQ and follow + the instructions. + + The installation locations chosen are where configure will look + for OpenSSL, so try to keep them as is. + * Building with wxWidgets. Download wxWidgets-2.8.9 or higher patch release (2.9.\* is a developer release which currently does not work with wxErlang). @@ -473,6 +683,9 @@ Well' here's the list: erlang system without gs (which might be okay as you probably will use wx anyway). + Note that there is no special 64bit version of TCL/TK needed, you + can use the 32bit program even for a 64bit build. + The Shell Environment --------------------- @@ -500,6 +713,12 @@ the ksh variant: $ cd $ERL_TOP $ eval $(./otp_build env_win32) +If you are building a 64 bit version, you supply `otp_build` with an architecture parameter: + + $ cd $ERL_TOP + $ eval `./otp_build env_win32 x64` + + This should do the final touch to the environment and building should be easy after this. You could run `./otp_build env_win32` without `eval` just to see what it does, and to see that the environment it @@ -509,10 +728,11 @@ style short names instead), the variables `OVERRIDE_TARGET`, `CC`, `CXX`, `$ERL_TOP/erts/etc/win32/cygwin_tools/vc` and `$ERL_TOP/erts/etc/win32/cygwin_tool` are added first in the PATH. -Try now a `which erlc`. That should result in the erlc wrapper script +Try now a `type erlc`. That should result in the erlc wrapper script (which does not have the .sh extension, for reasons best kept -untold...). It should reside in `$ERL_TOP/erts/etc/win32/cygwin_tools`. -You could also try `which cc.sh`, which `ar.sh` etc. +untold...). It should reside in `$ERL_TOP/erts/etc/win32/cygwin_tools` +or `$ERL_TOP/erts/etc/win32/msys_tools`. You could also try `which +cc.sh`, which `ar.sh` etc. Now you're ready to build... @@ -520,8 +740,8 @@ Now you're ready to build... Building and Installing ----------------------- -Now it's assumed that you have executed `` eval `./otp_build env_win32` `` -for this particular shell... +Now it's assumed that you have executed `` eval `./otp_build env_win32` `` or +`` eval `./otp_build env_win32 x64` `` for this particular shell... Building is easiest using the `otp_build` script. That script takes care of running configure, bootstrapping etc on Windows in a simple @@ -613,6 +833,13 @@ Lets get into more detail: $ release/win32/otp_win32_%OTP-REL% /S ... + or + + $ cd $ERL_TOP + $ release/win32/otp_win64_%OTP-REL% /S + ... + + and after a while Erlang/OTP-%OTP-REL% will have been installed in `C:\Program Files\erl%ERTS-VSN%\`, with shortcuts in the menu etc. @@ -735,6 +962,22 @@ Remember that: That's basically all you need to get going. +Using GIT +--------- + +You might want to check out versions of the source code from GitHUB. That is possible directly in cygwin, but not in Msys. There is a project MsysGIT: + +URL:<http://code.google.com/p/msysgit/> + +that makes a nice Git port. The msys prompt you get from MsysGIT is +however not compatible with the full version from MinGW, so you will +need to check out files using MsysGITs command prompt and then switch +to a common Msys command prompt for building. Also all test suites +cannot be built as MsysGIT/Msys does not handle symbolic links. To +build test suites on Windows, you will need Cygwin for now. Hopefully +all symbolic links will disappear from our repository soon and this +issue will disappear. + Final Words ----------- My hope is that the possibility to build the whole system on Windows @@ -752,11 +995,15 @@ be good. The idea to do this came from his work, so credit is well deserved. Of course this would have been completely impossible without the -excellent Cygwin package. The guys at Cygnus solutions and Redhat -deserves a huge THANKS! as well as all the other people in the free -software community who have helped in creating the magnificent +excellent Cygwin. The guys at Cygnus solutions and +Redhat deserves a huge THANKS! as well as all the other people in the +free software community who have helped in creating the magnificent software that constitutes Cygwin. +Also the people developing the alternative command prompt Msys anfd +the MinGW compiler are worth huge THANKS! The 64bit port would have +been impossible without the 64bit MinGW compiler. + Good luck and Happy Hacking, Patrik, OTP diff --git a/Makefile.in b/Makefile.in index c88e967e36..648575e5fd 100644 --- a/Makefile.in +++ b/Makefile.in @@ -695,6 +695,18 @@ tertiary_bootstrap_copy: cp $$x $$TF; \ true; \ done +# copy wx_object to remove undef behaviour warnings + for x in lib/wx/ebin/wx_object.beam; do \ + BN=`basename $$x`; \ + TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/wx/ebin/$$BN; \ + test -f $$TF && \ + test '!' -z "`find $$x -newer $$TF -print`" && \ + cp $$x $$TF; \ + test '!' -f $$TF && \ + cp $$x $$TF; \ + true; \ + done + for x in lib/test_server/include/*.hrl; do \ BN=`basename $$x`; \ TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/test_server/include/$$BN; \ diff --git a/erts/emulator/beam/erl_alloc.c b/erts/emulator/beam/erl_alloc.c index 1e75afe6f6..4d02a67d54 100644 --- a/erts/emulator/beam/erl_alloc.c +++ b/erts/emulator/beam/erl_alloc.c @@ -1095,7 +1095,7 @@ get_kb_value(char *param_end, char** argv, int* ip) char *param = argv[*ip]+1; char *value = get_value(param_end, argv, ip); errno = 0; - tmp = (Sint) strtol(value, &rest, 10); + tmp = (Sint) ErtsStrToSint(value, &rest, 10); if (errno != 0 || rest == value || tmp < 0 || max < ((Uint) tmp)) bad_value(param, param_end, value); if (max == (Uint) tmp) @@ -1112,7 +1112,7 @@ get_byte_value(char *param_end, char** argv, int* ip) char *param = argv[*ip]+1; char *value = get_value(param_end, argv, ip); errno = 0; - tmp = (Sint) strtol(value, &rest, 10); + tmp = (Sint) ErtsStrToSint(value, &rest, 10); if (errno != 0 || rest == value || tmp < 0) bad_value(param, param_end, value); return (Uint) tmp; @@ -1126,7 +1126,7 @@ get_amount_value(char *param_end, char** argv, int* ip) char *param = argv[*ip]+1; char *value = get_value(param_end, argv, ip); errno = 0; - tmp = (Sint) strtol(value, &rest, 10); + tmp = (Sint) ErtsStrToSint(value, &rest, 10); if (errno != 0 || rest == value || tmp < 0) bad_value(param, param_end, value); return (Uint) tmp; diff --git a/erts/emulator/beam/erl_thr_progress.c b/erts/emulator/beam/erl_thr_progress.c index 02f36fc75e..75f8209c3b 100644 --- a/erts/emulator/beam/erl_thr_progress.c +++ b/erts/emulator/beam/erl_thr_progress.c @@ -915,7 +915,7 @@ has_reached_wakeup(ErtsThrPrgrVal wakeup) if (limit == ERTS_THR_PRGR_VAL_WAITING) limit = 0; else if (limit < current) /* Wrapped */ - limit + 1; + limit += 1; if (!erts_thr_progress_has_passed__(limit, wakeup)) erl_exit(ERTS_ABORT_EXIT, diff --git a/erts/emulator/beam/sys.h b/erts/emulator/beam/sys.h index 6b4b382caa..eb6f2f8516 100644 --- a/erts/emulator/beam/sys.h +++ b/erts/emulator/beam/sys.h @@ -256,6 +256,7 @@ typedef unsigned int Eterm; typedef unsigned int Uint; typedef int Sint; #define ERTS_SIZEOF_ETERM SIZEOF_INT +#define ErtsStrToSint strtol #else #error Found no appropriate type to use for 'Eterm', 'Uint' and 'Sint' #endif @@ -288,6 +289,7 @@ typedef long Sint; #define SWORD_CONSTANT(Const) Const##L #define UWORD_CONSTANT(Const) Const##UL #define ERTS_SIZEOF_ETERM SIZEOF_LONG +#define ErtsStrToSint strtol #elif SIZEOF_VOID_P == SIZEOF_INT typedef unsigned int Eterm; typedef unsigned int Uint; @@ -295,6 +297,7 @@ typedef int Sint; #define SWORD_CONSTANT(Const) Const #define UWORD_CONSTANT(Const) Const##U #define ERTS_SIZEOF_ETERM SIZEOF_INT +#define ErtsStrToSint strtol #elif SIZEOF_VOID_P == SIZEOF_LONG_LONG typedef unsigned long long Eterm; typedef unsigned long long Uint; @@ -302,6 +305,11 @@ typedef long long Sint; #define SWORD_CONSTANT(Const) Const##LL #define UWORD_CONSTANT(Const) Const##ULL #define ERTS_SIZEOF_ETERM SIZEOF_LONG_LONG +#if defined(__WIN32__) +#define ErtsStrToSint _strtoi64 +#else +#define ErtsStrToSint strtoll +#endif #else #error Found no appropriate type to use for 'Eterm', 'Uint' and 'Sint' #endif diff --git a/erts/test/ethread_SUITE_data/ethread_tests.c b/erts/test/ethread_SUITE_data/ethread_tests.c index 7e7e133d6c..ed96ecdbd2 100644 --- a/erts/test/ethread_SUITE_data/ethread_tests.c +++ b/erts/test/ethread_SUITE_data/ethread_tests.c @@ -82,6 +82,7 @@ static void print_eol(void) { fprintf(stderr, EOL); + fflush(stderr); } static void print_line(char *frmt,...) @@ -826,6 +827,7 @@ detached_thread_test(void) * Tests */ #define MTT_TIMES 10 +#define MTT_HARD_LIMIT (80000) static int mtt_terminate; static ethr_mutex mtt_mutex; @@ -866,14 +868,20 @@ mtt_create_join_threads(void) while (1) { if (ix >= no_tids) { no_tids += 100; + if (no_tids > MTT_HARD_LIMIT) { + print_line("Hit the hard limit on number of threads (%d)!", + MTT_HARD_LIMIT); + break; + } tids = (ethr_tid *) realloc((void *)tids, sizeof(ethr_tid)*no_tids); ASSERT(tids); } res = ethr_thr_create(&tids[ix], mtt_thread, NULL, NULL); - if (res != 0) + if (res != 0) { break; + } ix++; - } while (res == 0); + } no_threads = ix; diff --git a/lib/Makefile b/lib/Makefile index 37e8ce06d7..402e73722a 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -76,7 +76,7 @@ else SUB_DIRECTORIES = hipe parsetools asn1/src else ifdef TERTIARY_BOOTSTRAP - SUB_DIRECTORIES = snmp sasl jinterface ic syntax_tools + SUB_DIRECTORIES = snmp sasl jinterface ic syntax_tools wx else # Not bootstrap build SUB_DIRECTORIES = $(ERTS_SUB_DIRECTORIES) $(OTHER_SUB_DIRECTORIES) endif diff --git a/lib/debugger/src/dbg_wx_filedialog_win.erl b/lib/debugger/src/dbg_wx_filedialog_win.erl index de9e11d81f..f109652a70 100644 --- a/lib/debugger/src/dbg_wx_filedialog_win.erl +++ b/lib/debugger/src/dbg_wx_filedialog_win.erl @@ -24,7 +24,7 @@ -export([new/3, getFilename/1, getFilenames/1, getDirectory/1, destroy/1]). %% Internal --export([init/1, handle_call/3, handle_event/2, +-export([init/1, handle_call/3, handle_event/2, handle_cast/2, handle_info/2, code_change/3, terminate/2]). -include_lib("wx/include/wx.hrl"). @@ -193,6 +193,9 @@ handle_call(getDirectory, _From, State = #state{path=Dir}) -> handle_call(destroy, _From, State) -> {stop, normal, ok, State}. +handle_cast(_, State) -> + {noreply, State}. + %% events handle_event(#wx{id=?wxID_UP}, State0) -> State = update_window(change_dir(0, State0)), diff --git a/lib/wx/Makefile b/lib/wx/Makefile index 0bc89e08ad..9a75b2e36e 100644 --- a/lib/wx/Makefile +++ b/lib/wx/Makefile @@ -1,7 +1,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 2008-2010. All Rights Reserved. +# Copyright Ericsson AB 2008-2011. All Rights Reserved. # # The contents of this file are subject to the Erlang Public License, # Version 1.1, (the "License"); you may not use this file except in @@ -18,12 +18,19 @@ # include ./vsn.mk -include ./config.mk -SUBDIRS = src -ifeq ($(CAN_BUILD_DRIVER), true) -SUBDIRS += c_src -endif -SUBDIRS += examples doc/src + +ifdef TERTIARY_BOOTSTRAP + INSIDE_ERLSRC = true + SUBDIRS = src +else # Normal build + include ./config.mk + SUBDIRS = src + ifeq ($(CAN_BUILD_DRIVER), true) + SUBDIRS += c_src + endif + SUBDIRS += examples doc/src +endif #TERTIARY_BOOTSTRAP + CLEANDIRS = $(SUBDIRS) api_gen ifeq ($(INSIDE_ERLSRC),true) @@ -32,6 +39,7 @@ ifeq ($(INSIDE_ERLSRC),true) # Default Subdir Targets # ---------------------------------------------------- SUB_DIRECTORIES=$(SUBDIRS) + include $(ERL_TOP)/make/otp_subdir.mk else # we are building standalone wxErlang diff --git a/lib/wx/api_gen/gl_gen_c.erl b/lib/wx/api_gen/gl_gen_c.erl index 0f5cb0e1f4..be2c5cf2bf 100644 --- a/lib/wx/api_gen/gl_gen_c.erl +++ b/lib/wx/api_gen/gl_gen_c.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2010. All Rights Reserved. +%% Copyright Ericsson AB 2008-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -238,7 +238,7 @@ decode_arg(P=#arg{name=Name,type=#type{size=BSz,name=Type,single={list,TSz}}},A0 {P, A}; decode_arg(P=#arg{name=Name,type=#type{name=Type,base=guard_int}},A0) -> A = align(4,A0), - w(" ~s *~s = (~s *) * (int *) bp; bp += 4;~n", [Type,Name,Type]), + w(" ~s *~s = (~s *) (ErlDrvSInt) * (int *) bp; bp += 4;~n", [Type,Name,Type]), {P, A}; decode_arg(P=#arg{name=Name,type=#type{name=Type,base=string,single=true}},A0) -> w(" ~s *~s = (~s *) bp;~n", [Type,Name,Type]), diff --git a/lib/wx/c_src/gen/gl_funcs.cpp b/lib/wx/c_src/gen/gl_funcs.cpp index 30542a0f02..fa1476dba5 100644 --- a/lib/wx/c_src/gen/gl_funcs.cpp +++ b/lib/wx/c_src/gen/gl_funcs.cpp @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2008-2010. All Rights Reserved. + * Copyright Ericsson AB 2008-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -395,7 +395,7 @@ case 5043: { // glBitmap GLfloat *yorig = (GLfloat *) bp; bp += 4; GLfloat *xmove = (GLfloat *) bp; bp += 4; GLfloat *ymove = (GLfloat *) bp; bp += 4; - GLubyte *bitmap = (GLubyte *) * (int *) bp; bp += 4; + GLubyte *bitmap = (GLubyte *) (ErlDrvSInt) * (int *) bp; bp += 4; weglBitmap(*width,*height,*xorig,*yorig,*xmove,*ymove,bitmap); }; break; case 5044: { // glBitmap @@ -538,7 +538,7 @@ case 5073: { // glColorPointer GLint *size = (GLint *) bp; bp += 4; GLenum *type = (GLenum *) bp; bp += 4; GLsizei *stride = (GLsizei *) bp; bp += 4; - GLvoid *pointer = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *pointer = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglColorPointer(*size,*type,*stride,pointer); }; break; case 5074: { // glColorPointer @@ -646,7 +646,7 @@ case 5090: { // glDrawElements GLenum *mode = (GLenum *) bp; bp += 4; GLsizei *count = (GLsizei *) bp; bp += 4; GLenum *type = (GLenum *) bp; bp += 4; - GLvoid *indices = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *indices = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglDrawElements(*mode,*count,*type,indices); }; break; case 5091: { // glDrawElements @@ -661,7 +661,7 @@ case 5092: { // glDrawPixels GLsizei *height = (GLsizei *) bp; bp += 4; GLenum *format = (GLenum *) bp; bp += 4; GLenum *type = (GLenum *) bp; bp += 4; - GLvoid *pixels = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *pixels = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglDrawPixels(*width,*height,*format,*type,pixels); }; break; case 5093: { // glDrawPixels @@ -678,7 +678,7 @@ case 5094: { // glEdgeFlagv }; break; case 5095: { // glEdgeFlagPointer GLsizei *stride = (GLsizei *) bp; bp += 4; - GLvoid *pointer = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *pointer = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglEdgeFlagPointer(*stride,pointer); }; break; case 5096: { // glEdgeFlagPointer @@ -1265,7 +1265,7 @@ case 5149: { // glIndexMask case 5150: { // glIndexPointer GLenum *type = (GLenum *) bp; bp += 4; GLsizei *stride = (GLsizei *) bp; bp += 4; - GLvoid *pointer = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *pointer = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglIndexPointer(*type,*stride,pointer); }; break; case 5151: { // glIndexPointer @@ -1300,7 +1300,7 @@ case 5157: { // glInitNames case 5158: { // glInterleavedArrays GLenum *format = (GLenum *) bp; bp += 4; GLsizei *stride = (GLsizei *) bp; bp += 4; - GLvoid *pointer = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *pointer = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglInterleavedArrays(*format,*stride,pointer); }; break; case 5159: { // glInterleavedArrays @@ -1561,7 +1561,7 @@ case 5199: { // glNormal3sv case 5200: { // glNormalPointer GLenum *type = (GLenum *) bp; bp += 4; GLsizei *stride = (GLsizei *) bp; bp += 4; - GLvoid *pointer = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *pointer = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglNormalPointer(*type,*stride,pointer); }; break; case 5201: { // glNormalPointer @@ -1933,7 +1933,7 @@ case 5274: { // glTexCoordPointer GLint *size = (GLint *) bp; bp += 4; GLenum *type = (GLenum *) bp; bp += 4; GLsizei *stride = (GLsizei *) bp; bp += 4; - GLvoid *pointer = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *pointer = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglTexCoordPointer(*size,*type,*stride,pointer); }; break; case 5275: { // glTexCoordPointer @@ -2016,7 +2016,7 @@ case 5286: { // glTexImage1D GLint *border = (GLint *) bp; bp += 4; GLenum *format = (GLenum *) bp; bp += 4; GLenum *type = (GLenum *) bp; bp += 4; - GLvoid *pixels = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *pixels = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglTexImage1D(*target,*level,*internalformat,*width,*border,*format,*type,pixels); }; break; case 5287: { // glTexImage1D @@ -2039,7 +2039,7 @@ case 5288: { // glTexImage2D GLint *border = (GLint *) bp; bp += 4; GLenum *format = (GLenum *) bp; bp += 4; GLenum *type = (GLenum *) bp; bp += 4; - GLvoid *pixels = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *pixels = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglTexImage2D(*target,*level,*internalformat,*width,*height,*border,*format,*type,pixels); }; break; case 5289: { // glTexImage2D @@ -2087,7 +2087,7 @@ case 5294: { // glTexSubImage1D GLsizei *width = (GLsizei *) bp; bp += 4; GLenum *format = (GLenum *) bp; bp += 4; GLenum *type = (GLenum *) bp; bp += 4; - GLvoid *pixels = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *pixels = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglTexSubImage1D(*target,*level,*xoffset,*width,*format,*type,pixels); }; break; case 5295: { // glTexSubImage1D @@ -2109,7 +2109,7 @@ case 5296: { // glTexSubImage2D GLsizei *height = (GLsizei *) bp; bp += 4; GLenum *format = (GLenum *) bp; bp += 4; GLenum *type = (GLenum *) bp; bp += 4; - GLvoid *pixels = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *pixels = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglTexSubImage2D(*target,*level,*xoffset,*yoffset,*width,*height,*format,*type,pixels); }; break; case 5297: { // glTexSubImage2D @@ -2188,7 +2188,7 @@ case 5312: { // glVertexPointer GLint *size = (GLint *) bp; bp += 4; GLenum *type = (GLenum *) bp; bp += 4; GLsizei *stride = (GLsizei *) bp; bp += 4; - GLvoid *pointer = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *pointer = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglVertexPointer(*size,*type,*stride,pointer); }; break; case 5313: { // glVertexPointer @@ -2222,7 +2222,7 @@ case 5317: { // glDrawRangeElements GLuint *end = (GLuint *) bp; bp += 4; GLsizei *count = (GLsizei *) bp; bp += 4; GLenum *type = (GLenum *) bp; bp += 4; - GLvoid *indices = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *indices = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglDrawRangeElements(*mode,*start,*end,*count,*type,indices); }; break; case 5318: { // glDrawRangeElements @@ -2244,7 +2244,7 @@ case 5319: { // glTexImage3D GLint *border = (GLint *) bp; bp += 4; GLenum *format = (GLenum *) bp; bp += 4; GLenum *type = (GLenum *) bp; bp += 4; - GLvoid *pixels = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *pixels = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglTexImage3D(*target,*level,*internalformat,*width,*height,*depth,*border,*format,*type,pixels); }; break; case 5320: { // glTexImage3D @@ -2271,7 +2271,7 @@ case 5321: { // glTexSubImage3D GLsizei *depth = (GLsizei *) bp; bp += 4; GLenum *format = (GLenum *) bp; bp += 4; GLenum *type = (GLenum *) bp; bp += 4; - GLvoid *pixels = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *pixels = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglTexSubImage3D(*target,*level,*xoffset,*yoffset,*zoffset,*width,*height,*depth,*format,*type,pixels); }; break; case 5322: { // glTexSubImage3D @@ -2306,7 +2306,7 @@ case 5324: { // glColorTable GLsizei *width = (GLsizei *) bp; bp += 4; GLenum *format = (GLenum *) bp; bp += 4; GLenum *type = (GLenum *) bp; bp += 4; - GLvoid *table = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *table = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglColorTable(*target,*internalformat,*width,*format,*type,table); }; break; case 5325: { // glColorTable @@ -2389,7 +2389,7 @@ case 5332: { // glColorSubTable GLsizei *count = (GLsizei *) bp; bp += 4; GLenum *format = (GLenum *) bp; bp += 4; GLenum *type = (GLenum *) bp; bp += 4; - GLvoid *data = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *data = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglColorSubTable(*target,*start,*count,*format,*type,data); }; break; case 5333: { // glColorSubTable @@ -2415,7 +2415,7 @@ case 5335: { // glConvolutionFilter1D GLsizei *width = (GLsizei *) bp; bp += 4; GLenum *format = (GLenum *) bp; bp += 4; GLenum *type = (GLenum *) bp; bp += 4; - GLvoid *image = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *image = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglConvolutionFilter1D(*target,*internalformat,*width,*format,*type,image); }; break; case 5336: { // glConvolutionFilter1D @@ -2434,7 +2434,7 @@ case 5337: { // glConvolutionFilter2D GLsizei *height = (GLsizei *) bp; bp += 4; GLenum *format = (GLenum *) bp; bp += 4; GLenum *type = (GLenum *) bp; bp += 4; - GLvoid *image = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *image = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglConvolutionFilter2D(*target,*internalformat,*width,*height,*format,*type,image); }; break; case 5338: { // glConvolutionFilter2D @@ -2530,8 +2530,8 @@ case 5346: { // glSeparableFilter2D GLsizei *height = (GLsizei *) bp; bp += 4; GLenum *format = (GLenum *) bp; bp += 4; GLenum *type = (GLenum *) bp; bp += 4; - GLvoid *row = (GLvoid *) * (int *) bp; bp += 4; - GLvoid *column = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *row = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; + GLvoid *column = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglSeparableFilter2D(*target,*internalformat,*width,*height,*format,*type,row,column); }; break; case 5347: { // glSeparableFilter2D @@ -2666,7 +2666,7 @@ case 5360: { // glCompressedTexImage3D GLsizei *depth = (GLsizei *) bp; bp += 4; GLint *border = (GLint *) bp; bp += 4; GLsizei *imageSize = (GLsizei *) bp; bp += 4; - GLvoid *data = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *data = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglCompressedTexImage3D(*target,*level,*internalformat,*width,*height,*depth,*border,*imageSize,data); }; break; case 5361: { // glCompressedTexImage3D @@ -2689,7 +2689,7 @@ case 5362: { // glCompressedTexImage2D GLsizei *height = (GLsizei *) bp; bp += 4; GLint *border = (GLint *) bp; bp += 4; GLsizei *imageSize = (GLsizei *) bp; bp += 4; - GLvoid *data = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *data = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglCompressedTexImage2D(*target,*level,*internalformat,*width,*height,*border,*imageSize,data); }; break; case 5363: { // glCompressedTexImage2D @@ -2710,7 +2710,7 @@ case 5364: { // glCompressedTexImage1D GLsizei *width = (GLsizei *) bp; bp += 4; GLint *border = (GLint *) bp; bp += 4; GLsizei *imageSize = (GLsizei *) bp; bp += 4; - GLvoid *data = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *data = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglCompressedTexImage1D(*target,*level,*internalformat,*width,*border,*imageSize,data); }; break; case 5365: { // glCompressedTexImage1D @@ -2734,7 +2734,7 @@ case 5366: { // glCompressedTexSubImage3D GLsizei *depth = (GLsizei *) bp; bp += 4; GLenum *format = (GLenum *) bp; bp += 4; GLsizei *imageSize = (GLsizei *) bp; bp += 4; - GLvoid *data = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *data = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglCompressedTexSubImage3D(*target,*level,*xoffset,*yoffset,*zoffset,*width,*height,*depth,*format,*imageSize,data); }; break; case 5367: { // glCompressedTexSubImage3D @@ -2760,7 +2760,7 @@ case 5368: { // glCompressedTexSubImage2D GLsizei *height = (GLsizei *) bp; bp += 4; GLenum *format = (GLenum *) bp; bp += 4; GLsizei *imageSize = (GLsizei *) bp; bp += 4; - GLvoid *data = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *data = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglCompressedTexSubImage2D(*target,*level,*xoffset,*yoffset,*width,*height,*format,*imageSize,data); }; break; case 5369: { // glCompressedTexSubImage2D @@ -2782,7 +2782,7 @@ case 5370: { // glCompressedTexSubImage1D GLsizei *width = (GLsizei *) bp; bp += 4; GLenum *format = (GLenum *) bp; bp += 4; GLsizei *imageSize = (GLsizei *) bp; bp += 4; - GLvoid *data = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *data = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglCompressedTexSubImage1D(*target,*level,*xoffset,*width,*format,*imageSize,data); }; break; case 5371: { // glCompressedTexSubImage1D @@ -2958,7 +2958,7 @@ case 5401: { // glFogCoorddv case 5402: { // glFogCoordPointer GLenum *type = (GLenum *) bp; bp += 4; GLsizei *stride = (GLsizei *) bp; bp += 4; - GLvoid *pointer = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *pointer = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglFogCoordPointer(*type,*stride,pointer); }; break; case 5403: { // glFogCoordPointer @@ -3003,7 +3003,7 @@ case 5412: { // glSecondaryColorPointer GLint *size = (GLint *) bp; bp += 4; GLenum *type = (GLenum *) bp; bp += 4; GLsizei *stride = (GLsizei *) bp; bp += 4; - GLvoid *pointer = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *pointer = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglSecondaryColorPointer(*size,*type,*stride,pointer); }; break; case 5413: { // glSecondaryColorPointer @@ -3156,7 +3156,7 @@ case 5434: { // glBufferData GLenum *target = (GLenum *) bp; bp += 4; bp += 4; GLsizeiptr size = (GLsizeiptr) * (GLuint64EXT *) bp; bp += 8; - GLvoid *data = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *data = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; GLenum *usage = (GLenum *) bp; bp += 4; weglBufferData(*target,size,data,*usage); }; break; @@ -3173,7 +3173,7 @@ case 5436: { // glBufferSubData bp += 4; GLintptr offset = (GLintptr) * (GLuint64EXT *) bp; bp += 8; GLsizeiptr size = (GLsizeiptr) * (GLuint64EXT *) bp; bp += 8; - GLvoid *data = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *data = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglBufferSubData(*target,offset,size,data); }; break; case 5437: { // glBufferSubData @@ -3833,7 +3833,7 @@ case 5518: { // glVertexAttribPointer GLboolean *normalized = (GLboolean *) bp; bp += 1; bp += 3; GLsizei *stride = (GLsizei *) bp; bp += 4; - GLvoid *pointer = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *pointer = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglVertexAttribPointer(*index,*size,*type,*normalized,*stride,pointer); }; break; case 5519: { // glVertexAttribPointer @@ -4051,7 +4051,7 @@ case 5541: { // glVertexAttribIPointer GLint *size = (GLint *) bp; bp += 4; GLenum *type = (GLenum *) bp; bp += 4; GLsizei *stride = (GLsizei *) bp; bp += 4; - GLvoid *pointer = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *pointer = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglVertexAttribIPointer(*index,*size,*type,*stride,pointer); }; break; case 5542: { // glVertexAttribIPointer @@ -4345,7 +4345,7 @@ case 5578: { // glDrawElementsInstanced GLenum *mode = (GLenum *) bp; bp += 4; GLsizei *count = (GLsizei *) bp; bp += 4; GLenum *type = (GLenum *) bp; bp += 4; - GLvoid *indices = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *indices = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; GLsizei *primcount = (GLsizei *) bp; bp += 4; weglDrawElementsInstanced(*mode,*count,*type,indices,*primcount); }; break; @@ -5341,7 +5341,7 @@ case 5683: { // glDrawElementsBaseVertex GLenum *mode = (GLenum *) bp; bp += 4; GLsizei *count = (GLsizei *) bp; bp += 4; GLenum *type = (GLenum *) bp; bp += 4; - GLvoid *indices = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *indices = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; GLint *basevertex = (GLint *) bp; bp += 4; weglDrawElementsBaseVertex(*mode,*count,*type,indices,*basevertex); }; break; @@ -5359,7 +5359,7 @@ case 5685: { // glDrawRangeElementsBaseVertex GLuint *end = (GLuint *) bp; bp += 4; GLsizei *count = (GLsizei *) bp; bp += 4; GLenum *type = (GLenum *) bp; bp += 4; - GLvoid *indices = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *indices = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; GLint *basevertex = (GLint *) bp; bp += 4; weglDrawRangeElementsBaseVertex(*mode,*start,*end,*count,*type,indices,*basevertex); }; break; @@ -5377,7 +5377,7 @@ case 5687: { // glDrawElementsInstancedBaseVertex GLenum *mode = (GLenum *) bp; bp += 4; GLsizei *count = (GLsizei *) bp; bp += 4; GLenum *type = (GLenum *) bp; bp += 4; - GLvoid *indices = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *indices = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; GLsizei *primcount = (GLsizei *) bp; bp += 4; GLint *basevertex = (GLint *) bp; bp += 4; weglDrawElementsInstancedBaseVertex(*mode,*count,*type,indices,*primcount,*basevertex); @@ -5772,7 +5772,7 @@ case 5725: { // glGetQueryObjectui64v }; break; case 5726: { // glDrawArraysIndirect GLenum *mode = (GLenum *) bp; bp += 4; - GLvoid *indirect = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *indirect = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglDrawArraysIndirect(*mode,indirect); }; break; case 5727: { // glDrawArraysIndirect @@ -5783,7 +5783,7 @@ case 5727: { // glDrawArraysIndirect case 5728: { // glDrawElementsIndirect GLenum *mode = (GLenum *) bp; bp += 4; GLenum *type = (GLenum *) bp; bp += 4; - GLvoid *indirect = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *indirect = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglDrawElementsIndirect(*mode,*type,indirect); }; break; case 5729: { // glDrawElementsIndirect @@ -6718,7 +6718,7 @@ case 5840: { // glVertexAttribLPointer GLint *size = (GLint *) bp; bp += 4; GLenum *type = (GLenum *) bp; bp += 4; GLsizei *stride = (GLsizei *) bp; bp += 4; - GLvoid *pointer = (GLvoid *) * (int *) bp; bp += 4; + GLvoid *pointer = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4; weglVertexAttribLPointer(*index,*size,*type,*stride,pointer); }; break; case 5841: { // glVertexAttribLPointer diff --git a/lib/wx/examples/demo/demo.erl b/lib/wx/examples/demo/demo.erl index 59c20e09fb..61e71af021 100644 --- a/lib/wx/examples/demo/demo.erl +++ b/lib/wx/examples/demo/demo.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -27,7 +27,7 @@ -behaviour(wx_object). -export([start/0, start/1, start_link/0, start_link/1, format/3, init/1, terminate/2, code_change/3, - handle_info/2, handle_call/3, handle_event/2]). + handle_info/2, handle_call/3, handle_cast/2, handle_event/2]). -record(state, {win, demo, example, selector, log, code}). @@ -189,6 +189,10 @@ handle_call(Msg, _From, State) -> io:format("Got Call ~p~n",[Msg]), {reply,ok,State}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. + %% Async Events are handled in handle_event as in handle_info handle_event(#wx{event=#wxCommand{type=command_listbox_selected, cmdString=Ex}}, State = #state{demo={_,DemoSz}, example=Example, code=Code}) -> diff --git a/lib/wx/examples/demo/ex_aui.erl b/lib/wx/examples/demo/ex_aui.erl index 6adfd970fc..50f077638d 100644 --- a/lib/wx/examples/demo/ex_aui.erl +++ b/lib/wx/examples/demo/ex_aui.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -25,7 +25,7 @@ %% wx_object callbacks -export([init/1, terminate/2, code_change/3, - handle_info/2, handle_call/3, handle_event/2]). + handle_info/2, handle_call/3, handle_cast/2, handle_event/2]). -include("../../include/wx.hrl"). @@ -92,6 +92,10 @@ handle_call(Msg, _From, State) -> demo:format(State#state.config, "Got Call ~p\n", [Msg]), {reply,{error, nyi}, State}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. + %% Async Events are handled in handle_event as in handle_info handle_event(#wx{obj = Notebook, event = #wxCommand{type = command_button_clicked}}, diff --git a/lib/wx/examples/demo/ex_button.erl b/lib/wx/examples/demo/ex_button.erl index 28c8273cb9..0dd0363933 100644 --- a/lib/wx/examples/demo/ex_button.erl +++ b/lib/wx/examples/demo/ex_button.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,7 +26,7 @@ -behaviour(wx_object). -export([start/1, init/1, terminate/2, code_change/3, - handle_info/2, handle_call/3, handle_event/2]). + handle_info/2, handle_call/3, handle_cast/2, handle_event/2]). -record(state, { @@ -153,6 +153,10 @@ handle_call(Msg, _From, State) -> demo:format(State#state.config,"Got Call ~p~n",[Msg]), {reply,ok,State}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. + code_change(_, _, State) -> {stop, ignore, State}. diff --git a/lib/wx/examples/demo/ex_canvas.erl b/lib/wx/examples/demo/ex_canvas.erl index 844c7eddf3..1ec4760f40 100644 --- a/lib/wx/examples/demo/ex_canvas.erl +++ b/lib/wx/examples/demo/ex_canvas.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -25,7 +25,7 @@ %% wx_object callbacks -export([init/1, terminate/2, code_change/3, - handle_info/2, handle_call/3, handle_event/2, handle_sync_event/3]). + handle_info/2, handle_call/3, handle_cast/2, handle_event/2, handle_sync_event/3]). -include_lib("wx/include/wx.hrl"). @@ -144,6 +144,10 @@ handle_call(Msg, _From, State) -> demo:format(State#state.config, "Got Call ~p\n", [Msg]), {reply,{error, nyi}, State}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. + code_change(_, _, State) -> {stop, ignore, State}. diff --git a/lib/wx/examples/demo/ex_canvas_paint.erl b/lib/wx/examples/demo/ex_canvas_paint.erl index 38d6b62f1d..9bc083766a 100644 --- a/lib/wx/examples/demo/ex_canvas_paint.erl +++ b/lib/wx/examples/demo/ex_canvas_paint.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -25,7 +25,7 @@ %% wx_object callbacks -export([init/1, terminate/2, code_change/3, - handle_info/2, handle_call/3, handle_event/2, handle_sync_event/3]). + handle_info/2, handle_call/3, handle_cast/2, handle_event/2, handle_sync_event/3]). -include_lib("wx/include/wx.hrl"). @@ -211,6 +211,10 @@ handle_call(Msg, _From, State) -> demo:format(State#state.config, "Got Call ~p\n", [Msg]), {reply,{error, nyi}, State}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. + code_change(_, _, State) -> {stop, ignore, State}. diff --git a/lib/wx/examples/demo/ex_choices.erl b/lib/wx/examples/demo/ex_choices.erl index 75f8d22493..2e456ae249 100644 --- a/lib/wx/examples/demo/ex_choices.erl +++ b/lib/wx/examples/demo/ex_choices.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -21,7 +21,7 @@ -behaviour(wx_object). -export([start/1, init/1, terminate/2, code_change/3, - handle_info/2, handle_call/3, handle_event/2]). + handle_info/2, handle_call/3, handle_cast/2, handle_event/2]). -include_lib("wx/include/wx.hrl"). @@ -147,6 +147,10 @@ handle_call(Msg, _From, State) -> demo:format(State#state.config,"Got Call ~p\n",[Msg]), {reply, {error,nyi}, State}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. + code_change(_, _, State) -> {stop, ignore, State}. diff --git a/lib/wx/examples/demo/ex_cursor.erl b/lib/wx/examples/demo/ex_cursor.erl index 322bdcbb6c..c1a558541b 100644 --- a/lib/wx/examples/demo/ex_cursor.erl +++ b/lib/wx/examples/demo/ex_cursor.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -25,7 +25,7 @@ %% wx_object callbacks -export([init/1, terminate/2, code_change/3, - handle_info/2, handle_call/3, handle_event/2]). + handle_info/2, handle_call/3, handle_cast/2, handle_event/2]). -include_lib("wx/include/wx.hrl"). @@ -135,6 +135,10 @@ handle_call(Msg, _From, State) -> demo:format(State#state.config, "Got Call ~p\n", [Msg]), {reply,{error, nyi}, State}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. + code_change(_, _, State) -> {stop, ignore, State}. diff --git a/lib/wx/examples/demo/ex_dialogs.erl b/lib/wx/examples/demo/ex_dialogs.erl index 020e9eeb14..b39344f8b1 100644 --- a/lib/wx/examples/demo/ex_dialogs.erl +++ b/lib/wx/examples/demo/ex_dialogs.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -25,7 +25,7 @@ %% wx_object callbacks -export([init/1, terminate/2, code_change/3, - handle_info/2, handle_call/3, handle_event/2]). + handle_info/2, handle_call/3, handle_cast/2, handle_event/2]). -include_lib("wx/include/wx.hrl"). @@ -153,6 +153,10 @@ handle_call(Msg, _From, State) -> demo:format(State#state.config, "Got Call ~p\n", [Msg]), {reply,{error, nyi}, State}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. + code_change(_, _, State) -> {stop, ignore, State}. diff --git a/lib/wx/examples/demo/ex_frame_utils.erl b/lib/wx/examples/demo/ex_frame_utils.erl index 3064c9f3b7..a90642b355 100644 --- a/lib/wx/examples/demo/ex_frame_utils.erl +++ b/lib/wx/examples/demo/ex_frame_utils.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -25,7 +25,7 @@ %% wx_object callbacks -export([init/1, terminate/2, code_change/3, - handle_info/2, handle_call/3, handle_event/2]). + handle_info/2, handle_call/3, handle_cast/2, handle_event/2]). -include_lib("wx/include/wx.hrl"). @@ -102,6 +102,10 @@ handle_call(Msg, _From, State) -> demo:format(State#state.config, "Got Call ~p\n", [Msg]), {reply,{error, nyi}, State}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. + code_change(_, _, State) -> {stop, ignore, State}. diff --git a/lib/wx/examples/demo/ex_gauge.erl b/lib/wx/examples/demo/ex_gauge.erl index d30c3fea58..ffc667ff05 100644 --- a/lib/wx/examples/demo/ex_gauge.erl +++ b/lib/wx/examples/demo/ex_gauge.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -23,7 +23,7 @@ -include_lib("wx/include/wx.hrl"). -export([start/1, init/1, terminate/2, code_change/3, - handle_info/2, handle_call/3, handle_event/2]). + handle_info/2, handle_call/3, handle_cast/2, handle_event/2]). -record(gauge, {obj, value, @@ -118,6 +118,10 @@ handle_call(Msg, _From, State) -> demo:format(State#state.config,"Got Call ~p\n",[Msg]), {reply,ok, State}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. + %% Async Events are handled in handle_event as in handle_info handle_event(#wx{id = ?ID_START_STOP, event = #wxCommand{type = command_togglebutton_clicked, diff --git a/lib/wx/examples/demo/ex_gl.erl b/lib/wx/examples/demo/ex_gl.erl index 53f1eda847..72dad2cf9d 100644 --- a/lib/wx/examples/demo/ex_gl.erl +++ b/lib/wx/examples/demo/ex_gl.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -21,7 +21,7 @@ -behaviour(wx_object). -export([init/1, code_change/3, handle_info/2, handle_event/2, - handle_call/3, terminate/2, + handle_call/3, handle_cast/2, terminate/2, start/1]). -include_lib("wx/include/wx.hrl"). @@ -118,6 +118,10 @@ handle_call(Msg, _From, State) -> io:format("Got Call ~p~n",[Msg]), {reply,ok,State}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. + code_change(_, _, State) -> {stop, not_yet_implemented, State}. diff --git a/lib/wx/examples/demo/ex_graphicsContext.erl b/lib/wx/examples/demo/ex_graphicsContext.erl index bcd7a75be0..c356500d99 100644 --- a/lib/wx/examples/demo/ex_graphicsContext.erl +++ b/lib/wx/examples/demo/ex_graphicsContext.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,7 +26,7 @@ %% wx_object callbacks -export([init/1, terminate/2, code_change/3, handle_info/2, handle_call/3, - handle_event/2, handle_sync_event/3]). +handle_cast/2, handle_event/2, handle_sync_event/3]). -include_lib("wx/include/wx.hrl"). @@ -98,6 +98,10 @@ handle_call(Msg, _From, State) -> demo:format(State#state.config, "Got Call ~p\n", [Msg]), {reply,{error, nyi}, State}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. + code_change(_, _, State) -> {stop, ignore, State}. diff --git a/lib/wx/examples/demo/ex_grid.erl b/lib/wx/examples/demo/ex_grid.erl index 2169c818ff..d1a9952ab2 100644 --- a/lib/wx/examples/demo/ex_grid.erl +++ b/lib/wx/examples/demo/ex_grid.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -25,7 +25,7 @@ %% wx_object callbacks -export([init/1, terminate/2, code_change/3, - handle_info/2, handle_call/3, handle_event/2]). + handle_info/2, handle_call/3, handle_cast/2, handle_event/2]). -include_lib("wx/include/wx.hrl"). @@ -81,6 +81,10 @@ handle_info(_Msg, State) -> handle_call(_Msg, _From, State) -> {reply,{error, nyi}, State}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. + code_change(_, _, State) -> {stop, ignore, State}. diff --git a/lib/wx/examples/demo/ex_htmlWindow.erl b/lib/wx/examples/demo/ex_htmlWindow.erl index b864cd10b2..564c790e48 100644 --- a/lib/wx/examples/demo/ex_htmlWindow.erl +++ b/lib/wx/examples/demo/ex_htmlWindow.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -25,7 +25,7 @@ %% wx_object callbacks -export([init/1, terminate/2, code_change/3, - handle_info/2, handle_call/3, handle_event/2]). + handle_info/2, handle_call/3, handle_cast/2, handle_event/2]). -include("../../include/wx.hrl"). @@ -81,6 +81,10 @@ handle_call(Msg, _From, State) -> demo:format(State#state.config, "Got Call ~p\n", [Msg]), {reply,{error, nyi}, State}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. + code_change(_, _, State) -> {stop, ignore, State}. diff --git a/lib/wx/examples/demo/ex_listCtrl.erl b/lib/wx/examples/demo/ex_listCtrl.erl index 3faec4e229..13096dfa52 100644 --- a/lib/wx/examples/demo/ex_listCtrl.erl +++ b/lib/wx/examples/demo/ex_listCtrl.erl @@ -23,7 +23,7 @@ -behaviour(wx_object). -export([start/1, init/1, terminate/2, code_change/3, - handle_info/2, handle_call/3, handle_event/2]). + handle_info/2, handle_call/3, handle_cast/2, handle_event/2]). -record(state, { @@ -147,6 +147,11 @@ handle_call(Msg, _From, State) -> demo:format(State#state.config,"Got Call ~p\n",[Msg]), {reply,ok,State}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. + + code_change(_, _, State) -> {stop, ignore, State}. diff --git a/lib/wx/examples/demo/ex_notebook.erl b/lib/wx/examples/demo/ex_notebook.erl index 2e16ccfffa..fc38fdae08 100644 --- a/lib/wx/examples/demo/ex_notebook.erl +++ b/lib/wx/examples/demo/ex_notebook.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -23,7 +23,7 @@ -behaviour(wx_object). -export([start/1, init/1, terminate/2, code_change/3, - handle_info/2, handle_call/3, handle_event/2]). + handle_info/2, handle_call/3, handle_cast/2, handle_event/2]). -record(state, { @@ -133,6 +133,11 @@ handle_call(Msg, _From, State) -> demo:format(State#state.config,"Got Call ~p\n",[Msg]), {reply,ok,State}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. + + code_change(_, _, State) -> {stop, ignore, State}. diff --git a/lib/wx/examples/demo/ex_pickers.erl b/lib/wx/examples/demo/ex_pickers.erl index 892c5b449d..8013a5ba32 100644 --- a/lib/wx/examples/demo/ex_pickers.erl +++ b/lib/wx/examples/demo/ex_pickers.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -25,7 +25,7 @@ %% wx_object callbacks -export([init/1, terminate/2, code_change/3, - handle_info/2, handle_call/3, handle_event/2]). + handle_info/2, handle_call/3, handle_cast/2, handle_event/2]). -include_lib("wx/include/wx.hrl"). @@ -124,6 +124,11 @@ handle_call(Msg, _From, State) -> demo:format(State#state.config, "Got Call ~p\n", [Msg]), {reply,{error, nyi}, State}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. + + code_change(_, _, State) -> {stop, ignore, State}. diff --git a/lib/wx/examples/demo/ex_popupMenu.erl b/lib/wx/examples/demo/ex_popupMenu.erl index 8774dbef7b..d6778c5dc5 100644 --- a/lib/wx/examples/demo/ex_popupMenu.erl +++ b/lib/wx/examples/demo/ex_popupMenu.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -25,7 +25,7 @@ %% wx_object callbacks -export([init/1, terminate/2, code_change/3, - handle_info/2, handle_call/3, handle_event/2]). + handle_info/2, handle_call/3, handle_cast/2, handle_event/2]). -include_lib("wx/include/wx.hrl"). @@ -90,6 +90,11 @@ handle_call(Msg, _From, State) -> demo:format(State#state.config, "Got Call ~p\n", [Msg]), {reply,{error, nyi}, State}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. + + code_change(_, _, State) -> {stop, ignore, State}. diff --git a/lib/wx/examples/demo/ex_radioBox.erl b/lib/wx/examples/demo/ex_radioBox.erl index 8211aec4a2..ab7685f41f 100644 --- a/lib/wx/examples/demo/ex_radioBox.erl +++ b/lib/wx/examples/demo/ex_radioBox.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -21,7 +21,7 @@ -behaviour(wx_object). -export([start/1, init/1, terminate/2, code_change/3, - handle_info/2, handle_call/3, handle_event/2]). + handle_info/2, handle_call/3, handle_cast/2, handle_event/2]). -include_lib("wx/include/wx.hrl"). @@ -107,6 +107,9 @@ handle_call(Msg, _From, State) -> demo:format(State#state.config,"Got Call ~p\n",[Msg]), {reply, {error, nyi}, State}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. code_change(_, _, State) -> {stop, ignore, State}. diff --git a/lib/wx/examples/demo/ex_sashWindow.erl b/lib/wx/examples/demo/ex_sashWindow.erl index dd05f4e45f..d8a8958f28 100644 --- a/lib/wx/examples/demo/ex_sashWindow.erl +++ b/lib/wx/examples/demo/ex_sashWindow.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -25,7 +25,7 @@ %% wx_object callbacks -export([init/1, terminate/2, code_change/3, - handle_info/2, handle_call/3, handle_event/2]). + handle_info/2, handle_call/3, handle_cast/2, handle_event/2]). -include_lib("wx/include/wx.hrl"). @@ -116,6 +116,10 @@ handle_call(Msg, _From, State) -> demo:format(State#state.config, "Got Call ~p\n", [Msg]), {reply,{error, nyi}, State}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. + code_change(_, _, State) -> {stop, ignore, State}. diff --git a/lib/wx/examples/demo/ex_sizers.erl b/lib/wx/examples/demo/ex_sizers.erl index 2cc6efd503..7b9e8eb37f 100644 --- a/lib/wx/examples/demo/ex_sizers.erl +++ b/lib/wx/examples/demo/ex_sizers.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -25,7 +25,7 @@ %% wx_object callbacks -export([init/1, terminate/2, code_change/3, - handle_info/2, handle_call/3, handle_event/2]). + handle_info/2, handle_call/3, handle_cast/2, handle_event/2]). -include_lib("wx/include/wx.hrl"). @@ -101,6 +101,10 @@ handle_call(Msg, _From, State) -> demo:format(State#state.config, "Got Call ~p\n", [Msg]), {reply,{error, nyi}, State}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. + code_change(_, _, State) -> {stop, ignore, State}. diff --git a/lib/wx/examples/demo/ex_slider.erl b/lib/wx/examples/demo/ex_slider.erl index 7b669d96f6..612543ff26 100644 --- a/lib/wx/examples/demo/ex_slider.erl +++ b/lib/wx/examples/demo/ex_slider.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -21,7 +21,7 @@ -behaviour(wx_object). -export([start/1, init/1, terminate/2, code_change/3, - handle_info/2, handle_call/3, handle_event/2]). + handle_info/2, handle_call/3, handle_cast/2, handle_event/2]). -include_lib("wx/include/wx.hrl"). @@ -101,6 +101,10 @@ handle_call(Msg, _From, State) -> demo:format(State#state.config,"Got Call ~p\n",[Msg]), {reply, {error, nyi},State}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. + code_change(_, _, State) -> {stop, ignore, State}. diff --git a/lib/wx/examples/demo/ex_splitterWindow.erl b/lib/wx/examples/demo/ex_splitterWindow.erl index c135f298fa..4f25b73293 100644 --- a/lib/wx/examples/demo/ex_splitterWindow.erl +++ b/lib/wx/examples/demo/ex_splitterWindow.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -25,7 +25,7 @@ %% wx_object callbacks -export([init/1, terminate/2, code_change/3, - handle_info/2, handle_call/3, handle_event/2]). + handle_info/2, handle_call/3, handle_cast/2, handle_event/2]). -include_lib("wx/include/wx.hrl"). @@ -90,6 +90,10 @@ handle_call(Msg, _From, State) -> demo:format(State#state.config, "Got Call ~p\n", [Msg]), {reply,{error, nyi}, State}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. + code_change(_, _, State) -> {stop, ignore, State}. diff --git a/lib/wx/examples/demo/ex_static.erl b/lib/wx/examples/demo/ex_static.erl index 67061520c4..013bd5ac35 100644 --- a/lib/wx/examples/demo/ex_static.erl +++ b/lib/wx/examples/demo/ex_static.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -25,7 +25,7 @@ %% wx_object callbacks -export([init/1, terminate/2, code_change/3, - handle_info/2, handle_call/3, handle_event/2]). + handle_info/2, handle_call/3, handle_cast/2, handle_event/2]). -include_lib("wx/include/wx.hrl"). @@ -105,6 +105,10 @@ handle_call(Msg, _From, State) -> demo:format(State#state.config, "Got Call ~p\n", [Msg]), {reply,{error, nyi}, State}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. + code_change(_, _, State) -> {stop, ignore, State}. diff --git a/lib/wx/examples/demo/ex_textCtrl.erl b/lib/wx/examples/demo/ex_textCtrl.erl index 95837c7c4c..d82884f30b 100644 --- a/lib/wx/examples/demo/ex_textCtrl.erl +++ b/lib/wx/examples/demo/ex_textCtrl.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -21,7 +21,7 @@ -behaviour(wx_object). -export([start/1, init/1, terminate/2, code_change/3, - handle_info/2, handle_call/3, handle_event/2]). + handle_info/2, handle_call/3, handle_cast/2, handle_event/2]). -include_lib("wx/include/wx.hrl"). @@ -92,6 +92,10 @@ handle_call(Msg, _From, State) -> demo:format(State#state.config,"Got Call ~p\n",[Msg]), {reply, {error,nyi}, State}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. + code_change(_, _, State) -> {stop, ignore, State}. diff --git a/lib/wx/examples/demo/ex_treeCtrl.erl b/lib/wx/examples/demo/ex_treeCtrl.erl index fa40795393..611904500a 100644 --- a/lib/wx/examples/demo/ex_treeCtrl.erl +++ b/lib/wx/examples/demo/ex_treeCtrl.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -25,7 +25,7 @@ %% wx_object callbacks -export([init/1, terminate/2, code_change/3, - handle_info/2, handle_call/3, handle_event/2]). + handle_info/2, handle_call/3, handle_cast/2, handle_event/2]). -include_lib("wx/include/wx.hrl"). @@ -109,6 +109,10 @@ handle_call(Msg, _From, State) -> demo:format(State#state.config, "Got Call ~p\n", [Msg]), {reply,{error, nyi}, State}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. + code_change(_, _, State) -> {stop, ignore, State}. diff --git a/lib/wx/examples/sudoku/sudoku_board.erl b/lib/wx/examples/sudoku/sudoku_board.erl index 14e32f4782..4b26ff97da 100644 --- a/lib/wx/examples/sudoku/sudoku_board.erl +++ b/lib/wx/examples/sudoku/sudoku_board.erl @@ -30,7 +30,7 @@ draw/3, %% Callbacks init/1, handle_sync_event/3, - handle_event/2, handle_info/2, handle_call/3, + handle_event/2, handle_info/2, handle_call/3, handle_cast/2, code_change/3, terminate/2]). -include("sudoku.hrl"). @@ -209,6 +209,10 @@ handle_call({draw, DC, Size},_From, S) -> redraw(DC,Size,S), {reply, ok, S}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. + code_change(_, _, State) -> {stop, not_yet_implemented, State}. diff --git a/lib/wx/examples/sudoku/sudoku_gui.erl b/lib/wx/examples/sudoku/sudoku_gui.erl index bbcfe8c466..3d0c95ffa7 100644 --- a/lib/wx/examples/sudoku/sudoku_gui.erl +++ b/lib/wx/examples/sudoku/sudoku_gui.erl @@ -24,7 +24,7 @@ %%%------------------------------------------------------------------- -module(sudoku_gui). --export([init/1, handle_info/2, handle_call/3, handle_event/2, +-export([init/1, handle_info/2, handle_call/3, handle_cast/2, handle_event/2, terminate/2, code_change/3]). -compile(export_all). @@ -230,6 +230,10 @@ handle_event(Msg,S) -> handle_call(What, _From, State) -> {stop, {call, What}, State}. +handle_cast(Msg, State) -> + io:format("Got cast ~p~n",[Msg]), + {noreply,State}. + code_change(_, _, State) -> {stop, not_yet_implemented, State}. diff --git a/lib/wx/src/Makefile b/lib/wx/src/Makefile index 46bc06271c..4e5971de03 100644 --- a/lib/wx/src/Makefile +++ b/lib/wx/src/Makefile @@ -18,7 +18,15 @@ # include ../vsn.mk -include ../config.mk +ifdef TERTIARY_BOOTSTRAP + VSN = $(WX_VSN) + INSIDE_ERLSRC = true + include $(ERL_TOP)/make/target.mk + include $(ERL_TOP)/make/$(TARGET)/otp.mk + RELSYSDIR = $(RELEASE_PATH)/lib/wx-$(VSN) +else # Normal build + include ../config.mk +endif ESRC = . EGEN = gen @@ -65,7 +73,11 @@ APPUP_SRC = $(APPUP_FILE).src APPUP_TARGET = $(EBIN)/$(APPUP_FILE) # Targets -debug opt: $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) +ifdef TERTIARY_BOOTSTRAP + opt: $(EBIN)/wx_object.beam +else + debug opt: $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) +endif clean: rm -f $(TARGET_FILES) diff --git a/lib/wx/src/wx_object.erl b/lib/wx/src/wx_object.erl index bc85cd93d4..80f8937656 100644 --- a/lib/wx/src/wx_object.erl +++ b/lib/wx/src/wx_object.erl @@ -108,7 +108,38 @@ get_pid/1 ]). --export([behaviour_info/1]). +%% -export([behaviour_info/1]). +-callback init(Args :: term()) -> + {#wx_ref{}, State :: term()} | {#wx_ref{}, State :: term(), timeout() | hibernate} | + {stop, Reason :: term()} | ignore. +-callback handle_event(Request :: #wx{}, State :: term()) -> + {noreply, NewState :: term()} | + {noreply, NewState :: term(), timeout() | hibernate} | + {stop, Reason :: term(), NewState :: term()}. +-callback handle_call(Request :: term(), From :: {pid(), Tag :: term()}, + State :: term()) -> + {reply, Reply :: term(), NewState :: term()} | + {reply, Reply :: term(), NewState :: term(), timeout() | hibernate} | + {noreply, NewState :: term()} | + {noreply, NewState :: term(), timeout() | hibernate} | + {stop, Reason :: term(), Reply :: term(), NewState :: term()} | + {stop, Reason :: term(), NewState :: term()}. +-callback handle_cast(Request :: term(), State :: term()) -> + {noreply, NewState :: term()} | + {noreply, NewState :: term(), timeout() | hibernate} | + {stop, Reason :: term(), NewState :: term()}. +-callback handle_info(Info :: timeout() | term(), State :: term()) -> + {noreply, NewState :: term()} | + {noreply, NewState :: term(), timeout() | hibernate} | + {stop, Reason :: term(), NewState :: term()}. +-callback terminate(Reason :: (normal | shutdown | {shutdown, term()} | + term()), + State :: term()) -> + term(). +-callback code_change(OldVsn :: (term() | {down, term()}), State :: term(), + Extra :: term()) -> + {ok, NewState :: term()} | {error, Reason :: term()}. + %% System exports -export([system_continue/3, @@ -125,15 +156,15 @@ %%% API %%%========================================================================= %% @hidden -behaviour_info(callbacks) -> - [{init,1}, - {handle_call,3}, - {handle_info,2}, - {handle_event,2}, - {terminate,2}, - {code_change,3}]; -behaviour_info(_Other) -> - undefined. +%% behaviour_info(callbacks) -> +%% [{init,1}, +%% {handle_call,3}, +%% {handle_info,2}, +%% {handle_event,2}, +%% {terminate,2}, +%% {code_change,3}]; +%% behaviour_info(_Other) -> +%% undefined. %% ----------------------------------------------------------------- |