Commit Graph

136 Commits

Author SHA1 Message Date
Emmanuele Bassi
b2cbe7ba79 builder: Skip introspecting lookup_callback_symbol()
Opaque function pointers as return values are not really usable in high
level languages, even via introspection.
2015-06-11 11:45:03 +01:00
Matthias Clasen
569d5ad763 GtkBuilder: Export the template parsing entry point
This will let gtk-builder-tool validate templates.
2015-04-30 06:19:10 -04:00
Matthias Clasen
10860d229e Formatting fixes 2015-04-30 06:19:10 -04:00
Matthias Clasen
d58500b318 GtkBuilder: Report more lookup failures as GError
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
2015-04-29 15:19:31 -04:00
Matthias Clasen
fc83c8ac76 GtkBuilder: Add new convenience API
Add a convenience function that is like gtk_builder_get_object()
but stashes away a GError if a lookup fails. To make the error
message informative, the function takes a line/column pair.

Doing things this way is necessary because the custom_tag_end,
custom_finished, and parser_finished vfuncs don't take a
GError parameter, despite being called from a place where
we can report a GError back.
2015-04-27 22:54:25 -04:00
Matthias Clasen
1525d4ab89 GtkBuilder: Document private convenience API 2015-04-27 22:53:42 -04:00
Matthias Clasen
c8446f43fd GtkBuilder: Introduce some private helpers
Add functions that help reporting errors from builder
subparsers consistently.
2015-04-27 01:15:21 -04:00
Matthias Clasen
cd8b19dcb0 docs: Add an cross-reference to template docs 2015-04-26 10:19:26 -04:00
Maks Naumov
87d36885ac Properly check result of g_utf8_get_char_validated()
g_utf8_get_char_validated() may return -1 or -2
return type is gunichar(guint32)

Therefore such checks like 'gunichar < 0' or 'gunichar > 0'
are always 'false' or 'true'(except when gunichar == 0).

Signed-off-by: Maks Naumov <maksqwe1@ukr.net>

https://bugzilla.gnome.org/show_bug.cgi?id=742774
2015-01-11 15:46:06 -05:00
Matthias Clasen
40049581bc Trivial documentation tweaks 2014-10-04 15:48:07 -04:00
Matthias Clasen
2e83e7d335 GtkBuilder: Don't use deprecated types in examples 2014-10-03 09:33:35 -04:00
Matthias Clasen
80226ca926 GtkBuilder: Undo the type name heuristic changes
These turned out to break existing ui files, concretely
GWeatherLocationEntry was no longer guessed correctly.

Update the testcases to reflect this, and add a testcase
for GWeather.
2014-10-03 09:29:45 -04:00
Matthias Clasen
d5531da7f8 Trivial typography improvement
Use an em dash instead of -- in documentation.
2014-10-02 22:37:37 -04:00
Matthias Clasen
f35dff334f Factor out a function
Factor out the typename-to-get-type mangling as a separate
function, for easier testing.

Also fix some cases where it doesn't, currently, like
GString -> g_string_get_type and
GdkRGB -> gdk_rgb_get_type
2014-09-26 23:30:29 -04:00
Matthias Clasen
0c2f3402c3 GtkBuilder: Mention more error domains
This has been requested in
https://bugzilla.gnome.org/show_bug.cgi?id=708206
2014-09-26 22:37:21 -04:00
Matthias Clasen
23fcc5e373 GtkBuilder: Support parsing int64/uin64 values
This was missing; the code to parse these numbers was there,
but the switch didn't have cases for these types.

https://bugzilla.gnome.org/show_bug.cgi?id=602443
2014-08-21 14:22:13 -04:00
Benjamin Otte
3df52ae6d5 builder: Cleanup
Use the usual way of providing user data to vfuncs:
- Don't allocate it, use the stack
- Use CamelCase for naming the struct
2014-05-31 05:19:40 +02:00
Evan Nemerson
54ec42f035 gtk: port many nullability annotation fixes from Vala bindings
https://bugzilla.gnome.org/show_bug.cgi?id=730745
2014-05-30 13:24:20 -07:00
Matthias Clasen
6de6656d1f GtkBuilder: Ensure types are fully initialized
Just calling get_type() does not ensure that the signals, properties
and everything else gets set up properly. Ensure it is, by calling
g_type_class_ref() before using the type. This fixes the testcase
added in the previous commit.
2014-05-30 12:39:07 -04:00
Matthias Clasen
49cf5142ba Deprecate GdkColor
It has been replaced by GdkRGBA. Time to make it official.
http://bugzilla.gnome.org/show_bug.cgi?id=636695
2014-05-22 09:09:55 -04:00
Juan Pablo Ugarte
49fa04212b GtkBuilder: improved parsing error report for invalid properties and signals.
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.
2014-05-01 17:59:53 -03:00
Juan Pablo Ugarte
887fc60cce Added bindings support to GtkBuilder by introducing 3 new <property> 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"
2014-04-18 18:59:14 -03:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
Matthias Clasen
7f6a964c47 Docs: Remove all entities and turn off sgml mode
With all element markup gone, it is time to turn off
sgml mode, and get rid of entities as well.
2014-02-09 17:58:07 -05:00
William Jon McCann
e34bd4137d docs: use apostrophes in *n't 2014-02-07 13:32:47 -05:00
William Jon McCann
7a208fbbf3 docs: use proper apostrophe
https://wiki.gnome.org/Design/OS/Typography
2014-02-07 13:06:10 -05:00
William Jon McCann
0ce016650b docs: Use markup for links 2014-02-07 09:42:12 -05:00
William Jon McCann
2a45418b67 docs: use proper quotes 2014-02-05 15:08:42 -05:00
William Jon McCann
c3dfb17031 docs: fix missing quotation mark 2014-02-05 15:08:42 -05:00
William Jon McCann
fd7adf3b51 docs: add back id for section heading
It was lost during the markdown conversion.
2014-02-05 12:33:39 -05:00
William Jon McCann
b4d4ffcf38 docs: Don't use <xi:include> 2014-02-05 12:32:20 -05:00
William Jon McCann
3b3d8ca456 docs: Use "#" for refsect2 instead of ## 2014-02-04 21:00:58 -05:00
William Jon McCann
76447c3512 docs: use quotes instead of <firstterm> 2014-02-04 18:10:11 -05:00
William Jon McCann
50e06e11ee docs: use markdown instead of <filename> tags 2014-02-04 16:58:53 -05:00
Matthias Clasen
245c385ae7 Docs: Don't use note elements
In most cases, the text itself makes the message clear enough.
2014-02-02 01:22:14 -05:00
Matthias Clasen
09d1b28249 docs: Convert to markdown
Specifically, switch to using markdown syntax for sections.
2014-02-02 00:30:27 -05:00
William Jon McCann
768bc44081 docs: use |[ ]| instead of <programlisting></programlisting>
https://bugzilla.gnome.org/show_bug.cgi?id=723119
2014-01-29 12:45:49 -05:00
William Jon McCann
bf35c77f14 docs: use () instead of <function> tags 2014-01-27 23:08:08 -05:00
William Jon McCann
22586ea7c2 docs: use #*-struct instead of <structname> 2014-01-27 19:59:55 -05:00
William Jon McCann
c6e1b2513e docs: fix links in builder docs 2014-01-21 22:40:55 -05:00
William Jon McCann
bc03314a06 docs: fix GtkBuilder typename 2014-01-21 18:57:37 -05:00
Volker Sobek
a4d69e7f14 docs/comments: Fix spelling of 'explicitly'
This replaces all occurrences of 'explicitely' with 'explicitly'. Only
code comments and gtk-doc statements are affected.

https://bugzilla.gnome.org/show_bug.cgi?id=722429
2014-01-18 03:47:46 +01:00
Matthias Clasen
df455db2e3 GtkBuilder: Make IDs optional
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
2013-11-18 06:00:02 -05:00
Daniel Svensson
4d41903548 Use g_return_val_if_fail where return value needed.
https://bugzilla.gnome.org/show_bug.cgi?id=710987
2013-10-29 17:12:23 -04:00
Alexander Larsson
07eafbaaa8 GtkBuilder: Fall back to gtk_test_register_all_types if type lookup fails
This is important because the dlsym() approach can fail if gtk was
loaded with RTLD_LOCAL.

https://bugzilla.gnome.org/show_bug.cgi?id=710096
2013-10-15 21:41:35 -04:00
Ryan Lortie
3f0b9a7574 GtkBuilder: add GtkApplication
Add a GtkApplication (private) field to GtkBuilder
2013-10-15 09:24:11 -04:00
Ryan Lortie
3bb059b6e8 Mention of -rdynamic in GtkBuilder lookup error
We toss a g_warning() if we can't find the user's signal handler.  A good chunk
of the time this will be because they didn't use -rdynamic.  Add a note about
that.
2013-07-27 18:15:17 -04:00
Matthias Clasen
6f78424b5d Trivial typo fix 2013-07-26 08:48:38 -04:00
Matthias Clasen
0aa57d26b5 Move wholly deprecated classes to gtk/deprecated/
We've recently a number of classes wholly. For these cases,
move the headers and sources to gtk/deprecated/ and adjust
Makefiles and includes accordingly.

Affected classes:
GtkAction
GtkActionGroup
GtkActivatable
GtkIconFactory
GtkImageMenuItem
GtkRadioAction
GtkRecentAction
GtkStock
GtkToggleAction
GtkUIManager
2013-07-19 21:39:47 -04:00
Emmanuele Bassi
0899ef7cc9 gtk: Use new macros for defining private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
2013-07-09 09:30:02 +01:00