summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--pango.override21
2 files changed, 25 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index d7bee3cc..13491c04 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
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.
+
* atk.override (_wrap_atk_relation_new): remove unused variable.
* gtk/gtk-types.defs (Window): transient_parent field is a
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));
+}