Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply standard coding style #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 32 additions & 24 deletions Headers/CoreGraphics/CGAffineTransform.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Expand Down Expand Up @@ -54,7 +54,7 @@ extern const CGAffineTransform CGAffineTransformIdentity;
*/
#ifdef IN_CGAFFINETRANSFORM_C
#define GS_AFTR_SCOPE extern
#define GS_AFTR_ATTR
#define GS_AFTR_ATTR
#else
#define GS_AFTR_SCOPE static inline
#define GS_AFTR_ATTR __attribute__((unused))
Expand Down Expand Up @@ -106,7 +106,7 @@ GS_AFTR_SCOPE CGAffineTransform CGAffineTransformRotate(
GS_AFTR_SCOPE bool CGAffineTransformEqualToTransform(
CGAffineTransform t1,
CGAffineTransform t2
) GS_AFTR_ATTR;
) GS_AFTR_ATTR;

GS_AFTR_SCOPE bool CGAffineTransformIsIdentity(
CGAffineTransform t
Expand Down Expand Up @@ -158,7 +158,8 @@ GS_AFTR_SCOPE CGAffineTransform CGAffineTransformMakeTranslation(
return matrix;
}

GS_AFTR_SCOPE CGAffineTransform CGAffineTransformMakeScale(CGFloat sx, CGFloat sy)
GS_AFTR_SCOPE CGAffineTransform CGAffineTransformMakeScale(CGFloat sx,
CGFloat sy)
{
CGAffineTransform matrix;

Expand Down Expand Up @@ -210,26 +211,33 @@ GS_AFTR_SCOPE CGAffineTransform CGAffineTransformRotate(
return CGAffineTransformConcat(CGAffineTransformMakeRotation(angle), t);
}

GS_AFTR_SCOPE bool CGAffineTransformEqualToTransform(CGAffineTransform t1, CGAffineTransform t2)
GS_AFTR_SCOPE bool CGAffineTransformEqualToTransform(CGAffineTransform t1,
CGAffineTransform t2)
{
if (t1.a != t2.a) {
return false;
}
if (t1.b != t2.b) {
return false;
}
if (t1.c != t2.c) {
return false;
}
if (t1.d != t2.d) {
return false;
}
if (t1.tx != t2.tx) {
return false;
}
if (t1.ty != t2.ty) {
return false;
}
if (t1.a != t2.a)
{
return false;
}
if (t1.b != t2.b)
{
return false;
}
if (t1.c != t2.c)
{
return false;
}
if (t1.d != t2.d)
{
return false;
}
if (t1.tx != t2.tx)
{
return false;
}
if (t1.ty != t2.ty)
{
return false;
}
return true;
}

Expand Down
6 changes: 3 additions & 3 deletions Headers/CoreGraphics/CGBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Expand Down Expand Up @@ -53,7 +53,7 @@
#define CGFLOAT_MIN FLT_MIN
#define CGFLOAT_MAX FLT_MAX
#endif

typedef CGFLOAT_TYPE CGFloat;
#endif // CGFLOAT_DEFINED

Expand Down
4 changes: 2 additions & 2 deletions Headers/CoreGraphics/CGBitmapContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Expand Down
7 changes: 4 additions & 3 deletions Headers/CoreGraphics/CGColor.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Expand Down Expand Up @@ -46,7 +46,8 @@ const extern CFStringRef kCGColorClear;

/* Functions */

extern CGColorRef CGColorCreate(CGColorSpaceRef colorspace, const CGFloat components[]);
extern CGColorRef CGColorCreate(CGColorSpaceRef colorspace,
const CGFloat components[]);
CGColorRef CGColorCreateCopy(CGColorRef clr);

CGColorRef CGColorCreateCopyWithAlpha(CGColorRef clr, CGFloat alpha);
Expand Down
10 changes: 6 additions & 4 deletions Headers/CoreGraphics/CGColorSpace.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Expand All @@ -41,7 +41,8 @@ typedef struct CGColorSpace* CGColorSpaceRef;
#include <CoreGraphics/CGBase.h>
#include <CoreGraphics/CGDataProvider.h>

typedef enum CGColorSpaceModel {
typedef enum CGColorSpaceModel
{
kCGColorSpaceModelUnknown = -1,
kCGColorSpaceModelMonochrome = 0,
kCGColorSpaceModelRGB = 1,
Expand All @@ -55,7 +56,8 @@ typedef enum CGColorSpaceModel {

/* Constants */

typedef enum CGColorRenderingIntent {
typedef enum CGColorRenderingIntent
{
kCGRenderingIntentDefault = 0,
kCGRenderingIntentAbsoluteColorimetric = 1,
kCGRenderingIntentRelativeColorimetric = 2,
Expand Down
48 changes: 31 additions & 17 deletions Headers/CoreGraphics/CGContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Expand Down Expand Up @@ -52,7 +52,8 @@ typedef struct OPGState* OPGStateRef;

/* Constants */

typedef enum CGBlendMode {
typedef enum CGBlendMode
{
kCGBlendModeNormal = 0,
kCGBlendModeMultiply = 1,
kCGBlendModeScreen = 2,
Expand Down Expand Up @@ -83,35 +84,40 @@ typedef enum CGBlendMode {
kCGBlendModePlusLighter = 27
} CGBlendMode;

typedef enum CGInterpolationQuality {
typedef enum CGInterpolationQuality
{
kCGInterpolationDefault = 0,
kCGInterpolationNone = 1,
kCGInterpolationLow = 2,
kCGInterpolationMedium = 4,
kCGInterpolationHigh = 3
} CGInterpolationQuality;

typedef enum CGLineCap {
typedef enum CGLineCap
{
kCGLineCapButt = 0,
kCGLineCapRound = 1,
kCGLineCapSquare = 2
} CGLineCap;

typedef enum CGLineJoin {
typedef enum CGLineJoin
{
kCGLineJoinMiter = 0,
kCGLineJoinRound = 1,
kCGLineJoinBevel = 2
} CGLineJoin;

typedef enum CGPathDrawingMode {
typedef enum CGPathDrawingMode
{
kCGPathFill = 0,
kCGPathEOFill = 1,
kCGPathStroke = 2,
kCGPathFillStroke = 3,
kCGPathEOFillStroke = 4
} CGPathDrawingMode;

typedef enum CGTextDrawingMode {
typedef enum CGTextDrawingMode
{
kCGTextFill = 0,
kCGTextStroke = 1,
kCGTextFillStroke = 2,
Expand All @@ -122,7 +128,8 @@ typedef enum CGTextDrawingMode {
kCGTextClip = 7
} CGTextDrawingMode;

typedef enum CGTextEncoding {
typedef enum CGTextEncoding
{
kCGEncodingFontSpecific = 0,
kCGEncodingMacRoman = 1
} CGTextEncoding;
Expand Down Expand Up @@ -209,7 +216,8 @@ void CGContextSetStrokePattern(

void CGContextSetShouldSmoothFonts(CGContextRef ctx, int shouldSmoothFonts);

void CGContextSetAllowsFontSmoothing(CGContextRef ctx, bool allowsFontSmoothing);
void CGContextSetAllowsFontSmoothing(CGContextRef ctx,
bool allowsFontSmoothing);

void CGContextSetBlendMode(CGContextRef ctx, CGBlendMode mode);

Expand Down Expand Up @@ -321,7 +329,8 @@ void CGContextDrawPath(CGContextRef ctx, CGPathDrawingMode mode);

void CGContextStrokeRect(CGContextRef ctx, CGRect rect);

void CGContextStrokeRectWithWidth(CGContextRef ctx, CGRect rect, CGFloat width);
void CGContextStrokeRectWithWidth(CGContextRef ctx, CGRect rect,
CGFloat width);

void CGContextFillRect(CGContextRef ctx, CGRect rect);

Expand Down Expand Up @@ -357,7 +366,8 @@ void CGContextEOClip(CGContextRef ctx);

void CGContextClipToRect(CGContextRef ctx, CGRect rect);

void CGContextClipToRects(CGContextRef ctx, const CGRect rects[], size_t count);
void CGContextClipToRects(CGContextRef ctx, const CGRect rects[],
size_t count);

void CGContextClipToMask(CGContextRef ctx, CGRect rect, CGImageRef mask);

Expand All @@ -373,15 +383,17 @@ void CGContextSetAlpha(CGContextRef ctx, CGFloat alpha);

void CGContextSetFillColorSpace(CGContextRef ctx, CGColorSpaceRef colorspace);

void CGContextSetStrokeColorSpace(CGContextRef ctx, CGColorSpaceRef colorspace);
void CGContextSetStrokeColorSpace(CGContextRef ctx,
CGColorSpaceRef colorspace);

void CGContextSetFillColor(CGContextRef ctx, const CGFloat components[]);

void CGContextSetStrokeColor(CGContextRef ctx, const CGFloat components[]);

void CGContextSetGrayFillColor(CGContextRef ctx, CGFloat gray, CGFloat alpha);

void CGContextSetGrayStrokeColor(CGContextRef ctx, CGFloat gray, CGFloat alpha);
void CGContextSetGrayStrokeColor(CGContextRef ctx, CGFloat gray,
CGFloat alpha);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks odd, should be 1 argument per line if it won't all fit on one line?


void CGContextSetRGBFillColor(
CGContextRef ctx,
Expand Down Expand Up @@ -417,7 +429,8 @@ void CGContextSetCMYKStrokeColor(
CGFloat alpha
);

void CGContextSetRenderingIntent(CGContextRef ctx, CGColorRenderingIntent intent);
void CGContextSetRenderingIntent(CGContextRef ctx,
CGColorRenderingIntent intent);

/* Drawing Images */

Expand Down Expand Up @@ -537,7 +550,8 @@ void CGContextEndTransparencyLayer(CGContextRef ctx);

/* User to Device Transformation */

CGAffineTransform CGContextGetUserSpaceToDeviceSpaceTransform(CGContextRef ctx);
CGAffineTransform CGContextGetUserSpaceToDeviceSpaceTransform(
CGContextRef ctx);

CGPoint CGContextConvertPointToDeviceSpace(CGContextRef ctx, CGPoint point);

Expand Down Expand Up @@ -566,7 +580,7 @@ void OPContextResetClip(CGContextRef ctx);
void OPContextSetIdentityCTM(CGContextRef ctx);

void OPContextSetCairoDeviceOffset(CGContextRef ctx,
CGFloat x, CGFloat y);
CGFloat x, CGFloat y);

OPGStateRef OPContextCopyGState(CGContextRef ctx);

Expand Down
6 changes: 3 additions & 3 deletions Headers/CoreGraphics/CGDataConsumer.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@

Author: BALATON Zoltan <balaton@eik.bme.hu>
Date: 2006

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Expand Down
Loading