diff options
| author | Xavier ASUS <xavi92psx@gmail.com> | 2019-10-18 00:31:54 +0200 |
|---|---|---|
| committer | Xavier ASUS <xavi92psx@gmail.com> | 2019-10-18 00:31:54 +0200 |
| commit | 268a53de823a6750d6256ee1fb1e7707b4b45740 (patch) | |
| tree | 42c1799a9a82b2f7d9790ee9fe181d72a7274751 /sim/ucsim/gui.src/obsolete | |
| download | sdcc-gas-268a53de823a6750d6256ee1fb1e7707b4b45740.tar.gz | |
sdcc-3.9.0 fork implementing GNU assembler syntax
This fork aims to provide better support for stm8-binutils
Diffstat (limited to 'sim/ucsim/gui.src/obsolete')
29 files changed, 2771 insertions, 0 deletions
diff --git a/sim/ucsim/gui.src/obsolete/a.cc b/sim/ucsim/gui.src/obsolete/a.cc new file mode 100644 index 0000000..81d62c3 --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/a.cc @@ -0,0 +1,87 @@ +#include <curses.h> +#include <panel.h> + +int sfr[4]; +int port[4]; + +void +init_panel(PANEL *p) +{ + int mask, x, y; + int na, ha; + int cursor= 2; + WINDOW *w= panel_window(p); + + if (has_colors()) + { + na= COLOR_PAIR(1); + ha= COLOR_PAIR(2); + } + else + { + na= A_NORMAL; + ha= A_STANDOUT; + } + //wattron(w, COLOR_PAIR); + x= 0; + for (mask= 1, y= 0; mask < 0x100; mask<<= 1,y++) + { + wattrset(w, (y==cursor)?ha:na); + mvwprintw(w, y,x, "%s", (sfr[0]&mask)?"High":" Low"); + } +} + +wchar_t +wait_input(PANEL *p) +{ + WINDOW *w= panel_window(p); + wchar_t c; + + c= wgetch(w); + printw("%d 0x%x\n",c,c); + return(c); +} + +int +main(int argc, char *argv[]) +{ + wchar_t c; + + initscr(); /* initialize the curses library */ + keypad(stdscr, TRUE); /* enable keyboard mapping */ + nonl(); /* tell curses not to do NL->CR/NL on output */ + cbreak(); /* take input chars one at a time, no wait for \n */ + noecho(); /* don't echo input */ + if (has_colors()) + { + start_color(); + printw("has %d colors and %d pairs\n", COLORS, COLOR_PAIRS); + init_pair(1, COLOR_WHITE, COLOR_BLUE); + init_pair(2, COLOR_WHITE, COLOR_RED); + } + if (has_key(KEY_UP)) + printw("has UP KEY_UP=0x%x\n",KEY_UP); + else + printf("has no UP\n"); + c= getch(); + printw("got %d %x\n",c,c); + + WINDOW *w= newwin(10,10, 3,3); + keypad(w, TRUE); + PANEL *p= new_panel(w); + + sfr[0]= 0x5a; + init_panel(p); + update_panels(); + doupdate(); + c= wait_input(p); + //c= getch(); + + endwin(); + if (c==KEY_UP) + printf("got UP\n"); + else if (c==KEY_DOWN) + printf("got DOWN\n"); + else + printf("got \"%d\"\n", c); +} diff --git a/sim/ucsim/gui.src/obsolete/app.cc b/sim/ucsim/gui.src/obsolete/app.cc new file mode 100644 index 0000000..309497b --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/app.cc @@ -0,0 +1,171 @@ +/* + * Simulator of microcontrollers (app.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM 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. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include <stdlib.h> + +#include "appcl.h" +#include "deskcl.h" + + +cl_app::cl_app(char *iname): + cl_group(iname, this) +{ + drawn= 0; +} + +cl_app::~cl_app(void) +{ + endwin(); +} + +int +cl_app::init(void) +{ + initscr(); + keypad(stdscr, TRUE); + nonl(); + cbreak(); + noecho(); + + pos= new cl_box(0,0, COLS, LINES); + cl_view::init(); + state|= SF_SELECTED;//select(); + class cl_box b(*pos); + //b.move_rel(0,1); + //b.grow(0,-2); + if ((desk= mk_desk(&b))) + insert(desk); + desk->select(); + mk_views(desk); + + //update(); + update_panels(); + doupdate(); + return(0); +} + +class cl_gin * +cl_app::mk_input(void) +{ + class cl_gin *i= new cl_gin(); + i->init(); + i->add_input(stdin, 0); + return(i); +} + +int * +cl_app::mk_palette(void) +{ + int *p, i; + int colors; + + colors= 64; + p= (int*)malloc(colors * sizeof(int)); + if (has_colors()) + { + start_color(); + + init_pair(i= C_WIN+C_WIN_NORMAL, COLOR_YELLOW, COLOR_BLUE); + p[i]= COLOR_PAIR(i)|A_BOLD; + for (i= 1; i < colors; i++) + p[i]= p[C_WIN+C_WIN_NORMAL]; + // desktop + init_pair(i= C_DSK_BG, COLOR_BLACK, COLOR_WHITE); + p[i]= COLOR_PAIR(i); + // menus and status bar + init_pair(i= C_DSK_NORMAL, COLOR_WHITE, COLOR_BLUE); + p[i]= COLOR_PAIR(i)|A_BOLD; + init_pair(i= C_DSK_DISABLED, COLOR_WHITE, COLOR_BLUE); + p[i]= COLOR_PAIR(i); + // window + init_pair(i= C_WIN+C_WIN_FPASSIVE, COLOR_WHITE, COLOR_BLUE); + p[i]= COLOR_PAIR(i); + init_pair(i= C_WIN+C_WIN_FACTIVE, COLOR_WHITE, COLOR_BLUE); + p[i]= COLOR_PAIR(i)|A_BOLD; + init_pair(i= C_WIN+C_WIN_SELECTED, COLOR_YELLOW, COLOR_RED); + p[i]= COLOR_PAIR(i)|A_BOLD; + } + else + { + for (i= 0; i < colors; i++) + p[i]= A_NORMAL; + p[C_WIN+C_WIN_FACTIVE]|= A_BOLD; + p[C_WIN+C_WIN_SELECTED]|= A_REVERSE; + } + return(p); +} + +class cl_group * +cl_app::mk_desk(class cl_box *ipos) +{ + class cl_group *d= new cl_desk(ipos, "desktop", this); + d->init(); + return(d); +} + + +int +cl_app::handle_event(struct t_event *event) +{ + if (!cl_group::handle_event(event)) + { + if (event->what == EV_KEY) + switch (event->event.key) + { + case KEY_BREAK: case KEY_EXIT: + event->what= EV_COMMAND; + event->event.msg.cmd= CMD_QUIT; + break; + } + } + return(0); +} + +int +cl_app::run(void) +{ + struct t_event event; + + drawn= 0; + while (get_event(&event)) + { + if (!handle_event(&event)) + { + if (event.what == EV_COMMAND && + event.event.msg.cmd == CMD_QUIT) + return(0); + unhandled(&event); + } + if (drawn) + update(); + drawn= 0; + } + return(0); +} + + +/* End of gui.src/app.cc */ diff --git a/sim/ucsim/gui.src/obsolete/appcl.h b/sim/ucsim/gui.src/obsolete/appcl.h new file mode 100644 index 0000000..92a80c9 --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/appcl.h @@ -0,0 +1,54 @@ +/* + * Simulator of microcontrollers (appcl.h) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM 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. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#ifndef APPCL_HEADER +#define APPCL_HEADER + +#include "groupcl.h" + + +class cl_app: public cl_group +{ +public: + class cl_group *desk; + int drawn; +public: + cl_app(char *iname); + ~cl_app(void); + virtual int init(void); + virtual class cl_gin *mk_input(void); + virtual int *mk_palette(void); + virtual class cl_group *mk_desk(class cl_box *ipos); + + virtual int handle_event(struct t_event *event); + virtual int run(void); +}; + + +#endif + +/* End of gui.src/appcl.h */ diff --git a/sim/ucsim/gui.src/obsolete/bg.cc b/sim/ucsim/gui.src/obsolete/bg.cc new file mode 100644 index 0000000..d854d30 --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/bg.cc @@ -0,0 +1,63 @@ +/* + * Simulator of microcontrollers (bg.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM 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. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include <stdlib.h> + +#include "bgcl.h" + + +cl_bg::cl_bg(class cl_box *ipos, char *iname, class cl_app *iapp): + cl_view(ipos, iname, iapp) +{ + options&= ~OF_SELECTABLE; +} + +int * +cl_bg::mk_palette(void) +{ + int *p; + + p= (int*)malloc(1*sizeof(int)); + p[0]= C_DSK_BG; + return(p); +} + +int +cl_bg::draw(void) +{ + int x, y, color= get_color(0); + + wmove(window, 0, 0); + wattrset(window, color); + for (y= 0; y < pos->h; y++) + for (x= 0; x < pos->w; x++) + waddch(window, ACS_CKBOARD); + return(0); +} + + +/* End of gui.src/bg.cc */ diff --git a/sim/ucsim/gui.src/obsolete/bgcl.h b/sim/ucsim/gui.src/obsolete/bgcl.h new file mode 100644 index 0000000..968ed81 --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/bgcl.h @@ -0,0 +1,47 @@ +/* + * Simulator of microcontrollers (bgcl.h) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM 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. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#ifndef BGCL_HEADER +#define BGCL_HEADER + + +#include "viewcl.h" +#include "appcl.h" + + +class cl_bg: public cl_view +{ +public: + cl_bg(class cl_box *ipos, char *iname, class cl_app *iapp); + virtual int *mk_palette(void); + virtual int draw(void); +}; + + +#endif + +/* End of gui.src/bgcl.h */ diff --git a/sim/ucsim/gui.src/obsolete/desk.cc b/sim/ucsim/gui.src/obsolete/desk.cc new file mode 100644 index 0000000..6808cd7 --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/desk.cc @@ -0,0 +1,58 @@ +/* + * Simulator of microcontrollers (desk.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM 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. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include "deskcl.h" +#include "bgcl.h" + + +int +cl_desk::handle_event(struct t_event *event) +{ + if (cl_group::handle_event(event)) + return(1); + if (event->what == EV_KEY && + event->event.key == KEY_F(6)) + { + select_next(); + return(1); + } + return(0); +} + +int +cl_desk::mk_views(class cl_group *ins_to) +{ + class cl_box b(*pos); + + b.move_rel(0,1); + b.grow(0,-2); + insert(new cl_bg(&b, "background", app)); + return(0); +} + + +/* End of gui.src/desk.cc */ diff --git a/sim/ucsim/gui.src/obsolete/deskcl.h b/sim/ucsim/gui.src/obsolete/deskcl.h new file mode 100644 index 0000000..b3346b7 --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/deskcl.h @@ -0,0 +1,42 @@ +/* + * Simulator of microcontrollers (deskcl.h) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM 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. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include "groupcl.h" + + +class cl_desk: public cl_group +{ +public: + cl_desk(class cl_box *ipos, char *iname, class cl_app *iapp): + cl_group(ipos, iname, iapp) {} + virtual int mk_views(class cl_group *ins_to); + + virtual int handle_event(struct t_event *event); +}; + + +/* End of gui.src/deskcl.h */ diff --git a/sim/ucsim/gui.src/obsolete/event.cc b/sim/ucsim/gui.src/obsolete/event.cc new file mode 100644 index 0000000..3207589 --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/event.cc @@ -0,0 +1,126 @@ +/* + * Simulator of microcontrollers (event.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM 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. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include "ddconfig.h" + +#include <curses.h> + +//#include <stdio.h> + +#include "eventcl.h" + + +cl_input_src::cl_input_src(FILE *ifile, class cl_view *iview) +{ + file= ifile; + view= iview; +} + + +cl_gin::cl_gin(void) +{ + FD_ZERO(&in_set); + max_fdes= 0; + inputs= new cl_list(1, 1); +} + +cl_gin::~cl_gin(void) +{ + delete inputs; +} + + +int +cl_gin::add_input(FILE *ifile, class cl_view *iview) +{ + int d= fileno(ifile); + + inputs->add(new cl_input_src(ifile, iview)); + if (d > max_fdes) + max_fdes= d; + FD_SET(d, &in_set); + return(0); +} + +class cl_input_src * +cl_gin::get_input_src(int fdes) +{ + int i; + + for (i= 0; i < inputs->count; i++) + { + class cl_input_src *s= (class cl_input_src *)(inputs->at(i)); + if (fileno(s->file) == fdes) + return(s); + } + return(0); +} + +int +cl_gin::get_event(struct t_event *event) +{ + fd_set set; + //static struct timeval timeout= {0,0}; + wchar_t c; + + //FD_ZERO(&set); + set= in_set; + //FD_SET(fileno(stdin), &set); + if(::select(/*fileno(stdin)*/max_fdes+1, + &set, NULL, NULL, + NULL/*&timeout*/) > 0) + { + int i; + for (i= 0; i < inputs->count; i++) + { + class cl_input_src *s= (class cl_input_src *)(inputs->at(i)); + if (!s->file || + !(FD_ISSET(fileno(s->file), &set))) + continue; + if (s->view) + { + if (s->file) + { + c= fgetc(s->file); + return(s->view->mk_event(event, s->file, c)); + } + } + else + if ((c= getch()) > 0) + { + event->what= EV_KEY; + event->event.key= c; + return(1); + } + } + } + + return(0); +} + + +/* End of gui.src/event.cc */ diff --git a/sim/ucsim/gui.src/obsolete/eventcl.h b/sim/ucsim/gui.src/obsolete/eventcl.h new file mode 100644 index 0000000..4077a72 --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/eventcl.h @@ -0,0 +1,96 @@ +/* + * Simulator of microcontrollers (eventcl.h) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM 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. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#ifndef EVENTCL_HEADER +#define EVENTCL_HEADER + +#include "ddconfig.h" + +#if FD_HEADER_OK +# include HEADER_FD +#endif + +#include "pobjcl.h" + +#include "viewcl.h" + + +#define EV_NOTHING 0x0000 +#define EV_MOUSE_DOWN 0x0001 +#define EV_MOUSE_UP 0x0002 +#define EV_MOUSE_MOVE 0x0004 +#define EV_MOUSE_AUTO 0x0008 +#define EV_KEY 0x0010 +#define EV_COMMAND 0x0100 +#define EV_BROADCAST 0x0200 + +// cathegories +#define EV_MOUSE (EV_MOUSE_DOWN|EV_MOUSE_UP|EV_MOUSE_MOVE|EV_MOUSE_AUTO) +#define EV_KEYBOARD EV_KEY +#define EV_MESSAGE 0xff00 + +#define CMD_QUIT 0 + +struct t_event { + int what; + union { + wchar_t key; + struct { + int cmd; + long param; + } msg; + } event; +}; + + +class cl_input_src: public cl_base +{ +public: + FILE *file; + class cl_view *view; + cl_input_src(FILE *ifile, class cl_view *iview); +}; + +class cl_gin: public cl_base +{ +public: + fd_set in_set; + int max_fdes; + cl_list *inputs; +public: + cl_gin(void); + ~cl_gin(void); + + virtual int add_input(FILE *ifile, class cl_view *iview); + virtual class cl_input_src *get_input_src(int fdes); + virtual int get_event(struct t_event *event); +}; + + +#endif + +/* End of gui.src/eventcl.h */ diff --git a/sim/ucsim/gui.src/obsolete/frame.cc b/sim/ucsim/gui.src/obsolete/frame.cc new file mode 100644 index 0000000..b6b00e8 --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/frame.cc @@ -0,0 +1,76 @@ +/* + * Simulator of microcontrollers (frame.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM 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. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include "ddconfig.h" + +#include <stdlib.h> +#include "i_string.h" + +#include "framecl.h" +#include "wincl.h" + + +cl_frame::cl_frame(class cl_box *ipos, class cl_view *iwindow, char *iname, + class cl_app *iapp): + cl_view(ipos, iname, iapp) +{ + win= iwindow; + options&= ~OF_SELECTABLE; +} + +int * +cl_frame::mk_palette(void) +{ + int *p; + + p= (int*)malloc(2*sizeof(int)); + p[0]= C_WIN_FPASSIVE; + p[1]= C_WIN_FACTIVE; + return(p); +} + +int +cl_frame::draw(void) +{ + char *t; + int color; + + color= get_color((win && (win->state&SF_SELECTED))?1:0); + wattrset(window, color); + box(window, ACS_VLINE, ACS_HLINE); + if (!(t= strdup(((class cl_win *)win)->get_title()))) + return(0); + if ((signed)strlen(t) > (pos->w)-4) + t[(pos->w)-4]= '\0'; + mvwprintw(window, 0,((pos->w)-strlen(t))/2, "[%s]", t); + free(t); + app->drawn++; + return(0); +} + + +/* End of gui.src/frame.cc */ diff --git a/sim/ucsim/gui.src/obsolete/framecl.h b/sim/ucsim/gui.src/obsolete/framecl.h new file mode 100644 index 0000000..6a3c06a --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/framecl.h @@ -0,0 +1,48 @@ +/* + * Simulator of microcontrollers (framecl.h) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM 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. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#ifndef FRAMELCL_HEADER +#define FRAMELCL_HEADER + +#include "viewcl.h" +#include "appcl.h" + + +class cl_frame: public cl_view +{ + class cl_view *win; +public: + cl_frame(class cl_box *ipos, class cl_view *iwindow, char *iname, + class cl_app *iapp); + virtual int *mk_palette(void); + virtual int draw(void); +}; + + +#endif + +/* End of gui.src/framecl.h */ diff --git a/sim/ucsim/gui.src/obsolete/group.cc b/sim/ucsim/gui.src/obsolete/group.cc new file mode 100644 index 0000000..45bb0e4 --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/group.cc @@ -0,0 +1,393 @@ +/* + * Simulator of microcontrollers (group.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM 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. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include "groupcl.h" +#include "appcl.h" + + +cl_group::cl_group(class cl_box *ipos, char *iname, class cl_app *iapp): + cl_view(ipos, iname, iapp) +{ + current= 0; +} + +cl_group::cl_group(char *iname, class cl_app *iapp): + cl_view(iname, iapp) +{ + current= 0; +} + +cl_group::~cl_group(void) +{} + +int +cl_group::init(void) +{ + cl_view::init(); + mk_views(this); + return(0); +} + +int +cl_group::mk_views(class cl_group *ins_to) +{ + return(0); +} + + +/* + * Make output by drawing all subviews + */ + +static void do_draw_view(class cl_view *view) +{ + view->draw(); +} + +int +cl_group::draw(void) +{ + /*int i; + + for (i= 0; i < views->count; i++) + { + class cl_view *v= (class cl_view *)(views->at(i)); + v->draw(); + app->drawn++; + }*/ + for_each(do_draw_view); + return(0); +} + +/*int +cl_group::update(void) +{ + draw(); + update_panels(); + doupdate(); +}*/ + + +int +cl_group::handle_event(struct t_event *event) +{ + int handled= 0; + + if (event->what & (EV_KEY|EV_COMMAND)) + { + if (current) + handled= current->handle_event(event); + } + else if (event->what & EV_MESSAGE) + { + class cl_view *v= last; + do + { + handled= v->handle_event(event); + v= v->next; + } + while (! handled && + v != last); + } + return(handled); +} + + +/* + * Managing views + */ + +//class cl_view * +void +cl_group::insert(class cl_view *view) +{ + /*if (view && + view->ok()) + { + views->add_at(0, view); + view->parent= this; + view->select(); + //view->draw(); + return(view); + } + return(0);*/ + insert_before(view, first()); + if (view->options & OF_SELECTABLE) + view->select(); + draw(); +} + +void +cl_group::insert_before(class cl_view *view, class cl_view *target) +{ + unsigned int ss; + + if (view && + !(view->parent) && + (!target || + target->parent == this)) + { + ss= view->state; + //view->hide(); + insert_view(view, target); + /*if (ss & SF_VISIBLE) + view->show();*/ + if (state & SF_ACTIVE) + view->change_state(SF_ACTIVE, 1); + } +} + +void +cl_group::insert_view(class cl_view *view, class cl_view *target) +{ + view->parent= this; + if (target) + { + target= target->prev(); + view->next= target->next; + target->next= view; + } + else + { + if (!last) + view->next= view; + else + { + view->next= last->next; + last->next= view; + } + last= view; + } +} + +class cl_view * +cl_group::first(void) +{ + if (!last) + return(0); + return(last->next); +} + + +/*class cl_view * +cl_group::get_by_state(unsigned int what, int enabled) +{ + int i; + + for (i= 0; i < views->count; i++) + { + class cl_view *v= (class cl_view *)(views->at(i)); + if ((enabled && + (state&what)) + || + (!enabled && + ((~state)&what)) + ) + return(v); + } + return(0); +}*/ + +/*int +cl_group::select(void) +{ +}*/ + +/*int +cl_group::unselect(void) +{ +}*/ + +int +cl_group::select_next() +{ + /* int start, i; + class cl_view *v; + + if (views->count <= 1) + return(1); + if (current) + start= views->index_of(current); + else + if ((v= get_by_state(SF_SELECTED, 1))) + start= views->index_of(v); + else + if ((v= get_by_state(SF_FOCUSED, 1))) + start= views->index_of(v); + else + start= 0; + i= (start+1)%(views->count); + while (i != start) + { + v= (class cl_view *)(views->at(i)); + if ((v->options & OF_SELECTABLE) && + v->select()) + { + //update(); + return(1); + } + i= (i+1)%(views->count); + }*/ + return(0); +} + +int +cl_group::select_prev() +{ + /* int start, i; + class cl_view *v; + + if (views->count <= 1) + return(1); + if (current) + start= views->index_of(current); + else + if ((v= get_by_state(SF_SELECTED, 1))) + start= views->index_of(v); + else + if ((v= get_by_state(SF_FOCUSED, 1))) + start= views->index_of(v); + else + start= 0; + i= start-1; if (i < 0) i= views->count-1; + while (i != start) + { + v= (class cl_view *)(views->at(i)); + if ((v->options & OF_SELECTABLE) && + v->select()) + { + //update(); + return(1); + } + i= start-1; if (i < 0) i= views->count-1; + }*/ + return(0); +} + +class cl_view * +cl_group::current_sub_view(void) +{ + return(current); +} + +void +cl_group::for_each(void (*func)(class cl_view *view)) +{ + class cl_view *v; + + if (!last) + return; + v= last->next; + do + { + func(v); + v= v->next; + } + while (v != last); +} + +void +cl_group::set_current(class cl_view *view) +{ + //current= view; + if (current == view) + return; + //lock(); + /*focus_view(view, 0);*/ + if ((state & SF_FOCUSED) && + (current != 0)) + current->change_state(SF_FOCUSED, 0); + //if (mode!=ENTER_SELECT) select_view(current, 0); + if (current) + current->change_state(SF_SELECTED, 0); + //if (mode!=LEAVE_SELECT) select_view(view, 1); + if (view) + view->change_state(SF_SELECTED, 1); + //focuse_view(view, 1); + if ((state & SF_FOCUSED) && + (view != 0)) + view->change_state(SF_SELECTED, 1); + current= view; + //unlock(); +} + +/*int +cl_group::terminal_view(void) +{ + return(views->count == 0); +}*/ + +static unsigned int grp_what, grp_en; + +static void +do_set_state(class cl_view *v) +{ + v->change_state(grp_what, grp_en); +} + +void +cl_group::change_state(unsigned int what, int enable) +{ + cl_view::change_state(what, enable); + /*if (enable && + (what & SF_SELECTED)) + { + class cl_view *v= get_by_state(SF_SELECTED, 1); + if (v) + { + current= v; + current->change_state(SF_FOCUSED, 1); + current->change_state(SF_SELECTED, 1); + } + else + { + if ((v= get_by_state(SF_FOCUSED, 1))) + { + current= v; + current->change_state(SF_SELECTED, 1); + } + } + }*/ + switch (what) + { + case SF_ACTIVE: + //lock(); + grp_what= what; + grp_en= enable; + for_each(do_set_state); + //unlock(); + break; + case SF_FOCUSED: + if (current) + current->change_state(SF_FOCUSED, enable); + break; + } + draw(); +} + + +/* End of gui.src/group.cc */ diff --git a/sim/ucsim/gui.src/obsolete/groupcl.h b/sim/ucsim/gui.src/obsolete/groupcl.h new file mode 100644 index 0000000..87f0ba8 --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/groupcl.h @@ -0,0 +1,70 @@ +/* + * Simulator of microcontrollers (groupcl.h) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM 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. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#ifndef GROUPCL_HEADER +#define GROUPCL_HEADER + +#include "viewcl.h" + +class cl_group: public cl_view +{ +public: + class cl_view *current; + +public: + cl_group(class cl_box *ipos, char *iname, class cl_app *iapp); + cl_group(char *iname, class cl_app *iapp); + ~cl_group(void); + virtual int init(void); + virtual int mk_views(class cl_group *ins_to); + virtual int is_group(void) {return(1);} + + virtual int draw(void); + //virtual int update(void); + + virtual int handle_event(struct t_event *event); + + virtual /*class cl_view **/void insert(class cl_view *view); + virtual void insert_before(class cl_view *view, class cl_view *target); + virtual void insert_view(class cl_view *view, class cl_view *target); + virtual class cl_view *first(void); + virtual void for_each(void (*func)(class cl_view *view)); + //virtual class cl_view *get_by_state(unsigned int what, int enabled); + //virtual int select(void); + //virtual int unselect(void); + virtual int select_next(); + virtual int select_prev(); + virtual class cl_view *current_sub_view(void); + virtual void set_current(class cl_view *view); + //virtual int terminal_view(void); + virtual void change_state(unsigned int what, int enable); +}; + + +#endif + +/* End of gui.src/groupcl.h */ diff --git a/sim/ucsim/gui.src/obsolete/label.cc b/sim/ucsim/gui.src/obsolete/label.cc new file mode 100644 index 0000000..90c54a3 --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/label.cc @@ -0,0 +1,74 @@ +/* + * Simulator of microcontrollers (label.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM 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. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include "ddconfig.h" + +#include <stdlib.h> +#include "i_string.h" + +#include "labelcl.h" + + +cl_label::cl_label(class cl_box *ipos, class cl_app *iapp, char *ilabel): + cl_view(ipos, "label", iapp) +{ + options&= ~OF_SELECTABLE; + if (!ilabel || + !(*ilabel)) + label= strdup(""); + else + label= strdup(ilabel); +} + +cl_label::~cl_label(void) +{ + free(label); +} + +int * +cl_label::mk_palette(void) +{ + int *p; + + p= (int*)malloc(1*sizeof(int)); + p[0]= C_WIN_NORMAL; + return(p); +} + +int +cl_label::draw(void) +{ + int color= get_color(0); + + cl_view::draw(); + wattrset(window, color); + mvwprintw(window, 0,0, "%s", label); + return(0); +} + + +/* End of gui.src/label.cc */ diff --git a/sim/ucsim/gui.src/obsolete/labelcl.h b/sim/ucsim/gui.src/obsolete/labelcl.h new file mode 100644 index 0000000..79d6288 --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/labelcl.h @@ -0,0 +1,50 @@ +/* + * Simulator of microcontrollers (labelcl.h) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM 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. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#ifndef LABELCL_HEADER +#define LABELCL_HEADER + + +#include "viewcl.h" +#include "appcl.h" + + +class cl_label: public cl_view +{ +public: + char *label; +public: + cl_label(class cl_box *ipos, class cl_app *iapp, char *ilabel); + ~cl_label(void); + virtual int *mk_palette(void); + virtual int draw(void); +}; + + +#endif + +/* End of gui.src/labelcl.h */ diff --git a/sim/ucsim/gui.src/obsolete/palette.h b/sim/ucsim/gui.src/obsolete/palette.h new file mode 100644 index 0000000..6f9d383 --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/palette.h @@ -0,0 +1,44 @@ +/* + * Simulator of microcontrollers (palette.h) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM 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. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#ifndef PALETTE_HEADER +#define PALETTE_HEADER + + +#define C_DSK_BG 1 +#define C_DSK_NORMAL 2 +#define C_DSK_DISABLED 3 + +#define C_WIN 8 +#define C_WIN_FPASSIVE 0 +#define C_WIN_FACTIVE 1 +#define C_WIN_NORMAL 5 +#define C_WIN_SELECTED 6 + +#endif + +/* End of gui.src/palette.h */ diff --git a/sim/ucsim/gui.src/obsolete/portmon.src/(c).1 b/sim/ucsim/gui.src/obsolete/portmon.src/(c).1 new file mode 100644 index 0000000..d673f9f --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/portmon.src/(c).1 @@ -0,0 +1,25 @@ +/* + * Simulator of microcontrollers (@@F@@) + * + * Copyright (C) @@S@@,@@Y@@ Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM 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. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ diff --git a/sim/ucsim/gui.src/obsolete/portmon.src/Makefile.in b/sim/ucsim/gui.src/obsolete/portmon.src/Makefile.in new file mode 100644 index 0000000..0169421 --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/portmon.src/Makefile.in @@ -0,0 +1,131 @@ +# +# uCsim gui.src/portmon.src/Makefile +# +# (c) Drotos Daniel, Talker Bt. 1999 +# + +SHELL = /bin/sh +CXX = @CXX@ +CPP = @CPP@ +CXXCPP = @CXXCPP@ +RANLIB = @RANLIB@ +INSTALL = @INSTALL@ +MAKEDEP = @MAKEDEP + +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +PKGDIR = ../ + +DEFS = $(subs -DHAVE_CONFIG_H,,@DEFS@) +CPPFLAGS = @CPPFLAGS@ -I. -I$(top_builddir) -I$(PKGDIR) +CFLAGS = @CFLAGS@ @WALL_FLAG@ +CXXFLAGS = @CXXFLAGS@ @WALL_FLAG@ + +LIBS = -L$(top_builddir) -L$(PKGDIR) -lgui @CURSES_LIBS@ -lutil @LIBS@ + +curses_ok = @curses_ok@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +libdir = @libdir@ +datadir = @datadir@ +includedir = @includedir@ +mandir = @mandir@ +man1dir = $(mandir)/man1 +man2dir = $(mandir)/man2 +infodir = @infodir@ +srcdir = @srcdir@ + +OBJECTS = portmon.o \ + pmapp.o port.o + + +# Compiling entire program or any subproject +# ------------------------------------------ +all: checkconf otherlibs portmon.src + + +# Compiling and installing everything and runing test +# --------------------------------------------------- +install: all installdirs + $(INSTALL) -s portmon $(bindir) + + +# Deleting all the installed files +# -------------------------------- +uninstall: + rm -f $(bindir)/portmon + + +# Performing self-test +# -------------------- +check: + + +# Performing installation test +# ---------------------------- +installcheck: + + +# Creating installation directories +# --------------------------------- +installdirs: + test -d $(bindir) || $(INSTALL) -d $(bindir) + + +# Creating dependencies +# --------------------- +dep: Makefile.dep + +Makefile.dep: $(srcdir)/*.cc $(top_builddir)/*.h $(PKGDIR)/*.h + $(MAKEDEP) $(CPPFLAGS) $(filter %.cc,$^) >Makefile.dep + +-include Makefile.dep +include clean.mk + +#parser.cc: parser.y + +#plex.cc: plex.l + +# My rules +# -------- +ifeq ($(curses_ok),yes) +portmon.src: portmon +else +portmon.src: +endif + +portmon: $(OBJECTS) $(top_builddir)/*.a $(PKGDIR)/*.a + $(CXX) $(CXXFLAGS) -o portmon $(OBJECTS) $(LIBS) + +ifeq ($(curses_ok),yes) +otherlibs: + $(MAKE) -C $(top_builddir) libs + $(MAKE) -C $(PKGDIR) libs +else +otherlibs: +endif + +.cc.o: + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@ + +.y.cc: + rm -f $*.cc $*.h + $(YACC) -d $< + mv y.tab.c $*.cc + mv y.tab.h $*.h + +.l.cc: + rm -f $*.cc + $(LEX) -t $< >$*.cc + + +# Remaking configuration +# ---------------------- +checkconf: + @if [ -f $(top_builddir)/devel ]; then\ + $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\ + fi + +# End of gui.src/portmon.src/Makefile.in diff --git a/sim/ucsim/gui.src/obsolete/portmon.src/clean.mk b/sim/ucsim/gui.src/obsolete/portmon.src/clean.mk new file mode 100644 index 0000000..02760e9 --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/portmon.src/clean.mk @@ -0,0 +1,28 @@ +# uCsim gui.src/portmon.src/clean.mk + +# Deleting all files created by building the program +# -------------------------------------------------- +clean: + rm -f *core *[%~] *.[oa] + rm -f .[a-z]*~ + rm -f portmon + + +# Deleting all files created by configuring or building the program +# ----------------------------------------------------------------- +distclean: clean + rm -f config.cache config.log config.status + rm -f Makefile *.dep + + +# Like clean but some files may still exist +# ----------------------------------------- +mostlyclean: clean + + +# Deleting everything that can reconstructed by this Makefile. It deletes +# everything deleted by distclean plus files created by bison, etc. +# ----------------------------------------------------------------------- +realclean: distclean + +# End of gui.src/portmon.src/clean.mk diff --git a/sim/ucsim/gui.src/obsolete/portmon.src/conf.mk b/sim/ucsim/gui.src/obsolete/portmon.src/conf.mk new file mode 100644 index 0000000..fe3dcfe --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/portmon.src/conf.mk @@ -0,0 +1,12 @@ +# uCsim gui.src/portmon.src/conf.mk + +# +# Makefile targets to remake configuration +# + +freshconf: Makefile + +Makefile: $(srcdir)/Makefile.in $(top_srcdir)/configure.ac + cd $(top_builddir) && $(SHELL) ./config.status + +# End of gui.src/portmon.src/conf.mk diff --git a/sim/ucsim/gui.src/obsolete/portmon.src/pmapp.cc b/sim/ucsim/gui.src/obsolete/portmon.src/pmapp.cc new file mode 100644 index 0000000..2605a22 --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/portmon.src/pmapp.cc @@ -0,0 +1,113 @@ +/* + * Simulator of microcontrollers (pmapp.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM 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. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include "wincl.h" +#include "labelcl.h" + +#include "pmappcl.h" +#include "portcl.h" + + +int +cl_pmapp::mk_views(class cl_group *ins_to) +{ + class cl_view *v; + //class cl_win *w; + class cl_box *b; + + b= new cl_box(0,0,0,0); + + if (!ins_to) + return(0); + + b->set(43,2,14,13); + v= new cl_portw(b, 3, "Port #3", this); + v->init(); + ins_to->insert(v); + + b->set(29,2,14,13); + v= new cl_portw(b, 2, "Port #2", this); + v->init(); + ins_to->insert(v); + /* + b->set(15,2,14,13); + ins_to->insert(v= new cl_portw(b, 1, "Port #1", this)); + v->init(); + + b->set(1,2,14,13); + ins_to->insert(v= new cl_portw(b, 0, "Port #0", this)); + v->init(); + + b->set(59,3,19,11); + v= new cl_label(b, this, +"Next win: n,TAB\nPrev win: p\nCursor : u,d,l,r,\n arrows\nToggle : space,CR\nQuit : q"); + v->init(); + b->move_rel(-1,-1); + b->grow(2,2); + + b->set(58,2,21,13); + w= new cl_win(b, "Help", this); + w->options&= ~OF_SELECTABLE; + w->init(); + w->insert(v); + ins_to->insert(w); + w->draw(); + */ + delete b; + + return(0); +} + +int * +cl_pmapp::mk_palette(void) +{ + return(cl_app::mk_palette()); +} + +int +cl_pmapp::handle_event(struct t_event *event) +{ + if (event->what == EV_KEY) + switch (event->event.key) + { + case 'q': + event->what= EV_COMMAND; + event->event.msg.cmd= CMD_QUIT; + return(0); + case 'p': + desk->select_prev(); + return(1); + case 'n': case '\t': + desk->select_next(); + return(1); + + } + return(cl_app::handle_event(event)); +} + + +/* End of gui.src/portmon.src/pmapp.cc */ diff --git a/sim/ucsim/gui.src/obsolete/portmon.src/pmappcl.h b/sim/ucsim/gui.src/obsolete/portmon.src/pmappcl.h new file mode 100644 index 0000000..d9f3011 --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/portmon.src/pmappcl.h @@ -0,0 +1,48 @@ +/* + * Simulator of microcontrollers (pmappcl.h) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM 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. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#ifndef PMAPPCL_HEADER +#define PMAPPCL_HEADER + +#include "appcl.h" + + +class cl_pmapp: public cl_app +{ +public: + cl_pmapp(char *iname): cl_app(iname) {} + + virtual int mk_views(class cl_group *ins_to); + virtual int *mk_palette(void); + + virtual int handle_event(struct t_event *event); +}; + + +#endif + +/* End of gui.src/portmon.src/pmappcl.h */ diff --git a/sim/ucsim/gui.src/obsolete/portmon.src/port.cc b/sim/ucsim/gui.src/obsolete/portmon.src/port.cc new file mode 100644 index 0000000..010ec3e --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/portmon.src/port.cc @@ -0,0 +1,143 @@ +/*@1@*/ + +#include "portcl.h" + + +/* + * Viewer of the port + */ + +cl_port::cl_port(class cl_box *ipos, int iid, char *iname, class cl_app *iapp): + cl_view(ipos, iname, iapp) +{ + id= iid; + sfr= 0; + pin= 0; + curs_x= curs_y= 0; +} + +int +cl_port::draw(void) +{ + int x, y, mask, hc, nc; + + cl_view::draw(); + + nc= hc= get_color(C_WIN_NORMAL); + if (state & SF_SELECTED) + hc= get_color(C_WIN_SELECTED); + mvwprintw(window, 0,0, "SFR PORT PIN"); + for (x= 0, mask= 0x80, y= 1; mask; mask>>= 1,y++) + { + wattrset(window, (curs_x)?nc:(curs_y==y-1?hc:nc)); + mvwprintw(window, y,x, " %c", (sfr&mask)?'1':'0'); + } + wattrset(window, nc); + for (x= 5, mask= 0x80, y= 1; mask; mask>>= 1,y++) + mvwprintw(window, y,x, "%c", (sfr&pin&mask)?'1':'0'); + for (x=9, mask= 0x80, y= 1; mask; mask>>= 1,y++) + { + wattrset(window, curs_x?(curs_y==y-1?hc:nc):nc); + mvwprintw(window, y,x, "%c ", (pin&mask)?'1':'0'); + } + wattrset(window, nc); + mvwprintw(window, 9,0, "0x%02x 0x%02x", sfr, pin); + mvwprintw(window, 10,4, "0x%02x", sfr&pin); + app->drawn++; + return(0); +} + +int +cl_port::handle_event(struct t_event *event) +{ + if (event->what == EV_KEY) + switch (event->event.key) + { + case KEY_HOME: + curs_y= 0; draw(); return(1); + case KEY_A1: + curs_x= curs_y= 0; draw(); return(1); + case KEY_A3: + curs_y= 0; curs_x= 1; draw(); return(1); + case KEY_C1: + curs_x= 0; curs_y= 7; draw(); return(1); + case KEY_C3: + curs_x= 1; curs_y= 7; draw(); return(1); + case KEY_LEFT: case KEY_RIGHT: case 'j': case 'k': case 'l': case 'r': + if (curs_x) + curs_x= 0; + else + curs_x= 1; + draw(); + return(1); + case KEY_UP: case 'u': + curs_y--; + if (curs_y < 0) + curs_y= 7; + draw(); + return(1); + case KEY_DOWN: case 'd': + curs_y++; + if (curs_y > 7) + curs_y= 0; + draw(); + return(1); + case ' ': case '\n': case '\r': + if (curs_x) + toggle_pin(7-curs_y); + else + toggle_sfr(7-curs_y); + return(1); + } + return(cl_view::handle_event(event)); +} + +int +cl_port::toggle_sfr(int bitnr) +{ + int mask= 1<<bitnr; + sfr^= mask; + draw(); + return(0); +} + +int +cl_port::toggle_pin(int bitnr) +{ + int mask= 1<<bitnr; + pin^= mask; + draw(); + return(0); +} + +/* + * Window to show port viewer + ****************************************************************************** + */ + +cl_portw::cl_portw(class cl_box *ipos, int iid, char *ititle, + class cl_app *iapp): + cl_win(ipos, ititle, iapp) +{ + id= iid; +} + +class cl_view * +cl_portw::mk_intern(class cl_box *ipos) +{ + char n[100]= ""; + + sprintf(n, "port%dviewer", id); + class cl_view *v= new cl_port(ipos, id, n, app); + v->init(); + return(v); +} + +int +cl_portw::handle_event(struct t_event *event) +{ + return(cl_win::handle_event(event)); +} + + +/* End of gui.src/portmap.src/port.cc */ diff --git a/sim/ucsim/gui.src/obsolete/portmon.src/portcl.h b/sim/ucsim/gui.src/obsolete/portmon.src/portcl.h new file mode 100644 index 0000000..760f0ad --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/portmon.src/portcl.h @@ -0,0 +1,64 @@ +/* + * Simulator of microcontrollers (portcl.h) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM 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. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#ifndef PORTCL_HEADER +#define PORTCL_HEADER + +#include "viewcl.h" +#include "wincl.h" + + +class cl_port: public cl_view +{ +public: + int id; + int sfr, pin; + int curs_x, curs_y; +public: + cl_port(class cl_box *ipos, int iid, char *iname, class cl_app *iapp); + + virtual int draw(void); + virtual int handle_event(struct t_event *event); + int toggle_sfr(int bitnr); + int toggle_pin(int bitnr); +}; + +class cl_portw: public cl_win +{ +public: + int id; +public: + cl_portw(class cl_box *ipos, int iid, char *ititle, class cl_app *iapp); + virtual class cl_view *mk_intern(class cl_box *ipos); + + virtual int handle_event(struct t_event *event); +}; + + +#endif + +/* End of gui.src/portmon.src/portcl.h */ diff --git a/sim/ucsim/gui.src/obsolete/portmon.src/portmon.cc b/sim/ucsim/gui.src/obsolete/portmon.src/portmon.cc new file mode 100644 index 0000000..50d3b3a --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/portmon.src/portmon.cc @@ -0,0 +1,68 @@ +/* + * Simulator of microcontrollers (portmon.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM 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. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include <curses.h> + +#include "pmappcl.h" + + +class cl_pmapp *app; + +void xx(class cl_view *v) +{ + fprintf(stderr,"%s 0x%x ", v->name, v->state); +} + +int +main(int argc, char *argv) +{ + app= new cl_pmapp("portmon"); + app->init(); + { + class cl_view *v= app; + while (v) + { + if (v->is_group()) + { + class cl_group *g= (class cl_group *)v; + fprintf(stderr, "%s->%s\n", g->name,(g->current)?(g->current->name):"none"); + g->for_each(xx); + fprintf(stderr, "\n"); + v= g->current; + } + else + v= 0; + } + } + app->run(); + //getch(); + delete app; + return(0); +} + + +/* End of gui.src/portmon.src/portmon.cc */ diff --git a/sim/ucsim/gui.src/obsolete/view.cc b/sim/ucsim/gui.src/obsolete/view.cc new file mode 100644 index 0000000..9ead6f4 --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/view.cc @@ -0,0 +1,356 @@ +/* + * Simulator of microcontrollers (view.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM 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. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include "ddconfig.h" + +#include <stdlib.h> +#include "i_string.h" + +#include "appcl.h" + + +/* + * Box + */ + +cl_box::cl_box(int ix, int iy, int iw, int ih): + cl_base() +{ + x= ix; + y= iy; + w= iw; + h= ih; +} + +void +cl_box::set(int ix, int iy, int iw, int ih) +{ + x= ix; + y= iy; + w= iw; + h= ih; +} + +void +cl_box::move_rel(int dx, int dy) +{ + x+= dx; + y+= dy; +} + +void +cl_box::grow(int dw, int dh) +{ + w+= dw; + h+= dh; +} + + +/* + * Astbract of a viewer + ****************************************************************************** + */ + +cl_view::cl_view(class cl_box *ipos, char *iname, class cl_app *iapp): + cl_base() +{ + pos= new cl_box(ipos->x,ipos->y, ipos->w,ipos->h); + if ((window= newwin(pos->h,pos->w, pos->y,pos->x))) + { + leaveok(window, TRUE); + panel= new_panel(window); + } + else + { + panel= 0; + delwin(window); + window= 0; + } + parent= 0; + next= last= 0; + app= iapp; + state= SF_NOTHING; + options= OF_SELECTABLE; + if (!iname || + !(*iname)) + { + name= (char*)malloc(100); + sprintf(name, "view%p", this); + } + else + name= strdup(iname); +} + +cl_view::cl_view(char *iname, class cl_app *iapp): + cl_base() +{ + window= 0; + panel= 0; + parent= 0; + next= last= 0; + app= iapp; + state= SF_NOTHING; + options= OF_SELECTABLE; + if (!iname || + !(*iname)) + { + name= (char*)malloc(100); + sprintf(name, "view%p", this); + } + else + name= strdup(iname); +} + +cl_view::~cl_view(void) +{ + if (panel) + del_panel(panel); + if (window) + delwin(window); + if (palette) + free(palette); + if (name) + free(name); +} + +int +cl_view::init(void) +{ + input= mk_input(); + palette= mk_palette(); + //draw(); + return(0); +} + +class cl_gin * +cl_view::mk_input(void) +{ + return(0); +} + +int * +cl_view::mk_palette(void) +{ + return(0); +} + +int +cl_view::ok(void) +{ + return(window && panel); +} + + +/* + * Make output into the view + */ + +int +cl_view::draw(void) +{ + int color, x, y; + + color= get_color(palette?0:C_WIN_NORMAL); + + wattrset(window, color); + for (y= 0; y < pos->h; y++) + for (x= 0; x < pos->w; x++) + mvwaddch(window, y,x, ' '); + app->drawn++; + + return(0); +} + +int +cl_view::update(void) +{ + draw(); + update_panels(); + doupdate(); + return(0); +} + +int +cl_view::get_color(int color) +{ + int *p; + class cl_view *v; + + v= this; + while (v) + { + p= v->get_palette(); + if (p) + color= p[color]; + v= v->parent; + } + return(color); +} + +int * +cl_view::get_palette(void) +{ + return(palette); +} + + +/* + * Event handling + */ + +int +cl_view::get_event(struct t_event *event) +{ + if (parent) + return(parent->get_event(event)); + if (input) + return(input->get_event(event)); + return(0); +} + +int +cl_view::handle_event(struct t_event *event) +{ + return(0); +} + +int +cl_view::unhandled(struct t_event *event) +{ + return(0); +} + +int +cl_view::mk_event(struct t_event *event, FILE *f, int key) +{ + event->what= EV_KEY; + event->event.key= key; + return(1); +} + + +class cl_view * +cl_view::prev(void) +{ + class cl_view *v; + + v= next; + while (v != this) + v= v->next; + return(v); +} + +class cl_view * +cl_view::prev_view(void) +{ + if (parent && + parent->first() == this) + return(0); + else + return(prev()); +} + + +int +cl_view::select(void) +{ + /* class cl_view *v; + + if (!(options & OF_SELECTABLE)) + return(0); + if (state & SF_SELECTED) + return(1); + if (parent && + !(parent->select())) + return(0); + if (parent) + { + v= parent->current_sub_view(); + if (v && + v != this) + v->unselect(); + parent->set_current(this); + } + change_state(SF_FOCUSED, 1); + change_state(SF_SELECTED, 1); + draw(); + return(1);*/ + if (options & OF_SELECTABLE) + if (parent) + parent->set_current(this); + return(1); +} + +int +cl_view::unselect(void) +{ + class cl_view *csv= current_sub_view(); + if (csv && + !(csv->unselect())) + return(0); + if (!terminal_view()) + change_state(SF_FOCUSED, 0); + change_state(SF_SELECTED, 0); + draw(); + return(1); +} + +class cl_view * +cl_view::current_sub_view(void) +{ + return(0); +} + +int +cl_view::terminal_view(void) +{ + return(1); +} + +void +cl_view::change_state(unsigned int what, int enable) +{ + if (enable) + state|= what; + else + state&= ~what; + if (parent) + { + switch (what) + { + case SF_FOCUSED: + //reset_cursor(); + /*message(parent, EV_BROADCAST, + (enable)?CM_RECEIVED_FOCUS:CM_RELEASED_FOCUS, this);*/ + break; + } + } + draw(); +} + + +/* End of gui.src/view.cc */ diff --git a/sim/ucsim/gui.src/obsolete/viewcl.h b/sim/ucsim/gui.src/obsolete/viewcl.h new file mode 100644 index 0000000..668fee1 --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/viewcl.h @@ -0,0 +1,118 @@ +/* + * Simulator of microcontrollers (viewcl.h) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM 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. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#ifndef VIEWCL_HEADER +#define VIEWCL_HEADER + +#include <curses.h> +#include <panel.h> + +#include "pobjcl.h" + +#include "palette.h" +#include "eventcl.h" + + +// Status flags +#define SF_NOTHING 0x0000 +#define SF_SELECTED 0x0001 +#define SF_FOCUSED 0x0002 +#define SF_ACTIVE 0x0004 + +// Option flags +#define OF_NOTHING 0x0000 +#define OF_SELECTABLE 0x0001 + + +class cl_box: public cl_base +{ +public: + int x, y; + int w, h; +public: + cl_box(int ix, int iy, int iw, int ih); + void set(int ix, int iy, int iw, int ih); + void move_rel(int dx, int dy); + void grow(int dw, int dh); +}; + + +class cl_app; +class cl_group; + +class cl_view: public cl_base +{ +public: + char *name; + WINDOW *window; + PANEL *panel; + class cl_group *parent; + class cl_view *next, *last; + class cl_app *app; + class cl_gin *input; + class cl_box *pos; + int *palette; + unsigned int state; // See SF_XXXX + unsigned int options; // See OF_XXXX +public: + cl_view(class cl_box *ipos, char *iname, class cl_app *iapp); + cl_view(char *name, class cl_app *iapp); + ~cl_view(void); + virtual int init(void); + virtual class cl_gin *mk_input(void); + virtual int *mk_palette(void); + virtual int is_group(void) {return(0);} + + virtual int ok(void); + virtual int draw(void); + virtual int update(void); + virtual int get_color(int color); + virtual int *get_palette(void); + + virtual int get_event(struct t_event *event); + virtual int handle_event(struct t_event *event); + virtual int unhandled(struct t_event *event); + virtual int mk_event(struct t_event *event, FILE *f, int key); + + virtual class cl_view *prev(void); + virtual class cl_view *prev_view(void); + + virtual int select(void); + virtual int unselect(void); + virtual class cl_view *get_by_state(unsigned int what, int enabled) + {return(0);} + virtual int select_next() {return(0);} + virtual class cl_view *current_sub_view(void); + virtual void set_current(class cl_view *view) {} + virtual int terminal_view(void); + virtual void change_state(unsigned int what, int enable); +}; + + +#endif + +/* End of gui.src/viewcl.h */ diff --git a/sim/ucsim/gui.src/obsolete/win.cc b/sim/ucsim/gui.src/obsolete/win.cc new file mode 100644 index 0000000..b5a9a92 --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/win.cc @@ -0,0 +1,111 @@ +/* + * Simulator of microcontrollers (win.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM 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. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include "ddconfig.h" + +#include <stdlib.h> +#include "i_string.h" + +#include "wincl.h" + + +cl_win::cl_win(class cl_box *ipos, char *ititle, class cl_app *iapp): + cl_group(ipos, 0, iapp) +{ + title= strdup(ititle); + free(name); + if (!ititle || + !(*ititle)) + { + name= (char*)malloc(100); + sprintf(name, "win%p", this); + } + else + name= strdup(ititle); +} + +cl_win::~cl_win(void) +{ + if (frame) + delete frame; + if (title) + free(title); +} + +int +cl_win::init(void) +{ + cl_group::init(); + if ((frame= mk_frame(pos))) + insert(frame); + class cl_box *b= new cl_box(pos->x,pos->y, pos->w,pos->h); + b->move_rel(1,1); + b->grow(-2,-2); + if ((intern= mk_intern(b))) + insert(intern); + //draw(); + delete b; + return(0); +} + +int * +cl_win::mk_palette(void) +{ + int *p= (int*)malloc(8*sizeof(int)), i; + for (i= 0; i < 8; i++) + p[i]= i+C_WIN; + return(p); +} + +class cl_frame * +cl_win::mk_frame(class cl_box *ipos) +{ + char n[100]= ""; + + sprintf(n, "frameof_\"%s\"", name); + class cl_frame *f= new cl_frame(ipos, this, n, app); + f->init(); + return(f); +} + +class cl_view * +cl_win::mk_intern(class cl_box *ipos) +{ + class cl_view *v= new cl_view(ipos, 0, app); + v->init(); + v->options&= ~OF_SELECTABLE; + return(v); +} + +char * +cl_win::get_title(void) +{ + return(title); +} + + +/* End of gui.src/win.cc */ diff --git a/sim/ucsim/gui.src/obsolete/wincl.h b/sim/ucsim/gui.src/obsolete/wincl.h new file mode 100644 index 0000000..ddbd0a9 --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/wincl.h @@ -0,0 +1,55 @@ +/* + * Simulator of microcontrollers (wincl.h) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM 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. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#ifndef WINCL_HEADER +#define WINCL_HEADER + +#include "groupcl.h" +#include "framecl.h" + + +class cl_win: public cl_group +{ +public: + class cl_view *frame; + class cl_view *intern; + char *title; +public: + cl_win(class cl_box *ipos, char *ititle, class cl_app *iapp); + ~cl_win(void); + virtual int init(void); + virtual int *mk_palette(void); + virtual class cl_frame *mk_frame(class cl_box *ipos); + virtual class cl_view *mk_intern(class cl_box *ipos); + + virtual char *get_title(void); +}; + + +#endif + +/* End of gui.src/wincl.h */ |
