Fixed stupid STUPID **STUPID** C and C++ language bullshit.
This commit is contained in:
parent
794186a5a9
commit
4d3d80736b
|
@ -15,14 +15,14 @@ CFLAGS += \
|
|||
-Wno-switch \
|
||||
--std=c99
|
||||
|
||||
# TODO consider switching to C++11
|
||||
# this will hopelessly disbar Haiku for GCC 2
|
||||
# C++11 is needed due to stupid rules involving commas at the end of enum lists that C++03 stupidly didn't follow
|
||||
# This means sorry, no GCC 2 for Haiku builds :(
|
||||
CXXFLAGS += \
|
||||
-g \
|
||||
-Wall -Wextra -pedantic \
|
||||
-Wno-unused-parameter \
|
||||
-Wno-switch \
|
||||
--std=c++03
|
||||
--std=c++11
|
||||
|
||||
LDFLAGS += \
|
||||
-g
|
||||
|
|
|
@ -2,8 +2,7 @@
|
|||
// TODO versioning macros?
|
||||
#include <AppKit.h>
|
||||
#include <InterfaceKit.h>
|
||||
//TODO#include "../ui.h"
|
||||
#include "ui.hpp"
|
||||
#include "../ui.h"
|
||||
#include "../ui_haiku.hpp"
|
||||
#include "../common/uipriv.h"
|
||||
|
||||
|
|
34
ui.h
34
ui.h
|
@ -297,41 +297,37 @@ typedef struct uiDrawBrush uiDrawBrush;
|
|||
typedef struct uiDrawStrokeParams uiDrawStrokeParams;
|
||||
typedef struct uiDrawMatrix uiDrawMatrix;
|
||||
|
||||
typedef enum uiDrawBrushType uiDrawBrushType;
|
||||
typedef struct uiDrawBrushGradientStop uiDrawBrushGradientStop;
|
||||
|
||||
typedef enum uiDrawLineCap uiDrawLineCap;
|
||||
typedef enum uiDrawLineJoin uiDrawLineJoin;
|
||||
typedef enum uiDrawFillMode uiDrawFillMode;
|
||||
|
||||
enum uiDrawBrushType {
|
||||
// ISO C forbids us from forward declaring enums >:(
|
||||
typedef enum uiDrawBrushType {
|
||||
uiDrawBrushTypeSolid,
|
||||
uiDrawBrushTypeLinearGradient,
|
||||
uiDrawBrushTypeRadialGradient,
|
||||
uiDrawBrushTypeImage,
|
||||
};
|
||||
} uiDrawBrushType;
|
||||
|
||||
enum uiDrawLineCap {
|
||||
typedef enum uiDrawLineCap {
|
||||
uiDrawLineCapFlat,
|
||||
uiDrawLineCapRound,
|
||||
uiDrawLineCapSquare,
|
||||
};
|
||||
} uiDrawLineCap;
|
||||
|
||||
enum uiDrawLineJoin {
|
||||
typedef enum uiDrawLineJoin {
|
||||
uiDrawLineJoinMiter,
|
||||
uiDrawLineJoinRound,
|
||||
uiDrawLineJoinBevel,
|
||||
};
|
||||
} uiDrawLineJoin;
|
||||
|
||||
// this is the default for botoh cairo and Direct2D (in the latter case, from the C++ helper functions)
|
||||
// Core Graphics doesn't explicitly specify a default, but NSBezierPath allows you to choose one, and this is the initial value
|
||||
// so we're good to use it too!
|
||||
#define uiDrawDefaultMiterLimit 10.0
|
||||
|
||||
enum uiDrawFillMode {
|
||||
typedef enum uiDrawFillMode {
|
||||
uiDrawFillModeWinding,
|
||||
uiDrawFillModeAlternate,
|
||||
};
|
||||
} uiDrawFillMode;
|
||||
|
||||
struct uiDrawMatrix {
|
||||
double M11;
|
||||
|
@ -437,14 +433,12 @@ _UI_EXTERN void uiDrawClip(uiDrawContext *c, uiDrawPath *path);
|
|||
_UI_EXTERN void uiDrawSave(uiDrawContext *c);
|
||||
_UI_EXTERN void uiDrawRestore(uiDrawContext *c);
|
||||
|
||||
typedef enum uiModifiers uiModifiers;
|
||||
|
||||
enum uiModifiers {
|
||||
typedef enum uiModifiers {
|
||||
uiModifierCtrl = 1 << 0,
|
||||
uiModifierAlt = 1 << 1,
|
||||
uiModifierShift = 1 << 2,
|
||||
uiModifierSuper = 1 << 3,
|
||||
};
|
||||
} uiModifiers;
|
||||
|
||||
struct uiAreaMouseEvent {
|
||||
double X;
|
||||
|
@ -465,9 +459,7 @@ struct uiAreaMouseEvent {
|
|||
uint64_t Held1To64;
|
||||
};
|
||||
|
||||
typedef enum uiExtKey uiExtKey;
|
||||
|
||||
enum uiExtKey {
|
||||
typedef enum uiExtKey {
|
||||
uiExtKeyEscape = 1,
|
||||
uiExtKeyInsert, // equivalent to "Help" on Apple keyboards
|
||||
uiExtKeyDelete,
|
||||
|
@ -507,7 +499,7 @@ enum uiExtKey {
|
|||
uiExtKeyNSubtract,
|
||||
uiExtKeyNMultiply,
|
||||
uiExtKeyNDivide,
|
||||
};
|
||||
} uiExtKey;
|
||||
|
||||
struct uiAreaKeyEvent {
|
||||
char Key;
|
||||
|
|
Loading…
Reference in New Issue