Re: [Vala] glib-enums as properties?





On Thu, Jul 10, 2008 at 5:01 AM, Jared Moore <jaredm gmx com> wrote:
Hi,

Yes definitely file a bug for that.

If you ever use valac and get any error or warning messages, there is
most likely a bug in the valac codegen.

And if you aren't sure whether something is a bug, file it anyway,
since the maintainers will typically pay much more attention to bug
reports than the mailing list. :) If it turns out to not be a bug, the
maintainers will be able to easily identify that and close it, no harm
done :).

Cheers,
Jared

2008/7/10 Hannes Matuschek <hmatuschek googlemail com>:
> Hi,
>
> I've tried to define a enum from GLib (RegexCompileFlags) as a
> construction-property.
>
> The attached code fails to compile at C-level due missing definition of
> 'G_TYPE_REGEX_COMPILE_FLAGS'!
>
> Tested with current release and svn (rev. 1690)
>
> Should I file a bug?
>

The reason there's a problem is that GRegex does not utilize GObject, which supports giving GTypes to enumerations, thus allowing them to be used as properties.

To fix this, Vala would need to generate the GEnum boilerplate code somewhere. You can do this yourself with glib-mkenums.

 

> Hannes
>
> using GLib;
>
>
> public class Main: Object
> {
>  /*
>    Don't work:
>      All but..
>
>    Not found at all but defined in vapi:
>      ProcessSignal, LocaleCategory
>
>    Work:
>      ParamFlags,   --> 'G_TYPE_PARAM_FLAGS' defined in gobject/gparamspecs.h
>      IOCondition   --> 'G_TYPE_IO_CONDITION' defined in gobject/gsourceclosure.h
>  */
>
>  public RegexCompileFlags cflags { get; construct; }
>
>  public static int main (string[] args)
>  {
>    return 0;
>  }
> }
>
>
> _______________________________________________
> Vala-list mailing list
> Vala-list gnome org
> http://mail.gnome.org/mailman/listinfo/vala-list
>
>
_______________________________________________
Vala-list mailing list
Vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]