Minor refactoring...
authorJan Vrany <jan.vrany@fit.cvut.cz>
Fri, 03 Jun 2011 08:54:52 +0000
changeset 2 7e604e6f195e
parent 1 a9c9bb21d650
child 3 32456ba40192
Minor refactoring...
Make.proto
Make.spec
WebKitRenderer.st
WebKitView.st
abbrev.stc
bc.mak
libInit.cc
libwebkit.rc
stx_libwebkit.st
--- a/Make.proto	Thu Jun 02 23:03:04 2011 +0000
+++ b/Make.proto	Fri Jun 03 08:54:52 2011 +0000
@@ -34,7 +34,7 @@
 # add the path(es) here:,
 # ********** OPTIONAL: MODIFY the next lines ***
 # LOCALINCLUDES=-Ifoo -Ibar
-LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/libview -I$(INCLUDE_TOP)/stx/libview2 -I$(INCLUDE_TOP)/stx/libbasic
+LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/libview -I$(INCLUDE_TOP)/stx/libwidg -I$(INCLUDE_TOP)/stx/libview2 -I$(INCLUDE_TOP)/stx/libbasic
 
 
 # if you need any additional defines for embedded C code,
@@ -63,10 +63,17 @@
 
 all:: preMake classLibRule postMake
 
-pre_objs::  
+pre_objs::  update-svn-revision
 
 
 
+update-svn-revision:
+	if [ ! -r .svnversion -o "$(shell svnversion -n)" != "$(shell cat .svnversion)" ]; then \
+		svnversion -n > .svnversion; \
+		sed -i -e "s/\"\$$SVN\-Revision:\".*\"\$$\"/\"\$$SVN-Revision:\"'$(shell svnversion -n)'\"\$$\"/g" \
+			stx_libwebkit.st; \
+	fi
+.PHONY: update-svn-revision
 
 
 # add more install actions here
@@ -86,6 +93,8 @@
 	cd ../libbasic2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
 	cd ../libview && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
 	cd ../libview2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../libui && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../libwidg && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
 	cd ../librun && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
 
 
@@ -100,8 +109,9 @@
 
 
 # BEGINMAKEDEPEND --- do not remove this line; make depend needs it
+$(OUTDIR)WebKitRenderer.$(O) WebKitRenderer.$(H): WebKitRenderer.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)WebKitView.$(O) WebKitView.$(H): WebKitView.st $(INCLUDE_TOP)/stx/libview/SimpleView.$(H) $(INCLUDE_TOP)/stx/libview/DisplaySurface.$(H) $(INCLUDE_TOP)/stx/libview/GraphicsMedium.$(H) $(INCLUDE_TOP)/stx/libview/DeviceGraphicsContext.$(H) $(INCLUDE_TOP)/stx/libview/GraphicsContext.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)stx_libwebkit.$(O) stx_libwebkit.$(H): stx_libwebkit.st $(INCLUDE_TOP)/stx/libbasic/LibraryDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/ProjectDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
-$(OUTDIR)WebKitView.$(O) WebKitView.$(H): WebKitView.st $(INCLUDE_TOP)/stx/libview/SimpleView.$(H) $(INCLUDE_TOP)/stx/libview/DisplaySurface.$(H) $(INCLUDE_TOP)/stx/libview/GraphicsMedium.$(H) $(INCLUDE_TOP)/stx/libview/DeviceGraphicsContext.$(H) $(INCLUDE_TOP)/stx/libview/GraphicsContext.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 
 # ENDMAKEDEPEND --- do not remove this line
 
--- a/Make.spec	Thu Jun 02 23:03:04 2011 +0000
+++ b/Make.spec	Fri Jun 03 08:54:52 2011 +0000
@@ -49,19 +49,17 @@
 # STCWARNINGS=-warnEOLComments
 STCWARNINGS=-warnNonStandard
 
-UNIX_CLASSES= \
+COMMON_CLASSES= \
+	WebKitRenderer \
 	WebKitView \
-
-COMMON_CLASSES= \
 	stx_libwebkit \
 
 
 
 
-UNIX_OBJS= \
+COMMON_OBJS= \
+    $(OUTDIR)WebKitRenderer.$(O) \
     $(OUTDIR)WebKitView.$(O) \
-
-COMMON_OBJS= \
     $(OUTDIR)stx_libwebkit.$(O) \
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/WebKitRenderer.st	Fri Jun 03 08:54:52 2011 +0000
@@ -0,0 +1,60 @@
+"{ Package: 'stx:libwebkit' }"
+
+Object subclass:#WebKitRenderer
+	instanceVariableNames:'view in out'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Views-WebKit'
+!
+
+
+!WebKitRenderer class methodsFor:'instance creation'!
+
+for: aWebKitView
+
+    self new initializeForView: aWebKitView
+
+    "Created: / 02-06-2011 / 23:38:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!WebKitRenderer methodsFor:'initialization'!
+
+initializeForView: aWebKitView
+
+    view := aWebKitView.
+
+    "Created: / 02-06-2011 / 23:38:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!WebKitRenderer methodsFor:'spawn/terminate renderer'!
+
+spawnRenderer
+
+    | inPipe outPipe |
+    inPipe := NonPositionableExternalStream makePipe.
+    outPipe := NonPositionableExternalStream makePipe.
+
+    self halt:'Unfinished'.
+
+    OperatingSystem
+        exec: '/home/jv/work/uzbl/uzbl-core'
+        withArguments: #('/home/jv/work/uzbl/uzbl-core' '-c' '-' '-p' '-s')
+        environment: nil
+        fileDescriptors: #(1 2 3)
+        fork: true
+        newPgrp: false
+        inDirectory: Filename defaultDirectory pathName
+
+    "Created: / 02-06-2011 / 23:40:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+terminateRenderer
+
+    "Created: / 02-06-2011 / 23:40:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!WebKitRenderer class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- a/WebKitView.st	Thu Jun 02 23:03:04 2011 +0000
+++ b/WebKitView.st	Fri Jun 03 08:54:52 2011 +0000
@@ -1,19 +1,53 @@
 "{ Package: 'stx:libwebkit' }"
 
 SimpleView subclass:#WebKitView
-	instanceVariableNames:'router url progress'
+	instanceVariableNames:'url progress rendererView'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Views-WebKit'
 !
 
-Object subclass:#EventRouter
-	instanceVariableNames:'view in out'
-	classVariableNames:''
-	poolDictionaries:''
-	privateIn:WebKitView
-!
+
+!WebKitView class methodsFor:'startup'!
+
+open
+
+    |url webkitView urlView  topView|
+
+    url := 'http://www.webkit.org' asValue.
+
+    topView := StandardSystemView new                ;
+                extent:(640 @ 480).
+    topView label:'WebKit demo'.
+
+    urlView := EditField in: topView.
+    urlView layout: (LayoutFrame fractions:(0 @ 0 corner:1.0 @ 0) offsets:(0 @ 0 corner:0 @ 25)).
+    urlView model: url.
+
+    webkitView := self in:topView.
+    webkitView layout: (LayoutFrame fractions:(0 @ 0 corner:1.0 @ 1.0) offsets:(0 @ 26 corner:0 @ 0)).
+    webkitView url: url.
 
+    topView open.
+
+    ^ webkitView
+
+    "
+     WebKitView open
+    "
+
+    "Modified: / 16-05-1998 / 16:53:53 / cg"
+    "Created: / 03-06-2011 / 09:40:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!WebKitView methodsFor:'accessing - classes'!
+
+rendererClass
+
+    ^WebKitRenderer
+
+    "Created: / 03-06-2011 / 09:38:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
 
 !WebKitView methodsFor:'aspects'!
 
@@ -22,7 +56,7 @@
 
     progress isNil ifTrue:[
         progress := ValueHolder new.
-        progress addDependent:router.
+        progress addDependent:rendererView.
     ].
     ^ progress
 
@@ -36,7 +70,7 @@
 
     progress notNil ifTrue:[
         oldValue := progress value.
-        progress removeDependent:router.
+        progress removeDependent:rendererView.
     ].
     progress := something.
     progress notNil ifTrue:[
@@ -67,11 +101,11 @@
 
     url notNil ifTrue:[
         oldValue := url value.
-        url removeDependent:router.
+        url removeDependent:rendererView.
     ].
     url := something.
     url notNil ifTrue:[
-        url addDependent:router.
+        url addDependent:rendererView.
     ].
     newValue := url value.
     oldValue ~~ newValue ifTrue:[
@@ -84,11 +118,13 @@
 !WebKitView methodsFor:'initialization'!
 
 initialize
-
     super initialize.
-    router := EventRouter for: self.
+    renderer := self rendererClass for:self.
+    rendererView := XEmbedContainerView in: self.
+    rendererView origin: 0.0@0.0 corner: 1.0@1.0.
 
     "Created: / 02-06-2011 / 23:46:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-06-2011 / 09:39:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !WebKitView methodsFor:'realization'!
@@ -100,51 +136,6 @@
     "Created: / 02-06-2011 / 23:33:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
-!WebKitView::EventRouter class methodsFor:'instance creation'!
-
-for: aWebKitView
-
-    self new initializeForView: aWebKitView
-
-    "Created: / 02-06-2011 / 23:38:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!WebKitView::EventRouter methodsFor:'initialization'!
-
-initializeForView: aWebKitView
-
-    view := aWebKitView.
-
-    "Created: / 02-06-2011 / 23:38:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!WebKitView::EventRouter methodsFor:'spawn/terminate renderer'!
-
-spawnRenderer
-
-    | inPipe outPipe |
-    inPipe := NonPositionableExternalStream makePipe.
-    outPipe := NonPositionableExternalStream makePipe.
-
-    self halt:'Unfinished'.
-
-    OperatingSystem
-        exec: '/home/jv/work/uzbl/uzbl-core'
-        withArguments: #('/home/jv/work/uzbl/uzbl-core' '-c' '-' '-p' '-s')
-        environment: nil
-        fileDescriptors: #(1 2 3)
-        fork: true
-        newPgrp: false
-        inDirectory: Filename defaultDirectory pathName
-
-    "Created: / 02-06-2011 / 23:40:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-terminateRenderer
-
-    "Created: / 02-06-2011 / 23:40:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
 !WebKitView class methodsFor:'documentation'!
 
 version_SVN
--- a/abbrev.stc	Thu Jun 02 23:03:04 2011 +0000
+++ b/abbrev.stc	Fri Jun 03 08:54:52 2011 +0000
@@ -1,2 +1,3 @@
+WebKitRenderer WebKitRenderer stx:libwebkit 'Views-WebKit' 0
 WebKitView WebKitView stx:libwebkit 'Views-WebKit' 2
 stx_libwebkit stx_libwebkit stx:libwebkit '* Projects & Packages *' 4
--- a/bc.mak	Thu Jun 02 23:03:04 2011 +0000
+++ b/bc.mak	Fri Jun 03 08:54:52 2011 +0000
@@ -28,7 +28,7 @@
 
 
 
-LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\libview -I$(INCLUDE_TOP)\stx\libview2 -I$(INCLUDE_TOP)\stx\libbasic
+LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\libview -I$(INCLUDE_TOP)\stx\libwidg -I$(INCLUDE_TOP)\stx\libview2 -I$(INCLUDE_TOP)\stx\libbasic
 LOCALDEFINES=
 
 STCLOCALOPT=-package=$(PACKAGE) -I. $(LOCALINCLUDES) -H. $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES)  -varPrefix=$(LIBNAME)
@@ -48,12 +48,16 @@
 	pushd ..\libbasic2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 	pushd ..\libview & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 	pushd ..\libview2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\libui & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\libwidg & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 	pushd ..\librun & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 
 
 
 
 # BEGINMAKEDEPEND --- do not remove this line; make depend needs it
+$(OUTDIR)WebKitRenderer.$(O) WebKitRenderer.$(H): WebKitRenderer.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)WebKitView.$(O) WebKitView.$(H): WebKitView.st $(INCLUDE_TOP)\stx\libview\SimpleView.$(H) $(INCLUDE_TOP)\stx\libview\DisplaySurface.$(H) $(INCLUDE_TOP)\stx\libview\GraphicsMedium.$(H) $(INCLUDE_TOP)\stx\libview\DeviceGraphicsContext.$(H) $(INCLUDE_TOP)\stx\libview\GraphicsContext.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)stx_libwebkit.$(O) stx_libwebkit.$(H): stx_libwebkit.st $(INCLUDE_TOP)\stx\libbasic\LibraryDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\ProjectDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 
 # ENDMAKEDEPEND --- do not remove this line
--- a/libInit.cc	Thu Jun 02 23:03:04 2011 +0000
+++ b/libInit.cc	Fri Jun 03 08:54:52 2011 +0000
@@ -27,10 +27,9 @@
 void _libstx_libwebkit_Init(pass, __pRT__, snd)
 OBJ snd; struct __vmData__ *__pRT__; {
 __BEGIN_PACKAGE2__("libstx_libwebkit", _libstx_libwebkit_Init, "stx:libwebkit");
+_WebKitRenderer_Init(pass,__pRT__,snd);
+_WebKitView_Init(pass,__pRT__,snd);
 _stx_137libwebkit_Init(pass,__pRT__,snd);
-#ifdef UNIX
-_WebKitView_Init(pass,__pRT__,snd);
-#endif /* UNIX */
 
 
 __END_PACKAGE__();
--- a/libwebkit.rc	Thu Jun 02 23:03:04 2011 +0000
+++ b/libwebkit.rc	Fri Jun 03 08:54:52 2011 +0000
@@ -23,7 +23,7 @@
       VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2011\nCopyright eXept Software AG 1998-2011\0"
       VALUE "ProductName", "Smalltalk/X\0"
       VALUE "ProductVersion", "6.1.2.1\0"
-      VALUE "ProductDate", "Thu, 02 Jun 2011 23:04:23 GMT\0"
+      VALUE "ProductDate", "Fri, 03 Jun 2011 08:56:21 GMT\0"
     END
 
   END
--- a/stx_libwebkit.st	Thu Jun 02 23:03:04 2011 +0000
+++ b/stx_libwebkit.st	Fri Jun 03 08:54:52 2011 +0000
@@ -27,9 +27,10 @@
      exclude individual packages in the #excludedFromPrerequisites method."
 
     ^ #(
-        #'stx:libbasic'    "Object - superclass of WebKitView::EventRouter "
+        #'stx:libbasic'    "Object - superclass of WebKitRenderer "
         #'stx:libview'    "DeviceGraphicsContext - superclass of WebKitView "
         #'stx:libview2'    "ValueHolder - referenced by WebKitView>>url "
+        #'stx:libwidg'    "EditField - referenced by WebKitView class>>open "
     )
 ! !
 
@@ -43,7 +44,8 @@
 
     ^ #(
         "<className> or (<className> attributes...) in load order"
-        (WebKitView unix)
+        WebKitRenderer
+        WebKitView
         #'stx_libwebkit'
     )
 !
@@ -103,7 +105,7 @@
     "Return a SVN revision number of myself.
      This number is updated after a commit"
 
-    ^ "$SVN-Revision:"'nil'"$"
+    ^ "$SVN-Revision:"'2'"$"
 ! !
 
 !stx_libwebkit class methodsFor:'documentation'!