Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Main
Synchronet
Commits
7473b8e8
Commit
7473b8e8
authored
Oct 12, 2017
by
rswindell
Browse files
Terminology update (GET -> COPY, PUT -> PASTE).
Added Cut and Paste-Insert support to stdio version of UIFC.
parent
fa9e35bf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
29 deletions
+48
-29
src/uifc/uifc.h
src/uifc/uifc.h
+3
-3
src/uifc/uifc32.c
src/uifc/uifc32.c
+11
-11
src/uifc/uifcx.c
src/uifc/uifcx.c
+34
-15
No files found.
src/uifc/uifc.h
View file @
7473b8e8
...
...
@@ -206,11 +206,11 @@
/* And ungets the mouse event. */
#define K_PASSWORD (1L<<16)
/* Does not display text while editing */
/* Bottom line elements */
/* Bottom line elements */
#define BL_INS (1<<0)
/* INS key */
#define BL_DEL (1<<1)
/* DEL key */
#define BL_
GET
(1<<2)
/*
Get key
*/
#define BL_P
UT
(1<<3)
/* P
ut key
*/
#define BL_
COPY
(1<<2)
/*
Copy operation
*/
#define BL_P
ASTE
(1<<3)
/* P
aste operation
*/
#define BL_EDIT (1<<4)
/* Edit key */
#define BL_HELP (1<<5)
/* Help key */
...
...
src/uifc/uifc32.c
View file @
7473b8e8
...
...
@@ -695,12 +695,12 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
if
(
api
->
helpbuf
!=
NULL
||
api
->
helpixbfile
[
0
]
!=
0
)
bline
|=
BL_HELP
;
if
(
mode
&
WIN_INS
)
bline
|=
BL_INS
;
if
(
mode
&
WIN_DEL
)
bline
|=
BL_DEL
;
if
(
mode
&
WIN_
GET
)
bline
|=
BL_
GET
;
if
(
mode
&
WIN_P
UT
)
bline
|=
BL_P
UT
;
if
(
mode
&
WIN_
COPY
)
bline
|=
BL_
COPY
;
if
(
mode
&
WIN_P
ASTE
)
bline
|=
BL_P
ASTE
;
if
(
mode
&
WIN_EDIT
)
bline
|=
BL_EDIT
;
if
(
api
->
bottomline
!=
NULL
)
{
if
((
mode
&
(
WIN_XTR
|
WIN_PASTEXTR
))
==
WIN_XTR
&&
(
*
cur
)
==
opts
-
1
)
api
->
bottomline
(
bline
&
~
BL_P
UT
);
api
->
bottomline
(
bline
&
~
BL_P
ASTE
);
else
api
->
bottomline
(
bline
);
}
...
...
@@ -1593,19 +1593,19 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
break
;
case
CIO_KEY_F
(
5
):
/* F5 - Copy */
case
CIO_KEY_CTRL_IC
:
/* Ctrl-Insert */
if
(
mode
&
WIN_
GET
&&
!
(
mode
&
WIN_XTR
&&
(
*
cur
)
==
opts
-
1
))
if
(
mode
&
WIN_
COPY
&&
!
(
mode
&
WIN_XTR
&&
(
*
cur
)
==
opts
-
1
))
return
((
*
cur
)
|
MSK_GET
);
break
;
case
CIO_KEY_SHIFT_DC
:
/* Shift-Del: Cut */
if
(
mode
&
WIN_
GET
&&
!
(
mode
&
WIN_XTR
&&
(
*
cur
)
==
opts
-
1
))
if
(
mode
&
WIN_
COPY
&&
!
(
mode
&
WIN_XTR
&&
(
*
cur
)
==
opts
-
1
))
return
((
*
cur
)
|
MSK_CUT
);
break
;
case
CIO_KEY_SHIFT_IC
:
/* Shift-Insert: Paste-Insert */
if
(
mode
&
WIN_P
UT
)
if
(
mode
&
WIN_P
ASTE
)
return
((
*
cur
)
|
MSK_PASTE_INSERT
);
break
;
case
CIO_KEY_F
(
6
):
/* F6 - Paste-Over */
if
(
mode
&
WIN_P
UT
&&
(
mode
&
WIN_PASTEXTR
||
!
(
mode
&
WIN_XTR
&&
(
*
cur
)
==
opts
-
1
)))
if
(
mode
&
WIN_P
ASTE
&&
(
mode
&
WIN_PASTEXTR
||
!
(
mode
&
WIN_XTR
&&
(
*
cur
)
==
opts
-
1
)))
return
((
*
cur
)
|
MSK_PASTE_OVER
);
break
;
case
CIO_KEY_IC
:
/* insert */
...
...
@@ -1825,9 +1825,9 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
}
}
/* Update the status bar to reflect the Put/Paste option applicability */
if
(
bline
&
BL_P
UT
&&
api
->
bottomline
!=
NULL
)
{
if
(
bline
&
BL_P
ASTE
&&
api
->
bottomline
!=
NULL
)
{
if
((
mode
&
(
WIN_XTR
|
WIN_PASTEXTR
))
==
WIN_XTR
&&
(
*
cur
)
==
opts
-
1
)
api
->
bottomline
(
bline
&
~
BL_P
UT
);
api
->
bottomline
(
bline
&
~
BL_P
ASTE
);
else
api
->
bottomline
(
bline
);
}
...
...
@@ -2428,13 +2428,13 @@ void bottomline(int line)
uprintf
(
i
,
api
->
scrn_len
+
1
,
BLACK
|
(
api
->
cclr
<<
4
),
"Edit Item "
);
i
+=
11
;
}
if
(
line
&
BL_
GET
)
{
if
(
line
&
BL_
COPY
)
{
uprintf
(
i
,
api
->
scrn_len
+
1
,
api
->
bclr
|
(
api
->
cclr
<<
4
),
"F5 "
);
i
+=
3
;
uprintf
(
i
,
api
->
scrn_len
+
1
,
BLACK
|
(
api
->
cclr
<<
4
),
"Copy Item "
);
i
+=
11
;
}
if
(
line
&
BL_P
UT
)
{
if
(
line
&
BL_P
ASTE
)
{
uprintf
(
i
,
api
->
scrn_len
+
1
,
api
->
bclr
|
(
api
->
cclr
<<
4
),
"F6 "
);
i
+=
3
;
uprintf
(
i
,
api
->
scrn_len
+
1
,
BLACK
|
(
api
->
cclr
<<
4
),
"Paste "
);
...
...
src/uifc/uifcx.c
View file @
7473b8e8
...
...
@@ -254,10 +254,10 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
}
}
str
[
0
]
=
0
;
if
(
mode
&
WIN_
GET
)
strcat
(
str
,
", Copy"
);
if
(
mode
&
WIN_P
UT
)
strcat
(
str
,
", Paste"
);
if
(
mode
&
WIN_
COPY
)
strcat
(
str
,
", Copy
, X-Cut
"
);
if
(
mode
&
WIN_P
ASTE
)
strcat
(
str
,
", Paste
, Insert
"
);
if
(
mode
&
WIN_INS
)
strcat
(
str
,
", Add"
);
if
(
mode
&
WIN_DEL
)
...
...
@@ -313,31 +313,50 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
if
(
opts
==
1
)
return
(
MSK_DEL
);
return
(
which
(
"Delete"
,
opts
)
|
MSK_DEL
);
case
'C'
:
/* Copy
/Get
*/
if
(
!
(
mode
&
WIN_
GET
))
case
'C'
:
/* Copy */
if
(
!
(
mode
&
WIN_
COPY
))
break
;
if
(
!
opts
)
break
;
if
(
i
>
0
&&
i
<=
opts
)
return
((
i
-
1
)
|
MSK_
GET
);
return
((
i
-
1
)
|
MSK_
COPY
);
if
(
opts
==
1
)
return
(
MSK_
GET
);
return
(
which
(
"Copy"
,
opts
)
|
MSK_
GET
);
case
'
P
'
:
/*
Paste/P
ut */
if
(
!
(
mode
&
WIN_
PUT
))
return
(
MSK_
COPY
);
return
(
which
(
"Copy"
,
opts
)
|
MSK_
COPY
);
case
'
X
'
:
/*
C
ut */
if
(
!
(
mode
&
WIN_
COPY
))
break
;
if
(
!
opts
)
break
;
if
(
i
>
0
&&
i
<=
opts
)
return
((
i
-
1
)
|
MSK_
P
UT
);
return
((
i
-
1
)
|
MSK_
C
UT
);
if
(
opts
==
1
)
return
(
MSK_PUT
);
return
(
which
(
"Paste"
,
opts
)
|
MSK_PUT
);
return
(
MSK_CUT
);
return
(
which
(
"Cut"
,
opts
)
|
MSK_CUT
);
case
'P'
:
/* Paste-Over */
if
(
!
(
mode
&
WIN_PASTE
))
break
;
if
(
!
opts
)
break
;
if
(
i
>
0
&&
i
<=
opts
)
return
((
i
-
1
)
|
MSK_PASTE_OVER
);
if
(
opts
==
1
)
return
(
MSK_PASTE_OVER
);
return
(
which
(
"Paste over"
,
opts
)
|
MSK_PASTE_OVER
);
case
'I'
:
/* Paste-Insert */
if
(
!
(
mode
&
WIN_PASTE
))
break
;
if
(
!
opts
)
break
;
if
(
i
>
0
&&
i
<=
opts
+
1
)
return
((
i
-
1
)
|
MSK_PASTE_INSERT
);
if
(
opts
==
1
)
return
(
MSK_PASTE_INSERT
);
return
(
which
(
"Insert pasted item before"
,
opts
+
1
)
|
MSK_PASTE_INSERT
);
}
}
}
/*************************************************************************/
/* This function is a windowed input string input routine. */
/*************************************************************************/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment