diff options
author | James Henstridge <james@daa.com.au> | 2002-03-16 07:03:10 +0000 |
---|---|---|
committer | James Henstridge <jamesh@src.gnome.org> | 2002-03-16 07:03:10 +0000 |
commit | a60c5ec86ad16ac8e6024a2fa133316e9e9447f2 (patch) | |
tree | 7df609576b2e438ae738068e9849121a0bf84945 /pango.override | |
parent | dde1ea527031d32f829da7565119a167b0ef3bbe (diff) | |
download | pygtk-a60c5ec86ad16ac8e6024a2fa133316e9e9447f2.tar.gz |
override the compare slot to use pango_font_description_equal.
2002-03-16 James Henstridge <james@daa.com.au>
* pango.override (_wrap_pango_font_description_tp_compare):
override the compare slot to use pango_font_description_equal.
(_wrap_pango_font_description_tp_hash): and the hash function.
Diffstat (limited to 'pango.override')
-rw-r--r-- | pango.override | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/pango.override b/pango.override index f97314d3..d2cae681 100644 --- a/pango.override +++ b/pango.override @@ -63,3 +63,24 @@ _wrap_pango_font_description_new(PyGBoxed *self, PyObject *args, self->free_on_dealloc = TRUE; return 0; } +%% +override-slot PangoFontDescription.tp_compare +static int +_wrap_pango_font_description_tp_compare(PyGBoxed *self, PyGBoxed *other) +{ + if (self->boxed == other->boxed || + pango_font_description_equal(pyg_boxed_get(self, PangoFontDescription), + pyg_boxed_get(other, PangoFontDescription))) + return 0; + if (self->boxed > other->boxed) + return -1; + return 1; +} +%% +override-slot PangoFontDescription.tp_hash +static long +_wrap_pango_font_description_tp_hash(PyGBoxed *self) +{ + return (long)pango_font_description_hash( + pyg_boxed_get(self, PangoFontDescription)); +} |