Browse Source

- removed slk references

- corrected minor algo errors in primitives
- added doxygen @file header
tags/v0.9.3
Dan Lynch 18 years ago
parent
commit
14f5d3203d
2 changed files with 16 additions and 24 deletions
  1. 10
    6
      src/hci/mucurses/core.c
  2. 6
    18
      src/hci/mucurses/core.h

+ 10
- 6
src/hci/mucurses/core.c View File

1
 #include <curses.h>
1
 #include <curses.h>
2
 #include "core.h"
2
 #include "core.h"
3
 
3
 
4
+/** @file
5
+ *
6
+ * MuCurses core functions
7
+ *
8
+ */
9
+
4
 WINDOW _stdscr = {
10
 WINDOW _stdscr = {
5
 	.attrs = A_DEFAULT,
11
 	.attrs = A_DEFAULT,
6
 	.ori_y = 0,
12
 	.ori_y = 0,
10
 	.scr = curscr,
16
 	.scr = curscr,
11
 };
17
 };
12
 
18
 
13
-struct _softlabelkeys *slks;
14
-
15
 /*
19
 /*
16
  *  Primitives
20
  *  Primitives
17
  */
21
  */
29
 	win->scr->movetoyx( win->scr, win->ori_y + win->curs_y,
33
 	win->scr->movetoyx( win->scr, win->ori_y + win->curs_y,
30
 				      win->ori_x + win->curs_x );
34
 				      win->ori_x + win->curs_x );
31
 	win->scr->putc(win->scr, ch);
35
 	win->scr->putc(win->scr, ch);
32
-	if ( ++(win->curs_x) == win->width ) {
36
+	if ( ++(win->curs_x) - win->width == 0 ) {
33
 		if ( wrap == WRAP ) {
37
 		if ( wrap == WRAP ) {
34
 			win->curs_x = 0;
38
 			win->curs_x = 0;
35
 			/* specification says we should really scroll,
39
 			/* specification says we should really scroll,
36
 			   but we have no buffer to scroll with, so we
40
 			   but we have no buffer to scroll with, so we
37
 			   can only overwrite back at the beginning of
41
 			   can only overwrite back at the beginning of
38
 			   the window */
42
 			   the window */
39
-			if ( ++(win->curs_y) == win->height )
43
+			if ( ++(win->curs_y) - win->height == 0 )
40
 				win->curs_y = 0;
44
 				win->curs_y = 0;
41
 		} else {
45
 		} else {
42
 			(win->curs_x)--;
46
 			(win->curs_x)--;
82
  */
86
  */
83
 int wmove ( WINDOW *win, int y, int x ) {
87
 int wmove ( WINDOW *win, int y, int x ) {
84
 	/* chech for out-of-bounds errors */
88
 	/* chech for out-of-bounds errors */
85
-	if ( ( ( (unsigned)x - win->ori_x ) > win->width ) ||
86
-	     ( ( (unsigned)y - win->ori_y ) > win->height ) ) {
89
+	if ( ( (unsigned)y >= win->height ) ||
90
+	     ( (unsigned)x >= win->width ) ) {
87
 		return ERR;
91
 		return ERR;
88
 	}
92
 	}
89
 
93
 

+ 6
- 18
src/hci/mucurses/core.h View File

1
 #ifndef CORE_H
1
 #ifndef CORE_H
2
 #define CORE_H
2
 #define CORE_H
3
 
3
 
4
+/** @file
5
+ *
6
+ * MuCurses core implementation specific header file
7
+ *
8
+ */
9
+
4
 #define WRAP 0
10
 #define WRAP 0
5
 #define NOWRAP 1
11
 #define NOWRAP 1
6
 
12
 
13
 			       pointer and malloc the array into being
19
 			       pointer and malloc the array into being
14
 			       ... */
20
 			       ... */
15
 
21
 
16
-struct _softlabel {
17
-	// label string
18
-	char *label;
19
-	/* Format of soft label 
20
-	   0: left justify
21
-	   1: centre justify
22
-	   2: right justify
23
-	 */
24
-	unsigned short fmt;
25
-};
26
-
27
-struct _softlabelkeys {
28
-	struct _softlabel fkeys[12];
29
-	attr_t attrs;
30
-	unsigned short fmt;
31
-	unsigned short maxlablen;
32
-};
33
-
34
 void _wputch ( WINDOW *win, chtype ch, int wrap );
22
 void _wputch ( WINDOW *win, chtype ch, int wrap );
35
 void _wputchstr ( WINDOW *win, const chtype *chstr, int wrap, int n );
23
 void _wputchstr ( WINDOW *win, const chtype *chstr, int wrap, int n );
36
 void _wputstr ( WINDOW *win, const char *str, int wrap, int n );
24
 void _wputstr ( WINDOW *win, const char *str, int wrap, int n );

Loading…
Cancel
Save