ResourcePack.st
changeset 3082 0f6435aaa66a
parent 3049 d5f2b3f66e37
child 3097 b2cca70d5d55
--- a/ResourcePack.st	Sat Dec 04 16:06:15 1999 +0100
+++ b/ResourcePack.st	Sun Dec 05 16:07:47 1999 +0100
@@ -635,7 +635,7 @@
      specify where #include files are searched for.
      Return true, if the style sheet could be read without errors, false otherwise."
 
-    |lineString l lNo rest value ifLevel skipping first ok encoding|
+    |lineString l lNo rest value ifLevel skipping first ok encoding pack|
 
     encoding := nil.
 
@@ -671,7 +671,7 @@
                                 value := nil.
                             ] do:[
                                 value := Compiler evaluate:rest compile:false.
-			    ].
+                            ].
                             (value == #Error) ifTrue:[
                                 ('ResourcePack [warning]: error in resource:' , lineString) errorPrintCR.
                             ].
@@ -692,13 +692,25 @@
                             ] ifFalse:[
                                 skipping ifFalse:[
                                     (lineString startsWith:'include') ifTrue:[
-                                        rest := lineString copyFrom:8.
-                                        value := Compiler evaluate:rest compile:false.
-                                        value isString ifFalse:[
-                                            ('ResourcePack [warning]: bad include filename: ' , value printString) errorPrintCR.
-                                            ('ResourcePack [info]: line ' , lNo printString , ': ''' , lineString , '''') infoPrintCR.
-                                        ] ifTrue:[
-                                            self readFromFile:value directory:dirName
+                                        (lineString startsWith:'includeResourcesFor') ifTrue:[
+                                            "/ include those resources ...
+                                            rest := lineString copyFrom:('includeResourcesFor' size + 1).
+                                            value := Compiler evaluate:rest compile:false.
+                                            value isBehavior ifTrue:[
+                                                pack := self class for:value.
+                                                pack notNil ifTrue:[
+                                                    self declareAllFrom:pack.
+                                                ]
+                                            ]
+                                        ] ifFalse:[
+                                            rest := lineString copyFrom:('include' size + 1).
+                                            value := Compiler evaluate:rest compile:false.
+                                            value isString ifFalse:[
+                                                ('ResourcePack [warning]: bad include filename: ' , value printString) errorPrintCR.
+                                                ('ResourcePack [info]: line ' , lNo printString , ': ''' , lineString , '''') infoPrintCR.
+                                            ] ifTrue:[
+                                                self readFromFile:value directory:dirName
+                                            ]
                                         ]
                                     ] ifFalse:[
                                         (lineString startsWith:'encoding') ifTrue:[
@@ -738,6 +750,6 @@
 !ResourcePack class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/ResourcePack.st,v 1.58 1999-12-01 19:04:00 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/ResourcePack.st,v 1.59 1999-12-05 15:07:47 cg Exp $'
 ! !
 ResourcePack initialize!