1994-04-27 02:55:59 +02:00
|
|
|
/* Top level support for Mac interface to GDB, the GNU debugger.
|
|
|
|
Copyright 1994 Free Software Foundation, Inc.
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
Contributed by Cygnus Support. Written by Stan Shebs.
|
1994-04-27 02:55:59 +02:00
|
|
|
|
|
|
|
This file is part of GDB.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|
|
|
|
|
|
|
#include "defs.h"
|
|
|
|
|
Changes for MacGDB:
Thu May 12 17:04:58 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (INCLUDE_CFLAGS): Add readline source dir.
(READLINE_CFLAGS, READLINE_SRC, READLINE_DIR): Uncomment.
(TSOBS): Don't compile inflow.c.
(all, install): Add MacGDB.
* main.c (main): Do Mac-specific init and command loop if a
standalone app, skip full option help message if compiling
with MPW C.
(gdb_readline): If MPW, add a newline after the (gdb) prompt.
* utils.c (_initialize_utils): If MPW, don't try to use termcap to
compute the window size.
* config/m68k/xm-mpw.h (printf, fprintf, fputs, fputc, putc,
fflush): Define as macros that expand into hacked_... versions.
(StandAlone, mac_app): Declare.
* macgdb.r (SIZE): Set the default partition to 4000K.
* mac-xdep.c (readline.h, history.h): Include.
(terminal.h): Don't include.
(mac_app): Define.
(gdb_has_a_terminal): Define Mac-specific version.
(do_keyboard_command): Simplify search for command string.
(readline): Define as gdb_readline.
Add other history/readline stubs to make main gdb link.
(hacked_fprintf, hacked_printf, hacked_vfprintf, hacked_fputs,
hacked_fputc, hacked_fflush): New functions, intercept output to
stdout and stderr, send to console window.
1994-05-13 02:31:31 +02:00
|
|
|
#include "readline.h"
|
|
|
|
#include "history.h"
|
|
|
|
|
1994-04-27 02:55:59 +02:00
|
|
|
#include <Values.h>
|
|
|
|
#include <Types.h>
|
|
|
|
#include <Resources.h>
|
|
|
|
#include <QuickDraw.h>
|
|
|
|
#include <Fonts.h>
|
|
|
|
#include <Events.h>
|
|
|
|
#include <Windows.h>
|
|
|
|
#include <Menus.h>
|
|
|
|
#include <TextEdit.h>
|
|
|
|
#include <Dialogs.h>
|
|
|
|
#include <Desk.h>
|
|
|
|
#include <ToolUtils.h>
|
|
|
|
#include <Memory.h>
|
|
|
|
#include <SegLoad.h>
|
|
|
|
#include <Files.h>
|
|
|
|
#include <Folders.h>
|
|
|
|
#include <OSUtils.h>
|
|
|
|
#include <OSEvents.h>
|
|
|
|
#include <DiskInit.h>
|
|
|
|
#include <Packages.h>
|
|
|
|
#include <Traps.h>
|
|
|
|
#include <Lists.h>
|
|
|
|
#include <GestaltEqu.h>
|
|
|
|
#include <PPCToolbox.h>
|
|
|
|
#include <AppleEvents.h>
|
|
|
|
#include <StandardFile.h>
|
|
|
|
#include <Sound.h>
|
|
|
|
|
|
|
|
#ifdef MPW
|
|
|
|
#define QD(whatever) (qd.##whatever)
|
|
|
|
#define QDPat(whatever) (&(qd.##whatever))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef THINK_C
|
|
|
|
#define QD(whatever) (whatever)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define p2c(pstr,cbuf) \
|
|
|
|
strncpy(cbuf, ((char *) (pstr) + 1), pstr[0]); \
|
|
|
|
cbuf[pstr[0]] = '\0';
|
|
|
|
|
|
|
|
#define pascalify(STR) \
|
|
|
|
sprintf(tmpbuf, " %s", STR); \
|
|
|
|
tmpbuf[0] = strlen(STR);
|
|
|
|
|
|
|
|
#include "gdbcmd.h"
|
|
|
|
#include "call-cmds.h"
|
|
|
|
#include "symtab.h"
|
|
|
|
#include "inferior.h"
|
|
|
|
#include "signals.h"
|
|
|
|
#include "target.h"
|
|
|
|
#include "breakpoint.h"
|
|
|
|
#include "gdbtypes.h"
|
|
|
|
#include "expression.h"
|
|
|
|
#include "language.h"
|
|
|
|
|
|
|
|
#include "mac-defs.h"
|
|
|
|
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
/* This is true if we are running as a standalone application. */
|
|
|
|
|
Changes for MacGDB:
Thu May 12 17:04:58 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (INCLUDE_CFLAGS): Add readline source dir.
(READLINE_CFLAGS, READLINE_SRC, READLINE_DIR): Uncomment.
(TSOBS): Don't compile inflow.c.
(all, install): Add MacGDB.
* main.c (main): Do Mac-specific init and command loop if a
standalone app, skip full option help message if compiling
with MPW C.
(gdb_readline): If MPW, add a newline after the (gdb) prompt.
* utils.c (_initialize_utils): If MPW, don't try to use termcap to
compute the window size.
* config/m68k/xm-mpw.h (printf, fprintf, fputs, fputc, putc,
fflush): Define as macros that expand into hacked_... versions.
(StandAlone, mac_app): Declare.
* macgdb.r (SIZE): Set the default partition to 4000K.
* mac-xdep.c (readline.h, history.h): Include.
(terminal.h): Don't include.
(mac_app): Define.
(gdb_has_a_terminal): Define Mac-specific version.
(do_keyboard_command): Simplify search for command string.
(readline): Define as gdb_readline.
Add other history/readline stubs to make main gdb link.
(hacked_fprintf, hacked_printf, hacked_vfprintf, hacked_fputs,
hacked_fputc, hacked_fflush): New functions, intercept output to
stdout and stderr, send to console window.
1994-05-13 02:31:31 +02:00
|
|
|
int mac_app;
|
|
|
|
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
/* This is true if we are using WaitNextEvent. */
|
|
|
|
|
|
|
|
int use_wne;
|
|
|
|
|
|
|
|
/* This is true if we have Color Quickdraw. */
|
|
|
|
|
|
|
|
int has_color_qd;
|
1994-04-27 02:55:59 +02:00
|
|
|
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
/* This is true if we are using Color Quickdraw. */
|
|
|
|
|
|
|
|
int use_color_qd;
|
1994-04-27 02:55:59 +02:00
|
|
|
|
|
|
|
int inbackground;
|
|
|
|
|
|
|
|
Rect dragrect = { -32000, -32000, 32000, 32000 };
|
|
|
|
Rect sizerect;
|
|
|
|
|
|
|
|
int sbarwid = 15;
|
|
|
|
|
|
|
|
/* Globals for the console window. */
|
|
|
|
|
|
|
|
WindowPtr console_window;
|
|
|
|
|
|
|
|
ControlHandle console_v_scrollbar;
|
|
|
|
|
|
|
|
Rect console_v_scroll_rect;
|
|
|
|
|
|
|
|
TEHandle console_text;
|
|
|
|
|
|
|
|
Rect console_text_rect;
|
|
|
|
|
Changes for MacGDB:
Thu May 12 17:04:58 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (INCLUDE_CFLAGS): Add readline source dir.
(READLINE_CFLAGS, READLINE_SRC, READLINE_DIR): Uncomment.
(TSOBS): Don't compile inflow.c.
(all, install): Add MacGDB.
* main.c (main): Do Mac-specific init and command loop if a
standalone app, skip full option help message if compiling
with MPW C.
(gdb_readline): If MPW, add a newline after the (gdb) prompt.
* utils.c (_initialize_utils): If MPW, don't try to use termcap to
compute the window size.
* config/m68k/xm-mpw.h (printf, fprintf, fputs, fputc, putc,
fflush): Define as macros that expand into hacked_... versions.
(StandAlone, mac_app): Declare.
* macgdb.r (SIZE): Set the default partition to 4000K.
* mac-xdep.c (readline.h, history.h): Include.
(terminal.h): Don't include.
(mac_app): Define.
(gdb_has_a_terminal): Define Mac-specific version.
(do_keyboard_command): Simplify search for command string.
(readline): Define as gdb_readline.
Add other history/readline stubs to make main gdb link.
(hacked_fprintf, hacked_printf, hacked_vfprintf, hacked_fputs,
hacked_fputc, hacked_fflush): New functions, intercept output to
stdout and stderr, send to console window.
1994-05-13 02:31:31 +02:00
|
|
|
/* This will go away eventually. */
|
|
|
|
gdb_has_a_terminal () { return 1; }
|
|
|
|
|
1994-04-27 02:55:59 +02:00
|
|
|
mac_init ()
|
|
|
|
{
|
|
|
|
SysEnvRec se;
|
|
|
|
int eventloopdone = 0;
|
|
|
|
Boolean gotevent;
|
|
|
|
Point mouse;
|
|
|
|
EventRecord event;
|
|
|
|
WindowPtr win;
|
|
|
|
RgnHandle cursorRgn;
|
|
|
|
int i;
|
|
|
|
Handle menubar;
|
|
|
|
MenuHandle menu;
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
Handle siow_resource;
|
|
|
|
|
|
|
|
mac_app = 0;
|
|
|
|
|
|
|
|
/* Don't do anything if we`re running under MPW. */
|
|
|
|
if (!StandAlone)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* Don't do anything if we're using SIOW. */
|
|
|
|
/* This test requires that the siow 0 resource, as defined in
|
|
|
|
{RIncludes}siow.r, not be messed with. If it is, then the
|
|
|
|
standard Mac setup below will step on SIOW's Mac setup and
|
|
|
|
most likely crash the machine. */
|
|
|
|
siow_resource = GetResource('siow', 0);
|
|
|
|
if (siow_resource != nil)
|
|
|
|
return;
|
|
|
|
|
|
|
|
mac_app = 1;
|
1994-04-27 02:55:59 +02:00
|
|
|
|
|
|
|
/* Do the standard Mac environment setup. */
|
|
|
|
InitGraf (&QD (thePort));
|
|
|
|
InitFonts ();
|
|
|
|
FlushEvents (everyEvent, 0);
|
|
|
|
InitWindows ();
|
|
|
|
InitMenus ();
|
|
|
|
TEInit ();
|
|
|
|
InitDialogs (NULL);
|
|
|
|
InitCursor ();
|
|
|
|
|
|
|
|
/* Color Quickdraw is different from Classic QD. */
|
|
|
|
SysEnvirons(2, &se);
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
has_color_qd = se.hasColorQD;
|
|
|
|
/* Use it if we got it. */
|
|
|
|
use_color_qd = has_color_qd;
|
1994-04-27 02:55:59 +02:00
|
|
|
|
|
|
|
sizerect.top = 50;
|
|
|
|
sizerect.left = 50;
|
|
|
|
sizerect.bottom = 1000;
|
|
|
|
sizerect.right = 1000;
|
|
|
|
#if 0
|
|
|
|
sizerect.bottom = screenBits.bounds.bottom - screenBits.bounds.top;
|
|
|
|
sizerect.right = screenBits.bounds.right - screenBits.bounds.left;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Set up the menus. */
|
|
|
|
menubar = GetNewMBar (mbMain);
|
|
|
|
SetMenuBar (menubar);
|
|
|
|
/* Add the DAs etc as usual. */
|
|
|
|
menu = GetMHandle (mApple);
|
|
|
|
if (menu != nil) {
|
|
|
|
AddResMenu (menu, 'DRVR');
|
|
|
|
}
|
|
|
|
DrawMenuBar ();
|
|
|
|
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
new_console_window ();
|
|
|
|
}
|
|
|
|
|
|
|
|
new_console_window ()
|
|
|
|
{
|
1994-04-27 02:55:59 +02:00
|
|
|
/* Create the main window we're going to play in. */
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
if (has_color_qd)
|
1994-04-27 02:55:59 +02:00
|
|
|
console_window = GetNewCWindow (wConsole, NULL, (WindowPtr) -1L);
|
|
|
|
else
|
|
|
|
console_window = GetNewWindow (wConsole, NULL, (WindowPtr) -1L);
|
|
|
|
|
|
|
|
SetPort (console_window);
|
|
|
|
console_text_rect = console_window->portRect;
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
/* Leave 8 pixels of blank space, for aesthetic reasons and to
|
|
|
|
make it easier to select from the beginning of a line. */
|
|
|
|
console_text_rect.left += 8;
|
1994-04-27 02:55:59 +02:00
|
|
|
console_text_rect.bottom -= sbarwid - 1;
|
|
|
|
console_text_rect.right -= sbarwid - 1;
|
|
|
|
console_text = TENew (&console_text_rect, &console_text_rect);
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
TESetSelect (0, 40000, console_text);
|
1994-04-27 02:55:59 +02:00
|
|
|
TEDelete (console_text);
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
TEAutoView (1, console_text);
|
1994-04-27 02:55:59 +02:00
|
|
|
|
|
|
|
console_v_scroll_rect = console_window->portRect;
|
|
|
|
console_v_scroll_rect.bottom -= sbarwid - 1;
|
|
|
|
console_v_scroll_rect.left = console_v_scroll_rect.right - sbarwid;
|
|
|
|
console_v_scrollbar =
|
|
|
|
NewControl (console_window, &console_v_scroll_rect,
|
|
|
|
"\p", 1, 0, 0, 0, scrollBarProc, 0L);
|
|
|
|
|
|
|
|
ShowWindow (console_window);
|
|
|
|
SelectWindow (console_window);
|
|
|
|
}
|
|
|
|
|
|
|
|
mac_command_loop()
|
|
|
|
{
|
|
|
|
SysEnvRec se;
|
|
|
|
int eventloopdone = 0;
|
|
|
|
Boolean gotevent;
|
|
|
|
Point mouse;
|
|
|
|
EventRecord event;
|
|
|
|
WindowPtr win;
|
|
|
|
RgnHandle cursorRgn;
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
int i, tm;
|
1994-04-27 02:55:59 +02:00
|
|
|
Handle menubar;
|
|
|
|
MenuHandle menu;
|
|
|
|
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
/* Figure out if the WaitNextEvent Trap is available. */
|
|
|
|
use_wne =
|
1994-04-27 02:55:59 +02:00
|
|
|
(NGetTrapAddress (0x60, ToolTrap) != NGetTrapAddress (0x9f, ToolTrap));
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
/* Pass WaitNextEvent an empty region the first time through. */
|
1994-04-27 02:55:59 +02:00
|
|
|
cursorRgn = NewRgn ();
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
/* Go into the main event-handling loop. */
|
1994-04-27 02:55:59 +02:00
|
|
|
while (!eventloopdone)
|
|
|
|
{
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
/* Use WaitNextEvent if it is available, otherwise GetNextEvent. */
|
|
|
|
if (use_wne)
|
1994-04-27 02:55:59 +02:00
|
|
|
{
|
|
|
|
get_global_mouse (&mouse);
|
|
|
|
adjust_cursor (mouse, cursorRgn);
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
tm = GetCaretTime();
|
|
|
|
gotevent = WaitNextEvent (everyEvent, &event, tm, cursorRgn);
|
1994-04-27 02:55:59 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SystemTask ();
|
|
|
|
gotevent = GetNextEvent (everyEvent, &event);
|
|
|
|
}
|
|
|
|
/* First decide if the event is for a dialog or is just any old event. */
|
|
|
|
if (FrontWindow () != nil && IsDialogEvent (&event))
|
|
|
|
{
|
|
|
|
short itemhit;
|
|
|
|
DialogPtr dialog;
|
|
|
|
|
|
|
|
/* Handle all the modeless dialogs here. */
|
|
|
|
if (DialogSelect (&event, &dialog, &itemhit))
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (gotevent)
|
|
|
|
{
|
|
|
|
/* Make sure we have the right cursor before handling the event. */
|
|
|
|
adjust_cursor (event.where, cursorRgn);
|
|
|
|
do_event (&event);
|
|
|
|
}
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
do_idle ();
|
|
|
|
}
|
1994-04-27 02:55:59 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
/* Collect the global coordinates of the mouse pointer. */
|
|
|
|
|
1994-04-27 02:55:59 +02:00
|
|
|
get_global_mouse (mouse)
|
|
|
|
Point *mouse;
|
|
|
|
{
|
|
|
|
EventRecord evt;
|
|
|
|
|
|
|
|
OSEventAvail (0, &evt);
|
|
|
|
*mouse = evt.where;
|
|
|
|
}
|
|
|
|
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
/* Change the cursor's appearance to be appropriate for the given mouse
|
|
|
|
location. */
|
|
|
|
|
1994-04-27 02:55:59 +02:00
|
|
|
adjust_cursor (mouse, region)
|
|
|
|
Point mouse;
|
|
|
|
RgnHandle region;
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
/* Decipher an event, maybe do something with it. */
|
1994-04-27 02:55:59 +02:00
|
|
|
|
|
|
|
do_event (evt)
|
|
|
|
EventRecord *evt;
|
|
|
|
{
|
|
|
|
short part, err, rslt = 0;
|
|
|
|
WindowPtr win;
|
|
|
|
Boolean hit;
|
|
|
|
char key;
|
|
|
|
Point pnt;
|
|
|
|
|
|
|
|
switch (evt->what)
|
|
|
|
{
|
|
|
|
case mouseDown:
|
|
|
|
/* See if the click happened in a special part of the screen. */
|
|
|
|
part = FindWindow (evt->where, &win);
|
|
|
|
switch (part)
|
|
|
|
{
|
|
|
|
case inMenuBar:
|
|
|
|
adjust_menus ();
|
|
|
|
do_menu_command (MenuSelect (evt->where));
|
|
|
|
break;
|
|
|
|
case inSysWindow:
|
|
|
|
SystemClick (evt, win);
|
|
|
|
break;
|
|
|
|
case inContent:
|
|
|
|
if (win != FrontWindow ())
|
|
|
|
{
|
|
|
|
/* Bring the clicked-on window to the front. */
|
|
|
|
SelectWindow (win);
|
|
|
|
/* Fix the menu to match the new front window. */
|
|
|
|
adjust_menus ();
|
|
|
|
/* We always want to discard the event now, since clicks in a
|
|
|
|
windows are often irreversible actions. */
|
|
|
|
} else
|
|
|
|
/* Mouse clicks in the front window do something useful. */
|
|
|
|
do_mouse_down (win, evt);
|
|
|
|
break;
|
|
|
|
case inDrag:
|
|
|
|
/* Standard drag behavior, no tricks necessary. */
|
|
|
|
DragWindow (win, evt->where, &dragrect);
|
|
|
|
break;
|
|
|
|
case inGrow:
|
|
|
|
grow_window (win, evt->where);
|
|
|
|
break;
|
|
|
|
case inZoomIn:
|
|
|
|
case inZoomOut:
|
|
|
|
zoom_window (win, evt->where, part);
|
|
|
|
break;
|
|
|
|
case inGoAway:
|
|
|
|
close_window (win);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case keyDown:
|
|
|
|
case autoKey:
|
|
|
|
key = evt->message & charCodeMask;
|
|
|
|
/* Check for menukey equivalents. */
|
|
|
|
if (evt->modifiers & cmdKey)
|
|
|
|
{
|
|
|
|
if (evt->what == keyDown)
|
|
|
|
{
|
|
|
|
adjust_menus ();
|
|
|
|
do_menu_command (MenuKey (key));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (evt->what == keyDown)
|
|
|
|
{
|
|
|
|
/* Random keypress, interpret it. */
|
|
|
|
do_keyboard_command (key);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case activateEvt:
|
|
|
|
activate_window ((WindowPtr) evt->message, evt->modifiers & activeFlag);
|
|
|
|
break;
|
|
|
|
case updateEvt:
|
|
|
|
update_window ((WindowPtr) evt->message);
|
|
|
|
break;
|
|
|
|
case diskEvt:
|
|
|
|
/* Call DIBadMount in response to a diskEvt, so that the user can format
|
|
|
|
a floppy. (from DTS Sample) */
|
|
|
|
if (HiWord (evt->message) != noErr)
|
|
|
|
{
|
|
|
|
SetPt (&pnt, 50, 50);
|
|
|
|
err = DIBadMount (pnt, evt->message);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case app4Evt:
|
|
|
|
/* Grab only a single byte. */
|
|
|
|
switch ((evt->message >> 24) & 0xFF)
|
|
|
|
{
|
|
|
|
case 0xfa:
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
inbackground = !(evt->message & 1);
|
|
|
|
activate_window (FrontWindow (), !inbackground);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case kHighLevelEvent:
|
|
|
|
AEProcessAppleEvent (evt);
|
|
|
|
break;
|
|
|
|
case nullEvent:
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
do_idle ();
|
1994-04-27 02:55:59 +02:00
|
|
|
rslt = 1;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return rslt;
|
|
|
|
}
|
|
|
|
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
/* Do any idle-time activities. */
|
|
|
|
|
|
|
|
do_idle ()
|
|
|
|
{
|
|
|
|
TEIdle (console_text);
|
|
|
|
}
|
|
|
|
|
1994-04-27 02:55:59 +02:00
|
|
|
grow_window (win, where)
|
|
|
|
WindowPtr win;
|
|
|
|
Point where;
|
|
|
|
{
|
|
|
|
long winsize;
|
|
|
|
int h, v;
|
|
|
|
GrafPtr oldport;
|
|
|
|
|
|
|
|
winsize = GrowWindow (win, where, &sizerect);
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
/* Only do anything if it actually changed size. */
|
1994-04-27 02:55:59 +02:00
|
|
|
if (winsize != 0)
|
|
|
|
{
|
|
|
|
GetPort (&oldport);
|
|
|
|
SetPort (win);
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
if (win == console_window)
|
|
|
|
{
|
|
|
|
EraseRect (&win->portRect);
|
|
|
|
h = LoWord (winsize);
|
|
|
|
v = HiWord (winsize);
|
|
|
|
SizeWindow (win, h, v, 1);
|
|
|
|
resize_console_window ();
|
|
|
|
}
|
1994-04-27 02:55:59 +02:00
|
|
|
SetPort (oldport);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
zoom_window (win, where, part)
|
|
|
|
WindowPtr win;
|
|
|
|
Point where;
|
|
|
|
short part;
|
|
|
|
{
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
ZoomWindow (win, part, (win == FrontWindow ()));
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
if (win == console_window)
|
|
|
|
{
|
|
|
|
resize_console_window ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resize_console_window ()
|
|
|
|
{
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
adjust_console_sizes ();
|
|
|
|
adjust_console_scrollbars ();
|
|
|
|
adjust_console_text ();
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
InvalRect (&console_window->portRect);
|
1994-04-27 02:55:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
close_window (win)
|
|
|
|
WindowPtr win;
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
pascal void
|
|
|
|
v_scroll_proc (ControlHandle control, short part)
|
1994-04-27 02:55:59 +02:00
|
|
|
{
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
int oldval, amount = 0, newval;
|
|
|
|
int pagesize = ((*console_text)->viewRect.bottom - (*console_text)->viewRect.top) / (*console_text)->lineHeight;
|
|
|
|
if (part)
|
|
|
|
{
|
|
|
|
oldval = GetCtlValue (control);
|
|
|
|
switch (part)
|
|
|
|
{
|
|
|
|
case inUpButton:
|
|
|
|
amount = 1;
|
|
|
|
break;
|
|
|
|
case inDownButton:
|
|
|
|
amount = -1;
|
|
|
|
break;
|
|
|
|
case inPageUp:
|
|
|
|
amount = pagesize;
|
|
|
|
break;
|
|
|
|
case inPageDown:
|
|
|
|
amount = - pagesize;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
/* (should freak out) */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
SetCtlValue(control, oldval - amount);
|
|
|
|
newval = GetCtlValue (control);
|
|
|
|
amount = oldval - newval;
|
|
|
|
if (amount)
|
|
|
|
TEScroll (0, amount * (*console_text)->lineHeight, console_text);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
do_mouse_down (WindowPtr win, EventRecord *event)
|
|
|
|
{
|
|
|
|
short part, value;
|
1994-04-27 02:55:59 +02:00
|
|
|
Point mouse;
|
|
|
|
ControlHandle control;
|
|
|
|
|
|
|
|
if (1 /*is_app_window(win)*/)
|
|
|
|
{
|
|
|
|
SetPort (win);
|
|
|
|
mouse = event->where;
|
|
|
|
GlobalToLocal (&mouse);
|
|
|
|
part = FindControl(mouse, win, &control);
|
|
|
|
if (control == console_v_scrollbar)
|
|
|
|
{
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
switch (part)
|
|
|
|
{
|
|
|
|
case inThumb:
|
|
|
|
value = GetCtlValue (control);
|
|
|
|
part = TrackControl (control, mouse, nil);
|
|
|
|
if (part)
|
|
|
|
{
|
|
|
|
value -= GetCtlValue (control);
|
|
|
|
if (value)
|
|
|
|
TEScroll(0, value * (*console_text)->lineHeight,
|
|
|
|
console_text);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
value = TrackControl (control, mouse, (ProcPtr) v_scroll_proc);
|
|
|
|
break;
|
|
|
|
}
|
1994-04-27 02:55:59 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
TEClick (mouse, 0, console_text);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
scroll_text (hlines, vlines)
|
|
|
|
int hlines, vlines;
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
1994-04-27 02:55:59 +02:00
|
|
|
activate_window (win, activate)
|
|
|
|
WindowPtr win;
|
|
|
|
int activate;
|
|
|
|
{
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
Rect grow_rect;
|
|
|
|
|
1994-04-27 02:55:59 +02:00
|
|
|
if (win == nil) return;
|
|
|
|
/* It's convenient to make the activated window also be the
|
|
|
|
current GrafPort. */
|
|
|
|
if (activate)
|
|
|
|
SetPort(win);
|
|
|
|
/* Activate the console window's scrollbar. */
|
|
|
|
if (win == console_window)
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
{
|
|
|
|
if (activate)
|
|
|
|
{
|
|
|
|
TEActivate (console_text);
|
|
|
|
/* Cause the grow icon to be redrawn at the next update. */
|
|
|
|
grow_rect = console_window->portRect;
|
|
|
|
grow_rect.top = grow_rect.bottom - sbarwid;
|
|
|
|
grow_rect.left = grow_rect.right - sbarwid;
|
|
|
|
InvalRect (&grow_rect);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
TEDeactivate (console_text);
|
|
|
|
DrawGrowIcon (console_window);
|
|
|
|
}
|
|
|
|
HiliteControl (console_v_scrollbar, (activate ? 0 : 255));
|
|
|
|
}
|
1994-04-27 02:55:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
update_window (win)
|
|
|
|
WindowPtr win;
|
|
|
|
{
|
|
|
|
int controls = 1, growbox = 0;
|
|
|
|
GrafPtr oldport;
|
|
|
|
|
|
|
|
/* Set the updating window to be the current grafport. */
|
|
|
|
GetPort (&oldport);
|
|
|
|
SetPort (win);
|
|
|
|
/* recalc_depths(); */
|
|
|
|
BeginUpdate (win);
|
|
|
|
if (win == console_window)
|
|
|
|
{
|
|
|
|
draw_console ();
|
|
|
|
controls = 1;
|
|
|
|
growbox = 1;
|
|
|
|
}
|
|
|
|
if (controls)
|
|
|
|
UpdateControls (win, win->visRgn);
|
|
|
|
if (growbox)
|
|
|
|
DrawGrowIcon (win);
|
|
|
|
EndUpdate (win);
|
|
|
|
SetPort (oldport);
|
|
|
|
}
|
|
|
|
|
|
|
|
adjust_menus ()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
do_menu_command (which)
|
|
|
|
long which;
|
|
|
|
{
|
|
|
|
short menuid, menuitem;
|
|
|
|
short itemHit;
|
|
|
|
Str255 daname;
|
|
|
|
short daRefNum;
|
|
|
|
Boolean handledbyda;
|
|
|
|
WindowPtr win;
|
|
|
|
short ditem;
|
|
|
|
int i;
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
char cmdbuf[300];
|
1994-04-27 02:55:59 +02:00
|
|
|
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
cmdbuf[0] = '\0';
|
1994-04-27 02:55:59 +02:00
|
|
|
menuid = HiWord (which);
|
|
|
|
menuitem = LoWord (which);
|
|
|
|
switch (menuid)
|
|
|
|
{
|
|
|
|
case mApple:
|
|
|
|
switch (menuitem)
|
|
|
|
{
|
|
|
|
case miAbout:
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
Alert (128, nil);
|
|
|
|
break;
|
|
|
|
#if 0
|
|
|
|
case miHelp:
|
|
|
|
/* (should pop up help info) */
|
1994-04-27 02:55:59 +02:00
|
|
|
break;
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
#endif
|
1994-04-27 02:55:59 +02:00
|
|
|
default:
|
|
|
|
GetItem (GetMHandle (mApple), menuitem, daname);
|
|
|
|
daRefNum = OpenDeskAcc (daname);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case mFile:
|
|
|
|
switch (menuitem)
|
|
|
|
{
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
case miFileNew:
|
|
|
|
if (console_window == FrontWindow ())
|
|
|
|
{
|
|
|
|
close_window (console_window);
|
|
|
|
}
|
|
|
|
new_console_window ();
|
|
|
|
break;
|
|
|
|
case miFileOpen:
|
|
|
|
SysBeep (20);
|
|
|
|
break;
|
1994-04-27 02:55:59 +02:00
|
|
|
case miFileQuit:
|
|
|
|
ExitToShell ();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case mEdit:
|
|
|
|
/* handledbyda = SystemEdit(menuitem-1); */
|
|
|
|
switch (menuitem)
|
|
|
|
{
|
|
|
|
case miEditCut:
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
TECut (console_text);
|
1994-04-27 02:55:59 +02:00
|
|
|
break;
|
|
|
|
case miEditCopy:
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
TECopy (console_text);
|
1994-04-27 02:55:59 +02:00
|
|
|
break;
|
|
|
|
case miEditPaste:
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
TEPaste (console_text);
|
1994-04-27 02:55:59 +02:00
|
|
|
break;
|
|
|
|
case miEditClear:
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
TEDelete (console_text);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
/* All of these operations need the same postprocessing. */
|
|
|
|
adjust_console_sizes ();
|
|
|
|
adjust_console_scrollbars ();
|
|
|
|
adjust_console_text ();
|
|
|
|
break;
|
|
|
|
case mDebug:
|
|
|
|
switch (menuitem)
|
|
|
|
{
|
|
|
|
case miDebugTarget:
|
|
|
|
sprintf (cmdbuf, "target %s", "remote");
|
|
|
|
break;
|
|
|
|
case miDebugRun:
|
|
|
|
sprintf (cmdbuf, "run");
|
|
|
|
break;
|
|
|
|
case miDebugContinue:
|
|
|
|
sprintf (cmdbuf, "continue");
|
|
|
|
break;
|
|
|
|
case miDebugStep:
|
|
|
|
sprintf (cmdbuf, "step");
|
|
|
|
break;
|
|
|
|
case miDebugNext:
|
|
|
|
sprintf (cmdbuf, "next");
|
1994-04-27 02:55:59 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
HiliteMenu (0);
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
/* Execute a command if one had been given. Do here because a command
|
|
|
|
may longjmp before we get a chance to unhilite the menu. */
|
|
|
|
if (strlen (cmdbuf) > 0)
|
|
|
|
execute_command (cmdbuf, 0);
|
1994-04-27 02:55:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
char commandbuf[1000];
|
|
|
|
|
|
|
|
do_keyboard_command (key)
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
int key;
|
1994-04-27 02:55:59 +02:00
|
|
|
{
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
int startpos, endpos, i, len;
|
Changes for MacGDB:
Thu May 12 17:04:58 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (INCLUDE_CFLAGS): Add readline source dir.
(READLINE_CFLAGS, READLINE_SRC, READLINE_DIR): Uncomment.
(TSOBS): Don't compile inflow.c.
(all, install): Add MacGDB.
* main.c (main): Do Mac-specific init and command loop if a
standalone app, skip full option help message if compiling
with MPW C.
(gdb_readline): If MPW, add a newline after the (gdb) prompt.
* utils.c (_initialize_utils): If MPW, don't try to use termcap to
compute the window size.
* config/m68k/xm-mpw.h (printf, fprintf, fputs, fputc, putc,
fflush): Define as macros that expand into hacked_... versions.
(StandAlone, mac_app): Declare.
* macgdb.r (SIZE): Set the default partition to 4000K.
* mac-xdep.c (readline.h, history.h): Include.
(terminal.h): Don't include.
(mac_app): Define.
(gdb_has_a_terminal): Define Mac-specific version.
(do_keyboard_command): Simplify search for command string.
(readline): Define as gdb_readline.
Add other history/readline stubs to make main gdb link.
(hacked_fprintf, hacked_printf, hacked_vfprintf, hacked_fputs,
hacked_fputc, hacked_fflush): New functions, intercept output to
stdout and stderr, send to console window.
1994-05-13 02:31:31 +02:00
|
|
|
char *last_newline;
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
char buf[10], *text_str, *command, *cmd_start;
|
1994-04-27 02:55:59 +02:00
|
|
|
CharsHandle text;
|
|
|
|
|
|
|
|
if (key == '\015' || key == '\003')
|
|
|
|
{
|
|
|
|
text = TEGetText (console_text);
|
|
|
|
HLock ((Handle) text);
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
text_str = *text;
|
1994-04-27 02:55:59 +02:00
|
|
|
startpos = (*console_text)->selStart;
|
|
|
|
endpos = (*console_text)->selEnd;
|
|
|
|
if (startpos != endpos)
|
|
|
|
{
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
len = endpos - startpos;
|
|
|
|
cmd_start = text_str + startpos;
|
1994-04-27 02:55:59 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
for (i = startpos - 1; i >= 0; --i)
|
|
|
|
if (text_str[i] == '\015')
|
|
|
|
break;
|
|
|
|
last_newline = text_str + i;
|
|
|
|
len = (text_str + startpos) - 1 - last_newline;
|
|
|
|
cmd_start = last_newline + 1;
|
1994-04-27 02:55:59 +02:00
|
|
|
}
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
if (len > 1000) len = 999;
|
|
|
|
if (len < 0) len = 0;
|
|
|
|
strncpy (commandbuf + 1, cmd_start, len);
|
|
|
|
commandbuf[1 + len] = 0;
|
|
|
|
command = commandbuf + 1;
|
1994-04-27 02:55:59 +02:00
|
|
|
HUnlock ((Handle) text);
|
|
|
|
commandbuf[0] = strlen(command);
|
|
|
|
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
/* Insert a newline and recalculate before doing any command. */
|
|
|
|
key = '\015';
|
|
|
|
TEKey (key, console_text);
|
1994-04-27 02:55:59 +02:00
|
|
|
TEInsert (buf, 1, console_text);
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
adjust_console_sizes ();
|
|
|
|
adjust_console_scrollbars ();
|
|
|
|
adjust_console_text ();
|
1994-04-27 02:55:59 +02:00
|
|
|
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
if (strlen (command) > 0)
|
|
|
|
{
|
|
|
|
execute_command (command, 0);
|
|
|
|
bpstat_do_actions (&stop_bpstat);
|
|
|
|
}
|
1994-04-27 02:55:59 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
/* A self-inserting character. This includes delete. */
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
TEKey (key, console_text);
|
1994-04-27 02:55:59 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
/* Draw all graphical stuff in the console window. */
|
|
|
|
|
1994-04-27 02:55:59 +02:00
|
|
|
draw_console ()
|
|
|
|
{
|
|
|
|
SetPort (console_window);
|
|
|
|
TEUpdate (&(console_window->portRect), console_text);
|
|
|
|
}
|
|
|
|
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
/* Cause an update of a given window's entire contents. */
|
1994-04-27 02:55:59 +02:00
|
|
|
|
|
|
|
force_update (win)
|
|
|
|
WindowPtr win;
|
|
|
|
{
|
|
|
|
GrafPtr oldport;
|
|
|
|
|
|
|
|
if (win == nil) return;
|
|
|
|
GetPort (&oldport);
|
|
|
|
SetPort (win);
|
|
|
|
EraseRect (&win->portRect);
|
|
|
|
InvalRect (&win->portRect);
|
|
|
|
SetPort (oldport);
|
|
|
|
}
|
|
|
|
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
adjust_console_sizes ()
|
|
|
|
{
|
|
|
|
Rect tmprect;
|
|
|
|
|
|
|
|
tmprect = console_window->portRect;
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
/* Move and size the scrollbar. */
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
MoveControl (console_v_scrollbar, tmprect.right - sbarwid, 0);
|
|
|
|
SizeControl (console_v_scrollbar, sbarwid + 1, tmprect.bottom - sbarwid + 1);
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
/* Move and size the text. */
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
tmprect.left += 7;
|
|
|
|
tmprect.right -= sbarwid;
|
|
|
|
tmprect.bottom -= sbarwid;
|
|
|
|
InsetRect(&tmprect, 1, 1);
|
|
|
|
(*console_text)->destRect = tmprect;
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
/* Fiddle bottom of viewrect to be even multiple of text lines. */
|
|
|
|
tmprect.bottom = tmprect.top
|
|
|
|
+ ((tmprect.bottom - tmprect.top) / (*console_text)->lineHeight)
|
|
|
|
* (*console_text)->lineHeight;
|
|
|
|
(*console_text)->viewRect = tmprect;
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
}
|
|
|
|
|
1994-04-27 02:55:59 +02:00
|
|
|
adjust_console_scrollbars ()
|
|
|
|
{
|
|
|
|
int lines, newmax, value;
|
|
|
|
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
(*console_v_scrollbar)->contrlVis = 0;
|
1994-04-27 02:55:59 +02:00
|
|
|
lines = (*console_text)->nLines;
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
newmax = lines - (((*console_text)->viewRect.bottom
|
|
|
|
- (*console_text)->viewRect.top)
|
1994-04-27 02:55:59 +02:00
|
|
|
/ (*console_text)->lineHeight);
|
|
|
|
if (newmax < 0) newmax = 0;
|
Changes for MacGDB:
Thu May 12 17:04:58 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (INCLUDE_CFLAGS): Add readline source dir.
(READLINE_CFLAGS, READLINE_SRC, READLINE_DIR): Uncomment.
(TSOBS): Don't compile inflow.c.
(all, install): Add MacGDB.
* main.c (main): Do Mac-specific init and command loop if a
standalone app, skip full option help message if compiling
with MPW C.
(gdb_readline): If MPW, add a newline after the (gdb) prompt.
* utils.c (_initialize_utils): If MPW, don't try to use termcap to
compute the window size.
* config/m68k/xm-mpw.h (printf, fprintf, fputs, fputc, putc,
fflush): Define as macros that expand into hacked_... versions.
(StandAlone, mac_app): Declare.
* macgdb.r (SIZE): Set the default partition to 4000K.
* mac-xdep.c (readline.h, history.h): Include.
(terminal.h): Don't include.
(mac_app): Define.
(gdb_has_a_terminal): Define Mac-specific version.
(do_keyboard_command): Simplify search for command string.
(readline): Define as gdb_readline.
Add other history/readline stubs to make main gdb link.
(hacked_fprintf, hacked_printf, hacked_vfprintf, hacked_fputs,
hacked_fputc, hacked_fflush): New functions, intercept output to
stdout and stderr, send to console window.
1994-05-13 02:31:31 +02:00
|
|
|
SetCtlMax (console_v_scrollbar, newmax);
|
1994-04-27 02:55:59 +02:00
|
|
|
value = ((*console_text)->viewRect.top - (*console_text)->destRect.top)
|
|
|
|
/ (*console_text)->lineHeight;
|
Changes for MacGDB:
Thu May 12 17:04:58 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (INCLUDE_CFLAGS): Add readline source dir.
(READLINE_CFLAGS, READLINE_SRC, READLINE_DIR): Uncomment.
(TSOBS): Don't compile inflow.c.
(all, install): Add MacGDB.
* main.c (main): Do Mac-specific init and command loop if a
standalone app, skip full option help message if compiling
with MPW C.
(gdb_readline): If MPW, add a newline after the (gdb) prompt.
* utils.c (_initialize_utils): If MPW, don't try to use termcap to
compute the window size.
* config/m68k/xm-mpw.h (printf, fprintf, fputs, fputc, putc,
fflush): Define as macros that expand into hacked_... versions.
(StandAlone, mac_app): Declare.
* macgdb.r (SIZE): Set the default partition to 4000K.
* mac-xdep.c (readline.h, history.h): Include.
(terminal.h): Don't include.
(mac_app): Define.
(gdb_has_a_terminal): Define Mac-specific version.
(do_keyboard_command): Simplify search for command string.
(readline): Define as gdb_readline.
Add other history/readline stubs to make main gdb link.
(hacked_fprintf, hacked_printf, hacked_vfprintf, hacked_fputs,
hacked_fputc, hacked_fflush): New functions, intercept output to
stdout and stderr, send to console window.
1994-05-13 02:31:31 +02:00
|
|
|
SetCtlValue (console_v_scrollbar, value);
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
(*console_v_scrollbar)->contrlVis = 0xff;
|
|
|
|
ShowControl (console_v_scrollbar);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Scroll the TE record so that it is consistent with the scrollbar(s). */
|
|
|
|
|
|
|
|
adjust_console_text ()
|
|
|
|
{
|
|
|
|
TEScroll (((*console_text)->viewRect.left
|
|
|
|
- (*console_text)->destRect.left)
|
|
|
|
- 0 /* get h scroll value */,
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
((((*console_text)->viewRect.top - (*console_text)->destRect.top)
|
|
|
|
/ (*console_text)->lineHeight)
|
Wed Jun 15 17:36:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
(top.c.o, annotate.c.o): Add build rules.
* macgdb.r (SysTypes.r): Include.
('vers'): New resource, version info.
(mFile, mEdit, mDebug): Enable all menu items.
(mDebug): Add key equivalents for continue, step, next.
(wConsole): Add zoom and close boxes to window.
* mac-xdep.c (new_console_window): New function, code taken from
mac_init.
(mac_command_loop): Use GetCaretTime for wait interval, call
do_idle on null events.
(do_idle): New function.
(zoom_window): Implement zooming.
(v_scroll_proc): New function, handles vertical scrolling.
(activate_window): Do activation of console window.
(do_menu_command): Implement items of file, edit, and debug menus.
(do_keyboard_command): Fix command extraction.
(adjust_console_sizes, adjust_console_text): New functions.
(hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
hacked_putc): Don't call draw_console.
* ser-mac.c (mac_open): Add an error message for invalid ports.
(first_mac_write): New global.
(mac_write): Use first_mac_write to sleep on first several writes.
1994-06-16 03:03:01 +02:00
|
|
|
- GetCtlValue (console_v_scrollbar))
|
|
|
|
* (*console_text)->lineHeight,
|
|
|
|
console_text);
|
1994-04-27 02:55:59 +02:00
|
|
|
}
|
Changes for MacGDB:
Thu May 12 17:04:58 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (INCLUDE_CFLAGS): Add readline source dir.
(READLINE_CFLAGS, READLINE_SRC, READLINE_DIR): Uncomment.
(TSOBS): Don't compile inflow.c.
(all, install): Add MacGDB.
* main.c (main): Do Mac-specific init and command loop if a
standalone app, skip full option help message if compiling
with MPW C.
(gdb_readline): If MPW, add a newline after the (gdb) prompt.
* utils.c (_initialize_utils): If MPW, don't try to use termcap to
compute the window size.
* config/m68k/xm-mpw.h (printf, fprintf, fputs, fputc, putc,
fflush): Define as macros that expand into hacked_... versions.
(StandAlone, mac_app): Declare.
* macgdb.r (SIZE): Set the default partition to 4000K.
* mac-xdep.c (readline.h, history.h): Include.
(terminal.h): Don't include.
(mac_app): Define.
(gdb_has_a_terminal): Define Mac-specific version.
(do_keyboard_command): Simplify search for command string.
(readline): Define as gdb_readline.
Add other history/readline stubs to make main gdb link.
(hacked_fprintf, hacked_printf, hacked_vfprintf, hacked_fputs,
hacked_fputc, hacked_fflush): New functions, intercept output to
stdout and stderr, send to console window.
1994-05-13 02:31:31 +02:00
|
|
|
|
|
|
|
/* Readline substitute. */
|
|
|
|
|
|
|
|
char *
|
|
|
|
readline (char *prrompt)
|
|
|
|
{
|
|
|
|
return gdb_readline (prrompt);
|
|
|
|
}
|
|
|
|
|
|
|
|
char *rl_completer_word_break_characters;
|
|
|
|
|
|
|
|
char *rl_completer_quote_characters;
|
|
|
|
|
|
|
|
int (*rl_completion_entry_function) ();
|
|
|
|
|
|
|
|
int rl_point;
|
|
|
|
|
|
|
|
char *rl_line_buffer;
|
|
|
|
|
|
|
|
char *rl_readline_name;
|
|
|
|
|
|
|
|
/* History substitute. */
|
|
|
|
|
|
|
|
void
|
|
|
|
add_history (char *buf)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
stifle_history (int n)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
unstifle_history ()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
read_history (char *name)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
write_history (char *name)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
history_expand (char *x, char **y)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
extern HIST_ENTRY *
|
|
|
|
history_get (int xxx)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
int history_base;
|
|
|
|
|
|
|
|
char *
|
|
|
|
filename_completion_function (char *text, char *name)
|
|
|
|
{
|
|
|
|
return "?";
|
|
|
|
}
|
|
|
|
|
|
|
|
char *
|
|
|
|
tilde_expand (char *str)
|
|
|
|
{
|
|
|
|
return strsave (str);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Modified versions of standard I/O. */
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#undef fprintf
|
|
|
|
|
|
|
|
int
|
|
|
|
hacked_fprintf (FILE *fp, const char *fmt, ...)
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
va_start (ap, fmt);
|
|
|
|
if (mac_app && (fp == stdout || fp == stderr))
|
|
|
|
{
|
|
|
|
char buf[1000];
|
|
|
|
|
|
|
|
ret = vsprintf(buf, fmt, ap);
|
|
|
|
TEInsert (buf, strlen(buf), console_text);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
ret = vfprintf (fp, fmt, ap);
|
|
|
|
va_end (ap);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef printf
|
|
|
|
|
|
|
|
int
|
|
|
|
hacked_printf (const char *fmt, ...)
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
va_start (ap, fmt);
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
ret = hacked_vfprintf(stdout, fmt, ap);
|
Changes for MacGDB:
Thu May 12 17:04:58 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (INCLUDE_CFLAGS): Add readline source dir.
(READLINE_CFLAGS, READLINE_SRC, READLINE_DIR): Uncomment.
(TSOBS): Don't compile inflow.c.
(all, install): Add MacGDB.
* main.c (main): Do Mac-specific init and command loop if a
standalone app, skip full option help message if compiling
with MPW C.
(gdb_readline): If MPW, add a newline after the (gdb) prompt.
* utils.c (_initialize_utils): If MPW, don't try to use termcap to
compute the window size.
* config/m68k/xm-mpw.h (printf, fprintf, fputs, fputc, putc,
fflush): Define as macros that expand into hacked_... versions.
(StandAlone, mac_app): Declare.
* macgdb.r (SIZE): Set the default partition to 4000K.
* mac-xdep.c (readline.h, history.h): Include.
(terminal.h): Don't include.
(mac_app): Define.
(gdb_has_a_terminal): Define Mac-specific version.
(do_keyboard_command): Simplify search for command string.
(readline): Define as gdb_readline.
Add other history/readline stubs to make main gdb link.
(hacked_fprintf, hacked_printf, hacked_vfprintf, hacked_fputs,
hacked_fputc, hacked_fflush): New functions, intercept output to
stdout and stderr, send to console window.
1994-05-13 02:31:31 +02:00
|
|
|
va_end (ap);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef vfprintf
|
|
|
|
|
|
|
|
int
|
|
|
|
hacked_vfprintf (FILE *fp, const char *format, va_list args)
|
|
|
|
{
|
|
|
|
if (mac_app && (fp == stdout || fp == stderr))
|
|
|
|
{
|
|
|
|
char buf[1000];
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
ret = vsprintf(buf, format, args);
|
|
|
|
TEInsert (buf, strlen(buf), console_text);
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
if (strchr(buf, '\n'))
|
|
|
|
{
|
|
|
|
adjust_console_sizes ();
|
|
|
|
adjust_console_scrollbars ();
|
|
|
|
adjust_console_text ();
|
|
|
|
}
|
Changes for MacGDB:
Thu May 12 17:04:58 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (INCLUDE_CFLAGS): Add readline source dir.
(READLINE_CFLAGS, READLINE_SRC, READLINE_DIR): Uncomment.
(TSOBS): Don't compile inflow.c.
(all, install): Add MacGDB.
* main.c (main): Do Mac-specific init and command loop if a
standalone app, skip full option help message if compiling
with MPW C.
(gdb_readline): If MPW, add a newline after the (gdb) prompt.
* utils.c (_initialize_utils): If MPW, don't try to use termcap to
compute the window size.
* config/m68k/xm-mpw.h (printf, fprintf, fputs, fputc, putc,
fflush): Define as macros that expand into hacked_... versions.
(StandAlone, mac_app): Declare.
* macgdb.r (SIZE): Set the default partition to 4000K.
* mac-xdep.c (readline.h, history.h): Include.
(terminal.h): Don't include.
(mac_app): Define.
(gdb_has_a_terminal): Define Mac-specific version.
(do_keyboard_command): Simplify search for command string.
(readline): Define as gdb_readline.
Add other history/readline stubs to make main gdb link.
(hacked_fprintf, hacked_printf, hacked_vfprintf, hacked_fputs,
hacked_fputc, hacked_fflush): New functions, intercept output to
stdout and stderr, send to console window.
1994-05-13 02:31:31 +02:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return vfprintf (fp, format, args);
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef fputs
|
|
|
|
|
|
|
|
hacked_fputs (const char *s, FILE *fp)
|
|
|
|
{
|
|
|
|
if (mac_app && (fp == stdout || fp == stderr))
|
|
|
|
{
|
|
|
|
TEInsert (s, strlen(s), console_text);
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
if (strchr(s, '\n'))
|
|
|
|
{
|
|
|
|
adjust_console_sizes ();
|
|
|
|
adjust_console_scrollbars ();
|
|
|
|
adjust_console_text ();
|
|
|
|
}
|
Changes for MacGDB:
Thu May 12 17:04:58 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (INCLUDE_CFLAGS): Add readline source dir.
(READLINE_CFLAGS, READLINE_SRC, READLINE_DIR): Uncomment.
(TSOBS): Don't compile inflow.c.
(all, install): Add MacGDB.
* main.c (main): Do Mac-specific init and command loop if a
standalone app, skip full option help message if compiling
with MPW C.
(gdb_readline): If MPW, add a newline after the (gdb) prompt.
* utils.c (_initialize_utils): If MPW, don't try to use termcap to
compute the window size.
* config/m68k/xm-mpw.h (printf, fprintf, fputs, fputc, putc,
fflush): Define as macros that expand into hacked_... versions.
(StandAlone, mac_app): Declare.
* macgdb.r (SIZE): Set the default partition to 4000K.
* mac-xdep.c (readline.h, history.h): Include.
(terminal.h): Don't include.
(mac_app): Define.
(gdb_has_a_terminal): Define Mac-specific version.
(do_keyboard_command): Simplify search for command string.
(readline): Define as gdb_readline.
Add other history/readline stubs to make main gdb link.
(hacked_fprintf, hacked_printf, hacked_vfprintf, hacked_fputs,
hacked_fputc, hacked_fflush): New functions, intercept output to
stdout and stderr, send to console window.
1994-05-13 02:31:31 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return fputs (s, fp);
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef fputc
|
|
|
|
|
|
|
|
hacked_fputc (const char c, FILE *fp)
|
|
|
|
{
|
|
|
|
if (mac_app && (fp == stdout || fp == stderr))
|
|
|
|
{
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
char buf[1];
|
Changes for MacGDB:
Thu May 12 17:04:58 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (INCLUDE_CFLAGS): Add readline source dir.
(READLINE_CFLAGS, READLINE_SRC, READLINE_DIR): Uncomment.
(TSOBS): Don't compile inflow.c.
(all, install): Add MacGDB.
* main.c (main): Do Mac-specific init and command loop if a
standalone app, skip full option help message if compiling
with MPW C.
(gdb_readline): If MPW, add a newline after the (gdb) prompt.
* utils.c (_initialize_utils): If MPW, don't try to use termcap to
compute the window size.
* config/m68k/xm-mpw.h (printf, fprintf, fputs, fputc, putc,
fflush): Define as macros that expand into hacked_... versions.
(StandAlone, mac_app): Declare.
* macgdb.r (SIZE): Set the default partition to 4000K.
* mac-xdep.c (readline.h, history.h): Include.
(terminal.h): Don't include.
(mac_app): Define.
(gdb_has_a_terminal): Define Mac-specific version.
(do_keyboard_command): Simplify search for command string.
(readline): Define as gdb_readline.
Add other history/readline stubs to make main gdb link.
(hacked_fprintf, hacked_printf, hacked_vfprintf, hacked_fputs,
hacked_fputc, hacked_fflush): New functions, intercept output to
stdout and stderr, send to console window.
1994-05-13 02:31:31 +02:00
|
|
|
|
|
|
|
buf[0] = c;
|
|
|
|
TEInsert (buf, 1, console_text);
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
if (c == '\n')
|
|
|
|
{
|
|
|
|
adjust_console_sizes ();
|
|
|
|
adjust_console_scrollbars ();
|
|
|
|
adjust_console_text ();
|
|
|
|
}
|
|
|
|
return c;
|
Changes for MacGDB:
Thu May 12 17:04:58 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (INCLUDE_CFLAGS): Add readline source dir.
(READLINE_CFLAGS, READLINE_SRC, READLINE_DIR): Uncomment.
(TSOBS): Don't compile inflow.c.
(all, install): Add MacGDB.
* main.c (main): Do Mac-specific init and command loop if a
standalone app, skip full option help message if compiling
with MPW C.
(gdb_readline): If MPW, add a newline after the (gdb) prompt.
* utils.c (_initialize_utils): If MPW, don't try to use termcap to
compute the window size.
* config/m68k/xm-mpw.h (printf, fprintf, fputs, fputc, putc,
fflush): Define as macros that expand into hacked_... versions.
(StandAlone, mac_app): Declare.
* macgdb.r (SIZE): Set the default partition to 4000K.
* mac-xdep.c (readline.h, history.h): Include.
(terminal.h): Don't include.
(mac_app): Define.
(gdb_has_a_terminal): Define Mac-specific version.
(do_keyboard_command): Simplify search for command string.
(readline): Define as gdb_readline.
Add other history/readline stubs to make main gdb link.
(hacked_fprintf, hacked_printf, hacked_vfprintf, hacked_fputs,
hacked_fputc, hacked_fflush): New functions, intercept output to
stdout and stderr, send to console window.
1994-05-13 02:31:31 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
return fputc (c, fp);
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef putc
|
|
|
|
|
|
|
|
hacked_putc (const char c, FILE *fp)
|
|
|
|
{
|
|
|
|
if (mac_app && (fp == stdout || fp == stderr))
|
|
|
|
{
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
char buf[1];
|
Changes for MacGDB:
Thu May 12 17:04:58 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (INCLUDE_CFLAGS): Add readline source dir.
(READLINE_CFLAGS, READLINE_SRC, READLINE_DIR): Uncomment.
(TSOBS): Don't compile inflow.c.
(all, install): Add MacGDB.
* main.c (main): Do Mac-specific init and command loop if a
standalone app, skip full option help message if compiling
with MPW C.
(gdb_readline): If MPW, add a newline after the (gdb) prompt.
* utils.c (_initialize_utils): If MPW, don't try to use termcap to
compute the window size.
* config/m68k/xm-mpw.h (printf, fprintf, fputs, fputc, putc,
fflush): Define as macros that expand into hacked_... versions.
(StandAlone, mac_app): Declare.
* macgdb.r (SIZE): Set the default partition to 4000K.
* mac-xdep.c (readline.h, history.h): Include.
(terminal.h): Don't include.
(mac_app): Define.
(gdb_has_a_terminal): Define Mac-specific version.
(do_keyboard_command): Simplify search for command string.
(readline): Define as gdb_readline.
Add other history/readline stubs to make main gdb link.
(hacked_fprintf, hacked_printf, hacked_vfprintf, hacked_fputs,
hacked_fputc, hacked_fflush): New functions, intercept output to
stdout and stderr, send to console window.
1994-05-13 02:31:31 +02:00
|
|
|
|
|
|
|
buf[0] = c;
|
|
|
|
TEInsert (buf, 1, console_text);
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
if (c == '\n')
|
|
|
|
{
|
|
|
|
adjust_console_sizes ();
|
|
|
|
adjust_console_scrollbars ();
|
|
|
|
adjust_console_text ();
|
|
|
|
}
|
|
|
|
return c;
|
Changes for MacGDB:
Thu May 12 17:04:58 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (INCLUDE_CFLAGS): Add readline source dir.
(READLINE_CFLAGS, READLINE_SRC, READLINE_DIR): Uncomment.
(TSOBS): Don't compile inflow.c.
(all, install): Add MacGDB.
* main.c (main): Do Mac-specific init and command loop if a
standalone app, skip full option help message if compiling
with MPW C.
(gdb_readline): If MPW, add a newline after the (gdb) prompt.
* utils.c (_initialize_utils): If MPW, don't try to use termcap to
compute the window size.
* config/m68k/xm-mpw.h (printf, fprintf, fputs, fputc, putc,
fflush): Define as macros that expand into hacked_... versions.
(StandAlone, mac_app): Declare.
* macgdb.r (SIZE): Set the default partition to 4000K.
* mac-xdep.c (readline.h, history.h): Include.
(terminal.h): Don't include.
(mac_app): Define.
(gdb_has_a_terminal): Define Mac-specific version.
(do_keyboard_command): Simplify search for command string.
(readline): Define as gdb_readline.
Add other history/readline stubs to make main gdb link.
(hacked_fprintf, hacked_printf, hacked_vfprintf, hacked_fputs,
hacked_fputc, hacked_fflush): New functions, intercept output to
stdout and stderr, send to console window.
1994-05-13 02:31:31 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
return fputc (c, fp);
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef fflush
|
|
|
|
|
|
|
|
hacked_fflush (FILE *fp)
|
|
|
|
{
|
|
|
|
if (mac_app && (fp == stdout || fp == stderr))
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
{
|
|
|
|
adjust_console_sizes ();
|
|
|
|
adjust_console_scrollbars ();
|
|
|
|
adjust_console_text ();
|
|
|
|
return 0;
|
|
|
|
}
|
Changes for MacGDB:
Thu May 12 17:04:58 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (INCLUDE_CFLAGS): Add readline source dir.
(READLINE_CFLAGS, READLINE_SRC, READLINE_DIR): Uncomment.
(TSOBS): Don't compile inflow.c.
(all, install): Add MacGDB.
* main.c (main): Do Mac-specific init and command loop if a
standalone app, skip full option help message if compiling
with MPW C.
(gdb_readline): If MPW, add a newline after the (gdb) prompt.
* utils.c (_initialize_utils): If MPW, don't try to use termcap to
compute the window size.
* config/m68k/xm-mpw.h (printf, fprintf, fputs, fputc, putc,
fflush): Define as macros that expand into hacked_... versions.
(StandAlone, mac_app): Declare.
* macgdb.r (SIZE): Set the default partition to 4000K.
* mac-xdep.c (readline.h, history.h): Include.
(terminal.h): Don't include.
(mac_app): Define.
(gdb_has_a_terminal): Define Mac-specific version.
(do_keyboard_command): Simplify search for command string.
(readline): Define as gdb_readline.
Add other history/readline stubs to make main gdb link.
(hacked_fprintf, hacked_printf, hacked_vfprintf, hacked_fputs,
hacked_fputc, hacked_fflush): New functions, intercept output to
stdout and stderr, send to console window.
1994-05-13 02:31:31 +02:00
|
|
|
return fflush (fp);
|
|
|
|
}
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 21:57:02 +02:00
|
|
|
|
|
|
|
#undef fgetc
|
|
|
|
|
|
|
|
hacked_fgetc (FILE *fp)
|
|
|
|
{
|
|
|
|
if (mac_app && (fp == stdin))
|
|
|
|
{
|
|
|
|
/* Catch any attempts to use this. */
|
|
|
|
DebugStr("\pShould not be reading from stdin!");
|
|
|
|
return '\n';
|
|
|
|
}
|
|
|
|
return fgetc (fp);
|
|
|
|
}
|