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