/usr/i686-w64-mingw32/include/gdiplus/gdiplusstringformat.h is in mingw-w64-i686-dev 2.0.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | /*
* gdiplusstringformat.h
*
* GDI+ StringFormat class
*
* This file is part of the w32api package.
*
* Contributors:
* Created by Markus Koenig <markus@stber-koenig.de>
*
* THIS SOFTWARE IS NOT COPYRIGHTED
*
* This source code is offered for use in the public domain. You may
* use, modify or distribute it freely.
*
* This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
#ifndef __GDIPLUS_STRINGFORMAT_H
#define __GDIPLUS_STRINGFORMAT_H
#if __GNUC__ >=3
#pragma GCC system_header
#endif
#ifndef __cplusplus
#error "A C++ compiler is required to include gdiplusstringformat.h."
#endif
class StringFormat: public GdiplusBase
{
friend class Graphics;
friend class GraphicsPath;
public:
static const StringFormat* GenericDefault();
static const StringFormat* GenericTypographic();
StringFormat(INT formatFlags = 0, LANGID language = LANG_NEUTRAL):
nativeStringFormat(NULL), lastStatus(Ok)
{
lastStatus = DllExports::GdipCreateStringFormat(
formatFlags, language, &nativeStringFormat);
}
StringFormat(const StringFormat *format):
nativeStringFormat(NULL), lastStatus(Ok)
{
lastStatus = DllExports::GdipCloneStringFormat(
format ? format->nativeStringFormat : NULL,
&nativeStringFormat);
}
~StringFormat()
{
DllExports::GdipDeleteStringFormat(nativeStringFormat);
}
StringFormat* Clone() const
{
GpStringFormat *cloneStringFormat = NULL;
Status status = updateStatus(DllExports::GdipCloneStringFormat(
nativeStringFormat, &cloneStringFormat));
if (status == Ok) {
StringFormat *result = new StringFormat(
cloneStringFormat, lastStatus);
if (!result) {
DllExports::GdipDeleteStringFormat(cloneStringFormat);
lastStatus = OutOfMemory;
}
return result;
} else {
return NULL;
}
}
StringAlignment GetAlignment() const
{
StringAlignment result = StringAlignmentNear;
updateStatus(DllExports::GdipGetStringFormatAlign(
nativeStringFormat, &result));
return result;
}
LANGID GetDigitSubstitutionLanguage() const
{
LANGID result = 0;
StringDigitSubstitute method;
updateStatus(DllExports::GdipGetStringFormatDigitSubstitution(
nativeStringFormat, &result, &method));
return result;
}
StringDigitSubstitute GetDigitSubstitutionMethod() const
{
LANGID language;
StringDigitSubstitute result = StringDigitSubstituteUser;
updateStatus(DllExports::GdipGetStringFormatDigitSubstitution(
nativeStringFormat, &language, &result));
return result;
}
INT GetFormatFlags() const
{
INT result = 0;
updateStatus(DllExports::GdipGetStringFormatFlags(
nativeStringFormat, &result));
return result;
}
HotkeyPrefix GetHotkeyPrefix() const
{
HotkeyPrefix result = HotkeyPrefixNone;
updateStatus(DllExports::GdipGetStringFormatHotkeyPrefix(
nativeStringFormat, (INT*) &result));
return result;
}
Status GetLastStatus() const
{
Status result = lastStatus;
lastStatus = Ok;
return result;
}
StringAlignment GetLineAlignment() const
{
StringAlignment result = StringAlignmentNear;
updateStatus(DllExports::GdipGetStringFormatLineAlign(
nativeStringFormat, &result));
return result;
}
INT GetMeasurableCharacterRangeCount() const
{
INT result = 0;
updateStatus(DllExports::GdipGetStringFormatMeasurableCharacterRangeCount(
nativeStringFormat, &result));
return result;
}
INT GetTabStopCount() const
{
INT result = 0;
updateStatus(DllExports::GdipGetStringFormatTabStopCount(
nativeStringFormat, &result));
return result;
}
Status GetTabStops(INT count, REAL *firstTabOffset, REAL *tabStops)
{
return updateStatus(DllExports::GdipGetStringFormatTabStops(
nativeStringFormat, count,
firstTabOffset, tabStops));
}
StringTrimming GetTrimming() const
{
StringTrimming result = StringTrimmingNone;
updateStatus(DllExports::GdipGetStringFormatTrimming(
nativeStringFormat, &result));
return result;
}
Status SetAlignment(StringAlignment align)
{
return updateStatus(DllExports::GdipSetStringFormatAlign(
nativeStringFormat, align));
}
Status SetDigitSubstitution(LANGID language,
StringDigitSubstitute substitute)
{
return updateStatus(DllExports::GdipSetStringFormatDigitSubstitution(
nativeStringFormat, language, substitute));
}
Status SetFormatFlags(INT flags)
{
return updateStatus(DllExports::GdipSetStringFormatFlags(
nativeStringFormat, flags));
}
Status SetHotkeyPrefix(HotkeyPrefix hotkeyPrefix)
{
return updateStatus(DllExports::GdipSetStringFormatHotkeyPrefix(
nativeStringFormat, (INT) hotkeyPrefix));
}
Status SetLineAlignment(StringAlignment align)
{
return updateStatus(DllExports::GdipSetStringFormatLineAlign(
nativeStringFormat, align));
}
Status SetMeasurableCharacterRanges(INT rangeCount,
const CharacterRange *ranges)
{
return updateStatus(DllExports::GdipSetStringFormatMeasurableCharacterRanges(
nativeStringFormat, rangeCount, ranges));
}
Status SetTabStops(REAL firstTabOffset, INT count, const REAL *tabStops)
{
return updateStatus(DllExports::GdipSetStringFormatTabStops(
nativeStringFormat, firstTabOffset,
count, tabStops));
}
Status SetTrimming(StringTrimming trimming)
{
return updateStatus(DllExports::GdipSetStringFormatTrimming(
nativeStringFormat, trimming));
}
private:
StringFormat(GpStringFormat *stringFormat, Status status):
nativeStringFormat(stringFormat), lastStatus(status) {}
StringFormat(const StringFormat&);
StringFormat& operator=(const StringFormat&);
Status updateStatus(Status newStatus) const
{
if (newStatus != Ok) lastStatus = newStatus;
return newStatus;
}
GpStringFormat *nativeStringFormat;
mutable Status lastStatus;
};
// FIXME: do StringFormat::GenericDefault() et al. need to be thread safe?
// FIXME: maybe put this in gdiplus.c?
extern "C" void *_GdipStringFormatCachedGenericDefault;
extern "C" void *_GdipStringFormatCachedGenericTypographic;
__inline__ const StringFormat* StringFormat::GenericDefault()
{
if (!_GdipStringFormatCachedGenericDefault) {
GpStringFormat *nativeStringFormat = 0;
Status status = DllExports::GdipStringFormatGetGenericDefault(
&nativeStringFormat);
if (status == Ok && nativeStringFormat) {
_GdipStringFormatCachedGenericDefault = (void*)
new StringFormat(nativeStringFormat, Ok);
}
}
return (StringFormat*) _GdipStringFormatCachedGenericDefault;
}
__inline__ const StringFormat* StringFormat::GenericTypographic()
{
if (!_GdipStringFormatCachedGenericTypographic) {
GpStringFormat *nativeStringFormat = 0;
Status status = DllExports::GdipStringFormatGetGenericTypographic(
&nativeStringFormat);
if (status == Ok && nativeStringFormat) {
_GdipStringFormatCachedGenericTypographic = (void*)
new StringFormat(nativeStringFormat, Ok);
}
}
return (StringFormat*) _GdipStringFormatCachedGenericTypographic;
}
#endif /* __GDIPLUS_STRINGFORMAT_H */
|