1 // windows.cpp: Fenstersystem für IBM PC
  2 #include <stdio.h>
  3 #include <stdlib.h>
  4 #include <stdarg.h>
  5 #include "windows.hpp"
  6 // Konstruktor für ein Fenster
  7 Fenster::Fenster (int l, int o, int r, int u,
  8          char attri, char *Fenster_titel)
  9 {
 10 w_l_x = l;      // globale Werte eintragen
 11 w_o_y = o;
 12 w_r_x = r;
 13 w_u_y = u;
 14 w_attr = attri;
 15 w_cur_x = l +1; // wg. Rahmen
 16 w_cur_y = o +1;
 17 w_bytes = (r - l +1)*(u - o +1)*sizeof(int);
 18 w_save_buf = (int *) new char [w_bytes];
 19 w_leer = 0xfa;
 20 v_liesbox (w_save_buf, o,l,u,r);
 21 w_loeschen();
 22 w_make_box();
 23 w_titel(Fenster_titel,w_attr);
 24 w_anzahl++;
 25 }
 26 // Destruktor für ein Fenster
 27 Fenster::~Fenster()
 28 {
 29 // alten Bildschirm restaurieren
 30 v_schrbox (w_save_buf,w_o_y,w_l_x,w_u_y,w_r_x);
 31 delete [w_bytes] w_save_buf;
 32 w_anzahl--;
 33 if (!w_anzahl)
 34   {
 35    printf("\x1b[2J"); //am Ende
 36   }