Commit 75216bdd authored by Michael Meeks's avatar Michael Meeks
Browse files

Updated ( but still not working name support )

parent 921f98f8
......@@ -28,4 +28,7 @@ libglade-config
.libs
.deps
libglade.spec
libgladeConf.sh
NO-AUTO-GEN
intl
<<<<<<< ChangeLog
1999-06-05 Michael Meeks <michael@edenproject.org>
1999-06-20 James Henstridge <james@daa.com.au>
* glade/glade-gtk.c: Add extern glade_init_gtk_widget to kill
warning.
* dialogs.glade: example of using the standard dialogs with libglade.
* configure.in: upped version number to 0.2.
* glade/glade-gnome.c: small clean up.
* doc/libglade-docs.sgml: a few more changes to the documentation.
1999-06-19 James Henstridge <james@daa.com.au>
* glade/glade-gnome.c (gnomedialog_build_children): connect signals
to the individual button widgets.
(messagebox_build_children): similar for the message box widget.
* doc/libglade-docs.sgml: heaps of extra docs. This should reduce
the number of libglade questions people ask me (assuming they
read the docs of course :).
* doc/libglade-sections.txt: added entries for the extra functions.
* glade/glade-xml.h, glade/glade-xml.c
(glade_xml_signal_connect_full, glade_xml_signal_autoconnect_full):
Added two functions that should be useful for people wanting to write
language bindings for libglade. They allow the user to specify an
arbitrary function to use for connecting signals.
1999-06-17 James Henstridge <james@daa.com.au>
* gnome-widgets.glade: made the test glade file for GNOME a bit
nicer.
* glade/glade-gnome.c (toolbar_new): make toolbar button relief
match user preferences.
* glade/glade-gtk.c (text_new): small bug fix to text widget creation.
1999-06-14 James Henstridge <james@daa.com.au>
* glade/glade.h: moved the include of glade/glade-xml.h outside of
the extern "C" { ... } block, since it has its own extern "C" { ... }
stuff (and the extern "C" notation is not valid in C).
* glade/glade-gtk.c (optionmenu_new, combo_new): made adjustments to
match change in libglade-xgettext.
* libglade-xgettext (TranslatableStringParser.end_items): add list
items to translation list individually instead of as one large string.
* glade/glade-gnome.c (gnomedialog_new, app_new): added support for
setting wmname/wmclass on these windows as well.
* glade/glade-gtk.c: added support for GtkFileSelection,
GtkColorSelectionDialog and GtkFontSelectionDialog, including
the support for connecting signals to their buttons.
Also added support for setting the wmname/wmclass on windows.
1999-06-13 James Henstridge <james@daa.com.au>
* glade/glade-gnome.c: put #ifdef's round references to
GNOME_STOCK_PIXMAP_MIDI, so it will compile with gnome-libs-1.0.1
(Damon is keeping compatibility with that release for glade, so
I may as well do so as well).
1999-06-13 Richard Hestilow <hestgray@ionet.net>
* glade/glade-xml.h, glade-build.h, glade.h: added
"#ifdef __cplusplus" wrappers, otherwise was giving linktime
errors with g++.
1999-06-12 James Henstridge <james@daa.com.au>
* glade/glade-xml.c: fixed up gettext call.
* configure.in: added a call to AM_GNOME_GETTEXT so that the i18n
stuff should get included correctly. Note that there is no libglade
translation domain -- libglade should not give any of its own output.
1999-06-11 James Henstridge <james@daa.com.au>
* glade/glade-xml.[ch] (glade_xml_construct): added a third argument -
the translation domain.
(glade_xml_new_with_domain): a new constructor that allows you to
specify that this GladeXML object use a different translation
domain than the default.
* glade/glade-xml.c (glade_xml_set_common_params): translate the
tooltips.
* glade/glade-gnome.c: added calls to glade_xml_gettext at appropriate
places.
* glade/glade-gtk.c: added calls to glade_xml_gettext at appropriate
places.
* glade/glade-xml.c (glade_xml_gettext): new function to handle
translations of text in widget building routines.
* glade/glade-xml.h: added textdomain attribute to GladeXML structure
that will hold the gettext text domain used for translations. This
is just in preparation -- I haven't added i18n to libglade yet.
* glade/glade-xml.c (glade_xml_relative_file): small fix in call
to g_strconcat(). This one was picked up by Gary Ross.
* glade/glade-gnome.c (get_stock_name): now reads GNOME_STOCK_PIXMAP_
and GNOME_STOCK_MENU_ style stock names correctly.
(toolbar_new, toolbar_build_children): functions for building toolbars
that is aware of stock icons. Now the toolbars look correct.
(menu_new, menubar_new, menushell_build_children): Handle stock
menu items correctly. It even handles gnome-libs' internal
translation of stock menu item labels.
(pixmapmenuitem_new): This function does not worry about stock menu
items now. It does handle pixmaps next to the menu items though
like it should.
* Makefile.am (bin_SCRIPTS): added libglade-xgettext.
* libglade-xgettext: a small program that can extract translation
strings from glade XML files. Libglade itself has no i18n support
yet, but this is a start. The program can output both standard pot
files or a C file that can then be parsed by xgettext.
1999-06-10 James Henstridge <james@daa.com.au>
* test-libglade.c (main): updated to call glade_gnome_init() instead
of glade_init() if GNOME support is enabled.
* libglade.m4 (module_args): modified macro so that you can pass
`gnome' as the third argument to get GNOME support.
* libglade-config.in: you can now pass it the arguments gtk and gnome
to indicate which widget sets you wish to use. If you specify
GNOME, the --libs output will include -lglade-gnome.
* glade/Makefile.am: create a separate libglade-gnome library if
GNOME support is enabled.
* glade/glade-gnome.c: implemented the GnomeApp, GnomeAppBar,
GnomeDock, GnomeDockItem and GtkPixmapItem (sort of). Just about
everything displays, except that the GNOMEUIINFO stuff, which is
not properly implemented at this point in time.
* glade/glade-gnome.c (about_new): make the about dialog creation
routine use the values of gnome_app_id and gnome_app_version.
* glade/glade-tree.c (recurse_tree, destroy_func): the hash table of
widget name -> xmlNode was broken. It was freeing the keys before
they were used. This bug is from when I was converting libglade
over to using xmlNodeGetContent(). It should now be possible to
use the glade_xml_new("filename", "rootnode") style of initialisation,
and signal handlers that should be connected with
gtk_signal_connect_object should now work correctly as well.
* glade/glade-gtk.c (pixmap_new): the filename of the pixmap should
be relative to the xml file.
(toolbar_new, toolbar_build_children): fixed up toolbar support. I
used code from the examples by Craig M. Buchek and Gary Ross. The
actual implementation is different than both, but the sample code
was very helpful.
* doc/libglade-sections.txt: added extra entries to documentation.
* glade/glade-xml.c (glade_xml_set_common_params): new function that
exposes some of the work that glade_xml_build_widget performs.
* glade/glade-xml.h, glade/glade-xml.c (glade_xml_relative_file):
new function that resolves a filename that is relative to the XML
file for an interface. This is useful for resolving image file
names and other external files.
* glade/glade-xml.c (glade_xml_build_widget): make the height and
width setting code work correctly (before, setting width would unset
the height and vice versa).
1999-06-09 James Henstridge <james@daa.com.au>
* Makefile.am (EXTRA_DIST): added the custom.glade and
gnome-widgets.glade examples to the distribution.
* glade/glade-xml.h, glade/glade-xml.c: changed the second argument
name in glade_xml_signal_connect to handlername, so that people who
don't want to read the docs do not get confused as easily :)
1999-06-09 Michael Meeks <michael@edenproject.org>
* glade/glade-xml.c (glade_xml_new): Added return NULL on error
(glade_xml_construct): Added boolean - success return value.
1999-06-08 James Henstridge <james@daa.com.au>
* Makefile.am (confexec_DATA): install the libgladeConf.sh script.
* libgladeConf.sh.in: A file for use with the gnome-config shell
script.
* glade/glade-gnome.c: added support for GnomeDialog and
GnomeMessageBox. This still leaves support for GnomeApp to be done.
Before this can be finished though, I need to work out the stock
menu (GnomeUIInfo) stuff. I don't know how difficult this will be.
=======
1999-06-06 Erik Walthinsen <omega@cse.ogi.edu>
* converted libglade.spec to libglade.spec.in, made appropiate
......@@ -138,7 +333,6 @@
both gtk and gnome code.
(glade_get_adjustment): similar to above.
>>>>>>> 1.31
1999-06-04 Miguel de Icaza <miguel@nuclecu.unam.mx>
* glade/glade-gtk.c (optionmenu_new): Only add items if there are
......
Email: james@daa.com.au
if GNOME_SUPPORT
THE_FLAGS = $(GNOME_INCLUDEDIR)
THE_LIBS = $(GNOME_LIBDIR) $(GNOMEUI_LIBS)
THE_LIBS = glade/libglade-gnome.la glade/libglade.la $(GNOME_LIBDIR) $(GNOMEUI_LIBS)
else
THE_FLAGS = $(GTK_CFLAGS)
THE_FLAGS = glade/libglade.la $(GTK_CFLAGS)
THE_LIBS = $(GTK_LIBS)
endif
INCLUDES = $(THE_FLAGS) $(XML_CFLAGS)
EXTRA_DIST = \
libglade.spec \
libgladeConf.sh \
libglade.spec.in \
test.glade \
simple.glade \
example.glade \
libglade.m4
custom.glade \
gnome-widgets.glade \
dialogs.glade \
libglade.m4 \
libglade-xgettext
if LIBGLADE_FULLDIST
bin_SCRIPTS = libglade-config
bin_SCRIPTS = libglade-config libglade-xgettext
noinst_PROGRAMS = test-libglade
test_libglade_LDADD = glade/libglade.la $(THE_LIBS) $(XML_LIBS)
extra_dirs = macros doc
test_libglade_LDADD = $(THE_LIBS) $(XML_LIBS)
extra_dirs = intl po macros doc
m4datadir = $(datadir)/aclocal
m4data_DATA = libglade.m4
confexecdir = $(libdir)
confexec_DATA = libgladeConf.sh
else
extra_dirs =
endif
SUBDIRS = glade $(extra_dirs)
SUBDIRS = $(extra_dirs) glade
test_libglade_SOURCES = test-libglade.c
dist-hook:
cp libglade.spec $(distdir)
XXXXXXXX
libglade-0.2:
- Radio group support
- The start of gnome support -- this code has been split off into a
separate library called libglade-gnome. You can get the cflags or
libraries to link with the gnome code by calling `libglade-config
--cflags --libs gnome`. Also, if you want gnome support, you
should call glade_gnome_init() instead of glade_init().
- I18N support. Libglade can either use the current translation
domain when building the widget tree, or you can specify a
different one with glade_xml_new_with_domain(). There is also
a program called libglade-xgettext to help extract strings for
translation from an XML file.
libglade-0.1: 27-May-1999
- Many fixes from many people. This version should actually be
......
......@@ -14,6 +14,13 @@
/* If true, include GNOME support */
#undef ENABLE_GNOME
/* for gettext ... */
#undef HAVE_LC_MESSAGES
#undef HAVE_STPCPY
#undef ENABLE_NLS
#undef HAVE_CATGETS
#undef HAVE_GETTEXT
@BOTTOM@
#ifdef DEBUG
......
AC_INIT(test-libglade.c)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(libglade, 0.1)
AM_INIT_AUTOMAKE(libglade, 0.2)
AM_MAINTAINER_MODE
dnl get the GNOME macros
AM_ACLOCAL_INCLUDE(macros)
......@@ -50,10 +51,18 @@ GNOME_COMPILE_WARNINGS
AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
AM_CONDITIONAL(HAVE_GTK_DOC, $GTKDOC)
dnl gettext stuff ... there is no message catalog for libglade -- libglade
dnl provides translation for the XML files it reads in.
ALL_LINGUAS=
AM_GNOME_GETTEXT
AC_OUTPUT([Makefile
libglade.spec
macros/Makefile
intl/Makefile
po/Makefile.in
glade/Makefile
doc/Makefile
libglade-config])
libglade-config
libgladeConf.sh])
<?xml version="1.0"?>
<GTK-Interface>
<project>
<name>project1</name>
<directory></directory>
<source_directory>src</source_directory>
<pixmaps_directory>pixmaps</pixmaps_directory>
<language>C</language>
<gnome_support>True</gnome_support>
<gettext_support>True</gettext_support>
<use_widget_names>False</use_widget_names>
<output_main_file>True</output_main_file>
<output_support_files>True</output_support_files>
<output_build_files>True</output_build_files>
<backup_source_files>True</backup_source_files>
<main_source_file>interface.c</main_source_file>
<main_header_file>interface.h</main_header_file>
<handler_source_file>callbacks.c</handler_source_file>
<handler_header_file>callbacks.h</handler_header_file>
<support_source_file>support.c</support_source_file>
<support_header_file>support.h</support_header_file>
</project>
<widget>
<class>GtkFileSelection</class>
<name>filesel</name>
<border_width>10</border_width>
<signal>
<name>destroy</name>
<handler>gtk_main_quit</handler>
<last_modification_time>Mon, 14 Jun 1999 08:16:29 GMT</last_modification_time>
</signal>
<title>Select File</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_NONE</position>
<show_file_op_buttons>True</show_file_op_buttons>
<allow_shrink>False</allow_shrink>
<allow_grow>True</allow_grow>
<auto_shrink>False</auto_shrink>
<wmclass_name>hello</wmclass_name>
<wmclass_class>DialogExample</wmclass_class>
<widget>
<class>GtkButton</class>
<child_name>FileSel:ok_button</child_name>
<name>ok_button1</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>gtk_widget_hide</handler>
<object>filesel</object>
<last_modification_time>Mon, 14 Jun 1999 08:11:36 GMT</last_modification_time>
</signal>
<signal>
<name>clicked</name>
<handler>gtk_widget_show</handler>
<object>coloursel</object>
<last_modification_time>Mon, 14 Jun 1999 08:11:49 GMT</last_modification_time>
</signal>
<label>OK</label>
</widget>
<widget>
<class>GtkButton</class>
<child_name>FileSel:cancel_button</child_name>
<name>cancel_button1</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>gtk_main_quit</handler>
<last_modification_time>Mon, 14 Jun 1999 08:11:14 GMT</last_modification_time>
</signal>
<label>Cancel</label>
</widget>
</widget>
<widget>
<class>GtkColorSelectionDialog</class>
<name>coloursel</name>
<border_width>10</border_width>
<visible>False</visible>
<signal>
<name>destroy</name>
<handler>gtk_main_quit</handler>
<last_modification_time>Mon, 14 Jun 1999 08:16:37 GMT</last_modification_time>
</signal>
<title>Select Color</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_NONE</position>
<allow_shrink>False</allow_shrink>
<allow_grow>True</allow_grow>
<auto_shrink>False</auto_shrink>
<policy>GTK_UPDATE_CONTINUOUS</policy>
<wmclass_name>none</wmclass_name>
<widget>
<class>GtkButton</class>
<child_name>ColorSel:ok_button</child_name>
<name>ok_button2</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>gtk_widget_hide</handler>
<object>coloursel</object>
<last_modification_time>Mon, 14 Jun 1999 08:12:37 GMT</last_modification_time>
</signal>
<signal>
<name>clicked</name>
<handler>gtk_widget_show</handler>
<object>fontsel</object>
<last_modification_time>Mon, 14 Jun 1999 08:12:49 GMT</last_modification_time>
</signal>
<label>OK</label>
</widget>
<widget>
<class>GtkButton</class>
<child_name>ColorSel:cancel_button</child_name>
<name>cancel_button2</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>gtk_main_quit</handler>
<last_modification_time>Mon, 14 Jun 1999 08:12:21 GMT</last_modification_time>
</signal>
<label>Cancel</label>
</widget>
<widget>
<class>GtkButton</class>
<child_name>ColorSel:help_button</child_name>
<name>help_button1</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<label>Help</label>
</widget>
</widget>
<widget>
<class>GtkFontSelectionDialog</class>
<name>fontsel</name>
<border_width>4</border_width>
<visible>False</visible>
<signal>
<name>destroy</name>
<handler>gtk_main_quit</handler>
<last_modification_time>Mon, 14 Jun 1999 08:16:46 GMT</last_modification_time>
</signal>
<title>Select Font</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_NONE</position>
<allow_shrink>False</allow_shrink>
<allow_grow>True</allow_grow>
<auto_shrink>True</auto_shrink>
<wmclass_class>DialogExample</wmclass_class>
<widget>
<class>GtkButton</class>
<child_name>FontSel:ok_button</child_name>
<name>ok_button3</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>gtk_widget_hide</handler>
<object>fontsel</object>
<last_modification_time>Mon, 14 Jun 1999 08:13:24 GMT</last_modification_time>
</signal>
<signal>
<name>clicked</name>
<handler>gtk_widget_show</handler>
<object>filesel</object>
<last_modification_time>Mon, 14 Jun 1999 08:13:37 GMT</last_modification_time>
</signal>
<label>OK</label>
</widget>
<widget>
<class>GtkButton</class>
<child_name>FontSel:apply_button</child_name>
<name>apply_button1</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<label>Apply</label>
</widget>
<widget>
<class>GtkButton</class>
<child_name>FontSel:cancel_button</child_name>
<name>cancel_button3</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>gtk_main_quit</handler>
<last_modification_time>Mon, 14 Jun 1999 08:13:48 GMT</last_modification_time>
</signal>
<label>Cancel</label>
</widget>
</widget>
</GTK-Interface>
......@@ -7,24 +7,290 @@
<book id="libglade">
<bookinfo>
<title>Libglade Reference Manual</title>
<authorgroup>
<author>
<firstname>James</firstname>
<surname>Henstridge</surname>
<affiliation>
<address>
<email>james@daa.com.au</email>
</address>
</affiliation>
</author>
</authorgroup>
<copyright>
<year>1999</year>
<holder>James Henstridge</holder>
</copyright>
<legalnotice>
<para>Permission is granted to make and distribute verbatim
copies of this manual provided the copyright notice and this
permission notice are preserved on all copies.</para>
<para>Permission is granted to copy and distribute modified
versions of this manual under the conditions for verbatim
copying, provided also that the entire resulting derived work is
distributed under the terms of a permission notice identical to
this one.</para>
<para>Permission is granted to copy and distribute translations
of this manual into another language, under the above conditions
for modified versions.</para>
</legalnotice>
<abstract>
<para>This manual documents the interfaces of the libglade
library and has some short notes to help get you up to speed
with using the library.</para>
</abstract>
</bookinfo>
<chapter id="libglade-notes">
<title>Libglade Programming Notes</title>
<para>Libglade is an alternative to using Glade's code generation.
Instead of generating code from the XML interface description,
libglade loads and parses the description at runtime. It also
provides functions that can be used to connect signal handlers to
parts of the interface.</para>
<para>In this way, it allows you to separate your program code
from the interface code. In fact, if you use the
glade_xml_signal_autoconnect() function, the GUI code could be as
simple as the <filename>test-libglade.c</filename> example that
comes with libglade. Of course, you would also add your own
signal handlers to the code. Note that the signals are connected
the same way as if you had hand coded the interface. There is no
extra overhead to interfaces generated by libglade (after the
initial generating of course, and this is not much of an overhead)
when compared to a hand crafted interface.</para>
<sect1 id=libglade-basics>
<title>Libglade Programming Basics</title>
<para>Your basic libglade program will look something like this:</para>
<programlisting>
#include &lt;gtk/gtk.h&gt;
#include &lt;glade/glade.h&gt;
void some_signal_handler_func(GtkWidget *widget, gpointer user_data) {
/* do something useful here */
}
int main(int argc, char *argv[]) {
GladeXML *xml;
gtk_init(&amp;argc, &amp;argv);
glade_init();
/* load the interface */
xml = glade_xml_new("filename-for-interface", NULL);
/* connect the signals in the interface */
glade_xml_signal_autoconnect(xml);
/* start the event loop */
gtk_main();
return 0;
}
</programlisting>
<para>This will create the interface from the file
<filename>filename-for-interface</filename>, then connect all
the signals in the interface. The automatic signal connection
is done by looking up function names in the symbol table using
gmodule. This means that the interface file can use standard
GTK functions such as <function>gtk_widget_show</function>, or
<function>gtk_main_quit</function>, or others in the interface
and not have to write any code to connect the signals.</para>
<para>The <function>some_signal_handler_func</function> function
is not referenced anywhere in the program explicitely, but if
any signals are defined in the interface description that use
"some_signal_handler_func" as the handler name, then this