-/* $Id: macevlog.c,v 1.4 2003/02/23 12:41:44 ben Exp $ */
+/* $Id: macevlog.c,v 1.8 2003/05/04 14:18:18 simon Exp $ */
/*
* Copyright (c) 2003 Ben Harris
* All rights reserved.
static void mac_activateeventlog(WindowPtr, EventRecord *);
static void mac_groweventlog(WindowPtr, EventRecord *);
static void mac_updateeventlog(WindowPtr);
+static void mac_closeeventlog(WindowPtr);
static void mac_createeventlog(Session *s)
{
WinInfo *wi;
s->eventlog_window = GetNewWindow(wEventLog, NULL, (WindowPtr)-1);
- wi = smalloc(sizeof(*wi));
+ wi = snew(WinInfo);
memset(wi, 0, sizeof(*wi));
wi->s = s;
wi->wtype = wEventLog;
wi->activate = &mac_activateeventlog;
wi->grow = &mac_groweventlog;
wi->update = &mac_updateeventlog;
+ wi->close = &mac_closeeventlog;
SetWRefCon(s->eventlog_window, (long)wi);
GetPort(&saveport);
SetPort((GrafPtr)GetWindowPort(s->eventlog_window));
#else
(*s->eventlog)->selFlags = lExtendDrag | lNoDisjoint | lNoExtend;
#endif
- ShowWindow(s->eventlog_window);
}
void mac_freeeventlog(Session *s)
}
}
-/*
- * FIXME: logevent() should be passed a frontend handle, but backends have to
- * have a terminal handle instead, because they pass it to from_backend(),
- * so we accept a terminal handle here as well, and hope no-one tries to call
- * us with sensible arguments.
- */
-void logevent(void *frontend, char *str)
+void logevent(void *frontend, const char *str)
{
- Terminal *term = frontend;
- Session *s = term->frontend;
+ Session *s = frontend;
ListBounds bounds, visible;
Cell cell = { 0, 0 };
EndUpdate(window);
}
+static void mac_closeeventlog(WindowPtr window)
+{
+
+ HideWindow(window);
+}
+
void mac_showeventlog(Session *s)
{
+ SelectWindow(s->eventlog_window);
ShowWindow(s->eventlog_window);
}