/*
Newsflash! After 15 years of arduous toil, it's finally possible
for specially trained typists wielding advanced text editing
technology to define symbolic names for commonly used scrap
flavor type constants! Apple triumphs again!
*/
[originally from svn r2791]
-/* $Id: macterm.c,v 1.66 2003/02/04 02:03:53 ben Exp $ */
+/* $Id: macterm.c,v 1.67 2003/02/04 02:08:03 ben Exp $ */
/*
* Copyright (c) 1999 Simon Tatham
* Copyright (c) 1999, 2002 Ben Harris
/*
* Copyright (c) 1999 Simon Tatham
* Copyright (c) 1999, 2002 Ben Harris
#if TARGET_API_MAC_CARBON
if (1)
#else
#if TARGET_API_MAC_CARBON
if (1)
#else
- if (GetScrap(NULL, 'TEXT', &offset) == noTypeErr)
+ if (GetScrap(NULL, kScrapFlavorTypeText, &offset) == noTypeErr)
#endif
DisableItem(menu, iPaste);
else
#endif
DisableItem(menu, iPaste);
else
*/
if (ZeroScrap() != noErr)
return;
*/
if (ZeroScrap() != noErr)
return;
- PutScrap(len * sizeof(*data), 'utxt', data);
+ PutScrap(len * sizeof(*data), kScrapFlavorTypeUnicode, data);
/* Replace LINE SEPARATORs with CR for TEXT output. */
for (i = 0; i < len; i++)
/* Replace LINE SEPARATORs with CR for TEXT output. */
for (i = 0; i < len; i++)
s->font_charset, NULL, ".", 1);
} else
return;
s->font_charset, NULL, ".", 1);
} else
return;
- PutScrap(olen, 'TEXT', mactextbuf);
+ PutScrap(olen, kScrapFlavorTypeText, mactextbuf);
sfree(mactextbuf);
stsz = offsetof(StScrpRec, scrpStyleTab) + sizeof(ScrpSTElement);
sfree(mactextbuf);
stsz = offsetof(StScrpRec, scrpStyleTab) + sizeof(ScrpSTElement);
stsc->scrpStyleTab[0].scrpColor.red = 0;
stsc->scrpStyleTab[0].scrpColor.green = 0;
stsc->scrpStyleTab[0].scrpColor.blue = 0;
stsc->scrpStyleTab[0].scrpColor.red = 0;
stsc->scrpStyleTab[0].scrpColor.green = 0;
stsc->scrpStyleTab[0].scrpColor.blue = 0;
- PutScrap(stsz, 'styl', stsc);
+ PutScrap(stsz, kScrapFlavorTypeTextStyle, stsc);
sfree(data);
data = NULL;
} else {
sfree(data);
data = NULL;
} else {
- if (GetScrap(NULL, 'utxt', &offset) > 0) {
+ if (GetScrap(NULL, kScrapFlavorTypeUnicode, &offset) > 0) {
if (h == NULL)
h = NewHandle(0);
if (h == NULL)
h = NewHandle(0);
- *lenp = GetScrap(h, 'utxt', &offset) / sizeof(**p);
+ *lenp =
+ GetScrap(h, kScrapFlavorTypeUnicode, &offset) / sizeof(**p);
HLock(h);
*p = (wchar_t *)*h;
HLock(h);
*p = (wchar_t *)*h;
- } else if (GetScrap(NULL, 'TEXT', &offset) > 0) {
+ } else if (GetScrap(NULL, kScrapFlavorTypeText, &offset) > 0) {
- textlen = GetScrap(texth, 'TEXT', &offset);
+ textlen = GetScrap(texth, kScrapFlavorTypeText, &offset);
HLock(texth);
data = smalloc(textlen * 2);
/* XXX should use 'styl' scrap if it's there. */
HLock(texth);
data = smalloc(textlen * 2);
/* XXX should use 'styl' scrap if it's there. */