2 Copyright (c) 2007-2008 Luca Bruno
4 This file is part of Smalltalk YX.
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the 'Software'), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
16 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
27 Object subclass: #PangoAttrList
28 instanceVariableNames: ''
29 classVariableNames: ''!
34 instanceVariableNames: ''
35 classVariableNames: ''!
37 GPointer subclass: #GtkTextIter
38 instanceVariableNames: ''
39 classVariableNames: ''!
41 GPointer subclass: #GtkTextAttributes
42 instanceVariableNames: ''
43 classVariableNames: ''!
45 GPointer subclass: #PangoLanguage
46 instanceVariableNames: ''
47 classVariableNames: ''!
49 GPointer subclass: #GdkRectangle
50 instanceVariableNames: ''
51 classVariableNames: ''!
53 GObject subclass: #GtkObject
54 instanceVariableNames: ''
55 classVariableNames: ''!
57 GObject subclass: #GtkTextBuffer
58 instanceVariableNames: ''
59 classVariableNames: ''!
61 GObject subclass: #GdkDrawable
62 instanceVariableNames: ''
63 classVariableNames: ''!
65 GObject subclass: #GtkTextTagTable
66 instanceVariableNames: ''
67 classVariableNames: ''!
69 GObject subclass: #GtkTextChildAnchor
70 instanceVariableNames: ''
71 classVariableNames: ''!
73 GObject subclass: #GtkTextMark
74 instanceVariableNames: ''
75 classVariableNames: ''!
77 GObject subclass: #GtkTextTag
78 instanceVariableNames: ''
79 classVariableNames: ''!
81 GdkDrawable subclass: #GdkWindow
82 instanceVariableNames: ''
83 classVariableNames: ''!
85 GtkObject subclass: #GtkWidget
86 instanceVariableNames: ''
87 classVariableNames: ''!
89 GtkObject subclass: #GtkAdjustment
90 instanceVariableNames: ''
91 classVariableNames: ''!
93 GtkWidget subclass: #GtkContainer
94 instanceVariableNames: ''
95 classVariableNames: ''!
97 GtkWidget subclass: #GtkLabel
98 instanceVariableNames: ''
99 classVariableNames: ''!
101 GtkWidget subclass: #GtkButton
102 instanceVariableNames: ''
103 classVariableNames: ''!
105 GtkContainer subclass: #GtkBin
106 instanceVariableNames: ''
107 classVariableNames: ''!
109 GtkContainer subclass: #GtkWindow
110 instanceVariableNames: ''
111 classVariableNames: ''!
113 GtkContainer subclass: #GtkBox
114 instanceVariableNames: ''
115 classVariableNames: ''!
117 GtkContainer subclass: #GtkTextView
118 instanceVariableNames: ''
119 classVariableNames: ''!
121 GtkBin subclass: #GtkScrolledWindow
122 instanceVariableNames: ''
123 classVariableNames: ''!
125 GtkBox subclass: #GtkVBox
126 instanceVariableNames: ''
127 classVariableNames: ''!
129 GtkBox subclass: #GtkHBox
130 instanceVariableNames: ''
131 classVariableNames: ''!
135 WorkspaceView subclass: #GtkWorkspaceView
136 instanceVariableNames: 'textView'
137 classVariableNames: ''!
139 Workspace subclass: #GtkWorkspace
140 instanceVariableNames: ''
141 classVariableNames: ''!
146 !Gtk class methodsFor: 'main loop'!
148 primMain: idleProcess
149 <cCall: 'Gtk_main' plugin: 'gtk'>
159 "Use a semaphore to keep the process alive but suspended forever"
160 proc := [ [ ] repeat ] newProcess.
165 <cCall: 'Gtk_mainQuit' plugin: 'gtk'>
172 !GCallback class methodsFor: 'initialize-release'!
175 AllCallbacks := Bag new.
176 GClosureMarshal := GPointer handle: (Smalltalk plugin: 'gtk' cSymbol: 'syx_g_closure_marshal')
179 !GCallback class methodsFor: 'instance creation'!
181 selector: aSelector withArguments: anArray
182 ^self basicNew initializeSelector: aSelector arguments: anArray
185 !GCallback methodsFor: 'initialize-release'!
187 initializeSelector: aSelector arguments: anArray
188 selector := aSelector.
189 arguments := anArray.
192 self initializeGClosure.
193 AllCallbacks add: self
198 marshal := GClosureMarshal.
199 closure := GClosure on: self.
201 closure marshal: marshal
204 handlerId: aSignalHandler
205 handlerId := aSignalHandler
209 "This method is called directly from syx_gtk_callback"
210 selector key perform: selector value withArguments: arguments
213 !GCallback methodsFor: 'accessing'!
231 " Initialization code "