3 * Copyright (C) 2008 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 #include <libx/base.h>
26 #include <libx/object.h>
27 #include <libx/image.h>
28 #include <libx/cursor.h>
29 #include <libx/text.h>
35 #include "filemanager.h"
38 unsigned terminal_act
= 0;
41 wmwindow
*term_window
;
43 static unsigned i
= 0;
44 static unsigned j
= 0;
45 static unsigned k
= 0;
58 : "=b" (term_base
) :: "%eax");
63 term_window
= window_create ("Terminal");
68 unsigned iterminal_exit ()
75 /* change current tty to process tty */
81 unsigned ret
= window_delete (term_window
);
91 unsigned terminal_handle ()
100 if (term_window
!= 0) {
102 switch (term_base
[i
*2+1]) {
108 if (term_base
[i
*2-7] == 'e')
109 if (term_base
[i
*2-5] == 'x')
110 if (term_base
[i
*2-3] == 'i')
111 if (term_base
[i
*2-1] == 't')
120 xrectfill (term_window
->x
+1+(j
*5), term_window
->y
+11+(k
*9), term_window
->x
+6+(j
*5), term_window
->y
+19+(k
*9), 0xffffff);
123 xtext_putch (term_window
->x
+1+(j
*5), term_window
->y
+11+(k
*9), term_base
[i
*2], term_base
[i
*2+1]);
127 if (j
*5 > term_window
->size_x
-6) {
128 term_window
->size_x
+= j
*5;
133 if (k
*9 > term_window
->size_y
)
134 term_window
->size_y
+= k
*9;
146 unsigned init_terminal ()