Finished stripping ui.h of intmax.

This commit is contained in:
Pietro Gagliardi 2016-06-13 21:20:20 -04:00
parent 155299cdb9
commit 864c6c2511
6 changed files with 58 additions and 58 deletions

View File

@ -130,7 +130,7 @@ struct uiArea {
uiArea *a = self->libui_a; uiArea *a = self->libui_a;
uiAreaMouseEvent me; uiAreaMouseEvent me;
NSPoint point; NSPoint point;
uintmax_t buttonNumber; int buttonNumber;
NSUInteger pmb; NSUInteger pmb;
unsigned int i, max; unsigned int i, max;

View File

@ -7,10 +7,10 @@
// maybe it's easier to do it regardless of align // maybe it's easier to do it regardless of align
@interface gridChild : NSObject @interface gridChild : NSObject
@property uiControl *c; @property uiControl *c;
@property intmax_t left; @property int left;
@property intmax_t top; @property int top;
@property intmax_t xspan; @property int xspan;
@property intmax_t yspan; @property int yspan;
@property int hexpand; @property int hexpand;
@property uiAlign halign; @property uiAlign halign;
@property int vexpand; @property int vexpand;
@ -25,8 +25,8 @@
uiGrid *g; uiGrid *g;
NSMutableArray *children; NSMutableArray *children;
int padded; int padded;
uintmax_t nhexpand; int nhexpand;
uintmax_t nvexpand; int nvexpand;
NSMutableArray *edges; NSMutableArray *edges;
NSMutableArray *inBetweens; NSMutableArray *inBetweens;
@ -136,17 +136,17 @@ struct uiGrid {
{ {
gridChild *gc; gridChild *gc;
CGFloat padding; CGFloat padding;
intmax_t xmin, ymin; int xmin, ymin;
intmax_t xmax, ymax; int xmax, ymax;
intmax_t xcount, ycount; int xcount, ycount;
BOOL first; BOOL first;
int **gg; int **gg;
NSView ***gv; NSView ***gv;
BOOL **gspan; BOOL **gspan;
intmax_t x, y; int x, y;
int i; int i;
NSLayoutConstraint *c; NSLayoutConstraint *c;
intmax_t firstx, firsty; int firstx, firsty;
BOOL *hexpand, *vexpand; BOOL *hexpand, *vexpand;
BOOL doit; BOOL doit;
@ -423,7 +423,7 @@ struct uiGrid {
{ {
NSLayoutPriority priority; NSLayoutPriority priority;
BOOL update; BOOL update;
intmax_t oldn; int oldn;
uiControlSetParent(gc.c, uiControl(self->g)); uiControlSetParent(gc.c, uiControl(self->g));
uiDarwinControlSetSuperview(uiDarwinControl(gc.c), self); uiDarwinControlSetSuperview(uiDarwinControl(gc.c), self);
@ -591,7 +591,7 @@ static void uiGridChildEdgeHuggingChanged(uiDarwinControl *c)
uiDarwinControlDefaultHuggingPriority(uiGrid, view) uiDarwinControlDefaultHuggingPriority(uiGrid, view)
uiDarwinControlDefaultSetHuggingPriority(uiGrid, view) uiDarwinControlDefaultSetHuggingPriority(uiGrid, view)
static gridChild *toChild(uiControl *c, intmax_t xspan, intmax_t yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign) static gridChild *toChild(uiControl *c, int xspan, int yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign)
{ {
gridChild *gc; gridChild *gc;
@ -612,7 +612,7 @@ static gridChild *toChild(uiControl *c, intmax_t xspan, intmax_t yspan, int hexp
return gc; return gc;
} }
void uiGridAppend(uiGrid *g, uiControl *c, intmax_t left, intmax_t top, intmax_t xspan, intmax_t yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign) void uiGridAppend(uiGrid *g, uiControl *c, int left, int top, int xspan, int yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign)
{ {
gridChild *gc; gridChild *gc;
@ -626,7 +626,7 @@ void uiGridAppend(uiGrid *g, uiControl *c, intmax_t left, intmax_t top, intmax_t
[g->view append:gc]; [g->view append:gc];
} }
void uiGridInsertAt(uiGrid *g, uiControl *c, uiControl *existing, uiAt at, intmax_t xspan, intmax_t yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign) void uiGridInsertAt(uiGrid *g, uiControl *c, uiControl *existing, uiAt at, int xspan, int yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign)
{ {
gridChild *gc; gridChild *gc;

10
ui.h
View File

@ -545,10 +545,10 @@ struct uiAreaMouseEvent {
double AreaWidth; double AreaWidth;
double AreaHeight; double AreaHeight;
uintmax_t Down; int Down;
uintmax_t Up; int Up;
uintmax_t Count; int Count;
uiModifiers Modifiers; uiModifiers Modifiers;
@ -645,8 +645,8 @@ _UI_ENUM(uiAt) {
typedef struct uiGrid uiGrid; typedef struct uiGrid uiGrid;
#define uiGrid(this) ((uiGrid *) (this)) #define uiGrid(this) ((uiGrid *) (this))
_UI_EXTERN void uiGridAppend(uiGrid *g, uiControl *c, intmax_t left, intmax_t top, intmax_t xspan, intmax_t yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign); _UI_EXTERN void uiGridAppend(uiGrid *g, uiControl *c, int left, int top, int xspan, int yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign);
_UI_EXTERN void uiGridInsertAt(uiGrid *g, uiControl *c, uiControl *existing, uiAt at, intmax_t xspan, intmax_t yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign); _UI_EXTERN void uiGridInsertAt(uiGrid *g, uiControl *c, uiControl *existing, uiAt at, int xspan, int yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign);
_UI_EXTERN int uiGridPadded(uiGrid *g); _UI_EXTERN int uiGridPadded(uiGrid *g);
_UI_EXTERN void uiGridSetPadded(uiGrid *g, int padded); _UI_EXTERN void uiGridSetPadded(uiGrid *g, int padded);
_UI_EXTERN uiGrid *uiNewGrid(void); _UI_EXTERN uiGrid *uiNewGrid(void);

View File

@ -80,7 +80,7 @@ static GtkWidget *prepare(struct gridChild *gc, uiControl *c, int hexpand, uiAli
return widget; return widget;
} }
void uiGridAppend(uiGrid *g, uiControl *c, intmax_t left, intmax_t top, intmax_t xspan, intmax_t yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign) void uiGridAppend(uiGrid *g, uiControl *c, int left, int top, int xspan, int yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign)
{ {
struct gridChild gc; struct gridChild gc;
GtkWidget *widget; GtkWidget *widget;
@ -94,7 +94,7 @@ void uiGridAppend(uiGrid *g, uiControl *c, intmax_t left, intmax_t top, intmax_t
g_array_append_val(g->children, gc); g_array_append_val(g->children, gc);
} }
void uiGridInsertAt(uiGrid *g, uiControl *c, uiControl *existing, uiAt at, intmax_t xspan, intmax_t yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign) void uiGridInsertAt(uiGrid *g, uiControl *c, uiControl *existing, uiAt at, int xspan, int yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign)
{ {
struct gridChild gc; struct gridChild gc;
GtkWidget *widget; GtkWidget *widget;

View File

@ -73,10 +73,10 @@ static void capture(uiArea *a, BOOL capturing)
logLastError(L"error releasing capture on drag"); logLastError(L"error releasing capture on drag");
} }
static void areaMouseEvent(uiArea *a, uintmax_t down, uintmax_t up, WPARAM wParam, LPARAM lParam) static void areaMouseEvent(uiArea *a, int down, int up, WPARAM wParam, LPARAM lParam)
{ {
uiAreaMouseEvent me; uiAreaMouseEvent me;
uintmax_t button; int button;
POINT clientpt; POINT clientpt;
RECT client; RECT client;
BOOL inClient; BOOL inClient;

View File

@ -10,19 +10,19 @@
struct gridChild { struct gridChild {
uiControl *c; uiControl *c;
intmax_t left; int left;
intmax_t top; int top;
intmax_t xspan; int xspan;
intmax_t yspan; int yspan;
int hexpand; int hexpand;
uiAlign halign; uiAlign halign;
int vexpand; int vexpand;
uiAlign valign; uiAlign valign;
// have these here so they don't need to be reallocated each relayout // have these here so they don't need to be reallocated each relayout
intmax_t finalx, finaly; int finalx, finaly;
intmax_t finalwidth, finalheight; int finalwidth, finalheight;
intmax_t minwidth, minheight; int minwidth, minheight;
}; };
struct uiGrid { struct uiGrid {
@ -32,8 +32,8 @@ struct uiGrid {
std::map<uiControl *, size_t> *indexof; std::map<uiControl *, size_t> *indexof;
int padded; int padded;
intmax_t xmin, ymin; int xmin, ymin;
intmax_t xmax, ymax; int xmax, ymax;
}; };
#define xcount(g) ((g)->xmax - (g)->xmin) #define xcount(g) ((g)->xmax - (g)->xmin)
@ -44,20 +44,20 @@ struct uiGrid {
class gridLayoutData { class gridLayoutData {
size_t ycount; size_t ycount;
public: public:
intmax_t **gg; // topological map gg[y][x] = control index int **gg; // topological map gg[y][x] = control index
intmax_t *colwidths; int *colwidths;
intmax_t *rowheights; int *rowheights;
bool *hexpand; bool *hexpand;
bool *vexpand; bool *vexpand;
gridLayoutData(uiGrid *g) gridLayoutData(uiGrid *g)
{ {
size_t i; size_t i;
intmax_t x, y; int x, y;
this->gg = new intmax_t *[ycount(g)]; this->gg = new int *[ycount(g)];
for (y = 0; y < ycount(g); y++) { for (y = 0; y < ycount(g); y++) {
this->gg[y] = new intmax_t[xcount(g)]; this->gg[y] = new int[xcount(g)];
for (x = 0; x < xcount(g); x++) for (x = 0; x < xcount(g); x++)
this->gg[y][x] = -1; this->gg[y][x] = -1;
} }
@ -71,10 +71,10 @@ public:
this->gg[toyindex(g, y)][toxindex(g, x)] = i; this->gg[toyindex(g, y)][toxindex(g, x)] = i;
} }
this->colwidths = new intmax_t[xcount(g)]; this->colwidths = new int[xcount(g)];
ZeroMemory(this->colwidths, xcount(g) * sizeof (intmax_t)); ZeroMemory(this->colwidths, xcount(g) * sizeof (int));
this->rowheights = new intmax_t[ycount(g)]; this->rowheights = new int[ycount(g)];
ZeroMemory(this->rowheights, ycount(g) * sizeof (intmax_t)); ZeroMemory(this->rowheights, ycount(g) * sizeof (int));
this->hexpand = new bool[xcount(g)]; this->hexpand = new bool[xcount(g)];
ZeroMemory(this->hexpand, xcount(g) * sizeof (bool)); ZeroMemory(this->hexpand, xcount(g) * sizeof (bool));
this->vexpand = new bool[ycount(g)]; this->vexpand = new bool[ycount(g)];
@ -112,14 +112,14 @@ static void gridPadding(uiGrid *g, int *xpadding, int *ypadding)
static void gridRelayout(uiGrid *g) static void gridRelayout(uiGrid *g)
{ {
RECT r; RECT r;
intmax_t x, y, width, height; int x, y, width, height;
gridLayoutData *ld; gridLayoutData *ld;
int xpadding, ypadding; int xpadding, ypadding;
intmax_t ix, iy; int ix, iy;
intmax_t iwidth, iheight; int iwidth, iheight;
int i; int i;
struct gridChild *gc; struct gridChild *gc;
intmax_t nhexpand, nvexpand; int nhexpand, nvexpand;
if (g->children->size() == 0) if (g->children->size() == 0)
return; // nothing to do return; // nothing to do
@ -229,7 +229,7 @@ static void gridRelayout(uiGrid *g)
// 6) compute cell positions and sizes // 6) compute cell positions and sizes
for (iy = 0; iy < ycount(g); iy++) { for (iy = 0; iy < ycount(g); iy++) {
intmax_t curx; int curx;
int prev; int prev;
curx = 0; curx = 0;
@ -251,7 +251,7 @@ static void gridRelayout(uiGrid *g)
} }
} }
for (ix = 0; ix < xcount(g); ix++) { for (ix = 0; ix < xcount(g); ix++) {
intmax_t cury; int cury;
int prev; int prev;
cury = 0; cury = 0;
@ -357,16 +357,16 @@ static void uiGridSyncEnableState(uiWindowsControl *c, int enabled)
uiWindowsControlDefaultSetParentHWND(uiGrid) uiWindowsControlDefaultSetParentHWND(uiGrid)
static void uiGridMinimumSize(uiWindowsControl *c, intmax_t *width, intmax_t *height) static void uiGridMinimumSize(uiWindowsControl *c, int *width, int *height)
{ {
uiGrid *g = uiGrid(c); uiGrid *g = uiGrid(c);
int xpadding, ypadding; int xpadding, ypadding;
gridLayoutData *ld; gridLayoutData *ld;
intmax_t x, y; int x, y;
int i; int i;
struct gridChild *gc; struct gridChild *gc;
intmax_t minwid, minht; int minwid, minht;
intmax_t colwidth, rowheight; int colwidth, rowheight;
*width = 0; *width = 0;
*height = 0; *height = 0;
@ -429,7 +429,7 @@ static void gridArrangeChildren(uiGrid *g)
HWND insertAfter; HWND insertAfter;
gridLayoutData *ld; gridLayoutData *ld;
bool *visited; bool *visited;
intmax_t x, y; int x, y;
int i; int i;
struct gridChild *gc; struct gridChild *gc;
@ -479,7 +479,7 @@ static void gridRecomputeMinMax(uiGrid *g)
} }
} }
static struct gridChild *toChild(uiControl *c, intmax_t xspan, intmax_t yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign) static struct gridChild *toChild(uiControl *c, int xspan, int yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign)
{ {
struct gridChild *gc; struct gridChild *gc;
@ -509,7 +509,7 @@ static void add(uiGrid *g, struct gridChild *gc)
uiWindowsControlMinimumSizeChanged(uiWindowsControl(g)); uiWindowsControlMinimumSizeChanged(uiWindowsControl(g));
} }
void uiGridAppend(uiGrid *g, uiControl *c, intmax_t left, intmax_t top, intmax_t xspan, intmax_t yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign) void uiGridAppend(uiGrid *g, uiControl *c, int left, int top, int xspan, int yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign)
{ {
struct gridChild *gc; struct gridChild *gc;
@ -520,7 +520,7 @@ void uiGridAppend(uiGrid *g, uiControl *c, intmax_t left, intmax_t top, intmax_t
} }
// TODO decide what happens if existing is NULL // TODO decide what happens if existing is NULL
void uiGridInsertAt(uiGrid *g, uiControl *c, uiControl *existing, uiAt at, intmax_t xspan, intmax_t yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign) void uiGridInsertAt(uiGrid *g, uiControl *c, uiControl *existing, uiAt at, int xspan, int yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign)
{ {
struct gridChild *gc; struct gridChild *gc;
struct gridChild *other; struct gridChild *other;