diff --git a/darwin/area.m b/darwin/area.m index 656a1488..40d719a5 100644 --- a/darwin/area.m +++ b/darwin/area.m @@ -381,7 +381,7 @@ int sendAreaEvents(NSEvent *e) return 0; } -void uiAreaSetSize(uiArea *a, intmax_t width, intmax_t height) +void uiAreaSetSize(uiArea *a, int width, int height) { if (!a->scrolling) userbug("You cannot call uiAreaSetSize() on a non-scrolling uiArea. (area: %p)", a); @@ -417,7 +417,7 @@ uiArea *uiNewArea(uiAreaHandler *ah) return a; } -uiArea *uiNewScrollingArea(uiAreaHandler *ah, intmax_t width, intmax_t height) +uiArea *uiNewScrollingArea(uiAreaHandler *ah, int width, int height) { uiArea *a; struct scrollViewCreateParams p; diff --git a/darwin/combobox.m b/darwin/combobox.m index c1bffdce..89a2e28c 100644 --- a/darwin/combobox.m +++ b/darwin/combobox.m @@ -81,12 +81,12 @@ void uiComboboxAppend(uiCombobox *c, const char *text) [c->pbac addObject:toNSString(text)]; } -intmax_t uiComboboxSelected(uiCombobox *c) +int uiComboboxSelected(uiCombobox *c) { return [c->pb indexOfSelectedItem]; } -void uiComboboxSetSelected(uiCombobox *c, intmax_t n) +void uiComboboxSetSelected(uiCombobox *c, int n) { [c->pb selectItemAtIndex:n]; } diff --git a/darwin/radiobuttons.m b/darwin/radiobuttons.m index c9bcfe9f..9a38981a 100644 --- a/darwin/radiobuttons.m +++ b/darwin/radiobuttons.m @@ -74,7 +74,7 @@ static void uiRadioButtonsDestroy(uiControl *c) uiFreeControl(uiControl(r)); } -static NSButton *buttonAt(uiRadioButtons *r, uintmax_t n) +static NSButton *buttonAt(uiRadioButtons *r, int n) { return (NSButton *) [r->buttons objectAtIndex:n]; } @@ -152,7 +152,7 @@ void uiRadioButtonsAppend(uiRadioButtons *r, const char *text) [r->lastv retain]; } -intmax_t uiRadioButtonsSelected(uiRadioButtons *r) +int uiRadioButtonsSelected(uiRadioButtons *r) { NSButton *b; NSUInteger i; @@ -165,7 +165,7 @@ intmax_t uiRadioButtonsSelected(uiRadioButtons *r) return -1; } -void uiRadioButtonsSetSelected(uiRadioButtons *r, intmax_t n) +void uiRadioButtonsSetSelected(uiRadioButtons *r, int n) { NSButton *b; NSInteger state; diff --git a/ui.h b/ui.h index 50a76ed9..8f1dd9fe 100644 --- a/ui.h +++ b/ui.h @@ -198,8 +198,8 @@ _UI_EXTERN uiSeparator *uiNewHorizontalSeparator(void); typedef struct uiCombobox uiCombobox; #define uiCombobox(this) ((uiCombobox *) (this)) _UI_EXTERN void uiComboboxAppend(uiCombobox *c, const char *text); -_UI_EXTERN intmax_t uiComboboxSelected(uiCombobox *c); -_UI_EXTERN void uiComboboxSetSelected(uiCombobox *c, intmax_t n); +_UI_EXTERN int uiComboboxSelected(uiCombobox *c); +_UI_EXTERN void uiComboboxSetSelected(uiCombobox *c, int n); _UI_EXTERN void uiComboboxOnSelected(uiCombobox *c, void (*f)(uiCombobox *c, void *data), void *data); _UI_EXTERN uiCombobox *uiNewCombobox(void); @@ -215,8 +215,8 @@ _UI_EXTERN uiEditableCombobox *uiNewEditableCombobox(void); typedef struct uiRadioButtons uiRadioButtons; #define uiRadioButtons(this) ((uiRadioButtons *) (this)) _UI_EXTERN void uiRadioButtonsAppend(uiRadioButtons *r, const char *text); -_UI_EXTERN intmax_t uiRadioButtonsSelected(uiRadioButtons *r); -_UI_EXTERN void uiRadioButtonsSetSelected(uiRadioButtons *r, intmax_t n); +_UI_EXTERN int uiRadioButtonsSelected(uiRadioButtons *r); +_UI_EXTERN void uiRadioButtonsSetSelected(uiRadioButtons *r, int n); _UI_EXTERN void uiRadioButtonsOnSelected(uiRadioButtons *r, void (*f)(uiRadioButtons *, void *), void *data); _UI_EXTERN uiRadioButtons *uiNewRadioButtons(void); @@ -283,12 +283,12 @@ struct uiAreaHandler { #define uiArea(this) ((uiArea *) (this)) // TODO give a better name // TODO document the types of width and height -_UI_EXTERN void uiAreaSetSize(uiArea *a, intmax_t width, intmax_t height); +_UI_EXTERN void uiAreaSetSize(uiArea *a, int width, int height); // TODO uiAreaQueueRedraw() _UI_EXTERN void uiAreaQueueRedrawAll(uiArea *a); _UI_EXTERN void uiAreaScrollTo(uiArea *a, double x, double y, double width, double height); _UI_EXTERN uiArea *uiNewArea(uiAreaHandler *ah); -_UI_EXTERN uiArea *uiNewScrollingArea(uiAreaHandler *ah, intmax_t width, intmax_t height); +_UI_EXTERN uiArea *uiNewScrollingArea(uiAreaHandler *ah, int width, int height); struct uiAreaDrawParams { uiDrawContext *Context; diff --git a/unix/area.c b/unix/area.c index 3a420f00..eab01681 100644 --- a/unix/area.c +++ b/unix/area.c @@ -41,8 +41,8 @@ struct uiArea { uiAreaHandler *ah; gboolean scrolling; - intmax_t scrollWidth; - intmax_t scrollHeight; + int scrollWidth; + int scrollHeight; // note that this is a pointer; see above clickCounter *cc; @@ -482,7 +482,7 @@ static void areaWidget_class_init(areaWidgetClass *class) uiUnixControlAllDefaults(uiArea) -void uiAreaSetSize(uiArea *a, intmax_t width, intmax_t height) +void uiAreaSetSize(uiArea *a, int width, int height) { if (!a->scrolling) userbug("You cannot call uiAreaSetSize() on a non-scrolling uiArea. (area: %p)", a); @@ -522,7 +522,7 @@ uiArea *uiNewArea(uiAreaHandler *ah) return a; } -uiArea *uiNewScrollingArea(uiAreaHandler *ah, intmax_t width, intmax_t height) +uiArea *uiNewScrollingArea(uiAreaHandler *ah, int width, int height) { uiArea *a; diff --git a/unix/combobox.c b/unix/combobox.c index 65c0e59a..6fed804b 100644 --- a/unix/combobox.c +++ b/unix/combobox.c @@ -30,12 +30,12 @@ void uiComboboxAppend(uiCombobox *c, const char *text) gtk_combo_box_text_append(c->comboboxText, NULL, text); } -intmax_t uiComboboxSelected(uiCombobox *c) +int uiComboboxSelected(uiCombobox *c) { return gtk_combo_box_get_active(c->combobox); } -void uiComboboxSetSelected(uiCombobox *c, intmax_t n) +void uiComboboxSetSelected(uiCombobox *c, int n) { // we need to inhibit sending of ::changed because this WILL send a ::changed otherwise g_signal_handler_block(c->combobox, c->onSelectedSignal); diff --git a/unix/radiobuttons.c b/unix/radiobuttons.c index 4f6e24e5..da41107e 100644 --- a/unix/radiobuttons.c +++ b/unix/radiobuttons.c @@ -64,7 +64,7 @@ void uiRadioButtonsAppend(uiRadioButtons *r, const char *text) gtk_widget_show(rb); } -intmax_t uiRadioButtonsSelected(uiRadioButtons *r) +int uiRadioButtonsSelected(uiRadioButtons *r) { GtkToggleButton *tb; guint i; @@ -77,7 +77,7 @@ intmax_t uiRadioButtonsSelected(uiRadioButtons *r) return -1; } -void uiRadioButtonsSetSelected(uiRadioButtons *r, intmax_t n) +void uiRadioButtonsSetSelected(uiRadioButtons *r, int n) { GtkToggleButton *tb; gboolean active; diff --git a/windows/area.cpp b/windows/area.cpp index b4a87517..17110d33 100644 --- a/windows/area.cpp +++ b/windows/area.cpp @@ -51,7 +51,7 @@ static LRESULT CALLBACK areaWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM uiWindowsControlAllDefaults(uiArea) -static void uiAreaMinimumSize(uiWindowsControl *c, intmax_t *width, intmax_t *height) +static void uiAreaMinimumSize(uiWindowsControl *c, int *width, int *height) { // TODO *width = 0; @@ -80,7 +80,7 @@ void unregisterArea(void) logLastError(L"error unregistering uiArea window class"); } -void uiAreaSetSize(uiArea *a, intmax_t width, intmax_t height) +void uiAreaSetSize(uiArea *a, int width, int height) { a->scrollWidth = width; a->scrollHeight = height; @@ -118,7 +118,7 @@ uiArea *uiNewArea(uiAreaHandler *ah) return a; } -uiArea *uiNewScrollingArea(uiAreaHandler *ah, intmax_t width, intmax_t height) +uiArea *uiNewScrollingArea(uiAreaHandler *ah, int width, int height) { uiArea *a; diff --git a/windows/area.hpp b/windows/area.hpp index 6b82532d..e733b84e 100644 --- a/windows/area.hpp +++ b/windows/area.hpp @@ -11,8 +11,8 @@ struct uiArea { uiAreaHandler *ah; BOOL scrolling; - intmax_t scrollWidth; - intmax_t scrollHeight; + int scrollWidth; + int scrollHeight; intmax_t hscrollpos; intmax_t vscrollpos; int hwheelCarry; diff --git a/windows/combobox.cpp b/windows/combobox.cpp index ac10f211..87c999ea 100644 --- a/windows/combobox.cpp +++ b/windows/combobox.cpp @@ -36,7 +36,7 @@ uiWindowsControlAllDefaultsExceptDestroy(uiCombobox) #define comboboxWidth 107 /* this is actually the shorter progress bar width, but Microsoft only indicates as wide as necessary; LONGTERM */ #define comboboxHeight 14 /* LONGTERM: is this too high? */ -static void uiComboboxMinimumSize(uiWindowsControl *cc, intmax_t *width, intmax_t *height) +static void uiComboboxMinimumSize(uiWindowsControl *cc, int *width, int *height) { uiCombobox *c = uiCombobox(cc); uiWindowsSizing sizing; @@ -69,17 +69,17 @@ void uiComboboxAppend(uiCombobox *c, const char *text) uiFree(wtext); } -intmax_t uiComboboxSelected(uiCombobox *c) +int uiComboboxSelected(uiCombobox *c) { LRESULT n; n = SendMessage(c->hwnd, CB_GETCURSEL, 0, 0); if (n == (LRESULT) CB_ERR) return -1; - return (intmax_t) n; + return n; } -void uiComboboxSetSelected(uiCombobox *c, intmax_t n) +void uiComboboxSetSelected(uiCombobox *c, int n) { // TODO error check SendMessageW(c->hwnd, CB_SETCURSEL, (WPARAM) n, 0); diff --git a/windows/radiobuttons.cpp b/windows/radiobuttons.cpp index 3063d3cd..29cd2e66 100644 --- a/windows/radiobuttons.cpp +++ b/windows/radiobuttons.cpp @@ -20,7 +20,6 @@ static BOOL onWM_COMMAND(uiControl *c, HWND clicked, WORD code, LRESULT *lResult { uiRadioButtons *r = uiRadioButtons(c); WPARAM check; - uintmax_t i; if (code != BN_CLICKED) return FALSE; @@ -61,10 +60,10 @@ uiWindowsControlAllDefaultsExceptDestroy(uiRadioButtons) // from http://msdn.microsoft.com/en-us/library/windows/desktop/bb226818%28v=vs.85%29.aspx #define radiobuttonXFromLeftOfBoxToLeftOfLabel 12 -static void uiRadioButtonsMinimumSize(uiWindowsControl *c, intmax_t *width, intmax_t *height) +static void uiRadioButtonsMinimumSize(uiWindowsControl *c, int *width, int *height) { uiRadioButtons *r = uiRadioButtons(c); - intmax_t wid, maxwid; + int wid, maxwid; uiWindowsSizing sizing; int x, y; @@ -92,7 +91,7 @@ static void uiRadioButtonsMinimumSize(uiWindowsControl *c, intmax_t *width, intm static void radiobuttonsRelayout(uiRadioButtons *r) { RECT client; - intmax_t x, y, width, height; + int x, y, width, height; int height1; uiWindowsSizing sizing; @@ -149,7 +148,7 @@ void uiRadioButtonsAppend(uiRadioButtons *r, const char *text) uiWindowsControlMinimumSizeChanged(uiWindowsControl(r)); } -intmax_t uiRadioButtonsSelected(uiRadioButtons *r) +int uiRadioButtonsSelected(uiRadioButtons *r) { size_t i; @@ -159,9 +158,9 @@ intmax_t uiRadioButtonsSelected(uiRadioButtons *r) return -1; } -void uiRadioButtonsSetSelected(uiRadioButtons *r, intmax_t n) +void uiRadioButtonsSetSelected(uiRadioButtons *r, int n) { - intmax_t m; + int m; m = uiRadioButtonsSelected(r); if (m != -1)