Ginga Visual Studio 2010 solution (ginga-vs2010-solution) brings all necessary
files to easily make a functional Ginga Development Enviroment for Windows. 
Here, you will find all necessary project, solution and configurations files 
for Visual Studio that enable you, with just a few configurations, starting 
Ginga development on Windows.

The necessary subprojects are almost the same of Ginga for Linux.

  * ginga
  * gingacc-cm
  * gingacc-contextmanager
  * gingacc-dataprocessing
  * gingacc-ic
  * gingacc-mb
  * gingacc-multidevice
  * gingacc-player
  * gingacc-system
  * gingacc-tsparser
  * gingacc-tuner
  * gingacc-um
  * gingalssm
  * gingancl
  * telemidia-util-cpp
  * ncl30-cpp
  * ncl30-converter
  
Optionally, you can build a more friendly graphical user interface available in
the subproject:

  * gingagui-cpp

MAIN REQUISITES
===============
The main requirement is Visual Studio C++ 2012 (Professional or Express 
Edition). You can download it from:

  * Visual Studio Express: http://www.microsoft.com/express/Downloads

In order to simplify the build process we already provide you with a package 
containing all the necessary dependencies. You can download by just executing
the following bath script inside the contrib folder:

  * fetch_deps.bat
  
This script will download a zip file containing the dependencies. You should extract
the files to the folder contrib (the same folder where the script is). Note that
some extractor programs create a subfolder with the same name of the zip file
and then extract the content to this subfolder. The files extracted should be
in the contrib folder and not in a subfolder.

Of course, you can also download individually each one of the dependencies.
If you prefer this last one, the main requirements to make a functional 
development enviroment for this project are:
  
  * SDL 2.0
  * ffmpeg 
  * pthread
  * berkelium-win32
  * dlfcn-win32
  * expat
  * Lua >= 5.1.2
  * msinttypes
  * xerces-c >= 3.0
  * zlib >= 1.2.3
  * nclua

There is also another batch script that copy the dlls to the correct
folder in order to appropriate run the Ginga. The script is also 
in contrib folder:

   * cp_deps.bat 

Only if you want to build gingagui-cpp you will also need Qt 4.8 built for 
Visual Studio. You can download it from:

  * http://qt.nokia.com/downloads/windows-cpp-vs2010

Additionaly, and also only if you want to compile gingagui-cpp, we recommend
you to download the Visual Studio Addin for Qt:

  * http://qt-project.org/doc/qt-4.8/install-win.html

GETTING SOURCE CODE
============
All Ginga source code is available at Software Publico Brasileiro 
(http://www.softwarepublico.gov.br).

You can get the most recent source code with these commands:

  * git clone http://git.telemidia.puc-rio.br/ginga.git
  
And optionally:

  * git clone http://git.telemidia.puc-rio.br/gingagui-cpp.git

HOW TO SETUP YOUR VISUAL STUDIO ENVIROMENT ?
============================================

Directory Tree
--------------
Visual Studio Solution available here considers that the above projects are
all located in a the same root directory, following a structure like this:

  GINGA_BASE_DIR/
    contrib/
      berkelium-win32/
      ffmpeg/
      ...
    gingacc-cpp/
    gingalssm-cpp/
    gingancl-cpp/
    ncl30-cpp/
    telemidia-dshow-cpp/
    telemidia-util-cpp/
    ginga-vs2010-solution/

If you do not keep them in the same structure, you will need to do a lot of
additional path configuration in .sln and .vcproj files. These additional 
configurations are not discussed here in details, but mainly you will have to 
change "Additional Include Directories" (AID) and "Additional Library 
Directories" (ALD) to the correct location.

For changing AID you should open GingaWindows.sln select each project and menu:

  "Project->Properties->C/C++->Additional Include Directories"

For changing ALD you should select project and menu 
  
  "Project->Properties->Linker->Additional Library Directories"

Populating "Contrib" directory
------------------------------

For simplicity, you can get "contrib" dir by just running the following
script in contrib folder:
  
  * fetch_deps.bat

Otherwise, you must populate "contrib" directory with these following 
dependencies:

  -> freeimage (> x.x) (eq libpng, libjpeg, ... )
      http://freeimage.sourceforge.net/download.html

  -> berkelium-win32 (> x.x)
      http://www.khrona.com/products/awesomium/download

  -> dlfcn > (compat)
      http://code.google.com/p/dlfcn-win32

  -> xerces (> 3.0.1)
      http://xerces.apache.org/xerces-c/download.cgi

  -> pthread (> x.x)
      http://sourceware.org/pthreads-win32

  -> libcurl (> 7.18.0)
      http://curl.haxx.se/download.html

  -> lua 5.1.4
      http://code.google.com/p/luaforwindows

Be careful!! The directory name of each dependency must be the same mapped in 
AID and ALD! If you want you can change AID and ALD instead of renaming 
directory.


Configuring "contrib" directory location
----------------------------------------
As aforementioned, by default, "contrib" directory is located in

  $(GINGA_BASE_DIR)/contrib
 
If you want you can put this directory in another path. You need to configure 
Ginga VS Project, opening 
  
  ginga-vs2010-solution/GingaWindowsMonolitic/gingamonoprops.props
  
with a text editor and replacing <CONTRIBLIB_DIR> content with the apropriate
path.

For example,
  <CONTRIBLIB_DIR>
    D:\workspace-cpp\gingarootdir\contrib
  </CONTRIBLIB_DIR>

PATH enviroment variable
------------------------
In order to run Ginga, Windows must be able to locate all dependencies (dlls
files). There are many ways to do it. 

For example,
  - You can copy all dll dependencies to the C:\Windows\System32 
    directory, which is already in PATH variable;

  - You also can change PATH enviroment variable to be able to 
    locate each necessary dll;

If you run the script bellow, all necessary dlls will be copied to a folder
called "Ginga" inside the visual studio project folder.

   * cp_deps.bat

Here is another suggestion:
  - Create a "binaries" directory inside "contrib" and copy all dll dependecies
    to there. With this, you should add just the fullpath of "contrib/binaries" 
    to PATH enviroment variable.

COMPILING
=========
If all configuration steps are right, your enviroment is done and you are able
to open "ginga-vs2010-solution/GingaWindowsMonolitic.sln" with Visual 
Studio C++ 2010.

You should see two projects:
 	* GingaWindowsMonolitic

Click right button in GingaWindowsMonolitic solution at "Solution Explorer 
Window" and "build" to compile all Ginga files. If all your configurations and 
dependencies are right the project will be compiled. Enjoy it!

If any compilation problem occurs, FAQ Section can help you.

P.S. When you call "build" command for GingaWindowsMonolitic project, this will
copy some ginga settings files to %USERPROFILE%/ginga. Be sure that these files are in this location.

TESTING
============
  * TBD

FAQ
============
* TBD
