After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 615545 - Let Gtk.Activatable implementors override related-action and use-action-appearance properties
Let Gtk.Activatable implementors override related-action and use-action-appea...
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: Bindings: GTK+ GStreamer WebKitGTK+
0.8.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on: 730744
Blocks:
 
 
Reported: 2010-04-12 16:31 UTC by Aleksey Lim
Modified: 2018-05-22 13:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtk+-2.0: mark GtkActivatable properties as virtual (2.16 KB, patch)
2010-04-27 23:55 UTC, Evan Nemerson
none Details | Review

Description Aleksey Lim 2010-04-12 16:31:59 UTC
For now, gtk+-2.0.vapi contains:

    public Gtk.Action related_action { get; set; }
    public bool use_action_appearance { get; set; }

so, there is no way to override these props to follow
http://library.gnome.org/devel/gtk/unstable/GtkActivatable.html#GtkActivatable--related-action
http://library.gnome.org/devel/gtk/unstable/GtkActivatable.html#GtkActivatable--use-action-appearance
Comment 1 Evan Nemerson 2010-04-27 23:55:55 UTC
Created attachment 159738 [details] [review]
gtk+-2.0: mark GtkActivatable properties as virtual

Can you modify your gtk+-2.0.vapi to look like this:

               public virtual Gtk.Action related_action { get; set; }
               public virtual bool use_action_appearance { get; set; }

and give it a try? If it works, I'll go ahead and push the attached patch.
Comment 2 Aleksey Lim 2010-04-28 05:30:31 UTC
(In reply to comment #1)
> Created an attachment (id=159738) [details] [review]
> gtk+-2.0: mark GtkActivatable properties as virtual
> 
> Can you modify your gtk+-2.0.vapi to look like this:
> 
>                public virtual Gtk.Action related_action { get; set; }
>                public virtual bool use_action_appearance { get; set; }
> 
> and give it a try? If it works, I'll go ahead and push the attached patch.

It doesn't work as is, Activatable is an interface so "virtual" doesn't make sense. I added "abstract" instead and valac correctly generated g_object_class_override_property instead of g_object_class_install_property but C code is not right:

 foo.c:89: error: ‘GtkActivatableIface’ has no member named ‘get_related_action’
 foo.c:90: error: ‘GtkActivatableIface’ has no member named ‘set_related_action’
 foo.c:91: error: ‘GtkActivatableIface’ has no member named ‘get_use_action_appearance’
 foo.c:92: error: ‘GtkActivatableIface’ has no member named ‘set_use_action_appearance’

To reproduce:

  public class Sugar.MenuItem : Gtk.Button, Gtk.Activatable {
    public Gtk.Action related_action {
        get { return _action; }
        set { }
    }

    public bool use_action_appearance {
        get { return true; }
        set { }
    }

    private Gtk.Action _action;
  }

  $ valac foo.vala --pkg gtk+-2.0 --use-header --header foo.h -C
  $ gcc `pkg-config --cflags gtk+-2.0` foo.c -c
Comment 3 Aleksey Lim 2010-04-28 05:40:11 UTC
In my project, I use workaround(w/o changing gtk+-2.0.vapi) with two seds that just replace g_object_class_install_property with g_object_class_override_property in newly generated C code.
Comment 4 GNOME Infrastructure Team 2018-05-22 13:33:17 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/87.