gtk2/gtk/maketypes.awk
Owen Taylor 48a9f44f31 gdk/gdktypes.h gdk/gdkprivate.h gtk/gtk*.h gtk/Makefile.am gtk/makenums.pl
Mon Jun 15 16:29:45 1998  Owen Taylor  <otaylor@gtk.org>

	* gdk/gdktypes.h gdk/gdkprivate.h gtk/gtk*.h
	  gtk/Makefile.am gtk/makenums.pl

	Removed out the G_ENUM/FLAGS mechanism in favor
	of a perl script that parses the standard headers
	(with occasional /*< nick=foo >*/ style overrides)
	and extracts the enumerations.

	  gtk/maketypes.awk: Small improvments to the
	  translation of names. (Avoid splitting gc into
	  g_c_.)

Mon Jun 15 16:25:44 1998  Owen Taylor  <otaylor@gtk.org>

	* gtk/Makefile.am gtk/gtk.h gtk/gtkfontsel.[ch] gtk/testgtk.c:
	Damon Chaplin's <DAChaplin@email.msn.com> Font selection widget,
        and a simple example for testgtk.

Mon Jun 15 15:58:34 1998  Owen Taylor  <otaylor@gtk.org>

	* gtk/gtkentry.c:
	- Restored gtk_entry_adjust_scroll to static
	- Changed text positioning code so that we always
	  display as large a portion of the text as possible.

Mon Jun 15 15:42:12 1998  Owen Taylor  <otaylor@gtk.org>

	* gtk/gtktext.c (gtk_text_finalize): Free internal
	structures of text widget. Also, unreference pixmaps
	when unrealizing.

Sat Jun 13 19:14:39 1998  Owen Taylor  <otaylor@gtk.org>

	* gdk/gdkinputcommon.h (gdk_input_device_new): Change
	3.3.1 bug workaround to number keys starting at 1.

Sat Jun 13 11:56:57 1998  Owen Taylor  <otaylor@gtk.org>

	* docs/gtk_tut.sgml: Fixed urls for complete example
	source for scribble+widget-writing examples.
1998-06-15 21:27:17 +00:00

115 lines
2.3 KiB
Awk

BEGIN {
type_name = ""; # GtkEnumType
type_macro = ""; # GTK_TYPE_ENUM_TYPE
type_ident = ""; # _gtk_enum_type
type_counter = 0;
gen_macros = 0;
gen_entries = 0;
gen_vars = 0;
for (i = 2; i < ARGC; i++)
{
if (ARGV[i] == "macros")
gen_macros = 1;
else if (ARGV[i] == "entries")
gen_entries = 1;
else if (ARGV[i] == "variables")
gen_vars = 1;
ARGV[i] = "";
}
if (gen_macros)
printf ("/* type macros, generated by maketypes.awk */\n\n");
else if (gen_entries)
printf ("/* type entries, generated by maketypes.awk */\n\n");
else if (gen_vars)
printf ("/* type variables, generated by maketypes.awk */\n\n");
else
{
printf ("hm? what do you want me to do?\n") > "/dev/stderr";
exit 1;
}
}
function set_type (set_type_1)
{
type_counter += 1;
type_name = set_type_1;
type_macro = "GTK_TYPE";
tmp = type_name
gsub ("[A-Z][a-z]", "_&", tmp);
# OK, the following is ridiculous. But easier than writing a loop
gsub ("[a-z]", "&@", tmp);
gsub ("@[A-Z]", "@&", tmp);
gsub ("@@", "_", tmp);
gsub ("@", "", tmp);
type_macro = type_macro toupper (tmp);
type_ident = tolower (tmp);
sub ("^GTK_TYPE_GTK_", "GTK_TYPE_", type_macro);
}
function generate (generate_1)
{
if (gen_macros)
{
printf ("extern GtkType %s;\n", type_macro);
}
if (gen_entries)
{
printf (" { \"%s\", &%s,\n", type_name, type_macro);
if (generate_1 == "BOXED")
printf (" GTK_TYPE_%s, NULL },\n", generate_1);
else
printf (" GTK_TYPE_%s, %s_values },\n", generate_1, type_ident);
}
if (gen_vars)
{
printf ("GtkType %s = 0;\n", type_macro);
}
}
# skip scheme comments
";" {
sub (";.*", "");
}
# parse keywords
/\(define-enum/ {
if ($2 == "")
printf ("huh? define-enum keyword without arg?\n") > "/dev/stderr";
else
{
set_type($2);
generate("ENUM");
}
}
/\(define-flags/ {
if ($2 == "")
printf ("huh? define-flags keyword without arg?\n") > "/dev/stderr";
else
{
set_type($2);
generate("FLAGS");
}
}
/\(define-boxed/ {
if ($2 == "")
printf ("huh? define-boxed keyword without arg?\n") > "/dev/stderr";
else
{
set_type($2);
generate("BOXED");
}
}
END {
if (gen_macros)
printf("\n#define\tGTK_TYPE_NUM_BUILTINS\t(%u)\n", type_counter);
}