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
4fb6883a
Commit
4fb6883a
authored
21 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Win32 support in uifc32.c... tested, appears to work.
parent
4be06eb6
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/uifc/keys.h
+14
-0
14 additions, 0 deletions
src/uifc/keys.h
src/uifc/uifc32.c
+32
-14
32 additions, 14 deletions
src/uifc/uifc32.c
with
46 additions
and
14 deletions
src/uifc/keys.h
0 → 100644
+
14
−
0
View file @
4fb6883a
#define KEY_HOME 0x47 << 8
#define KEY_UP 72 << 8
#define KEY_END 0x4f << 8
#define KEY_DOWN 80 << 8
#define KEY_F(x) (0x3a+x) << 8
#define KEY_IC 0x52 << 8
#define KEY_DC 0x53 << 8
#define KEY_LEFT 0x4b << 8
#define KEY_RIGHT 0x4d << 8
#define KEY_PPAGE 0x49 << 8
#define KEY_NPAGE 0x51 << 8
/* #define KEY_BACKSPACE '\b' << 8 This is most likely wrong */
#define KEY_BACKSPACE 0xff << 8
/* Just a placeholder for now */
This diff is collapsed.
Click to expand it.
src/uifc/uifc32.c
+
32
−
14
View file @
4fb6883a
...
...
@@ -41,10 +41,14 @@
#endif
#include
"ciowrap.h"
#define mswait(x) delay(x)
#define putch(x) _putch(x,TRUE)
#define clreol() clrtoeol()
#define strnicmp(x,y,z) strncasecmp(x,y,z)
#elif defined(_WIN32)
#include
<share.h>
#include
<conio.h>
#include
<windows.h>
#include
"keys.h"
#define mswait(x) Sleep(x)
#endif
...
...
@@ -56,24 +60,26 @@
#define BL_GET (1<<2)
/* Get key */
#define BL_PUT (1<<3)
/* Put key */
#ifdef __unix__
enum
{
BLACK
,
BLUE
,
GREEN
,
CYAN
,
CYAN
,
RED
,
MAGENTA
,
MAGENTA
,
BROWN
,
LIGHTGRAY
,
DARKGRAY
,
DARKGRAY
,
LIGHTBLUE
,
LIGHTGREEN
,
LIGHTCYAN
,
LIGHTRED
,
LIGHTCYAN
,
LIGHTRED
,
LIGHTMAGENTA
,
YELLOW
,
WHITE
};
#endif
#define BLINK 128
...
...
@@ -93,7 +99,6 @@ static char *utimestr(time_t *intime);
static
void
help
();
static
int
ugetstr
(
char
*
outstr
,
int
max
,
long
mode
);
static
void
timedisplay
(
void
);
#define putch(x) _putch(x,TRUE)
/* API routines */
static
void
uifcbail
(
void
);
...
...
@@ -126,6 +131,20 @@ static void reset_dynamic(void) {
/* Returns 0 on success. */
/****************************************************************************/
#ifdef _WIN32
/* ToDo Merge with __unix__ */
int
inkey
(
int
mode
)
{
int
c
;
if
(
mode
)
return
(
kbhit
());
c
=
getch
();
if
(
!
c
)
c
=
(
getch
()
<<
8
);
return
(
c
);
}
#endif
int
uifcini32
(
uifcapi_t
*
uifcapi
)
{
int
i
;
...
...
@@ -262,14 +281,13 @@ int uscrn(char *str)
{
textattr
(
bclr
|
(
cclr
<<
4
));
gotoxy
(
1
,
1
);
clr
to
eol
();
clreol
();
gotoxy
(
3
,
1
);
cputs
(
str
);
if
(
!
puttext
(
1
,
2
,
api
->
scrn_width
,
api
->
scrn_len
,
blk_scrn
))
return
(
-
1
);
gotoxy
(
1
,
api
->
scrn_len
+
1
);
clrtoeol
();
refresh
();
clreol
();
reset_dynamic
();
return
(
0
);
}
...
...
@@ -873,12 +891,12 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
break
;
case
KEY_F
(
5
):
/* F5 */
if
(
mode
&
WIN_GET
&&
!
(
mode
&
WIN_XTR
&&
(
*
cur
)
==
opts
-
1
))
{
return
((
*
cur
)
|
MSK_GET
);
return
((
*
cur
)
|
MSK_GET
);
}
break
;
case
KEY_F
(
6
):
/* F6 */
if
(
mode
&
WIN_PUT
&&
!
(
mode
&
WIN_XTR
&&
(
*
cur
)
==
opts
-
1
))
{
return
((
*
cur
)
|
MSK_PUT
);
return
((
*
cur
)
|
MSK_PUT
);
}
break
;
case
KEY_IC
:
/* insert */
...
...
@@ -943,7 +961,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
if
(
a
==
1
&&
!
s
)
break
;
if
(
strlen
(
option
[
j
])
>
b
&&
((
!
a
&&
s
&&
!
strn
case
cmp
(
option
[
j
]
+
b
,
search
,
s
+
1
))
&&
((
!
a
&&
s
&&
!
strn
i
cmp
(
option
[
j
]
+
b
,
search
,
s
+
1
))
||
((
a
||
!
s
)
&&
toupper
(
option
[
j
][
b
])
==
toupper
(
i
))))
{
if
(
a
)
s
=
0
;
else
s
++
;
...
...
@@ -1014,7 +1032,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
}
}
if
(
a
==
2
)
s
=
0
;
s
=
0
;
}
else
switch
(
i
)
{
...
...
@@ -1452,7 +1470,7 @@ void bottomline(int line)
i
+=
4
;
gotoxy
(
i
,
api
->
scrn_len
+
1
);
textattr
(
BLACK
|
(
cclr
<<
4
));
clr
to
eol
();
clreol
();
}
...
...
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