summaryrefslogtreecommitdiff
path: root/gtk/gtkbuilderparser.c
Commit message (Collapse)AuthorAgeFilesLines
* Code cleanupMatthias Clasen2015-07-311-9/+4
| | | | | | Use g_slist_free_full more consistently. This commit just converts the obvious cases where g_slist_forall is directly followed by g_slist_free.
* gtkbuilderparser: Add some assertionsMatthias Clasen2015-07-171-0/+3
| | | | | Add some assertions that things are non-NULL when we know they are, so that coverity gets it.
* GtkBuilder: Emit a more detailed error for templatesMatthias Clasen2015-04-301-10/+15
| | | | | | Add the class and parent class name to the error message. gtk-builder-tool will parse the error message and use the class names for trying again to parse the file as a template.
* Convert more GtkBuilder to g_markup_collect_attributesMatthias Clasen2015-04-301-284/+215
| | | | The core parser itself was left, so handle it as well.
* Formatting fixesMatthias Clasen2015-04-301-256/+242
|
* GtkBuilder: Report more lookup failures as GErrorMatthias Clasen2015-04-291-31/+11
| | | | | | | | Report failures to lookup objects for property values and bindings via GError too, and provide location information while doing so. https://bugzilla.gnome.org/show_bug.cgi?id=748234
* GtkBuilder: Report 'invalid ID' errorsMatthias Clasen2015-04-271-2/+37
| | | | | | Look for a stashed GError after calling custom_tag_end, custom_finished or parser_finished vfuncs, and report them up.
* GtkBuilder: Unify builder error messagesMatthias Clasen2015-04-261-9/+6
| | | | Don't use <%s> for an attribute.
* Fix a misleading condition3.15.7Matthias Clasen2015-02-151-5/+5
| | | | gcc5 rightfully complains about this condition being unclear.
* GtkBuilder: Improve error messagesMatthias Clasen2014-09-291-4/+4
| | | | | | | No `' looks just terrible. For quoting in non-UI contexts, we prefer either '' or "". https://bugzilla.gnome.org/show_bug.cgi?id=735192
* GtkBuilder: added template parent type check.Juan Pablo Ugarte2014-05-021-1/+25
|
* GtkBuilder: improved parsing error report for invalid properties and signals.Juan Pablo Ugarte2014-05-011-34/+70
| | | | | | | | | | | | | Added GTK_BUILDER_ERROR_INVALID_PROPERTY and GTK_BUILDER_ERROR_INVALID_SIGNAL error codes ObjectInfo: Use a GType instead of a char * for the class name. PropertyInfo: Use a GParamSpec instead of a char * for the property name. SignalInfo: Use signal id and detail quark instead of a detailed signal name string. This not only save us a few malloc in each case but lets us simplify the code and report unknown properties and signals as a parsing error instead of just printing a warning.
* GtkBuilder: fixed a few minor memory leaks.Juan Pablo Ugarte2014-05-011-29/+26
| | | | | Fixed memory leaks in parse_object(), parse_template() and parse_signal() functions. Parameters value where strduped before the last posible return and not freed.
* Added bindings support to GtkBuilder by introducing 3 new <property> ↵Juan Pablo Ugarte2014-04-181-6/+45
| | | | | | | | | | | | | | attributes "bind-source" to specify the source object of the binding "bind-property" to specify the source property and "bind-flags" to specify the binding flags (optional) Binding an object sensitive property with a check button active property will look like this: <object class="GtkButton" id="button"> <property name="sensitive" bind-source="checkbutton" bind-property="active"/> </object> This is based on the original work done by Denis Washington for his GSoC project This closes Bug 654417 "[GSoC] Add <binding> element to GtkBuilder syntax"
* Fix typo (GTK_ENABLE_DEBUG vs. G_ENABLE_DEBUG).John Lindgren2014-03-211-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=726858
* GtkBuilder: Make IDs optionalMatthias Clasen2013-11-181-4/+4
| | | | | | | | | | | | | | | | One requirement of .ui files is that each object must have an ID, even if it is never referred to or directly loaded from the code. This makes editing .ui files much more onerous than it has to be, due to the frequent need to invent new IDs, while avoiding clashes. This commit makes IDs optional in the XML. They only need to be provided for objects which are referred to or explictly loaded from the code. Since GtkBuilder needs IDs for its own internal accounting, we create IDs of the form ___object_N___ if not specified in the XML. https://bugzilla.gnome.org/show_bug.cgi?id=712553
* Fix string allocation handling with GtkBuilder translationsKalev Lember2013-06-081-8/+8
| | | | | | | | | | | | | Use g_string_assign to avoid issues with assigning GString's internal buffer back to the same string. This can happen when no translations are available and _gtk_builder_parser_translate returns back the same pointer that was passed in. This fixes a regression from commit e9f182e37a7f6e2dc339054841a3c9f930f that caused GtkComboBoxText <items> from GtkBuilder to show up empty if no translations are available. https://bugzilla.gnome.org/show_bug.cgi?id=700629
* Fix a few memory leaks wrt to translationsMatthias Clasen2013-04-281-7/+6
| | | | | | | Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=699016 The fix here is slightly different. We make _gtk_builder_parser_translate return a const char * instead of a dup'ed string, and fix up the callers.
* GtkBuilder: Add private _gtk_builder_extend_with_template()Tristan Van Berkom2013-04-081-11/+122
| | | | | | | | | | | | This adds the definition of the <template> tag with some documentation on the variant of the format. _gtk_builder_extend_with_template() is to be used while GtkContainer builds from composite templates. A couple of error codes are also added to handle a few new possible failure cases. DTD Files gtkbuilder.rnc and gtkbuilder.rng have been updated to include the new <template> tag and it's attributes.
* gtk: Make functions static that don't need to be non-staticBenjamin Otte2012-10-021-5/+5
| | | | | | | | Also remove the starting underscore from function names where appropriate, as those functions are static now and not exported anymore. This is part of a bunch of fixes for gcc complaining about -Wmissing-declarations.
* Fix a cornercase of menu parsingMatthias Clasen2012-04-201-4/+4
| | | | | | | When a uimanager in a gtkbuilder file contains a menu, the builder parser was getting confused. https://bugzilla.gnome.org/show_bug.cgi?id=672789
* Change FSF AddressJavier Jardón2012-02-271-3/+1
|
* GtkBuilder: change format of menusRyan Lortie2012-01-251-46/+2
| | | | | | | | | | | | | | Change the format of GtkBuilder <menu> to be more in-line with the style of the rest of GtkBuilder so that we can do translation in a consistent way. The format is now substantially more difficult to hand-write, but tools should be along soon. There is an xslt program attached to the bug to help you convert your existing .ui files from the old format to the new one. https://bugzilla.gnome.org/show_bug.cgi?id=668696
* GtkBuilder: pick up named submenusMatthias Clasen2011-12-191-12/+28
| | | | | | When parsing GMenu xml, use the facility for pick up named submenus. Note that <section id='foo'>...</section> is _not_ a named submenu. It is a named item with an unnamed submenu :-(
* Pass domain to the menu parserMatthias Clasen2011-12-191-8/+9
| | | | This is necessary to make translations in markup work.
* Quick-and-dirty GtkBuilder integrationMatthias Clasen2011-12-191-0/+43
| | | | | | This makes GtkBuilder accept a GMenuMarkup tree at the toplevel (ie with <menu id='foo'> being a child of <interface>) and the resulting GMenu object can be obtained via gtk_builder_get_object (builder, "foo").
* Reduce includes of gtktypeutils.h to a minimumMatthias Clasen2011-01-041-2/+1
|
* Replace gtk_debug_flags with getter and setter functionsTor Lillqvist2010-09-081-1/+1
| | | | | | Preferrably should be made just into a local variable for libgtk like _gdk_debug_flags for libgdk. But for now used by gtk/tests/textbuffer.c and modules/printbackends/cups/gtkprintbackendcups.c.
* Miscellaneous string fixesPhilip Withnall2010-08-221-1/+1
| | | | Mostly capitalisation fixes. Closes: bgo#528257
* gtk/: fully remove gtkalias hacksJavier Jardón2010-07-101-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=623845
* Fix memory leaks when using add_objectsPaolo Borelli2009-08-141-1/+6
|
* Fix duplicated id detection in gtkbuilderPaolo Borelli2009-08-141-2/+4
| | | | Fix memory handling of duplicated id hashtable and add unit test
* Cleanup some translation handlingMatthias Clasen2009-06-151-35/+1
| | | | | | | Use g_*gettext functions in gdk-pixbuf instead direct gettext calls to benefit from the maybe-dont-translate functionality in GLib. Also, replace a hand-rolled version by g_dpgettext2 in gtkbuilderparser.c. Fixes bug 585791.
* Don't leak RequiresInfo when parsing GtkBuilder filesMatthias Clasen2009-05-031-1/+2
| | | | This fixes bug 579366.
* Trivial formatting fixMatthias Clasen2009-04-061-2/+2
|
* Improve GtkBuilder error reportingMatthias Clasen2009-04-061-9/+27
| | | | | Make GtkBuilder report an error when it encounters a duplicate id, instead of segfaulting later on
* 2.15.0GTK_2_15_0Matthias Clasen2009-01-011-1/+0
| | | | svn path=/trunk/; revision=22037
* Make gtk_builder_get_translation_domain() useful for subparsers.Matthias Clasen2008-12-081-4/+30
| | | | | | | | | | | * gtk/gtkbuilderparser.c: Make gtk_builder_get_translation_domain() useful for subparsers. * gtk/gtkcontainer.c: Make the child property parser support translatable child properties. svn path=/trunk/; revision=21855
* Bug 447998 - GtkBuilder does not support building parts of the xml treePaolo Borelli2008-07-161-4/+82
| | | | | | | | | | | | | | | | | | | 2008-07-15 Paolo Borelli <pborelli@katamail.com> Bug 447998 - GtkBuilder does not support building parts of the xml tree * gtk/gtkbuilder.c: * gtk/gtkbuilder.h: * gtk/gtkbuilderprivate.h: * gtk/gtkbuilderparser.c: * gtk/gtk.symbols: Add two new functions that allow cherry picking and construct objects from a ui description file or string. * gtk/tests/builder.c: tests for the above. svn path=/trunk/; revision=20845
* Set properties in the order in which they are specified in the xml file.Matthias Clasen2008-07-031-0/+1
| | | | | | | | * gtk/gtkbuilderparser.c (parse_custom): Set properties in the order in which they are specified in the xml file. svn path=/trunk/; revision=20749
* Include "config.h" instead of <config.h> Command used: find -nameJohan Dahlin2008-06-221-1/+1
| | | | | | | | | | | | 2008-06-21 Johan Dahlin <jdahlin@async.com.br> * *.[ch]: Include "config.h" instead of <config.h> Command used: find -name \*.[ch]|xargs perl -p -i -e 's/^#include <config.h>/#include "config.h"/g' Rubberstamped by Mitch and Tim svn path=/trunk/; revision=20669
* Bug 503071 – Application direction changes to right to left even ifBehdad Esfahbod2008-06-111-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | 2008-06-11 Behdad Esfahbod <behdad@gnome.org> Bug 503071 – Application direction changes to right to left even if theres no translation * configure.in: Bump glib requirement. * gtk/gtkaccellabel.c (_gtk_accel_label_class_get_accelerator_label): * gtk/gtkactiongroup.c (dgettext_swapped): * gtk/gtkbuilder.c (gtk_builder_class_init): * gtk/gtkbuilderparser.c (_dpgettext), (_gtk_builder_parser_translate): * gtk/gtkfilechooserdefault.c (list_size_data_func): * gtk/gtkimmulticontext.c (gtk_im_multicontext_append_menuitems): * gtk/gtkintl.h: * gtk/gtkmain.c (setlocale_initialization), (do_pre_parse_initialization), (gettext_initialization): * gtk/gtkstock.c (gtk_stock_lookup), (sgettext_swapped): Use g_dgettext() and g_dngettext(). svn path=/trunk/; revision=20358
* Added support for parsing required toolkit versions (so that uiTristan Van Berkom2008-05-251-3/+93
| | | | | | | | | | | | * gtk/gtkbuilderprivate.h, gtk/gtkbuilder.h, gtk/gtkbuilderparser.c: Added support for parsing required toolkit versions (so that ui descriptions can target specific versions of the backend widget libraries) bug 527612. * gtk/docs/reference/gtk/tmpl/gtkbuilder.sgml: Added documentation for the added xml tags to the ui description. svn path=/trunk/; revision=20152
* Bug 503071 - Application direction changes to right to left even if theres14:27:34 Tim Janik2008-05-201-7/+22
| | | | | | | | | | | 2008-05-20 14:27:34 Tim Janik <timj@imendio.com> * reverted recent unapproved changes by Yair Hershkovitz, regarding: Bug 503071 - Application direction changes to right to left even if theres no translation. svn path=/trunk/; revision=20116
* call g_i18n_init() in gettext_initialization(). do gettext_initializationYair Hershkovitz2008-05-111-22/+7
| | | | | | | | | | | | | | | | | | | | 2008-05-11 Yair Hershkovitz <yairhr@gmail.com> * gtk/gtkmain.c: call g_i18n_init() in gettext_initialization(). do gettext_initialization only once. * gtk/gtkbuilderparser.c: use glib i18n api. removed dpgettext() as it duplicates g_dpgettext() and added _g_dpgettext() to wrap g_dpgettext with the extended functionality that was in the removed dpgettext(). * gtk/gtkaccellabelc: * gtk/gtkstock.c: * gtk/gtkimmulticontext.c: * gtk/gtkactiongroup.c: * gtk/gtkintl.h: use glib i18n api. svn path=/trunk/; revision=20091
* gtk/gtkicontheme.h include <gdk/gdk.h> instead of <gdk/gdkscreen.h>.Michael Natterer2008-04-181-2/+0
| | | | | | | | | | | | | | | | | | | 2008-04-18 Michael Natterer <mitch@imendio.com> * gtk/gtkicontheme.h * gtk/gtkrecentmanager.h: include <gdk/gdk.h> instead of <gdk/gdkscreen.h>. * gtk/gtkbuilderparser.c * gtk/gtklinkbutton.c * gtk/gtkpreview.c * gtk/gtkrecentchooserdefault.c * gtk/gtkrecentchoosermenu.c * modules/input/gtkimcontextthai.c: remove inclusion of single files from gdk, none of the includes was actually needed. svn path=/trunk/; revision=20023
* - Treat enums like enums and not values - Avoid invalid free, in case ofJohan Dahlin2008-03-071-1/+5
| | | | | | | | | | | | | | | | | | 2008-03-07 Johan Dahlin <johan@gnome.org> * gtk/gtkbuilder.c: * gtk/gtkbuilderparser.c: * gtk/gtkbuilderprivate.h: * gtk/gtkiconfactory.c: * tests/buildertest.c: - Treat enums like enums and not values - Avoid invalid free, in case of more than two sources - Add better error messages - Add much improved tests (#520979, Christian Persch) svn path=/trunk/; revision=19732
* Add translatable/context and comment attributes on <col> tags under aJohan Dahlin2008-03-021-12/+20
| | | | | | | | | | | | | | | | | | 2008-02-29 Johan Dahlin <johan@gnome.org> * demos/gtk-demo/demo.ui: * gtk/gtkbuilderparser.c: * gtk/gtkbuilderprivate.h: * gtk/gtkliststore.c: * tests/buildertest.c: Add translatable/context and comment attributes on <col> tags under a GtkListStore. Refactor parts of the translation api and make it available inside gtk+ itself. Update tests and example. Fixes a part of #518642 svn path=/trunk/; revision=19685
* Do not use g_error for a few more errors, instead set the GError sent inJohan Dahlin2008-03-011-8/+21
| | | | | | | | | | | | | | | | 2008-02-29 Johan Dahlin <johan@gnome.org> * gtk/gtkbuilder.c: * gtk/gtkbuilderparser.c: * gtk/gtkbuilderprivate.h: Do not use g_error for a few more errors, instead set the GError sent in through add_from_file/add_from_string. * tests/buildertest.c: Add a couple of new parsing tests. (#519199, Pavel Syomin) svn path=/trunk/; revision=19681
* Fix some i18n errors. Pointed out by Behdad Esfahbod.Matthias Clasen2008-02-121-8/+4
| | | | | | | | | | | | | | 2008-02-12 Matthias Clasen <mclasne@redhat.com> * gtk/gtkpapersize.c: * gtk/gtkprintoperation.c: * gtk/gtkvolumebutton.c: * gtk/gtkbulderparser.c: Fix some i18n errors. Pointed out by Behdad Esfahbod. svn path=/trunk/; revision=19547