equal
deleted
inserted
replaced
28 objc-code here (due to define conflicts with Class, nil ...) we call |
28 objc-code here (due to define conflicts with Class, nil ...) we call |
29 helper functions to do the job; the helpers are in ../librun/NXsupport.c |
29 helper functions to do the job; the helpers are in ../librun/NXsupport.c |
30 |
30 |
31 All non-monochrome stuff is untested (I only have a monochroome station) |
31 All non-monochrome stuff is untested (I only have a monochroome station) |
32 |
32 |
33 $Header: /cvs/stx/stx/libview/NeXTWorkstation.st,v 1.13 1995-11-24 15:20:02 cg Exp $ |
33 $Header: /cvs/stx/stx/libview/NeXTWorkstation.st,v 1.14 1996-01-04 17:04:10 cg Exp $ |
34 written spring 92 by claus |
34 written spring 92 by claus |
35 '! |
35 '! |
36 |
36 |
37 !NeXTWorkstation primitiveDefinitions! |
37 !NeXTWorkstation primitiveDefinitions! |
38 |
38 |
398 %{ |
398 %{ |
399 char **names; |
399 char **names; |
400 char **cp; |
400 char **cp; |
401 int count, i; |
401 int count, i; |
402 static struct inlineCache dummy1 = _DUMMYILC1; |
402 static struct inlineCache dummy1 = _DUMMYILC1; |
403 extern OBJ _new_; |
|
404 OBJ arr; |
403 OBJ arr; |
405 |
404 |
406 names = (char **) _objc_availableFonts(_FontManager_new()); |
405 names = (char **) _objc_availableFonts(_FontManager_new()); |
407 /* count them */ |
406 /* count them */ |
408 for (cp = names; *cp; cp++) ;; |
407 for (cp = names; *cp; cp++) ;; |
409 count = cp - names; |
408 count = cp - names; |
410 arr = _SEND1(Array, _new_, CON_COMMA nil, &dummy1, _MKSMALLINT(count)); |
409 arr = _SEND1(@global(Array), @symbol(new:), CON_COMMA nil, &dummy1, _MKSMALLINT(count)); |
411 for (i=0; i<count;i++) |
410 for (i=0; i<count;i++) |
412 _ArrayInstPtr(arr)->a_element[i] = _MKSTRING(names[i] COMMA_CON); |
411 _ArrayInstPtr(arr)->a_element[i] = _MKSTRING(names[i] COMMA_CON); |
413 free(names); |
412 free(names); |
414 RETURN (arr); |
413 RETURN (arr); |
415 %} |
414 %} |