~mdw
/
sgt
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Can now save and load settings under Unix.
[sgt/putty]
/
mac
/
macevlog.c
diff --git
a/mac/macevlog.c
b/mac/macevlog.c
index
bd7e855
..
60283ed
100644
(file)
--- a/
mac/macevlog.c
+++ b/
mac/macevlog.c
@@
-1,4
+1,4
@@
-/* $Id: macevlog.c,v 1.
3 2003/02/19 01:03:47
ben Exp $ */
+/* $Id: macevlog.c,v 1.
6 2003/03/29 23:07:55
ben Exp $ */
/*
* Copyright (c) 2003 Ben Harris
* All rights reserved.
/*
* Copyright (c) 2003 Ben Harris
* All rights reserved.
@@
-46,6
+46,7
@@
static void mac_clickeventlog(WindowPtr, EventRecord *);
static void mac_activateeventlog(WindowPtr, EventRecord *);
static void mac_groweventlog(WindowPtr, EventRecord *);
static void mac_updateeventlog(WindowPtr);
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)
{
static void mac_createeventlog(Session *s)
{
@@
-57,7
+58,7
@@
static void mac_createeventlog(Session *s)
WinInfo *wi;
s->eventlog_window = GetNewWindow(wEventLog, NULL, (WindowPtr)-1);
WinInfo *wi;
s->eventlog_window = GetNewWindow(wEventLog, NULL, (WindowPtr)-1);
- wi = s
malloc(sizeof(*wi)
);
+ wi = s
new(WinInfo
);
memset(wi, 0, sizeof(*wi));
wi->s = s;
wi->wtype = wEventLog;
memset(wi, 0, sizeof(*wi));
wi->s = s;
wi->wtype = wEventLog;
@@
-65,6
+66,7
@@
static void mac_createeventlog(Session *s)
wi->activate = &mac_activateeventlog;
wi->grow = &mac_groweventlog;
wi->update = &mac_updateeventlog;
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));
SetWRefCon(s->eventlog_window, (long)wi);
GetPort(&saveport);
SetPort((GrafPtr)GetWindowPort(s->eventlog_window));
@@
-86,7
+88,6
@@
static void mac_createeventlog(Session *s)
#else
(*s->eventlog)->selFlags = lExtendDrag | lNoDisjoint | lNoExtend;
#endif
#else
(*s->eventlog)->selFlags = lExtendDrag | lNoDisjoint | lNoExtend;
#endif
- ShowWindow(s->eventlog_window);
}
void mac_freeeventlog(Session *s)
}
void mac_freeeventlog(Session *s)
@@
-110,7
+111,7
@@
void logevent(void *frontend, char *str)
{
Terminal *term = frontend;
Session *s = term->frontend;
{
Terminal *term = frontend;
Session *s = term->frontend;
- ListBounds bounds;
+ ListBounds bounds
, visible
;
Cell cell = { 0, 0 };
if (s->eventlog == NULL)
Cell cell = { 0, 0 };
if (s->eventlog == NULL)
@@
-120,12
+121,18
@@
void logevent(void *frontend, char *str)
#if TARGET_API_MAC_CARBON
GetListDataBounds(s->eventlog, &bounds);
#if TARGET_API_MAC_CARBON
GetListDataBounds(s->eventlog, &bounds);
+ GetListVisibleCells(s->eventlog, &visible);
#else
bounds = (*s->eventlog)->dataBounds;
#else
bounds = (*s->eventlog)->dataBounds;
+ visible = (*s->eventlog)->visible;
#endif
#endif
+
cell.v = bounds.bottom;
LAddRow(1, cell.v, s->eventlog);
LSetCell(str, strlen(str), cell, s->eventlog);
cell.v = bounds.bottom;
LAddRow(1, cell.v, s->eventlog);
LSetCell(str, strlen(str), cell, s->eventlog);
+ /* ">=" and "2" because there can be a blank cell below the last one. */
+ if (visible.bottom >= bounds.bottom)
+ LScroll(0, 2, s->eventlog);
}
static void mac_draweventloggrowicon(Session *s)
}
static void mac_draweventloggrowicon(Session *s)
@@
-246,9
+253,16
@@
static void mac_updateeventlog(WindowPtr window)
EndUpdate(window);
}
EndUpdate(window);
}
+static void mac_closeeventlog(WindowPtr window)
+{
+
+ HideWindow(window);
+}
+
void mac_showeventlog(Session *s)
{
void mac_showeventlog(Session *s)
{
+ SelectWindow(s->eventlog_window);
ShowWindow(s->eventlog_window);
}
ShowWindow(s->eventlog_window);
}