Revert "Set up basic logging."

Not right now.

This reverts commit 499bf2d00c.
This commit is contained in:
Pietro Gagliardi 2015-06-08 19:09:57 -04:00
parent 499bf2d00c
commit bf0b38b6c2
6 changed files with 7 additions and 26 deletions

View File

@ -1,4 +1,3 @@
- refine logging
- figure out how to deal with dchild at all, including preferred sizes - figure out how to deal with dchild at all, including preferred sizes
- make OS X uiEntry width based on default in Interface Builder, not from sizeToFit - make OS X uiEntry width based on default in Interface Builder, not from sizeToFit
- update state whenever setting parent - update state whenever setting parent

View File

@ -15,14 +15,14 @@ void die(const char *fmt, ...)
int onClosing(uiWindow *w, void *data) int onClosing(uiWindow *w, void *data)
{ {
uiLog("[test program] in onClosing()\n"); printf("in onClosing()\n");
uiQuit(); uiQuit();
return 1; return 1;
} }
int onShouldQuit(void *data) int onShouldQuit(void *data)
{ {
uiLog("[test program] in onShouldQuit()\n"); printf("in onShouldQuit()\n");
if (uiMenuItemChecked(shouldQuitItem)) { if (uiMenuItemChecked(shouldQuitItem)) {
uiControlDestroy(uiControl(data)); uiControlDestroy(uiControl(data));
return 1; return 1;
@ -72,7 +72,7 @@ int main(int argc, char *argv[])
w = newWindow("Main Window", 320, 240, 1); w = newWindow("Main Window", 320, 240, 1);
uiWindowOnClosing(w, onClosing, NULL); uiWindowOnClosing(w, onClosing, NULL);
uiLog("[test program] main window %p\n", w); printf("main window %p\n", w);
uiOnShouldQuit(onShouldQuit, w); uiOnShouldQuit(onShouldQuit, w);
@ -103,8 +103,8 @@ int main(int argc, char *argv[])
uiControlShow(uiControl(w)); uiControlShow(uiControl(w));
uiMain(); uiMain();
uiLog("[test program] after uiMain()\n"); printf("after uiMain()\n");
uiUninit(); uiUninit();
uiLog("[test program] after uiUninit()\n"); printf("after uiUninit()\n");
return 0; return 0;
} }

View File

@ -27,7 +27,7 @@ TEXT(Group, uiGroup, uiGroupTitle, uiGroupSetTitle)
static void onChanged(uiEntry *e, void *data) static void onChanged(uiEntry *e, void *data)
{ {
uiLog("[test program] onChanged()\n"); printf("onChanged()\n");
} }
static void toggleSpaced(uiCheckbox *c, void *data) static void toggleSpaced(uiCheckbox *c, void *data)

View File

@ -9,7 +9,7 @@ static uiProgressBar *pbar;
static void on ## what ## Changed(ui ## what *this, void *data) \ static void on ## what ## Changed(ui ## what *this, void *data) \
{ \ { \
uintmax_t value; \ uintmax_t value; \
uiLog("[test program] on %s changed\n", #what); \ printf("on %s changed\n", #what); \
value = ui ## what ## Value(this); \ value = ui ## what ## Value(this); \
uiSpinboxSetValue(spinbox, value); \ uiSpinboxSetValue(spinbox, value); \
uiSliderSetValue(slider, value); \ uiSliderSetValue(slider, value); \

View File

@ -28,9 +28,6 @@ func OnShouldQuit(f *func(data *void) int, data *void);
func FreeText(text *char); func FreeText(text *char);
// TODO add ... to IDL
raw "_UI_EXTERN void uiLog(const char *format, ...);";
func RegisterType(name *const char, parent uintmax_t, size size_t) uintmax_t; func RegisterType(name *const char, parent uintmax_t, size size_t) uintmax_t;
func IsA(p *void, type uintmax_t, fail int) *void; func IsA(p *void, type uintmax_t, fail int) *void;
struct Typed { struct Typed {

View File

@ -34,21 +34,6 @@ int windowClassOf(HWND hwnd, ...)
return -1; return -1;
} }
// TODO refine this
void uiLog(const char *fmt, ...)
{
va_list ap;
char buf[2048];
va_start(ap, fmt);
vsnprintf(buf, 2044, fmt, ap);
va_end(ap);
// unfortunately we need to make sure this is callable even before uiInit() executes or after uiUninit() has executed
// that means we can't use toUTF16(), because that requires our private heap
// sadly that means we're stuck with OutputDebugStringA() without some serious refinement
OutputDebugStringA(buf);
}
void complain(const char *fmt, ...) void complain(const char *fmt, ...)
{ {
va_list ap; va_list ap;