summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXFont.h
diff options
context:
space:
mode:
authordas <das>2006-03-22 00:21:15 (GMT)
committerdas <das>2006-03-22 00:21:15 (GMT)
commit2579527c4a82ca0cea032dfa5e9ed757f43cd59e (patch)
treefedd23bf410c6a013f190bd8aa27dbf9999214f1 /macosx/tkMacOSXFont.h
parenta035d9f0c9008fbb62a43d011474036c0c56ed3c (diff)
downloadtk-2579527c4a82ca0cea032dfa5e9ed757f43cd59e.zip
tk-2579527c4a82ca0cea032dfa5e9ed757f43cd59e.tar.gz
tk-2579527c4a82ca0cea032dfa5e9ed757f43cd59e.tar.bz2
* generic/tkFont.c: implementation of ATSUI text rendering
* generic/tkInt.h: in TkAqua provided by Benjamin * generic/tkTextDisp.c: Riefenstahl. [Patch 638966] * library/demos/unicodeout.tcl: * macosx/tkMacOSXFont.h (new file): * macosx/tkMacOSXFont.c: * tests/font.test: * unix/tkUnixFont.c: * win/tkWinFont.c: * generic/tkFont.c: moved MODULE_SCOPE declarations of * generic/tkFont.h: font helper procs into header files. * macosx/tkMacOSXButton.c: * macosx/tkMacOSXFont.h: * macosx/tkMacOSXMenubutton.c: * macosx/Wish.xcode/project.pbxproj: add new tkMacOSXFont.h file, * macosx/Wish.xcodeproj/project.pbxproj: turn off dead code stripping as it interferes with -sectcreate (rdar://4486223). * macosx/Wish.xcode/default.pbxuser: add TCLLIBPATH=/Library/Tcl * macosx/Wish.xcodeproj/default.pbxuser: env var setting to tktest. * unix/configure.in: fix detection of symbols build when enabling TkAqua debug code; filter nm output of libtclstub better to avoid error on intel macs [Bug 1415789]. * unix/configure: autoconf-2.59
Diffstat (limited to 'macosx/tkMacOSXFont.h')
-rw-r--r--macosx/tkMacOSXFont.h113
1 files changed, 113 insertions, 0 deletions
diff --git a/macosx/tkMacOSXFont.h b/macosx/tkMacOSXFont.h
new file mode 100644
index 0000000..ad16185
--- /dev/null
+++ b/macosx/tkMacOSXFont.h
@@ -0,0 +1,113 @@
+/*
+ * tkMacOSXFont.h --
+ *
+ * Private functions and structs exported from tkMacOSXFont.c
+ * for use in ATSU specific extensions.
+ *
+ * Copyright 2002-2004 Benjamin Riefenstahl, Benjamin.Riefenstahl@epost.de
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id: tkMacOSXFont.h,v 1.1 2006/03/22 00:21:18 das Exp $
+ */
+
+#ifndef TKMACOSXFONT_H
+#define TKMACOSXFONT_H 1
+
+#include "tkFont.h"
+
+/*
+ * Switches
+ */
+
+#define TK_MAC_USE_QUARZ 1
+
+/*
+ * Types
+ */
+
+/*
+ * The following structure represents our Macintosh-specific implementation
+ * of a font object.
+ */
+
+typedef struct {
+ TkFont font; /* Stuff used by generic font package. Must
+ * be first in structure. */
+
+ /*
+ * The ATSU view of the font and other text properties. Used for drawing
+ * and measuring.
+ */
+
+ ATSUFontID atsuFontId; /* == FMFont. */
+ ATSUTextLayout atsuLayout; /* ATSU layout object, representing the whole
+ * text that ATSU sees with some option
+ * bits. */
+ ATSUStyle atsuStyle; /* ATSU style object, representing a run of
+ * text with the same properties. */
+
+ /*
+ * The QuickDraw view of the font. Used to configure controls.
+ */
+
+ FMFontFamily qdFont; /* == FMFontFamilyId, Carbon replacement for
+ * QD face numbers. */
+ short qdSize; /* Font size in points. */
+ short qdStyle; /* QuickDraw style bits. */
+} TkMacOSXFont;
+
+
+#if TK_MAC_USE_QUARZ
+
+/*
+ * To use Quarz drawing we need some additional context. FIXME: We would
+ * have liked to use the similar functions from tkMacOSXDraw.c to do this
+ * (TkMacOSXSetUpCGContext(), etc), but a) those don't quite work for us
+ * (e.g. we can't use a simple upside-down coordinate system transformation,
+ * as we don't want upside-down characters ;-), and b) we don't have the
+ * necessary context information (MacDrawable), that we need as parameter for
+ * those functions. So I just cobbled together a limited edition, getting
+ * the necessary parameters from the current QD GraphPort.
+ */
+
+typedef struct {
+ CGContextRef cgContext; /* Quarz context. */
+ CGrafPtr graphPort; /* QD graph port to which this belongs.
+ * Needed for releasing cgContext. */
+ Rect portRect; /* Cached size of port. */
+} TkMacOSXFontDrawingContext;
+
+#else /* ! TK_MAC_USE_QUARZ */
+
+/*
+ * Just a dummy, so we don't have to #ifdef the parameter lists of functions
+ * that use this.
+ */
+
+typedef struct {} DrawingContext;
+
+#endif /* ? TK_MAC_USE_QUARZ */
+
+
+/*
+ * Function prototypes
+ */
+
+MODULE_SCOPE void TkMacOSXLayoutSetString(const TkMacOSXFont * fontPtr,
+ const TkMacOSXFontDrawingContext *drawingContextPtr,
+ const UniChar * uchars, int ulen);
+MODULE_SCOPE void TkMacOSXInitControlFontStyle(Tk_Font tkfont,
+ ControlFontStylePtr fsPtr);
+
+#if TK_MAC_USE_QUARZ
+MODULE_SCOPE void TkMacOSXQuarzStartDraw(
+ TkMacOSXFontDrawingContext * contextPtr);
+MODULE_SCOPE void TkMacOSXQuarzEndDraw(
+ TkMacOSXFontDrawingContext * contextPtr);
+#endif /* TK_MAC_USE_QUARZ */
+
+
+#endif /*TKMACOSXFONT_H*/
+