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
0154c07d
Commit
0154c07d
authored
Feb 09, 2014
by
deuce
Browse files
Do the DLL im/ex-port dance.
parent
2aebfd81
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
27 deletions
+29
-27
src/conio/CMakeLists.txt
src/conio/CMakeLists.txt
+2
-0
src/conio/ciolib.h
src/conio/ciolib.h
+12
-12
src/conio/mouse.c
src/conio/mouse.c
+15
-15
No files found.
src/conio/CMakeLists.txt
View file @
0154c07d
...
...
@@ -58,6 +58,8 @@ target_include_directories(ciolib PRIVATE "${XPDev_DIR}/../../../include/xpdev")
target_compile_definitions
(
ciolib PRIVATE $<TARGET_PROPERTY:xpdev,INTERFACE_COMPILE_DEFINITIONS>
)
target_include_directories
(
ciolib PRIVATE $<TARGET_PROPERTY:xpdev,INTERFACE_INCLUDE_DIRECTORIES>
)
target_link_libraries
(
ciolib xpdev
)
target_compile_definitions
(
ciolib PRIVATE CIOLIB_EXPORTS
)
target_compile_definitions
(
ciolib INTERFACE CIOLIB_IMPORTS
)
if
(
SDL_FOUND
)
target_include_directories
(
ciolib PRIVATE
${
SDL_INCLUDE_DIR
}
)
...
...
src/conio/ciolib.h
View file @
0154c07d
...
...
@@ -493,18 +493,18 @@ extern int ciolib_mouse_initialized;
#ifdef __cplusplus
extern
"C"
{
#endif
void
ciomouse_gotevent
(
int
event
,
int
x
,
int
y
);
int
mouse_trywait
(
void
);
int
mouse_wait
(
void
);
int
mouse_pending
(
void
);
int
ciolib_getmouse
(
struct
mouse_event
*
mevent
);
int
ciolib_ungetmouse
(
struct
mouse_event
*
mevent
);
void
ciolib_mouse_thread
(
void
*
data
);
int
ciomouse_setevents
(
int
events
);
int
ciomouse_addevents
(
int
events
);
int
ciomouse_delevents
(
int
events
);
int
ciomouse_addevent
(
int
event
);
int
ciomouse_delevent
(
int
event
);
CIOLIBEXPORT
void
CIOLIBCALL
ciomouse_gotevent
(
int
event
,
int
x
,
int
y
);
CIOLIBEXPORT
int
CIOLIBCALL
mouse_trywait
(
void
);
CIOLIBEXPORT
int
CIOLIBCALL
mouse_wait
(
void
);
CIOLIBEXPORT
int
CIOLIBCALL
mouse_pending
(
void
);
CIOLIBEXPORT
int
CIOLIBCALL
ciolib_getmouse
(
struct
mouse_event
*
mevent
);
CIOLIBEXPORT
int
CIOLIBCALL
ciolib_ungetmouse
(
struct
mouse_event
*
mevent
);
CIOLIBEXPORT
void
CIOLIBCALL
ciolib_mouse_thread
(
void
*
data
);
CIOLIBEXPORT
int
CIOLIBCALL
ciomouse_setevents
(
int
events
);
CIOLIBEXPORT
int
CIOLIBCALL
ciomouse_addevents
(
int
events
);
CIOLIBEXPORT
int
CIOLIBCALL
ciomouse_delevents
(
int
events
);
CIOLIBEXPORT
int
CIOLIBCALL
ciomouse_addevent
(
int
event
);
CIOLIBEXPORT
int
CIOLIBCALL
ciomouse_delevent
(
int
event
);
#ifdef __cplusplus
}
#endif
...
...
src/conio/mouse.c
View file @
0154c07d
...
...
@@ -100,7 +100,7 @@ int ciolib_mouse_initialized=0;
static
int
ungot
=
0
;
pthread_mutex_t
unget_mutex
;
void
init_mouse
(
void
)
void
CIOLIBCALL
init_mouse
(
void
)
{
memset
(
&
state
,
0
,
sizeof
(
state
));
state
.
click_timeout
=
0
;
...
...
@@ -111,37 +111,37 @@ void init_mouse(void)
ciolib_mouse_initialized
=
1
;
}
int
ciomouse_setevents
(
int
events
)
int
CIOLIBCALL
ciomouse_setevents
(
int
events
)
{
mouse_events
=
events
;
return
mouse_events
;
}
int
ciomouse_addevents
(
int
events
)
int
CIOLIBCALL
ciomouse_addevents
(
int
events
)
{
mouse_events
|=
events
;
return
mouse_events
;
}
int
ciomouse_delevents
(
int
events
)
int
CIOLIBCALL
ciomouse_delevents
(
int
events
)
{
mouse_events
&=
~
events
;
return
mouse_events
;
}
int
ciomouse_addevent
(
int
event
)
int
CIOLIBCALL
ciomouse_addevent
(
int
event
)
{
mouse_events
|=
(
1
<<
event
);
return
mouse_events
;
}
int
ciomouse_delevent
(
int
event
)
int
CIOLIBCALL
ciomouse_delevent
(
int
event
)
{
mouse_events
&=
~
(
1
<<
event
);
return
mouse_events
;
}
void
ciomouse_gotevent
(
int
event
,
int
x
,
int
y
)
void
CIOLIBCALL
ciomouse_gotevent
(
int
event
,
int
x
,
int
y
)
{
struct
in_mouse_event
*
ime
;
...
...
@@ -157,7 +157,7 @@ void ciomouse_gotevent(int event, int x, int y)
listPushNode
(
&
state
.
input
,
ime
);
}
void
add_outevent
(
int
event
,
int
x
,
int
y
)
void
CIOLIBCALL
add_outevent
(
int
event
,
int
x
,
int
y
)
{
struct
out_mouse_event
*
ome
;
int
but
;
...
...
@@ -179,7 +179,7 @@ void add_outevent(int event, int x, int y)
listPushNode
(
&
state
.
output
,
ome
);
}
int
more_multies
(
int
button
,
int
clicks
)
int
CIOLIBCALL
more_multies
(
int
button
,
int
clicks
)
{
switch
(
clicks
)
{
case
0
:
...
...
@@ -198,7 +198,7 @@ int more_multies(int button, int clicks)
return
(
0
);
}
void
ciolib_mouse_thread
(
void
*
data
)
void
CIOLIBCALL
ciolib_mouse_thread
(
void
*
data
)
{
int
timedout
;
int
timeout_button
=
0
;
...
...
@@ -431,7 +431,7 @@ void ciolib_mouse_thread(void *data)
}
}
int
mouse_trywait
(
void
)
int
CIOLIBCALL
mouse_trywait
(
void
)
{
int
result
;
...
...
@@ -449,7 +449,7 @@ int mouse_trywait(void)
}
}
int
mouse_wait
(
void
)
int
CIOLIBCALL
mouse_wait
(
void
)
{
int
result
;
...
...
@@ -467,14 +467,14 @@ int mouse_wait(void)
}
}
int
mouse_pending
(
void
)
int
CIOLIBCALL
mouse_pending
(
void
)
{
while
(
!
ciolib_mouse_initialized
)
SLEEP
(
1
);
return
(
listCountNodes
(
&
state
.
output
));
}
int
ciolib_getmouse
(
struct
mouse_event
*
mevent
)
int
CIOLIBCALL
ciolib_getmouse
(
struct
mouse_event
*
mevent
)
{
int
retval
=
0
;
...
...
@@ -505,7 +505,7 @@ int ciolib_getmouse(struct mouse_event *mevent)
return
(
retval
);
}
int
ciolib_ungetmouse
(
struct
mouse_event
*
mevent
)
int
CIOLIBCALL
ciolib_ungetmouse
(
struct
mouse_event
*
mevent
)
{
struct
mouse_event
*
me
;
...
...
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