Re: [anjuta-devel] Automatic association between .ui files and source files
- From: Tristan Van Berkom <tvb gnome org>
- To: Marco Diego Aurélio Mesquita <marcodiegomesquita gmail com>
- Cc: anjuta-devel-list <anjuta-devel-list gnome org>
- Subject: Re: [anjuta-devel] Automatic association between .ui files and source files
- Date: Wed, 15 May 2013 23:06:51 +0900
On Wed, May 15, 2013 at 11:00 PM, Marco Diego Aurélio Mesquita
<marcodiegomesquita gmail com> wrote:
On Wed, May 15, 2013 at 10:43 AM, Tristan Van Berkom <tvb gnome org> wrote:
On Wed, May 15, 2013 at 9:43 PM, Marco Diego Aurélio Mesquita
<marcodiegomesquita gmail com> wrote:
Sorry for the incomplete e-mail, I've sent it accidentally. Continuing...
The association between files is derived using marker comments. A long
time ago, I talked with Sébastien Granjoux and we agreed it was
acceptable. Current marker comment for this feature is /* ANJUTA:
Widgets declaration for gtk_foobar.ui - DO NOT REMOVE */. So, a C
source file with such marker comment will automatically be associated
with gtk_foobar.ui. Though I've implemented it only for C, the
approach used is entirely language-independent and it should not be
hard to add it to other languages.
This feature is a huge boost to my workflow and, I bet, for many other
people who would like to create gtk+ apps with anjuta. I'd really like
to get this included. I'd like comments on the approach used and the
feature.
Comments please!
Something that might help with this association, instead of comments,
would be if this was implied support for gtk_widget_class_set_template()
APIs.
If you create objects in Anjuta, with whatever language, there is an
implied relationship between the UI file and the class.
Example in GtkBuilder xml:
<template class="MyClass" parent="GtkBox">
... hierarchy definition.
</template>
In this case, "MyClass" must absolutely be the name of the GType which
the source files are creating.
In libgladeui APIs, you can get the template widget in the project using:
GladeWidget *glade_project_get_template (GladeProject *project);
And the name of the class ("MyClass" in the above example) will
be the GladeWidget unique name, returned by:
const gchar *glade_widget_get_name (GladeWidget *gwidget);
Hi Tristan!
It really seems like a good idea, but I'd like to stay with marker
comments as of now. Some reasons: it is already working, it has been
agreed upon (tough I think seb doesn't even remember we talked about
this, since it was so long ago), it is used for automatic placement of
members an it is used for the placement of callback prototypes. So, I
think that for now we should stay with it.
Maybe in the future. Also I think it is a good ideia to re-write
anjuta templates to make use of composite templates. It is my TODO
list.
Sure, it was just a heads-up / suggestion.
Also it's understandable that the gtk_widget_class_set_template()
semantic is not widely used yet, and not available in every language
(hopefully soon we have vala support though ;-)).
Just a suggestion, and just pointing out that in the bright future
of composite widgets defined with <template> xml, there is
already an implied relationship between the class name and
the xml data.
Cheers,
-Tristan
_______________________________________________
anjuta-devel-list mailing list
anjuta-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/anjuta-devel-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]