Commit d36df18d authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Moved font lists from the klass structure to a static structure in

Mon Jun 15 23:39:44 1998  Owen Taylor  <otaylor@gtk.org>

	* gtk/gtkfontsel.[ch] (gtk_font_selection_dialog_init): Moved font
	lists from the klass structure to a static structure
	in gtkfontsel.c; cleans up global the namespace.

Mon Jun 15 22:16:10 1998  Owen Taylor  <otaylor@gtk.org>

	* gtk/makeenums.pl (parse_entries): Fix (untriggered)
	bug with /*< skip >*/ and remove warning.
parent 406fd336
Mon Jun 15 23:39:44 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Moved font
lists from the klass structure to a static structure
in gtkfontsel.c; cleans up global the namespace.
Mon Jun 15 22:16:10 1998 Owen Taylor <otaylor@gtk.org>
* gtk/makeenums.pl (parse_entries): Fix (untriggered)
bug with /*< skip >*/ and remove warning.
Mon Jun 15 20:14:09 1998 Owen Taylor <otaylor@gtk.org>
* gtk/Makefile.am: Made the gtkmarshal.* generation
rules maintainer-only.
Mon Jun 15 16:29:45 1998 Owen Taylor <otaylor@gtk.org>
* gdk/gdktypes.h gdk/gdkprivate.h gtk/gtk*.h
......
Mon Jun 15 23:39:44 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Moved font
lists from the klass structure to a static structure
in gtkfontsel.c; cleans up global the namespace.
Mon Jun 15 22:16:10 1998 Owen Taylor <otaylor@gtk.org>
* gtk/makeenums.pl (parse_entries): Fix (untriggered)
bug with /*< skip >*/ and remove warning.
Mon Jun 15 20:14:09 1998 Owen Taylor <otaylor@gtk.org>
* gtk/Makefile.am: Made the gtkmarshal.* generation
rules maintainer-only.
Mon Jun 15 16:29:45 1998 Owen Taylor <otaylor@gtk.org>
* gdk/gdktypes.h gdk/gdkprivate.h gtk/gtk*.h
......
Mon Jun 15 23:39:44 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Moved font
lists from the klass structure to a static structure
in gtkfontsel.c; cleans up global the namespace.
Mon Jun 15 22:16:10 1998 Owen Taylor <otaylor@gtk.org>
* gtk/makeenums.pl (parse_entries): Fix (untriggered)
bug with /*< skip >*/ and remove warning.
Mon Jun 15 20:14:09 1998 Owen Taylor <otaylor@gtk.org>
* gtk/Makefile.am: Made the gtkmarshal.* generation
rules maintainer-only.
Mon Jun 15 16:29:45 1998 Owen Taylor <otaylor@gtk.org>
* gdk/gdktypes.h gdk/gdkprivate.h gtk/gtk*.h
......
Mon Jun 15 23:39:44 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Moved font
lists from the klass structure to a static structure
in gtkfontsel.c; cleans up global the namespace.
Mon Jun 15 22:16:10 1998 Owen Taylor <otaylor@gtk.org>
* gtk/makeenums.pl (parse_entries): Fix (untriggered)
bug with /*< skip >*/ and remove warning.
Mon Jun 15 20:14:09 1998 Owen Taylor <otaylor@gtk.org>
* gtk/Makefile.am: Made the gtkmarshal.* generation
rules maintainer-only.
Mon Jun 15 16:29:45 1998 Owen Taylor <otaylor@gtk.org>
* gdk/gdktypes.h gdk/gdkprivate.h gtk/gtk*.h
......
Mon Jun 15 23:39:44 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Moved font
lists from the klass structure to a static structure
in gtkfontsel.c; cleans up global the namespace.
Mon Jun 15 22:16:10 1998 Owen Taylor <otaylor@gtk.org>
* gtk/makeenums.pl (parse_entries): Fix (untriggered)
bug with /*< skip >*/ and remove warning.
Mon Jun 15 20:14:09 1998 Owen Taylor <otaylor@gtk.org>
* gtk/Makefile.am: Made the gtkmarshal.* generation
rules maintainer-only.
Mon Jun 15 16:29:45 1998 Owen Taylor <otaylor@gtk.org>
* gdk/gdktypes.h gdk/gdkprivate.h gtk/gtk*.h
......
Mon Jun 15 23:39:44 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Moved font
lists from the klass structure to a static structure
in gtkfontsel.c; cleans up global the namespace.
Mon Jun 15 22:16:10 1998 Owen Taylor <otaylor@gtk.org>
* gtk/makeenums.pl (parse_entries): Fix (untriggered)
bug with /*< skip >*/ and remove warning.
Mon Jun 15 20:14:09 1998 Owen Taylor <otaylor@gtk.org>
* gtk/Makefile.am: Made the gtkmarshal.* generation
rules maintainer-only.
Mon Jun 15 16:29:45 1998 Owen Taylor <otaylor@gtk.org>
* gdk/gdktypes.h gdk/gdkprivate.h gtk/gtk*.h
......
Mon Jun 15 23:39:44 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Moved font
lists from the klass structure to a static structure
in gtkfontsel.c; cleans up global the namespace.
Mon Jun 15 22:16:10 1998 Owen Taylor <otaylor@gtk.org>
* gtk/makeenums.pl (parse_entries): Fix (untriggered)
bug with /*< skip >*/ and remove warning.
Mon Jun 15 20:14:09 1998 Owen Taylor <otaylor@gtk.org>
* gtk/Makefile.am: Made the gtkmarshal.* generation
rules maintainer-only.
Mon Jun 15 16:29:45 1998 Owen Taylor <otaylor@gtk.org>
* gdk/gdktypes.h gdk/gdkprivate.h gtk/gtk*.h
......
......@@ -206,6 +206,12 @@
(dialog GTK_WINDOW_DIALOG)
(popup GTK_WINDOW_POPUP))
; enumerations from "../../gtk+/gtk/gtkfontsel.h"
(define-enum GtkFontMetricType
(ixels-metric PIXELS_METRIC)
(oints-metric POINTS_METRIC))
; enumerations from "../../gtk+/gtk/gtkobject.h"
(define-flags GtkObjectFlags
......
This diff is collapsed.
......@@ -50,19 +50,6 @@ typedef struct _GtkFontSelectionDialog GtkFontSelectionDialog;
typedef struct _GtkFontSelectionDialogClass GtkFontSelectionDialogClass;
typedef struct _FontInfo FontInfo;
typedef struct _FontStyle FontStyle;
/* This struct represents one family of fonts (with one foundry), e.g. adobe
courier or sony fixed. It stores the family name, the index of the foundry
name, and the index of and number of available styles. */
struct _FontInfo
{
gchar *family;
guint16 foundry;
gint style_index;
guint16 nstyles;
};
/* This is the number of properties which we keep in the properties array,
......@@ -74,32 +61,6 @@ struct _FontInfo
#define GTK_NUM_STYLE_PROPERTIES 5
/* Used for the flags field in FontStyle. Note that they can be combined,
e.g. a style can have multiple bitmaps and a true scalable version.
The displayed flag is used when displaying styles to remember which
styles have already been displayed. */
enum
{
BITMAP_FONT = 1 << 0,
SCALABLE_FONT = 1 << 1,
SCALABLE_BITMAP_FONT = 1 << 2,
DISPLAYED = 1 << 3
};
/* This represents one style, as displayed in the Font Style clist. It can
have a number of available pixel sizes and point sizes. The indexes point
into the two big klass->pixel_sizes & klass->point_sizes arrays. */
struct _FontStyle
{
guint16 properties[GTK_NUM_STYLE_PROPERTIES];
gint pixel_sizes_index;
guint16 npixel_sizes;
gint point_sizes_index;
guint16 npoint_sizes;
guint8 flags;
};
/* Used to determine whether we are using point or pixel sizes. */
typedef enum
{
......@@ -171,30 +132,6 @@ struct _GtkFontSelection
struct _GtkFontSelectionClass
{
GtkWindowClass parent_class;
/* This is a table with each FontInfo representing one font family+foundry */
FontInfo *font_info;
gint nfonts;
/* This stores all the valid combinations of properties for every family.
Each FontInfo holds an index into its own space in this one big array. */
FontStyle *font_styles;
gint nstyles;
/* This stores all the font sizes available for every style.
Each style holds an index into these arrays. */
guint16 *pixel_sizes;
guint16 *point_sizes;
/* These are the arrays of all possible weights/slants/set widths/spacings
and the amount of space allocated for each array. The extra array is
used for the foundries strings. */
gchar **properties[GTK_NUM_FONT_PROPERTIES];
guint16 nproperties[GTK_NUM_FONT_PROPERTIES];
guint16 space_allocated[GTK_NUM_FONT_PROPERTIES];
/* Whether any scalable bitmap fonts are available. */
gboolean scaled_bitmaps_available;
};
......
......@@ -35,6 +35,7 @@ extern GtkType GTK_TYPE_UPDATE_TYPE;
extern GtkType GTK_TYPE_VISIBILITY;
extern GtkType GTK_TYPE_WINDOW_POSITION;
extern GtkType GTK_TYPE_WINDOW_TYPE;
extern GtkType GTK_TYPE_FONT_METRIC_TYPE;
extern GtkType GTK_TYPE_OBJECT_FLAGS;
extern GtkType GTK_TYPE_ARG_FLAGS;
extern GtkType GTK_TYPE_PACKER_OPTIONS;
......@@ -98,4 +99,4 @@ extern GtkType GTK_TYPE_GDK_WINDOW;
extern GtkType GTK_TYPE_GDK_EVENT;
extern GtkType GTK_TYPE_GDK_COLOR;
#define GTK_TYPE_NUM_BUILTINS (97)
#define GTK_TYPE_NUM_BUILTINS (98)
......@@ -232,6 +232,11 @@ static GtkEnumValue _gtk_window_type_values[] = {
{ GTK_WINDOW_POPUP, "GTK_WINDOW_POPUP", "popup" },
{ 0, NULL, NULL }
};
static GtkEnumValue _gtk_font_metric_type_values[] = {
{ PIXELS_METRIC, "PIXELS_METRIC", "ixels-metric" },
{ POINTS_METRIC, "POINTS_METRIC", "oints-metric" },
{ 0, NULL, NULL }
};
static GtkEnumValue _gtk_object_flags_values[] = {
{ GTK_DESTROYED, "GTK_DESTROYED", "destroyed" },
{ GTK_FLOATING, "GTK_FLOATING", "floating" },
......
......@@ -70,6 +70,8 @@
GTK_TYPE_ENUM, _gtk_window_position_values },
{ "GtkWindowType", &GTK_TYPE_WINDOW_TYPE,
GTK_TYPE_ENUM, _gtk_window_type_values },
{ "GtkFontMetricType", &GTK_TYPE_FONT_METRIC_TYPE,
GTK_TYPE_ENUM, _gtk_font_metric_type_values },
{ "GtkObjectFlags", &GTK_TYPE_OBJECT_FLAGS,
GTK_TYPE_FLAGS, _gtk_object_flags_values },
{ "GtkArgFlags", &GTK_TYPE_ARG_FLAGS,
......
......@@ -35,6 +35,7 @@ GtkType GTK_TYPE_UPDATE_TYPE = 0;
GtkType GTK_TYPE_VISIBILITY = 0;
GtkType GTK_TYPE_WINDOW_POSITION = 0;
GtkType GTK_TYPE_WINDOW_TYPE = 0;
GtkType GTK_TYPE_FONT_METRIC_TYPE = 0;
GtkType GTK_TYPE_OBJECT_FLAGS = 0;
GtkType GTK_TYPE_ARG_FLAGS = 0;
GtkType GTK_TYPE_PACKER_OPTIONS = 0;
......
......@@ -73,13 +73,13 @@ sub parse_entries {
if (!defined $flags && defined $value && $value =~ /<</) {
$seenbitshift = 1;
}
if (!defined $options{skip}) {
if (defined $options) {
my %options = parse_options($options);
if (defined $options) {
my %options = parse_options($options);
if (!defined $options{skip}) {
push @entries, [ $name, $options{nick} ];
} else {
push @entries, [ $name ];
}
} else {
push @entries, [ $name ];
}
} else {
print STDERR "Can't understand: $_\n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment