[prev in list] [next in list] [prev in thread] [next in thread] 

List:       abiword-dev
Subject:    abiword/sugar update
From:       "Robert Staudinger" <robert.staudinger () gmail ! com>
Date:       2006-08-01 19:09:42
Message-ID: 408d079d0608011209t1a77677p7da5e49c17d06f33 () mail ! gmail ! com
[Download RAW message or body]

Hi,

so Erik's initial patch is now in the sugar branch - Thanks! (added a
quick hack that writes the plug ID to /var/run/abiword/wid in the
sugar installation and waits 5s before embedding so c/p is no more
needed)

How to get abi/sugar up and running then?
(1) patch your sugar jhbuild with the attached sugar-abi-jhbuild.diff,
this adds the possibility to do "./sugar-jhbuild abiword"
(2) Patch the "sugar" module with sugar-abi-activity.diff, this adds a
"hello world" activity that embeds AbiWord.
(3) Enjoy!

http://www.abisource.com/~robsta/tmp/sugar-abi-startup.png
http://www.abisource.com/~robsta/tmp/sugar-abi-running.png

- Rob

["sugar-abi-jhbuild.diff" (text/x-patch)]

diff --git a/build-scripts/olpc.jhbuildrc b/build-scripts/olpc.jhbuildrc
index 336c8df..418f888 100644
--- a/build-scripts/olpc.jhbuildrc
+++ b/build-scripts/olpc.jhbuildrc
@@ -7,6 +7,9 @@ moduleset = [ 'gnome-2.16' ]
 moduleset.append(os.path.join(base_dir, 'build-scripts', 'sugar.modules'))
 modules = [ 'sugar' ]
 
+branches['abiword'] = 'sugar'
+skip = [ 'libxml2' ]
+
 user_config = os.path.expanduser('~/.olpc.jhbuildrc')
 if os.path.isfile(user_config):
 	try:
diff --git a/build-scripts/sugar.modules b/build-scripts/sugar.modules
index 4c416d0..b918dfd 100644
--- a/build-scripts/sugar.modules
+++ b/build-scripts/sugar.modules
@@ -8,6 +8,9 @@
   <repository type="cvs" name="mozilla.org"
       cvsroot=":pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot"
       password="anonymous"/>
+  <repository type="cvs" name="abisource.com"
+      cvsroot=":pserver:anoncvs@anoncvs.abisource.com:/cvsroot"
+      password=""/>
   <repository type="git" name="git.laptop.org" default="yes"
       href="git://dev.laptop.org/"/>
   <repository type="svn" name="matchbox.o-hand.com"
@@ -74,4 +77,7 @@
       <dep package="gnome-python"/>
     </dependencies>
   </autotools>
+  <autotools id="abiword" autogenargs="--enable-sugar --enable-symbols --disable-debug --disable-gnome">
+    <branch repo="abisource.com" module="abi" checkoutdir="abiword"/>
+  </autotools>
 </moduleset>

["sugar-abi-activity.diff" (text/x-patch)]

diff --git a/activities/Makefile.am b/activities/Makefile.am
index 84bfa85..66b25d9 100644
--- a/activities/Makefile.am
+++ b/activities/Makefile.am
@@ -1 +1 @@
-SUBDIRS = browser chat terminal
+SUBDIRS = browser chat terminal hello
diff --git a/activities/hello/HelloActivity.py b/activities/hello/HelloActivity.py
new file mode 100644
index 0000000..2a92999
--- /dev/null
+++ b/activities/hello/HelloActivity.py
@@ -0,0 +1,39 @@
+
+import logging
+import os
+import time
+import gtk
+
+from sugar.activity.Activity import Activity
+import HelloConfig
+
+
+class AbiWord(gtk.Socket):
+
+	def __init__ (self):
+		gtk.Socket.__init__ (self)
+
+
+	def plug_in (self):
+
+		fp = open (HelloConfig.PREFIX + "/var/run/abiword/wid")
+		id = fp.read ()
+		fp.close ()
+		self.add_id (int (id))
+
+
+class HelloActivity (Activity):
+
+	def __init__ (self, service, args):
+		Activity.__init__ (self, service)
+	
+		self.set_title ("Hello")
+
+		hello = AbiWord ()
+		self.add (hello)
+
+		os.spawnlp (os.P_NOWAIT, 'abiword', '/dev/null')
+		time.sleep (5)
+
+		hello.plug_in ()
+		hello.show_all ()
diff --git a/activities/hello/HelloConfig.py.in b/activities/hello/HelloConfig.py.in
new file mode 100644
index 0000000..d805a02
--- /dev/null
+++ b/activities/hello/HelloConfig.py.in
@@ -0,0 +1,2 @@
+
+PREFIX = "@prefix@"
diff --git a/activities/hello/Makefile.am b/activities/hello/Makefile.am
new file mode 100644
index 0000000..8bdb2d7
--- /dev/null
+++ b/activities/hello/Makefile.am
@@ -0,0 +1,7 @@
+sugardir = $(pkgdatadir)/activities/hello
+sugar_PYTHON =			\
+	__init__.py		\
+	HelloConfig.py		\
+	HelloActivity.py
+
+EXTRA_DIST = hello.activity
diff --git a/activities/hello/__init__.py b/activities/hello/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/activities/hello/hello.activity b/activities/hello/hello.activity
new file mode 100644
index 0000000..6c1dee5
--- /dev/null
+++ b/activities/hello/hello.activity
@@ -0,0 +1,5 @@
+[Activity]
+name = Hello
+id = org.sugar.Hello
+python_module = hello.HelloActivity.HelloActivity
+show_launcher = yes
diff --git a/configure.ac b/configure.ac
index 46598fd..9e54fa4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,6 +28,8 @@ activities/Makefile
 activities/browser/Makefile
 activities/chat/Makefile
 activities/terminal/Makefile
+activities/hello/Makefile
+activities/hello/HelloConfig.py
 shell/Makefile
 shell/data/Makefile
 shell/PresenceService/Makefile


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic