Re: [Vala] Vala wishlist

2016-03-30 Thread yannick inizan
'to_string' hack exists :

int number = 33;
print (@"$number");

Gee.Traversable supports 'fold' and other few functions :
http://valadoc.org/#!api=gee-0.8/Gee.Traversable

2016-01-12 22:54 GMT+01:00 Afonso :

> My thoughs about Vala
> =
>
> I just started coding in Vala, and i found it's a quite fun language
> to learn, very simillar to Java and C#. The integration with GLib and
> GObject is simply amazing, and the possibilty to generate C code is
> also very pleasant.
>
> As `Vala` is still in a development phase, I would like to suggest
> a few features that could help `Vala` reach the next big step.
>
>
> # More functional support
>
> Altough `Vala` has support for closures, it would be good to hava even
> more functional power.
>
> For example, `Vala` could ship with a `filter` function that supports
> every Gee Collection, something like:
>
> var books = new TreeSet ();
> books_from_year = books.filter ( (b) => { return year == 1952; });
>
> Other functions could behave the same way, like `map`, `reverse`,
> `folds`, `all`, `any`, `or`, `all`, `takeWhile`, `dropWhile` just to
> mention a few (i know, i know, Vala != Haskell xD).
>
> Also, most closures end with a return statement. It would be a lot
> cleaner if one could skip the `return` statement, for example:
>
> var f = (a) => { a == 2; }; // Instead of { return a == 2; }
>
> It does much more sense in a closure context not to have a return
> statement. Also with mutliple statements closures, `Vala` could behave
> a little bit like `Ruby`, and automatically infer what does the
> closure returns:
>
> var f = ( a, b ) => {
>  a = b - 1;
>  if ( a > b )
>   "ok"; // return "ok";
>  else
>   "not ok"; // return "not ok";
> };
>
>
> # More syntatic sugar for print
>
> Whenever `stdout.printf` or `print` are invoked with an object,
> automatically use `to_string ()` method (like `Java`).
> For example, suppose we have the following class definition:
>
> public class Book : Object {
>  public string title { get; set; }
>  public int year { get; set; }
>
>  public string to_string () {
>   return "Title: %s, Year: %d".printf(this.title, this.year);
>  }
> }
>
> It would be nice if we could simply print an object like this:
>
> void main (string[] args) {
>  Book b = new Book ("The Old Man and the Sea", 1952);
>  print (b); // <=> print (b.to_string());
>
>  /* Output:
>  >> Title: The Old Man and the Sea, Year: 1952
>  */
> }
>
>
> Automatic array printing for basic types (and objects - using
> `to_string ()` method), like so:
>
>  void main (string[] args) {
>   string[] authors = { "George Orwell", "John Steinbeck" };
>   int[] years = { 1999, 2000, 2001 };
>
>  Book b1 = new Book ("The Old Man and the Sea", 1952);
>  Book b2 = new Book ("The Pearl", 1973);
>
>  Book[] books = { b1, b2 };
>
>   print (authors);
>   print (years);
>   print (books);
>
>   /* Output:
>   >> ["George Orwell", "John Steinbeck"]
>   >> [1999, 2000, 2001]
>   >> [Title: The Old Man and the Sea, Year: 1952,
>   Title: The Pearl, Year: 1973]
>   */
>
>  }
>
> Wish you all the best regards
>
> 3º ano, Mestrado Integrado em Engenharia Informática,
> Universidade do Minho
>
> ___
> vala-list mailing list
> vala-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/vala-list
>
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Vala 0.31 for Windows

2016-02-15 Thread yannick inizan
latest stable version is available on MSYS2 repositories

2016-02-15 21:45 GMT+01:00 :

> Hello everyone !
>
> I have build the latest version of Vala for Windows. You can find it here
> :
> https://cloud.openmailbox.org/index.php/apps/files/ajax/download.php?dir=%2FPartag%C3%A9=vala-0.31-setup.exe
>
> Could someone upload it to the GNOME server and update the link in the
> Vala wiki if possible ? Thanks
>
> (And excuse me for English mistakes, I am not a native speaker).
> ___
> vala-list mailing list
> vala-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/vala-list
>
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Help with libgda

2015-08-24 Thread yannick inizan
because vapi doesn't exist. Only 4.0 is present. libgda 6.0 has his own
generated vapi
If you want 6.0, build from git. Or on ubuntu :
https://launchpad.net/~inizan-yannick/+archive/ubuntu/development/

2015-08-24 21:20 GMT+02:00 Noe Nieto nni...@noenieto.com:

 Hi, I generated a vala project using Anjuta on Fedora 22. When I run make
 on the project I get the following error:

 $ make
 make  all-recursive
 make[1]: Entering directory '/home/nnieto/Code/mezquite'
 Making all in src
 make[2]: Entering directory '/home/nnieto/Code/mezquite/src'
   VALACmezquite_vala.stamp
 error: Package `libgda-5.0' not found in specified Vala API directories or
 GObject-Introspection GIR directories
 error: Package `libgda-mysql-5.0' not found in specified Vala API
 directories or GObject-Introspection GIR directories
 Compilation failed: 2 error(s), 0 warning(s)
 Makefile:479: recipe for target 'mezquite_vala.stamp' failed
 make[2]: *** [mezquite_vala.stamp] Error 1
 make[2]: Leaving directory '/home/nnieto/Code/mezquite/src'
 Makefile:454: recipe for target 'all-recursive' failed
 make[1]: *** [all-recursive] Error 1
 make[1]: Leaving directory '/home/nnieto/Code/mezquite'
 Makefile:365: recipe for target 'all' failed
 make: *** [all] Error 2

 Libgda is installed on the system:
 $ pkg-config --list-all | grep gda
 libgda-ldap-5.0 libgda-ldap-5.0 - GDA Ldap provider
 libgda-xslt-5.0 libgda-xslt-5.0 - GDA (GNOME Data
 Access) XSLT extension
 libgda-bdbsql-5.0   libgda-bdbsql-5.0 - GDA (GNOME Data
 Access) BDBSql provider
 libgda-jdbc-5.0 libgda-jdbc-5.0 - GDA (GNOME Data
 Access) JDBC provider
 libgda-sqlcipher-5.0libgda-sqlcipher-5.0 - GDA (GNOME Data
 Access) SQLCipher provider
 libgda-5.0  libgda-5.0 - GDA (GNOME Data Access)
 library
 libgdatalibgdata - GData client library
 libgda-report-5.0   libgda-report-5.0 - GDA (GNOME Data
 Access) Reports
 libgda-mdb-5.0  libgda-mdb-5.0 - GDA (GNOME Data
 Access) MDB provider
 libgda-sqlite-5.0   libgda-sqlite-5.0 - GDA (GNOME Data
 Access) SQLite provider
 libgda-mysql-5.0libgda-postgres-5.0 - GDA (GNOME Data
 Access) Mysql provider
 libgda-bdb-5.0  libgda-bdb-5.0 - GDA (GNOME Data
 Access) BDB provider
 libgda-postgres-5.0 libgda-postgres-5.0 - GDA (GNOME Data
 Access) PostgreSQL provider
 libgda-web-5.0  libgda-web-5.0 - GDA (GNOME Data
 Access) Web provider

 And my Makefile.am looks lik this:

 dnl Process this file with autoconf to produce a configure script.
 dnl Created by Anjuta application wizard.

 AC_INIT(mezquite, 0.1)

 AC_CONFIG_HEADERS([config.h])

 AM_INIT_AUTOMAKE([1.11])

 AM_SILENT_RULES([yes])

 AC_PROG_CC




 LT_INIT

 dnl Check for vala
 AM_PROG_VALAC([0.10.0])


 PKG_CHECK_MODULES(MEZQUITE, [libgda-5.0 libgda-mysql-5.0 gtk+-3.0])


 AC_OUTPUT([
 Makefile
 src/Makefile

 ])

 I'm a bit lost on this. Any help will be greatly appreciated.


 --
 ---
 Noe Nieto
 NNieto Consulting Services
 M: nni...@noenieto.com
 W: http://noenieto.com
 T:  @tzicatl https://twitter.com/#%21/tzicatl
 Li: Perfil en LinkedIn http://www.linkedin.com/profile/view?id=84300665
 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list

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


Re: [Vala] Treating a uint as a reference type?

2015-07-30 Thread yannick inizan
why don't you subclass uint ?

public struct Entity : uint {
// these methods are required at C-side.
internal Entity dup() { return this; }
internal void free() { delete this; }
 // your code
}

2015-07-30 16:43 GMT+02:00 Alan Manuel Gloria almkg...@gmail.com:

 Hi Vala World,

 I was wondering if it's possible to implement a Vala class as a C-side
 guint, but have Vala emit calls to a ref and unref function, and to treat a
 C-side 0 as a Vala-side null.

 Basically I want to make something like this:

 // Vala
 static
 Entity? mine = null;

 static
 void
 set_mine(owned Entity e) {
   mine = (owned) e;
 }

 static
 void
 do_stuff() {
   Entity e = Entity.create();
   set_mine(e);
 }

 And get it compiled to C:

 /* C */
 guint mine = NULL;
 void
 set_mine(guint e) {
   if (mine != NULL) entity_unref(mine);
   mine = e;
 }

 void
 do_stuff() {
   guint e = entity_create();
   set_mine(entity_ref(e));
 }

 So far, I've tried using a [Compact][CCode (cname=guint)] class, but that
 is passed around as a guint* and Vala feels obliged to add a typedef
 struct _guint guint. which fails since guint is already defined as
 unsigned int.

 I've also tried using a [CCode (cname=guint)] extern struct, but that
 causes any ref_function and unref_function attributes to be ignored, and
 still adds typedef struct _guint guint.

 Is it possible to have Vala remove the * in reference types and still
 have it use ref/unref functions and have it remove typedef?

 --

 I'm trying to make an Entity Component System, and ensure that destroyed
 entities are not reused until all references to them are destroyed.
 Entities are normally implemented as simple integer ID's, which are
 semantically a pointer to a row of component slots.

 My current design has each attached component add a reference to the
 entity, and the entity manager also adds a reference; when an entity is
 destroyed, the entity manager detaches all components (which cause each
 component to drop the reference) and drops its own reference; this frees
 the entity unless another reference is kept elsewhere.  If a reference to
 an entity is kept elsewhere, it can then be queried as to whether it has
 been destroyed without worrying that its ID has been re-allocated to a
 freshly-made entity (for instance, consider a missile locked on to some
 game entity; if the target dies, we want the missile to know it has no
 longer any valid target, not have it suddenly chase another entity that
 happened to get allocated the same ID as the missile's original target in a
 different subsystem).

 In my current design entities are compact classes with an ID and a refcount
 and custom ref_function and unref_function, and freed entities are retained
 in a freelist to reuse the ID.  I was wondering if I could make entities
 just the ID itself, and store the refcount in a separate array.

 I could possibly live with passing around Entity*, and use (guintptr) to
 extract the ID from the pointer, but I worry since C does not guarantee
 that a pointer can retain all possible guintptr values.  guintptr can hold
 any pointer type, but a pointer type is not necessarily capable of holding
 any guintptr.

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

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


Re: [Vala] Rewriting GLib C code in Vala

2015-07-24 Thread yannick inizan
in vapi header :

 * Note that on systems with a working poll(2), that function is used
 * in place of g_poll(). Thus g_poll() must have the same signature as
 * poll(), meaning GPollFD must have the same layout as struct pollfd.

you can use posix poll function instead

first, pass an PollFD array to get_info function :

PollFD[] fds;
int64 timeout;
renderer.get_info (out fds, out timeout);
// ...
Posix.poll ((pollfd[])fds, (int)timeout);



2015-07-24 11:04 GMT+02:00 Dmitry Golovin d...@golovin.in:

 Hello!

 I'm now transfering Cogl examples to Vala:
 https://github.com/tpimh/vala-cogl

 I'm a GLib newbie, so I need help with rewriting cogl-crate example:
 https://github.com/GNOME/cogl/blob/master/examples/cogl-crate.c

 Especially this part:

 ```c
   while (1)
 {
   CoglPollFD *poll_fds;
   int n_poll_fds;
   int64_t timeout;

   if (data.swap_ready)
 {
   paint (data);
   cogl_onscreen_swap_buffers (COGL_ONSCREEN (fb));
 }

   cogl_poll_renderer_get_info (cogl_context_get_renderer (ctx),
poll_fds, n_poll_fds, timeout);

   g_poll ((GPollFD *) poll_fds, n_poll_fds,
   timeout == -1 ? -1 : timeout / 1000);

   cogl_poll_renderer_dispatch (cogl_context_get_renderer (ctx),
poll_fds, n_poll_fds);
 }
 ```

 What I now have is:

 ```vala
 while (true) {
 Cogl.PollFD poll_fds;
 int n_poll_fds;
 int64 timeout;

 if (swap_ready) {
 paint();
 ((Onscreen)fb).swap_buffers();
 }

   poll_renderer_get_info(ctx.get_renderer(), poll_fds, n_poll_fds,
 timeout);

   /* poll? */

   poll_renderer_dispatch(ctx.get_renderer(), poll_fds, n_poll_fds);
 }
 ```

 I don't fully understand what PollFD is and what function in Vala GLib
 binding should be used for g_poll.

 Probably, I'm doing something terribly wrong. Maybe vapi line public
 static int poll_renderer_get_info (Cogl.Renderer renderer, Cogl.PollFD
 poll_fds, int n_poll_fds, int64 timeout); is wrong. You can find relevant
 vapi here:
 https://github.com/tpimh/vala-cogl/blob/master/vapi/cogl-2.0.vapi

 Thanks in advance!

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

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


Re: [Vala] Interface static method

2015-07-08 Thread yannick inizan
yes I try to implement this interface. We can't override 'get_protocols' or
'get_type' (no suitable method found to override) . Override
get_protocols (Type type) in Vala gives my_class_get_protocols
(GstURIHandler* handler, GType type) which is different than
method_get_protocols (GType type) for handlerIface-get_protocols

2015-07-08 8:41 GMT+02:00 Jens Georg m...@jensge.org:

 my question is simple : How implement static method c interface ?


 Yet I have no idea what you are trying to do. Are you trying to implement
 URIHandler interface in Vala?

  An exemple with GStreamer URIHandler :
 http://cgit.freedesktop.org/gstreamer/gstreamer/tree/gst/gsturi.h

 get_protocols member has 2 types : 1 in interface structure and the
 other
 as method.


 the get_protocols method is a convenience function that just calls the
 function pointer in the structure. For GObject interfaces, you don't have
 to do anything about that.

 If you want to implement this interface in vala, you just override the
 method because it is abstract and Vala does the rest of the magic.


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

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


[Vala] Interface static method

2015-07-07 Thread yannick inizan
my question is simple : How implement static method c interface ?
An exemple with GStreamer URIHandler :
http://cgit.freedesktop.org/gstreamer/gstreamer/tree/gst/gsturi.h

get_protocols member has 2 types : 1 in interface structure and the other
as method.

Actually we can't implement these types of interface
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Wrong glib-2.0 vapi

2015-06-16 Thread yannick inizan
thanks guys

2015-06-16 10:33 GMT+02:00 Luca Bruno lethalma...@gmail.com:

 On 16/06/2015 05:21, yannick inizan wrote:
  Hi.
 
  I've a problem with glib-2.0 vapi and OptionContext :
 
  [Compact]
  #if GLIB_2_44
  [CCode (ref_function = g_option_context_ref, unref_function =
  g_option_context_unref, type_id = G_TYPE_OPTION_GROUP)]
  #else
  [CCode (free_function = g_option_context_free)]
  #endif
  public class OptionContext {
 
  g_option_context_unref doesn't exist, but free_function exists.
  I've to copy vapi and remove this condition

 It's been reverted in e6b24a2e5f00ba73dd06b8e57cc1ab8ccddf38ee
 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list

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


[Vala] Wrong glib-2.0 vapi

2015-06-15 Thread yannick inizan
Hi.

I've a problem with glib-2.0 vapi and OptionContext :

[Compact]
#if GLIB_2_44
[CCode (ref_function = g_option_context_ref, unref_function =
g_option_context_unref, type_id = G_TYPE_OPTION_GROUP)]
#else
[CCode (free_function = g_option_context_free)]
#endif
public class OptionContext {

g_option_context_unref doesn't exist, but free_function exists.
I've to copy vapi and remove this condition
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] How to implement cast in vala?

2015-05-03 Thread yannick inizan
works for Classes yes. But if it was possible with other types, like this
in C# ? : https://msdn.microsoft.com/fr-fr/library/z5z9kes2.aspx



2015-05-04 0:22 GMT+02:00 Craig webe...@gmail.com:

 I don't understand what you're trying to do... You already have access to a
 Class2 via Class1.getClass2(). Do you want some sort of fancy syntactic
 sugar, so you can do something like `Class2 class2 = new Class1();` instead
 of `Class2 class2 = new Class1().getClass2()`?

 On Sat, May 2, 2015 at 8:49 AM, Akira Nakagawa matyapir...@gmail.com
 wrote:

  Hi all.
  I have an experience with C#, so I could do this in vala, too.
  public static implicit Class2 (Class1 val) {
  return val.getClass2();
  }
  There is no example or reference for vala,
  So how can I explicit/implicit-ly  convert class type in vala?
  ___
  vala-list mailing list
  vala-list@gnome.org
  https://mail.gnome.org/mailman/listinfo/vala-list
 
 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list

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


Re: [Vala] Bad C code generation (lvalue required as unary '' operand)

2015-01-29 Thread yannick inizan
add an 'v != null' assertion to avoid GLib Critical error :)

2015-01-29 17:42 GMT+01:00 Guillaume Poirier-Morency 
guillaumepoiriermore...@gmail.com:

 Le jeudi 29 janvier 2015 à 16:58 +0100, yannick inizan a écrit :
  the old safe method :
 
 
  public static void main (string[] args) {
  Value? v = toto;
  Value val = {};
  val.init (v.type());
  v.copy (ref val);
  print (%s\n, (string)val);
  }
 
 
  p.s. : sorry for last message (*$£% gmail)
 
  2015-01-29 16:48 GMT+01:00 Guillaume Poirier-Morency
  guillaumepoiriermore...@gmail.com:
  Le jeudi 29 janvier 2015 à 15:30 +0100, yannick inizan a
  écrit :
   Vala translate your cast to a get_type function of your
  value.
  
   ex:
   Value v = toto;
   var val = (string)v; //equals to 'var val = v.get_string();'
  
   so (Value)my_val is impossible because GLib.Value doesn't
  have a
   get_value function.
  
   2015-01-29 15:16 GMT+01:00 Guillaume Poirier-Morency
   guillaumepoiriermore...@gmail.com:
   I am working on Valum, a web micro-framework written
  in Vala
   https://github.com/antono/valum
  
   valac is generating very strange code that doesn't
  compile.
  
   Part of the framework is about offering facilities
  to push
   arbitrary
   values into CTPL template environment.
  
   At some point, I try to case a Value? to a non-null
  Value (I
   have of
   course tested the null case, I just want it to pass
  under
   --enable-experimental-non-null)
  
   vala --version
  
   Vala 0.26.1
  
   Here's the use case:
  
   Value? v;
   var val = (Value) v;
  
   The error:
  
  
   lvalue required as unary '' operand
  
   I attached the full log and the bug is easily
  reproducible
   (the sample
   does it).
  
   --
   Guillaume Poirier-Morency
  guillaumepoiriermore...@gmail.com
  
   ___
   vala-list mailing list
   vala-list@gnome.org
   https://mail.gnome.org/mailman/listinfo/vala-list
  
  
  
 
 
  Thanks for the answer!
 
  That kind of code should be detected by Vala compiler as an
  error.
 
  What approach would you recommend to cast Value? to
  Value ?
 
  It's not that bad if it is not yet possible, but I would
  really like to
  build the whole projet with --enable-experimental-non-null ;)
 
 
  --
  Guillaume Poirier-Morency guillaumepoiriermore...@gmail.com
 
 

 Great! That should do the trick for now :)
 --
 Guillaume Poirier-Morency guillaumepoiriermore...@gmail.com

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


Re: [Vala] Bad C code generation (lvalue required as unary '' operand)

2015-01-29 Thread yannick inizan
Vala translate your cast to a get_type function of your value.

ex:
Value v = toto;
var val = (string)v; //equals to 'var val = v.get_string();'

so (Value)my_val is impossible because GLib.Value doesn't have a get_value
function.

2015-01-29 15:16 GMT+01:00 Guillaume Poirier-Morency 
guillaumepoiriermore...@gmail.com:

 I am working on Valum, a web micro-framework written in Vala
 https://github.com/antono/valum

 valac is generating very strange code that doesn't compile.

 Part of the framework is about offering facilities to push arbitrary
 values into CTPL template environment.

 At some point, I try to case a Value? to a non-null Value (I have of
 course tested the null case, I just want it to pass under
 --enable-experimental-non-null)

 vala --version

 Vala 0.26.1

 Here's the use case:

 Value? v;
 var val = (Value) v;

 The error:


 lvalue required as unary '' operand

 I attached the full log and the bug is easily reproducible (the sample
 does it).

 --
 Guillaume Poirier-Morency guillaumepoiriermore...@gmail.com

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


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


Re: [Vala] Bad C code generation (lvalue required as unary '' operand)

2015-01-29 Thread yannick inizan
the old safe method :

public static void main (string[] args) {
Value? v = toto;
Value val = {};
val.init (v.type());
v.copy (ref val);
print (%s\n, (string)val);
}

p.s. : sorry for last message (*$£% gmail)

2015-01-29 16:48 GMT+01:00 Guillaume Poirier-Morency 
guillaumepoiriermore...@gmail.com:

 Le jeudi 29 janvier 2015 à 15:30 +0100, yannick inizan a écrit :
  Vala translate your cast to a get_type function of your value.
 
  ex:
  Value v = toto;
  var val = (string)v; //equals to 'var val = v.get_string();'
 
  so (Value)my_val is impossible because GLib.Value doesn't have a
  get_value function.
 
  2015-01-29 15:16 GMT+01:00 Guillaume Poirier-Morency
  guillaumepoiriermore...@gmail.com:
  I am working on Valum, a web micro-framework written in Vala
  https://github.com/antono/valum
 
  valac is generating very strange code that doesn't compile.
 
  Part of the framework is about offering facilities to push
  arbitrary
  values into CTPL template environment.
 
  At some point, I try to case a Value? to a non-null Value (I
  have of
  course tested the null case, I just want it to pass under
  --enable-experimental-non-null)
 
  vala --version
 
  Vala 0.26.1
 
  Here's the use case:
 
  Value? v;
  var val = (Value) v;
 
  The error:
 
 
  lvalue required as unary '' operand
 
  I attached the full log and the bug is easily reproducible
  (the sample
  does it).
 
  --
  Guillaume Poirier-Morency guillaumepoiriermore...@gmail.com
 
  ___
  vala-list mailing list
  vala-list@gnome.org
  https://mail.gnome.org/mailman/listinfo/vala-list
 
 
 

 Thanks for the answer!

 That kind of code should be detected by Vala compiler as an error.

 What approach would you recommend to cast Value? to Value ?

 It's not that bad if it is not yet possible, but I would really like to
 build the whole projet with --enable-experimental-non-null ;)


 --
 Guillaume Poirier-Morency guillaumepoiriermore...@gmail.com

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


Re: [Vala] Bad C code generation (lvalue required as unary '' operand)

2015-01-29 Thread yannick inizan
the old safe method :

2015-01-29 16:48 GMT+01:00 Guillaume Poirier-Morency 
guillaumepoiriermore...@gmail.com:

 Le jeudi 29 janvier 2015 à 15:30 +0100, yannick inizan a écrit :
  Vala translate your cast to a get_type function of your value.
 
  ex:
  Value v = toto;
  var val = (string)v; //equals to 'var val = v.get_string();'
 
  so (Value)my_val is impossible because GLib.Value doesn't have a
  get_value function.
 
  2015-01-29 15:16 GMT+01:00 Guillaume Poirier-Morency
  guillaumepoiriermore...@gmail.com:
  I am working on Valum, a web micro-framework written in Vala
  https://github.com/antono/valum
 
  valac is generating very strange code that doesn't compile.
 
  Part of the framework is about offering facilities to push
  arbitrary
  values into CTPL template environment.
 
  At some point, I try to case a Value? to a non-null Value (I
  have of
  course tested the null case, I just want it to pass under
  --enable-experimental-non-null)
 
  vala --version
 
  Vala 0.26.1
 
  Here's the use case:
 
  Value? v;
  var val = (Value) v;
 
  The error:
 
 
  lvalue required as unary '' operand
 
  I attached the full log and the bug is easily reproducible
  (the sample
  does it).
 
  --
  Guillaume Poirier-Morency guillaumepoiriermore...@gmail.com
 
  ___
  vala-list mailing list
  vala-list@gnome.org
  https://mail.gnome.org/mailman/listinfo/vala-list
 
 
 

 Thanks for the answer!

 That kind of code should be detected by Vala compiler as an error.

 What approach would you recommend to cast Value? to Value ?

 It's not that bad if it is not yet possible, but I would really like to
 build the whole projet with --enable-experimental-non-null ;)


 --
 Guillaume Poirier-Morency guillaumepoiriermore...@gmail.com

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


Re: [Vala] error: Non-constant field initializers, but the initializer seems constant

2014-12-12 Thread yannick inizan
Declaration are allowed outside classe/struct or fonction ?
Le 12 déc. 2014 15:38, Luca Bruno lethalma...@gmail.com a écrit :

 On 12/12/2014 15:31, Nicolas CARRIER wrote:
  namespace Plop {
  int my_int = -1;
  static void check_my_int_is_initialized() {
  if (my_int  0)
  my_int = 42;
  }
  public static int main(string[] args) {
  check_my_int_is_initialized();
  stdout.printf(@my_int is $my_int\n);
  return 0;
  }
  }
 That's an interesting bug. I think vala threats that -1 as unary
 operator of negation. Should be trivial to fix. Feel free to report a bug.
 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list

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


Re: [Vala] Using monodevelop for developing VALA?

2014-11-25 Thread yannick inizan
unfortunately yes, still Gtk2 behind Xwt framework. at this time, no IDE
are stable  ready for vala :( . we keep our text editor :)

2014-11-25 16:00 GMT+01:00 pancake panc...@youterm.com:

 is monodevelop still gtk2? i think that we shuold move to gtk3 if we want
 an ide for vala,

 but im pretty happy with vim

 On 11/21/2014 10:40 PM, Marek Gibek wrote:

 The only reason it's not open source is I'm planning to make business
 on it ;) You know, create multiplatform UI framework in Vala / OpenGL
 / WPF inspired, abstraction for system libraries, IDE plugin - write
 once, run everywhere (Windows, Linux, Android, iOS etc). Everybody has
 dreams - don't blame me for mines :D

 At some stage, I plan to make it open source (whole platform). With no
 restrictions if I fail. Or dual license - free for open source
 projects - if I succeed.

 So, please keep fingers crossed for any of those scenarios ;)

 Cheers,
 Marek

 On 11/21/14, Steven Oliver oliver.ste...@gmail.com wrote:

 Marek, do you plan to eventually open source your plugin for IntelliJ?

 Steven N. Oliver

 On Fri, Nov 21, 2014 at 9:58 AM, Marek Gibek gib...@gmail.com wrote:

  Hi!

 I updated mono vala plugin for MonoDevelop 5. Yannick Inizan created
 nice PPA for it here:
 https://launchpad.net/~inizan-yannick/+archive/ubuntu/mono

 Source code is here:
 https://mail.gnome.org/archives/vala-list/2014-August/msg00049.html

 Please note that:
 - I rewrote the references part (fixed, references and configurations)
 so it will not open old projects correctly (you have to recreate
 solution and project files)
 - I do not maintain it (I'm working on plugin for IntelliJ, but this
 is not open source for now)

 Best Regards,
 Marek

 On 11/21/14, Gonzalo Aguilar Delgado gagui...@aguilardelgado.com
 wrote:

 Hi,

 Someone is using monodevelop 4 or 5 to develop on vala? Because I
 cannot
 get it recognize vala projects. It can compile old ones but I cannot
 create new projects.

 Monodevelop is still working for vala?

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

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

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


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

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


Re: [Vala] converting void** to int[]*, or other ways to generically assign arrays

2014-10-15 Thread yannick inizan
there are no gtype for value array, except for string (GStrv) ?!

2014-10-16 7:00 GMT+02:00 Andy Lees andrewl...@gmail.com:

 Hi,

 In providing a general purpose configuration facility, I register the
 address of configured variables in a void*. The description of a configured
 item is:
 string key;
 Type type;
 void *loc;
 string? deflt;
 int size;
 ConfigFlags flags;
 and an example configuration definition would be:
 Conf.ConfItem (Priority, typeof (int32), conf.priority, 30, 0, 0)
 or
 Conf.ConfItem (Channels, typeof (int32[]), conf.channels, , 0, 0)
 and an assignment is like:
 *((int32*)it.loc) = int.parse (val);
 This works fine with single values, but I cannot seem to find a way to
 assign arrays.  If I use something like:
 void **ptr = it.loc;
 *ptr = to_int32_arr (list);
 The array pointer is assigned, but the length (and I assume a reference
 count) is not.

 A problem is that I cannot figure out how to declare a pointer to an array
 - declarations like: int32[] *target; don't compile.  Similarly an
 assignment like:
 *((int32[]*)it.loc) = to_int32_arr (list);
 Doesn't compile. ( syntax error, expected identifier).

 Surely there is a way to do this sort of thing straightforwardly in vala?
 Is there a way to declare a pointer to an array?

 Any assistance is welcome.

 Regards,

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

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


Re: [Vala] Nostril / Are you my mommy?

2014-10-07 Thread yannick inizan
are you my mommy ? héhé, another reference to Doctor Who in Vala's world
:)

2014-10-07 20:46 GMT+02:00 Daniel Brendle grindh...@skarphed.org:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Hello Vala folks.

 I want to introduce you to a small project written in Vala. It's name
 is nostril and it's purpose is to help people inspect HTTP-traffic in
 an easy and straight-forward GNOMEish way.
 Nostril acts as a proxy using libsoup and is simply plugged between
 the application that generates HTTP-traffic and the target.

 I started writing the program about a year ago until it was able to
 perform it's most basic tasks, and then i abandoned it due to a lack
 of time.
 I assumed that no one else would show interest in the project anyway
 but from time to time people write to me that they use it and think
 it's cool, some of whom i know, some of whom are randomly from the
 internet. So maybe i was wrong and there is some public interest indeed.

 This is why I decided to bring this to a broader audience, and I think
 the Vala-ML ist a good point to start.


 As always there is good news and bad news. Bad news first: I still
 don't have time to spend on this particular project. Good news:
 nostril is still a very small project. There is now huge codebase.
 There is only about five files with an overseeable amount of code in
 it. There are still a lot of easy-to-fix-bugs and
 easy-to-implement-features to be done. Nostril seems to be the perfect
 opportunity for people who want to start at hacking on a cool and
 useful project in vala and GTK.

 Do you want to adopt a nostril? Then wait no longer and become a core
 contributor :)

 You find nostril in https://github.com/grindhold/nostril

 Even if you don't want to adopt nostril, feedback, criticism, further
 ideas, thoughts and stars are  appreciated.


 Thank you,
 Grindhold
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.12 (GNU/Linux)

 iQIcBAEBAgAGBQJUNDUgAAoJEBuqgJs6izSEP4YP+gNNc1TmCXQSjsyHUI9WNlbJ
 DugLJsnAMXBXe84hRZLjipntVmou52G+CeTBEd9sxg/yj5LHz4uaprJKiggwDYNX
 h0MWLyv8BYS/JSbGiJRzFLoEu18CDJmEXAFQ/949W50hKhMAC4kiI1efr63YM4Gl
 qH2+iyPiuD2Lut4mQ8CH+CoIDo8UJ1PhLmS4Gr2HNeyzN8rZQbXPylNAc9W22Qdf
 p6h+rgm6glGZk8KZWTo6foFeVwpAAvdzQhcEJodn0BREWxT1q9Jg9sbdfmTyYXKH
 9Rhm9my8KZRCgZGuchOQPIpGQdLXI9n7KKk7qkL1jjXAl7Wkp+Eep+QviQvAJs3o
 83dbC5JdjGtKp5Ayn6jbPBDbySWQmTRvdZN1VLGJ7x9MNqFSgybUE6xNNrrnScCv
 C6pmSXVJslsyW+2vekflpW0//u/GAKeFuPFOSWkwX4iVrasx9BQtjY7eOj7HIfY0
 hGwtRACjLza9AlQ213ZAxq+BEwHdkNAzElgms8IBYcFv5qv6v6kpo/1fNPUF/w5G
 qtt5JA2PpRNbLXrfu0maEA7U/TQLF2NNmCYtgxxGHVyUt/Ow+9yNlMttSVF6vjEp
 bLBkqvLD3T1quitZkJHXvr5uSuzvwviOEA/LaXTCeKg2gY9r2fBAjngOkrTo1d8l
 MFPs36ah4lM0PbEXQ4ku
 =7E2J
 -END PGP SIGNATURE-
 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list

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


Re: [Vala] [ANNOUNCE] Vala 0.25.4 - Compiler for the GObject type system

2014-09-23 Thread yannick inizan
great job guys :)

2014-09-15 18:52 GMT+02:00 Jürg Billeter j...@bitron.ch:

 We are pleased to announce version 0.25.4 of Vala, a compiler for the
 GObject type system.

 Vala 0.25.4 is now available for download at:
http://download.gnome.org/sources/vala/0.25/

 Changes since 0.25.3
  * Add option --vapi-comments.
  * 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 (1):
   gtk+-2.0, gtk+-3.0: add missing GObject interface prerequisite

 Florian Brosch (2):
   GirWriter: do not generate errordomain elements
   xcb: re-add GetPropertyReply.format

 Jürg Billeter (1):
   Release 0.25.4

 Luca Bruno (4):
   Fix regression when assigning owned expressions to unowned variables.
   Fix critical on method varargs introduced by 7b6ee1be
   Resolve symbols in named arguments
   girwriter: Write accessor methods for interface properties

 Richard Wiedenhöft (1):
   Added option --vapi-comments to include comments in vapi-files

 Rico Tzschichholz (3):
   bindings: Update GIR-based bindings
   bindings: Update GIR-based bindings
   gtk+-3.0: Update to 3.13.9~

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

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


Re: [Vala] [Genie] Build for windows under linux. Using minwg.

2014-09-16 Thread yannick inizan
for Gstreamer, you can find msi installer here :
http://gstreamer.freedesktop.org/data/pkg/windows/

2014-09-16 21:03 GMT+02:00 gontzal txasato...@gmail.com:

 OK.
 But... is not easy to find the gstreamer bundle for windows and the
 gtk-clutter bundle. Any body knows about them?
 Thanks. I will try it.

 Gontzal.

 ig., 2014.eko iraren 14a 20:22(e)an, Daniel Espinosa igorleak idatzi zuen:


 I can help you. You can see at GXml project in git.gnome.org 
 http://git.gnome.org. I've managed to build it under windows with no
 problems.

 Just download GTK+ for windows bundle and use see to change prefix
 variable I'm all PC files to point to the Dir you uncompress this bundle.
 You must install mingw-w64 on your distribution.

 Then on terminal set PKG_CONFIG_PATH to pont the directory you uncompress
 gtk+ bundle and add to the path lib/pkgconfig directory; this is very
 important, if you don't set correctly, pkg-config will find PC files from
 your Linux Installation and you compilation will fail with lot errors on
 headers.

 When configure your software, use --host= to the platform you want to
 use, 32 or 64 bits. On Ubuntu you must use x86_64-w64-mingw32 for 64 bits
 and i686-w64-mingw32, if you get lot of errors from included  headers then
 the above host targets are wrong.

 If most module use gobject introspection, you must disable because bundle
 doesn't include it.

 As you can see on GXml, I've use valac to get C code then use the
 mingw-w64 compiler to compile it to get exe and DLLs.

 C code must depend on a rule that use valac to get it. But be this is not
 required, may you want to use valac directly, in theory it must use
 mingw-w64 compiler because the host setting.

 El sep 14, 2014 8:29 AM, Gontzal Uriarte txasato...@gmail.com mailto:
 txasato...@gmail.com escribió:

 Hi!!

 I have finished a Katamotz Ejercicios new application for reading
 learning and teaching. Is a Genie application and it uses gtk-3,
 pango,
 cogl, clutter, clutter-gtk and gstreamer. No problems for building
 under
 linux for linux, but how do it for Windows. I have seen some
 tutorials from
 Tarnyko and others but... there is anyone for help me?

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


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

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


Re: [Vala] [ANNOUNCE] Vala 0.25.4 - Compiler for the GObject type system

2014-09-15 Thread yannick inizan
great job guys :)

2014-09-15 18:52 GMT+02:00 Jürg Billeter j...@bitron.ch:

 We are pleased to announce version 0.25.4 of Vala, a compiler for the
 GObject type system.

 Vala 0.25.4 is now available for download at:
http://download.gnome.org/sources/vala/0.25/

 Changes since 0.25.3
  * Add option --vapi-comments.
  * 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 (1):
   gtk+-2.0, gtk+-3.0: add missing GObject interface prerequisite

 Florian Brosch (2):
   GirWriter: do not generate errordomain elements
   xcb: re-add GetPropertyReply.format

 Jürg Billeter (1):
   Release 0.25.4

 Luca Bruno (4):
   Fix regression when assigning owned expressions to unowned variables.
   Fix critical on method varargs introduced by 7b6ee1be
   Resolve symbols in named arguments
   girwriter: Write accessor methods for interface properties

 Richard Wiedenhöft (1):
   Added option --vapi-comments to include comments in vapi-files

 Rico Tzschichholz (3):
   bindings: Update GIR-based bindings
   bindings: Update GIR-based bindings
   gtk+-3.0: Update to 3.13.9~

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

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


Re: [Vala] [ANNOUNCE] Vala binding updated for Mono Develop 5.4 (Linux Windows)

2014-09-01 Thread yannick inizan
thanks for your job, but I have a question : how run plugin on Linux ? I
have built from source and installed, but in create solution dialog on
MonoDevelop, no Vala solution


2014-08-31 14:54 GMT+02:00 Marek Gibek gib...@gmail.com:

 Hi!

 I am happy to announce you that you can again use Mono Develop to
 develop Vala applications. I upgraded the old ValaBinding addin for
 Mono Develop 5.4 and it works very nice.

 I tested it under Linux  Windows.

 I refactored package references part, so it is not compatible with the
 previous Vala .mdproject files (if you still have any). For example, I
 fixed local project references to be current configuration aware
 (previously they always pointed to the debug output dll library, now
 they point to the .mdproject file).

 I'm very happy that the debugger works :) At least under Linux,
 because I cannot find gdb 64-bit for Windows. Code completion is still
 missing but should not be very hard to add as it was there in the
 previous version.

 https://sites.google.com/site/gibekm/programming/vala/monodevelopbinding

 Happy coding ;)
 Marek Gibek
 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list

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


Re: [Vala] cairo binding bug?

2014-06-25 Thread yannick inizan
Not a bug, Path is a compact class and haven't constructor.
So when you'll have a Context, do this :


Cairo.Context cr;
..
Cairo.Path path = cr.copy_path();

regards ;)


2014-06-26 3:24 GMT+02:00 Nor Jaidi Tuah norjaidi.t...@ubd.edu.bn:

 According to http://www.cairographics.org/manual/cairo-Paths.html,

The path may be either the return value from one of cairo_copy_path()
or cairo_copy_path_flat() or it may be constructed manually.

 But, trying to construct a path manually, i.e.,

   var path = new Cairo.Path ();

 gives a compiler error:

   error: `Cairo.Path' does not have a default constructor

 Am I doing this the wrong way, or is this a binding bug?


 Nice day
 Nor Jaidi Tuah





 PRIVILEGED/CONFIDENTIAL information may be contained in this message. If
 you are neither the addressee (intended recipient) nor an authorised
 recipient of the addressee, and have received this message in error, please
 destroy this message (including attachments) and notify the sender
 immediately. STRICT PROHIBITION: This message, whether in part or in whole,
 should not be reviewed, retained, copied, reused, disclosed, distributed or
 used for any purpose whatsoever. Such unauthorised use may be unlawful and
 may contain material protected by the Official Secrets Act (Cap 153) of the
 Laws of Brunei Darussalam. DISCLAIMER: We/This Department/The Government of
 Brunei Darussalam, accept[s] no responsibility for loss or damage arising
 from the use of this message in any manner whatsoever. Our messages are
 checked for viruses but we do not accept liability for any viruses which
 may be transmitted in or with this message.
 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list

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


Re: [Vala] About method overloading, constructor overloading and extension methods

2014-05-15 Thread yannick inizan
public G addG (G a, G b) {}

and check the type of your numbers inside the function ? :)


2014-05-15 19:48 GMT+02:00 geovanisouz...@gmail.com 
geovanisouz...@gmail.com:

 Hello guys,

 I'm thinking about the reasons behind the pseudo constructor overload,
 method naming convensions and C# entension methods.

 I don't look deep in Vala compiler implementation, but can suggested
 something to resolve this issue, based in what I see in generated C code: a
 name binder.

 Some kind of naming engine to rule 'em all, where the compiler can register
 all found method names (with types, the complete signature), and from the
 code writer can peek the C method names. For example, in the code:

 int add(int a, int b)
 {
 return a + b;
 }

 int main(string[] args)
 {
 var result = add(2, 3);
 print(Result: %d\n.printf(result));
 return 0;
 }


 All works fine, and the resulting C code:

 gint add (gint a, gint b) {
  gint result = 0;
 gint _tmp0_ = 0;
  gint _tmp1_ = 0;
 _tmp0_ = a;
  _tmp1_ = b;
 result = _tmp0_ + _tmp1_;
  return result;
 }


 gint _vala_main (gchar** args, int args_length1) {
 gint result = 0;
  gint _result_ = 0;
 gint _tmp0_ = 0;
  gchar* _tmp1_ = NULL;
 gchar* _tmp2_ = NULL;
  _tmp0_ = add (2, 3);
 _result_ = _tmp0_;
  _tmp1_ = g_strdup_printf (Result: %d\n, _result_);
 _tmp2_ = _tmp1_;
  g_print (%s, _tmp2_);
 _g_free0 (_tmp2_);
  result = 0;
 return result;
 }


 int main (int argc, char ** argv) {
 #if !GLIB_CHECK_VERSION (2,35,0)
 g_type_init ();
 #endif
 return _vala_main (argv, argc);
 }


 Well, fine. But if I declare another method, like:

 float add(float a, float b)
 {
 return a + b;
 }


 The compiler forbid me.

 I know that the recomended way to solve this is use diferent names for
 methods:

 float add_float(float a, float b)
 {
 return a + b;
 }

 int add_int(int a, int b)
 {
 return a + b;
 }


 And again, all works.

 But, if this is the recommended way to make it work, why the compiler
 itself doesn't do this for me? I would that this naming binder can
 expand:

 float add(float a, float b)
 int add(int a, int b)


 To something like this:

 gint add__int__int (gint a, gint b)
 gfloat add__float__float (gfloat a, gfloat b)


 Anyway, if the C compiler support overloading, why Vala does not?

 In case of extension methods, it can be expanded too, and only gain context
 when included and used in source files. In C the
 pseudo-object-oriented-programming is made passing the this (or in Vala
 self) variable to each function, thing made transparently by
 compilers/runtimes of other languages.

 Extension methods is basically like C functions (receiving a self
 reference) and mapped/validated by compiler when
 object.extension_method() is used.

 So, which effort is necessary to make Vala compiler accept this feature? I
 think that a centralized naming logic can help in these cases.

 Thank you.

 --
 @geovanisouza92 - Geovani de Souza
 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list

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


Re: [Vala] problems with Gdk.Pixbuf.from_stream_at_scale_async

2014-04-09 Thread yannick inizan
gdk-pixbuf-2.0 vapi hasn't been updated : all methods which end with _async
are async methods. please use this old creation method :

Gdk.Pixbuf pixbuf = null;
Gdk.Pixbuf.new_from_stream_at_scale_async.begin (stream, 100, 100, true,
null, (obj, res) = {
pixbuf = Gdk.Pixbuf.new_from_stream_at_scale_async.end (res);
});




2014-04-09 1:31 GMT+02:00 escoand passts...@freenet.de:

 Hi.

 I use Gdk.Pixbuf.from_stream_at_scale_async but for me it's clear how to
 handle it correctly.

 How can I add this pixbuf to an IconView? I don't get it right, apparently.

 I tried:

var file = File.new_for_uri(media.getIconURL());
var stream = file.read();
new Gdk.Pixbuf.from_stream_at_scale_async(stream, 100, 100, true);

 But an error is thrown:

...vala.c: In function 'upn_pplayer_on_media_available':
...vala.c:645:50: error: '_data_' undeclared (first use in this
 function)
 _tmp31_ = gdk_pixbuf_new_from_stream_finish (_data_-_res_,

  _inner_error_);
  ^
...vala.c:645:50: note: each undeclared identifier is reported only
once for each function it appears in

 Can you please give me a hint?
 Thanks in advance.
 escoand

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

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


Re: [Vala] [ANNOUNCE] Vala 0.24.0 - Compiler for the GObject type system

2014-03-24 Thread yannick inizan
great job Jürg, and for all others Vala maintainers :)


2014-03-24 20:28 GMT+01:00 Jürg Billeter j...@bitron.ch:

 We are pleased to announce version 0.24.0 of Vala, a compiler for the
 GObject type system.

 Vala 0.24.0 is now available for download at:
http://download.gnome.org/sources/vala/0.24/

 Changes since 0.23.3
  * 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

 ---
 Colin Watson (2):
   posix: Declare Group.gr_mem as null-terminated
   glib-2.0: Add missing C header for symlink

 David King (1):
   gio-2.0: Update to 2.39.91+

 Jürg Billeter (1):
   Release 0.24.0

 Luca Bruno (13):
   girparser: Add array_null_terminated, fixes hand-written change in
 gio
   dbusserver: Rename the generated parameters identifier
   gio-2.0: Make Action.state, state_type and parameter_type nullable
   gio-2.0: Also make Action.get_state_hint nullable
   gtk+-2.0, gtk+-3.0: Make ComboBox.set_active_iter parameter nullable
   Add test for bug 726347
   gstreamer-1.0: Make Element.add_pad parameter unowned
   gstreamer-1.0: Make Bin.add_many first parameter unowned
   gstreamer-1.0: Make Bin.add first parameter unowned
   codegen: Inherit array_length and array_null_terminated of methods
   gidlparser: Do not set nullable to void type
   gstreamer-0.10: Set GstURIHandler.get_uri_type vfunc to get_type
   tests: Use sed '$d' because head -n -1 is not portable

 Richard Wiedenhöft (1):
   Accept single ellipsis parameter for instance methods

 Rico Tzschichholz (2):
   cogl-1.0: Fix some array arguments in Cogl.Texture
   x11: Add missing evtype field of GenericEventCookie

 Simon (1):
   codewriter: Emit 'unowned' keyword for local variables

 Stef Walter (1):
   build: Fix missing backslashes in lists

 Steven Oliver (1):
   libpq: Add PQping enum and functions

 Will Szumski (2):
   girwriter: Don't add target for delegates without target
   girwriter: Set scope=call for delegates when async or notified does
 not apply

 Zeeshan Ali (Khattak) (1):
   gtk+-3.0: Correct binding for
 IconView.convert_widget_to_bin_window_coords

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

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


Re: [Vala] Access GTKText

2014-01-14 Thread yannick inizan
please find as attachment, a sample with a custom Gtk TextBuffer and a
custom TextTag.

link to the TextTag vala doc: http://valadoc.org/#!api=gtk+-3.0/Gtk.TextTag
here a few documentation of text tags parameters :
http://www.bravegnu.org/gtktext/x113.html

regards.


2014/1/14 Gilzad Hamuni gil...@gmx.net

 Hi list,

 I've compiled and tested this C-tutorial that shows how to have different
 fonts, colors and and sizes in a single text box:
 http://www.gtk.org/tutorial1.2/gtk_tut-14.html

 GtkWidget *text;
 ...
 text = gtk_text_new (NULL, NULL);
 ...
 fixed_font = gdk_font_load (-misc-fixed-medium-r-*-*-*-140-*-*-*-*-*-*);
 ...
 gtk_text_insert (GTK_TEXT (text), fixed_font, text-style-black,
 NULL,Hello\n, -1);


 Now I'd like to do the same in Vala. I've looked through valadoc and what
 valencia's completion would provide. But I couldn't find the keywords I
 expected in the Gtk namespace. Basically, I need an object that provides
 the gtk_text_insert(...) function, which allows me to add formatted text
 immediately.

 VteTerminal, SourceView and TextView seem to be too limited, as they
 doesn't seem to provide such a function. Or am I just to blind to find a
 substitude that is as rich?

 My understanding of creating GIR and VAPIs is not sufficient, but I think
 I wouldn't have to do this for gtktext.h, because the whole gtk-library is
 available to vala already?

 I'll be happy about any input. Thanks a bunch in advance.

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

using Gtk;

void main(string[] args)
{
	Gtk.init (ref args);
	var buffer = new MyTextBuffer (null);
	var view = new TextView.with_buffer (buffer);
	var win = new Window();
	win.realize.connect (() = {
		TextIter iter;
		buffer.get_start_iter (out iter);
		string txt = this is a bold  red formatted text;
		buffer.insert_with_tags (iter, txt, txt.length, buffer.bold_red);
	});
	win.add (view);
	win.show_all();
	Gtk.main();
}

class MyTextBuffer : TextBuffer
{
	public MyTextBuffer (TextTagTable? table)
	{
		Object (tag_table: table);
	}
	
	construct {
		bold_red = create_tag (bold-red, weight, Pango.Weight.BOLD, foreground, #FF);
	}
	
	public TextTag bold_red { get; private set; }
}
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Problem to handle shift key

2013-12-12 Thread yannick inizan
this code works on Ubuntu Saucy, Gtk+ 3.11.3


2013/12/13 Raum r...@no-log.org

 Hello,

 I've got a new problem :)  This code works on windows but not on linux and
 I don't understand why ?!?

 - CODE  gtk_test.vala ---
 public class Application   {
 public Gtk.Window window;
 public Application () {
 window = new Gtk.Window();
 // Prepare Gtk.Window:
 window.title = test;
 window.window_position = Gtk.WindowPosition.CENTER;
 window.destroy.connect (Gtk.main_quit);
 window.set_default_size (350, 70);

 window.add_events(Gdk.EventMask.KEY_RELEASE_MASK);
 window.add_events(Gdk.EventMask.KEY_PRESS_MASK);
 window.key_release_event.connect(on_key_press);
 window.key_press_event.connect(on_key_press);
 }

 public  bool on_key_press (Gdk.EventKey event) {
 stdout.printf (state : %d / shift modifier should be : %d\n,
 event.state, Gdk.ModifierType.SHIFT_MASK);
 return true;
 }

 public static int main (string[] args) {
 Gtk.init (ref args);

 Application app = new Application ();
 app.window.show_all ();
 Gtk.main ();
 return 0;
 }
 }
 -
 // Ubuntu 11.04

 # valac --pkg gtk+-3.0 gtk_test.vala
 # ./gtk_test
 state : 0 / shift modifier should be : 1   // I've pressed shift I
 should see 1 / 1 and not 0 / 1
 state : 1 / shift modifier should be : 1 // I've released shift, I see
 1/1, it's ok

 --

 I didn't compile this code on Windows/MingW but I've a similar code which
 working...

 Where am I wrong ?

 Thanks

 Regards

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

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