summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Henstridge <james@daa.com.au>2002-03-16 07:03:10 +0000
committerJames Henstridge <jamesh@src.gnome.org>2002-03-16 07:03:10 +0000
commita60c5ec86ad16ac8e6024a2fa133316e9e9447f2 (patch)
tree7df609576b2e438ae738068e9849121a0bf84945
parentdde1ea527031d32f829da7565119a167b0ef3bbe (diff)
downloadpygtk-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.
-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));
+}