Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
8d9b7625
Commit
8d9b7625
authored
20 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Fix od_conio to use a single-line status bar. This fixes everything!
od_cio is now working 100%. Whee!
parent
698fc429
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/conio/od_cio.c
+61
-23
61 additions, 23 deletions
src/conio/od_cio.c
with
61 additions
and
23 deletions
src/conio/od_cio.c
+
61
−
23
View file @
8d9b7625
#include
<stdarg.h>
#include
<stdio.h>
#include
<OpenDoor.h>
#include
"conio.h"
...
...
@@ -10,16 +11,19 @@ const int OD_tabs[10]={9,17,25,33,41,49,57,65,73,80};
int
OD_puttext
(
int
sx
,
int
sy
,
int
ex
,
int
ey
,
unsigned
char
*
fill
)
{
struct
text_info
ti
;
gettextinfo
(
&
ti
);
if
(
sx
<
1
||
sx
>
80
||
sx
>
ti
.
screenwidth
||
sy
<
1
||
sy
>
23
||
sy
>
ti
.
screenheight
||
ex
<
sx
||
ey
<
sy
||
ex
<
1
||
ex
>
80
||
ex
>
ti
.
screenwidth
||
ey
<
1
||
ey
>
23
)
||
ey
>
ti
.
screenheight
)
return
(
0
);
return
(
od_puttext
(
sx
,
sy
,
ex
,
ey
,
fill
));
...
...
@@ -27,16 +31,19 @@ int OD_puttext(int sx, int sy, int ex, int ey, unsigned char *fill)
int
OD_gettext
(
int
sx
,
int
sy
,
int
ex
,
int
ey
,
unsigned
char
*
fill
)
{
struct
text_info
ti
;
gettextinfo
(
&
ti
);
if
(
sx
<
1
||
sx
>
80
||
sx
>
ti
.
screenwidth
||
sy
<
1
||
sy
>
23
||
sy
>
ti
.
screenheight
||
ex
<
sx
||
ey
<
sy
||
ex
<
1
||
ex
>
80
||
ex
>
ti
.
screenwidth
||
ey
<
1
||
ey
>
23
)
||
ey
>
ti
.
screenheight
)
return
(
0
);
return
(
od_gettext
(
sx
,
sy
,
ex
,
ey
,
fill
));
...
...
@@ -169,6 +176,7 @@ void OD_delay(long msec)
int
OD_wherey
(
void
)
{
int
row
,
col
;
struct
text_info
ti
;
od_get_cursor
(
&
row
,
&
col
);
return
(
row
);
...
...
@@ -177,6 +185,7 @@ int OD_wherey(void)
int
OD_wherex
(
void
)
{
int
row
,
col
;
struct
text_info
ti
;
od_get_cursor
(
&
row
,
&
col
);
return
(
col
);
...
...
@@ -230,20 +239,29 @@ int OD_putch(unsigned char ch)
break
;
default:
gettextinfo
(
&
ti
);
if
(
wherey
()
==
ti
.
winbottom
-
ti
.
wintop
+
1
&&
wherex
()
==
ti
.
winright
-
ti
.
winleft
+
1
)
{
od_putch
(
ch
);
wscroll
();
gotoxy
(
ti
.
winleft
,
ti
.
cury
);
if
(
OD_wherey
()
==
ti
.
screenheight
&&
OD_wherex
()
==
ti
.
screenwidth
)
{
if
(
_wscroll
)
{
od_putch
(
ch
);
gotoxy
(
ti
.
winleft
,
ti
.
cury
);
}
}
else
{
if
(
wherex
()
==
ti
.
winright
-
ti
.
winleft
+
1
)
{
if
(
wherey
()
==
ti
.
winbottom
-
ti
.
wintop
+
1
&&
wherex
()
==
ti
.
winright
-
ti
.
winleft
+
1
)
{
od_putch
(
ch
);
gotoxy
(
ti
.
winleft
,
ti
.
cury
+
1
);
wscroll
();
gotoxy
(
ti
.
winleft
,
ti
.
cury
);
}
else
{
od_putch
(
ch
);
gotoxy
(
ti
.
curx
+
1
,
ti
.
cury
);
if
(
wherex
()
==
ti
.
winright
-
ti
.
winleft
+
1
)
{
od_putch
(
ch
);
gotoxy
(
ti
.
winleft
,
ti
.
cury
+
1
);
}
else
{
od_putch
(
ch
);
gotoxy
(
ti
.
curx
+
1
,
ti
.
cury
);
}
}
}
break
;
...
...
@@ -254,20 +272,26 @@ int OD_putch(unsigned char ch)
void
OD_gotoxy
(
int
x
,
int
y
)
{
if
(
x
<
1
||
x
>
80
||
y
<
1
||
y
>
23
)
struct
text_info
ti
;
char
ansi
[
16
];
gettextinfo
(
&
ti
);
if
(
x
>
ti
.
screenwidth
||
x
<
1
||
y
>
ti
.
screenheight
||
y
<
1
)
return
;
sprintf
(
ansi
,
"%c[%d;%dH"
,
27
,
y
,
x
);
od_set_cursor
(
y
,
x
);
}
void
OD_gettextinfo
(
struct
text_info
*
info
)
{
info
->
currmode
=
3
;
info
->
screenheight
=
23
;
info
->
screenwidth
=
80
;
info
->
screenheight
=
od_control
.
user_screen_length
?
od_control
.
user_screen_length
:
23
;
info
->
screenwidth
=
od_control
.
user_screenwidth
?
od_control
.
user_screenwidth
:
80
;
info
->
curx
=
wherex
();
info
->
cury
=
wherey
();
info
->
attribute
=
OD_attr
;
...
...
@@ -321,7 +345,21 @@ void OD_textmode(int mode)
{
}
ODAPIDEF
void
ODCALL
OD_pers
(
BYTE
btOperation
)
{
switch
(
btOperation
)
{
case
PEROP_UPDATE1
:
case
PEROP_DISPLAY1
:
ODScrnSetAttribute
(
0x70
);
ODScrnSetCursorPos
(
1
,
25
);
ODScrnDisplayString
(
"Design me a better ONE-LINE Status Bar! (Include Custom Keys Descriptions etc) "
);
}
}
void
OD_initciowrap
(
long
mode
)
{
od_control
.
od_mps
=
INCLUDE_MPS
;
od_add_personality
(
"CONIO"
,
1
,
24
,
OD_pers
);
od_set_personality
(
"CONIO"
);
od_init
();
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment