Re: [Vala] Vala to Android - Cairo

2013-03-26 Thread tarnyko
OK, I'm posting it mostly for the record, please note it is a long mail. 
Feel free to ask questions. Here we go. 

I found some pre-compiled versions of Cairo for Android on the Internet ; 
none of them was complete (with dependencies) nor usable with agcc/valac. 

So, after struggling a bit... 


Cairo 1.10.2 for Android :
http://www.tarnyko.net/repo/cairo-1.10.2-android-(TARNYKO).tar.bz2 


Here is a stand-alone Vala sample :
http://www.tarnyko.net/repo/cairo.vala
to be compiled with :
valac --cc=agcc --pkg cairo -o cairo cairo.vala --Xcc="-lpixman-1" 
--Xcc="-lpng15" 

It blits a "image.png" file with some overlay text. Should run fine on an 
Android phone. 


Next step is to display this stuff to Android's screen, and here we have
a problem ; by design, the OS doesn't allow native code to draw to screen.
Any data should be passed between a native library (*.so) and a running Java 
app. So I will use AndroidBitmapInfo from JNI as a vector. 


I've prepared a demo project :
http://www.tarnyko.net/repo/cairo-android-vala.tar.bz2
contains :
android.vapi : Android VAPI (dummy)
cairo-android.vala : Vala source
cairo-android.glue.c : C Android Glue 


should be compiled with :
valac --cc=agcc -X -shared --pkg cairo --pkg android --vapidir . 
cairo-android.vala cairo-android.glue.c -o libcairo-android.so 
--Xcc="-lpixman-1" --Xcc="-lpng15" --Xcc="-ljnigraphics" 

and drops a "libcairo-android.so" file which you can call from Java : 


static { System.loadLibrary("cairo-android"); }
drawPNG(bmp); 


Regards,
Tarnyko
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] [ANNOUNCE] Vala 0.20.0 - Compiler for the GObject type system

2013-03-26 Thread Jürg Billeter
We are pleased to announce version 0.20.0 of Vala, a compiler for the
GObject type system.

Vala 0.20.0 is now available for download at:
   http://download.gnome.org/sources/vala/0.20/

Changes since 0.19.0
 * Bug fixes and binding updates.

Vala is a programming language that aims to bring modern programming
language features to GNOME developers without imposing any additional
runtime requirements and without using a different ABI compared to
applications and libraries written in C.

valac, the Vala compiler, is a self-hosting compiler that translates
Vala source code into C source and header files. It uses the GObject
type system to create classes and interfaces declared in the Vala source
code.

More information about Vala is available at

http://www.vala-project.org/


The Vala Team

---
Evan Nemerson (3):
  girparser: support renaming fields in metadata
  bindings: update GIR-based bindings
  glib-2.0, gtk+-3.0: make parameter string for goption nullable

Jesse van den Kieboom (1):
  Updated gtk+-3.0 to lastest master

Jürg Billeter (1):
  Release 0.20.0

Luca Bruno (4):
  gtk+-2.0, gtk+-3.0: Fix IconView.get_visible_range
  gtk+-2.0, gtk+-3.0: Fix TreePath.to_string and TreeView.get_visible_range
  codegen: Destroy value of "as" cast in case the result is null
  Support non-null cast for enum values

Paolo Borelli (1):
  gtk+-3.0: make TreeView::set_search_entry nullable

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list