summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Henstridge <james@daa.com.au>2000-11-29 01:15:08 +0000
committerJames Henstridge <jamesh@src.gnome.org>2000-11-29 01:15:08 +0000
commit22974e1ee28b50d8f084c857ff0c35155624a2d8 (patch)
treee94b23c79d345ef38e1136b8099aac79aa0754a6
parent1080e4e22532f3958083aa2d291631d571359739 (diff)
downloadpygtk-22974e1ee28b50d8f084c857ff0c35155624a2d8.tar.gz
Havoc's enum handling patch.
2000-11-29 James Henstridge <james@daa.com.au> * codegen/h2def.py (write_enum_defs): Havoc's enum handling patch. * TODO: add todo item about creating real GObject subclasses, and add some info on the GInterface stuff.
-rw-r--r--ChangeLog5
-rw-r--r--TODO16
-rwxr-xr-xcodegen/h2def.py6
3 files changed, 24 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 66e4f510..6cc7b586 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2000-11-29 James Henstridge <james@daa.com.au>
+ * codegen/h2def.py (write_enum_defs): Havoc's enum handling patch.
+
+ * TODO: add todo item about creating real GObject subclasses, and
+ add some info on the GInterface stuff.
+
* examples/testgtk/testgtk.py (load_module): fix bug where
mod.__file__ is the .pyc file rather than the .py file.
diff --git a/TODO b/TODO
index 11fb0faa..f60bf310 100644
--- a/TODO
+++ b/TODO
@@ -13,13 +13,16 @@ Things to do for the gtk 2.0 based release
(c-name GtkTextModel)
)
* add a flag for the (object ...) sections like:
- (conforms-to GtkTextModel)
+ (implements GtkTextModel)
For the code generator:
* Create new ExtensionClasses for the interface (an empty `mixin' class).
* Use multiple inheritance to add these methods for classes that implement
the interface.
+ [ mostly done. Not handled by h2defs, and I don't know if it will
+ be possible to handle it from there - JH]
+
- Implement a new PyGtkTreeModel GObject type that can be the base for
new tree models defined in Python. Need to look at how the
GtkTreeIter->tree_node lifetime is handled, as it doesn't look like
@@ -30,3 +33,14 @@ Things to do for the gtk 2.0 based release
most of them.
- Add the rest of the new boxed types.
+
+- Make python subclasses of GObjects into new types in the GType
+ system. Should be possible to do from GObject.__class_init__ and a
+ bit of extra magic.
+
+ Maybe stop adding get_type() class methods, and switch over to
+ adding __gtype__ class attributes. This is easier when defining new
+ GObject types (ie. just set an attribute), but may mean calling
+ get_type() for all classes. Could do some special code so that the
+ __gtype__ attributes are of a special type that calls the get_type()
+ macro to convert to an int.
diff --git a/codegen/h2def.py b/codegen/h2def.py
index fd53a7bb..55fd47ca 100755
--- a/codegen/h2def.py
+++ b/codegen/h2def.py
@@ -127,7 +127,8 @@ def find_enum_defs(buf, enums=[]):
for val in splitter.split(vals):
if not string.strip(val): continue
entries.append(string.split(val)[0])
- enums.append((name, isflags, entries))
+ if name != 'GdkCursorType':
+ enums.append((name, isflags, entries))
pos = m.end()
@@ -159,7 +160,8 @@ def write_enum_defs(enums, output=None):
prefix = entries[0]
for ent in entries:
# shorten prefix til we get a match ...
- while ent[:len(prefix)] != prefix:
+ # and handle GDK_FONT_FoNT, GDK_FONT_FONTSET case
+ while ent[:len(prefix)] != prefix or len(prefix) >= len(ent):
prefix = prefix[:-1]
for ent in entries:
fp.write(' (value (name ' +