11/* Automatically generated by
2- SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.2347 uuid: 062614a7-e3da-4b30-997a-9568911b9ff5
2+ SmartSyntaxPluginCodeGenerator VMMaker.oscog-VB.2364 uuid: d084ec90-dd2d-0048-a171-0dadc3e52888
33 from
4- HostWindowPlugin VMMaker.oscog-eem.2347 uuid: 062614a7-e3da-4b30-997a-9568911b9ff5
4+ HostWindowPlugin VMMaker.oscog-VB.2364 uuid: d084ec90-dd2d-0048-a171-0dadc3e52888
55 */
6- static char __buildInfo [] = "HostWindowPlugin VMMaker.oscog-eem.2347 uuid: 062614a7-e3da-4b30-997a-9568911b9ff5 " __DATE__ ;
6+ static char __buildInfo [] = "HostWindowPlugin VMMaker.oscog-VB.2364 uuid: d084ec90-dd2d-0048-a171-0dadc3e52888 " __DATE__ ;
77
88
99
@@ -34,10 +34,15 @@ static char __buildInfo[] = "HostWindowPlugin VMMaker.oscog-eem.2347 uuid: 06261
3434#include "sqMemoryAccess.h"
3535
3636
37+ /*** Constants ***/
38+ #define PrimErrBadArgument 3
39+
40+
3741/*** Function Prototypes ***/
3842EXPORT (const char * ) getModuleName (void );
3943EXPORT (sqInt ) primitiveCloseHostWindow (void );
4044EXPORT (sqInt ) primitiveCreateHostWindow (void );
45+ EXPORT (sqInt ) primitiveHostWindowIcon (void );
4146EXPORT (sqInt ) primitiveHostWindowPosition (void );
4247EXPORT (sqInt ) primitiveHostWindowPositionSet (void );
4348#if TerfVM
@@ -89,6 +94,7 @@ static usqInt (*positive32BitValueOf)(sqInt oop);
8994static sqInt (* positive64BitIntegerFor )(usqLong integerValue );
9095static usqLong (* positive64BitValueOf )(sqInt oop );
9196static sqInt (* primitiveFail )(void );
97+ static sqInt (* primitiveFailFor )(sqInt reasonCode );
9298static sqInt (* slotSizeOf )(sqInt oop );
9399static sqInt (* stackIntegerValue )(sqInt offset );
94100static sqInt (* stackValue )(sqInt offset );
@@ -107,6 +113,7 @@ extern usqInt positive32BitValueOf(sqInt oop);
107113extern sqInt positive64BitIntegerFor (usqLong integerValue );
108114extern usqLong positive64BitValueOf (sqInt oop );
109115extern sqInt primitiveFail (void );
116+ extern sqInt primitiveFailFor (sqInt reasonCode );
110117extern sqInt slotSizeOf (sqInt oop );
111118extern sqInt stackIntegerValue (sqInt offset );
112119extern sqInt stackValue (sqInt offset );
@@ -116,9 +123,9 @@ extern
116123struct VirtualMachine * interpreterProxy ;
117124static const char * moduleName =
118125#ifdef SQUEAK_BUILTIN_PLUGIN
119- "HostWindowPlugin VMMaker.oscog-eem.2347 (i)"
126+ "HostWindowPlugin VMMaker.oscog-VB.2364 (i)"
120127#else
121- "HostWindowPlugin VMMaker.oscog-eem.2347 (e)"
128+ "HostWindowPlugin VMMaker.oscog-VB.2364 (e)"
122129#endif
123130;
124131
@@ -207,6 +214,44 @@ primitiveCreateHostWindow(void)
207214}
208215
209216
217+ /* Set the icon of the window by fetching the logo in given path. Fail if the
218+ windowIndex is invalid or the platform routine returns -1 to indicate
219+ failure
220+ */
221+
222+ /* HostWindowPlugin>>#primitiveHostWindowIcon:path: */
223+ EXPORT (sqInt )
224+ primitiveHostWindowIcon (void )
225+ {
226+ sqInt id ;
227+ sqInt pathLength ;
228+ char * pathString ;
229+ sqInt res ;
230+
231+ id = stackIntegerValue (1 );
232+ success (isBytes (stackValue (0 )));
233+ pathString = ((char * ) (firstIndexableField (stackValue (0 ))));
234+ if (failed ()) {
235+ return null ;
236+ }
237+ pathLength = slotSizeOf (((sqInt )(sqIntptr_t )(pathString ) - BaseHeaderSize ));
238+ res = ioSetIconOfWindow (id , pathString , pathLength );
239+ if (res == 0 ) {
240+ if (failed ()) {
241+ return null ;
242+ }
243+ pop (2 );
244+ return null ;
245+ }
246+ if (res == -1 ) {
247+ primitiveFailFor (PrimErrBadArgument );
248+ return null ;
249+ }
250+ primitiveFail ();
251+ return null ;
252+ }
253+
254+
210255/* Return the origin position of the user area of the window in pixels from
211256 the topleft corner of the screen. Fail if the windowIndex is invalid or
212257 the platform routine returns -1 to indicate failure
@@ -758,6 +803,7 @@ setInterpreter(struct VirtualMachine*anInterpreter)
758803 positive64BitIntegerFor = interpreterProxy -> positive64BitIntegerFor ;
759804 positive64BitValueOf = interpreterProxy -> positive64BitValueOf ;
760805 primitiveFail = interpreterProxy -> primitiveFail ;
806+ primitiveFailFor = interpreterProxy -> primitiveFailFor ;
761807 slotSizeOf = interpreterProxy -> slotSizeOf ;
762808 stackIntegerValue = interpreterProxy -> stackIntegerValue ;
763809 stackValue = interpreterProxy -> stackValue ;
@@ -793,6 +839,7 @@ void* HostWindowPlugin_exports[][3] = {
793839 {(void * )_m , "getModuleName" , (void * )getModuleName },
794840 {(void * )_m , "primitiveCloseHostWindow\000\000" , (void * )primitiveCloseHostWindow },
795841 {(void * )_m , "primitiveCreateHostWindow\000\000" , (void * )primitiveCreateHostWindow },
842+ {(void * )_m , "primitiveHostWindowIcon\000\000" , (void * )primitiveHostWindowIcon },
796843 {(void * )_m , "primitiveHostWindowPosition\000\000" , (void * )primitiveHostWindowPosition },
797844 {(void * )_m , "primitiveHostWindowPositionSet\000\000" , (void * )primitiveHostWindowPositionSet },
798845#if TerfVM
@@ -832,6 +879,7 @@ void* HostWindowPlugin_exports[][3] = {
832879
833880signed char primitiveCloseHostWindowAccessorDepth = 0 ;
834881signed char primitiveCreateHostWindowAccessorDepth = 0 ;
882+ signed char primitiveHostWindowIconAccessorDepth = 0 ;
835883signed char primitiveHostWindowPositionAccessorDepth = 0 ;
836884signed char primitiveHostWindowPositionSetAccessorDepth = 0 ;
837885#if TerfVM
0 commit comments