author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Mon, 06 Jun 2011 17:41:38 +0000 | |
changeset 3 | 32456ba40192 |
parent 2 | 7e604e6f195e |
child 4 | 385102f5bf00 |
permissions | -rw-r--r-- |
1 | 1 |
"{ Package: 'stx:libwebkit' }" |
2 |
||
3 |
SimpleView subclass:#WebKitView |
|
2 | 4 |
instanceVariableNames:'url progress rendererView' |
1 | 5 |
classVariableNames:'' |
6 |
poolDictionaries:'' |
|
7 |
category:'Views-WebKit' |
|
8 |
! |
|
9 |
||
2 | 10 |
|
11 |
!WebKitView class methodsFor:'startup'! |
|
12 |
||
13 |
open |
|
14 |
||
15 |
|url webkitView urlView topView| |
|
16 |
||
17 |
url := 'http://www.webkit.org' asValue. |
|
18 |
||
19 |
topView := StandardSystemView new ; |
|
20 |
extent:(640 @ 480). |
|
21 |
topView label:'WebKit demo'. |
|
22 |
||
23 |
urlView := EditField in: topView. |
|
24 |
urlView layout: (LayoutFrame fractions:(0 @ 0 corner:1.0 @ 0) offsets:(0 @ 0 corner:0 @ 25)). |
|
25 |
urlView model: url. |
|
26 |
||
27 |
webkitView := self in:topView. |
|
28 |
webkitView layout: (LayoutFrame fractions:(0 @ 0 corner:1.0 @ 1.0) offsets:(0 @ 26 corner:0 @ 0)). |
|
29 |
webkitView url: url. |
|
1 | 30 |
|
2 | 31 |
topView open. |
32 |
||
33 |
^ webkitView |
|
34 |
||
35 |
" |
|
36 |
WebKitView open |
|
37 |
" |
|
38 |
||
39 |
"Modified: / 16-05-1998 / 16:53:53 / cg" |
|
40 |
"Created: / 03-06-2011 / 09:40:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
41 |
! ! |
|
42 |
||
3
32456ba40192
Starts uzbl process and connects to its control socket
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
43 |
!WebKitView methodsFor:'accessing'! |
32456ba40192
Starts uzbl process and connects to its control socket
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
44 |
|
32456ba40192
Starts uzbl process and connects to its control socket
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
45 |
rendererView |
32456ba40192
Starts uzbl process and connects to its control socket
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
46 |
^ rendererView |
32456ba40192
Starts uzbl process and connects to its control socket
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
47 |
! ! |
32456ba40192
Starts uzbl process and connects to its control socket
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
48 |
|
2 | 49 |
!WebKitView methodsFor:'accessing - classes'! |
50 |
||
51 |
rendererClass |
|
52 |
||
53 |
^WebKitRenderer |
|
54 |
||
55 |
"Created: / 03-06-2011 / 09:38:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
56 |
! ! |
|
1 | 57 |
|
58 |
!WebKitView methodsFor:'aspects'! |
|
59 |
||
60 |
progress |
|
61 |
"return/create the 'progress' value holder (automatically generated)" |
|
62 |
||
63 |
progress isNil ifTrue:[ |
|
64 |
progress := ValueHolder new. |
|
2 | 65 |
progress addDependent:rendererView. |
1 | 66 |
]. |
67 |
^ progress |
|
68 |
||
69 |
"Modified: / 02-06-2011 / 23:45:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
70 |
! |
|
71 |
||
72 |
progress:something |
|
73 |
"set the 'progress' value holder (automatically generated)" |
|
74 |
||
75 |
|oldValue newValue| |
|
76 |
||
77 |
progress notNil ifTrue:[ |
|
78 |
oldValue := progress value. |
|
2 | 79 |
progress removeDependent:rendererView. |
1 | 80 |
]. |
81 |
progress := something. |
|
82 |
progress notNil ifTrue:[ |
|
83 |
progress addDependent:self. |
|
84 |
]. |
|
85 |
newValue := progress value. |
|
86 |
oldValue ~~ newValue ifTrue:[ |
|
87 |
self update:#value with:newValue from:progress. |
|
88 |
]. |
|
89 |
||
90 |
"Modified: / 02-06-2011 / 23:45:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
91 |
! |
|
92 |
||
93 |
url |
|
94 |
"return/create the 'url' value holder (automatically generated)" |
|
95 |
||
96 |
url isNil ifTrue:[ |
|
97 |
url := ValueHolder new. |
|
98 |
url addDependent:self. |
|
99 |
]. |
|
100 |
^ url |
|
101 |
! |
|
102 |
||
103 |
url:something |
|
104 |
"set the 'url' value holder (automatically generated)" |
|
105 |
||
106 |
|oldValue newValue| |
|
107 |
||
108 |
url notNil ifTrue:[ |
|
109 |
oldValue := url value. |
|
2 | 110 |
url removeDependent:rendererView. |
1 | 111 |
]. |
112 |
url := something. |
|
113 |
url notNil ifTrue:[ |
|
2 | 114 |
url addDependent:rendererView. |
1 | 115 |
]. |
116 |
newValue := url value. |
|
117 |
oldValue ~~ newValue ifTrue:[ |
|
118 |
self update:#value with:newValue from:url. |
|
119 |
]. |
|
120 |
||
121 |
"Modified: / 02-06-2011 / 23:45:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
122 |
! ! |
|
123 |
||
3
32456ba40192
Starts uzbl process and connects to its control socket
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
124 |
!WebKitView methodsFor:'initialization & release'! |
1 | 125 |
|
126 |
initialize |
|
127 |
super initialize. |
|
2 | 128 |
renderer := self rendererClass for:self. |
129 |
rendererView := XEmbedContainerView in: self. |
|
130 |
rendererView origin: 0.0@0.0 corner: 1.0@1.0. |
|
3
32456ba40192
Starts uzbl process and connects to its control socket
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
131 |
rendererView useWorkaround: #uzbl. |
1 | 132 |
|
133 |
"Created: / 02-06-2011 / 23:46:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3
32456ba40192
Starts uzbl process and connects to its control socket
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
134 |
"Modified: / 06-06-2011 / 18:11:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1 | 135 |
! ! |
136 |
||
137 |
!WebKitView methodsFor:'realization'! |
|
138 |
||
3
32456ba40192
Starts uzbl process and connects to its control socket
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
139 |
postRealize |
32456ba40192
Starts uzbl process and connects to its control socket
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
140 |
super postRealize. |
32456ba40192
Starts uzbl process and connects to its control socket
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
141 |
renderer spawn. |
1 | 142 |
|
3
32456ba40192
Starts uzbl process and connects to its control socket
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
143 |
"Created: / 06-06-2011 / 10:40:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1 | 144 |
! ! |
145 |
||
146 |
!WebKitView class methodsFor:'documentation'! |
|
147 |
||
148 |
version_SVN |
|
149 |
^ '$Id$' |
|
150 |
! ! |