1) g_print() can be redirected
2) g_print() does some extra processing, such as character set conversion.
Specifically, on W32 it will detect system codepage via GetACP(),
and will convert UTF-8 output into that codepage, even though
the output should stay unchanged (whether gtk-builder-tool interprets
strings from ui files as UTF-8 is a separate matter).
https://bugzilla.gnome.org/show_bug.cgi?id=765118
Make the preview command parse options properly, turn the ID into
an --id=ID option, and add a --css=FILE option that allows to
specify a css file to use for previewing.
This is useful for e.g. previewing the reftest .ui files with
their corresponding .css.
It turns out that xgettext does not understand translatable="1",
so don't make gtk-builder-tool produce this, even though
GtkBuilder can parse it just fine.
https://bugzilla.gnome.org/show_bug.cgi?id=754928
Setting these properties has the side-effect of setting the
corresponding -set properties, which makes GTK+ behave subtly
different. So don't mess with these.
We have a number of cases where properties should have their
default value overridden in a subclass, but haven't because thats
annoying to do. We also have properties where the absence of
an explicit value has context-dependent meaning.
Add a list of exceptions for these cases.
Catch an error that indicates the file looks like a template,
and then try again, this time with the template parsing API
of GtkBuilder. This is a little iffy, since we need to create
a 'fake' type and instance to pass in, but it works ok in
simple tests.