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.
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
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.
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
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.
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.
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"
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
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.
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