Re: utils
- From: Owen Taylor <otaylor redhat com>
- To: Havoc Pennington <hp redhat com>
- Cc: Miroslaw Dobrzanski-Neumann <mne mosaic-ag com>, GTKDEV <gtk-devel-list gnome org>
- Subject: Re: utils
- Date: Mon, 11 Mar 2002 12:03:53 -0500 (EST)
Havoc Pennington <hp redhat com> writes:
> Miroslaw Dobrzanski-Neumann <mne mosaic-ag com> writes:
> >
> > some utility functions are spread over many packages.
> > for example file handling utilities can be found in both glib and pango:
> >
> > having them in a one place (preferably glib) would make many things simpler.
> >
> > I believe pango_split_file_list () and others do not belong to pango but
> > rather they should be moved to glib.
> >
>
> I have no idea why pango-utils.h is installed and public, other than
> "GTK happens to use it" which isn't really a good reason...
Well, yes, that's about it :-)
- There is some backend-useful stuff in there that is protected by
PANGO_ENABLE_BACKEND; since we allow for external backends
- There is some generally useful pango stuff:
pango_log2vis_get_embedding_levels ()
pango_language_get_sample_string ()
Etc.
- There is some other random utility stuff in there that used also to
be protected, but then I needed it in GTK+, so I unprotected it.
It's maintainable, in the sense that I don't see any reason we'll
have to remove it; as to whether we should add similar stuff in
GLib, there is:
- A simple "scanner" that basically duplicates more complex
functionality in GLib.
gint pango_read_line (FILE *stream,
GString *str);
gboolean pango_skip_space (const char **pos);
gboolean pango_scan_word (const char **pos,
GString *out);
gboolean pango_scan_string (const char **pos,
GString *out);
gboolean pango_scan_int (const char **pos,
int *out);
If I was doing things now, I'd probably use GMarkup for the files that
I used this for. GScanner would have been another possibility, but
it didn't work for the line-oriented formats I was using, and always
takes me a bit too long to get going with.
I don't believe this belongs in GLib. (Maybe somethign like pango_read_line(),
but we have GIOChannel functions for doing stuff like this.)
- Two utility functions that probably should be added to GLib.
char ** pango_split_file_list (const char *str);
char *pango_trim_string (const char *str);
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]