Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Francis <francis@sugarlabs.org>2012-09-09 00:14:42 (GMT)
committer Daniel Francis <francis@sugarlabs.org>2012-09-09 00:14:42 (GMT)
commitb15d46f37a3e310f917dd216d50b12edc2a4b005 (patch)
tree68796fe5b9413ec3db2865bbf20525439344b177
parent8f6502a5fbf6c77dbef8d94a5ed6a851b8d3566a (diff)
Add all the GObject Signals and a necessary GObject Property
-rw-r--r--sugarvte/vteview.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/sugarvte/vteview.py b/sugarvte/vteview.py
index 3a789c1..395d2db 100644
--- a/sugarvte/vteview.py
+++ b/sugarvte/vteview.py
@@ -28,6 +28,25 @@ class WordCharRange:
end = None
class View(Gtk.Widget, Gtk.Scrollable):
+ __gsignals__ = {'buffer-changed': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE,
+ (GObject.TYPE_PYOBJECT,)),
+ 'char-size-changed': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE,
+ (GObject.TYPE_INT, GObject.TYPE_INT)),
+ 'selection-changed': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE,
+ tuple()),
+ 'increase-font-size': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE,
+ tuple()),
+ 'decrease-font-size': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE,
+ tuple()),
+ 'text-scrolled': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE,
+ (GObject.TYPE_INT,)),
+ 'copy-clipboard': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, tuple()),
+ 'paste-clipboard': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, tuple()),
+ 'copy-primary': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, tuple()),
+ 'paste-primary': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, tuple())}
+ __gproperties__ = {'word-chars' : (GObject.TYPE_PYOBJECT,
+ 'word chars', '',
+ GObject.PARAM_READWRITE)}
char_width = 1
char_height = 2
char_ascent = 3
@@ -64,9 +83,10 @@ treat all graphic non-punctuation non-space characters as word characters.
self.word_chars = []
if spec == None or spec[0] == '\0':
self.notify('word-chars')
+ return
ubuf = unicode(spec)
i = -1
- while i < len(ubuf):
+ while i + 1 < len(ubuf):
i += 1
if ubuf[i] == '-':
range.start = ubuf[i]
@@ -86,6 +106,7 @@ treat all graphic non-punctuation non-space characters as word characters.
range.start = ubuf[i]
range.end = ubuf[i + 1]
self.word_chars.append(range)
+ i += 2
continue
self.notify('word-chars')