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
b15555cc
Commit
b15555cc
authored
1 year ago
by
Deucе
Browse files
Options
Downloads
Patches
Plain Diff
Implement mousepointer()
parent
fec44dbb
No related branches found
No related tags found
1 merge request
!463
MRC mods by Codefenix (2024-10-20)
Pipeline
#4158
passed
1 year ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/conio/win32gdi.c
+30
-2
30 additions, 2 deletions
src/conio/win32gdi.c
with
30 additions
and
2 deletions
src/conio/win32gdi.c
+
30
−
2
View file @
b15555cc
...
...
@@ -16,10 +16,12 @@ static HANDLE wch;
static
bool
maximized
=
false
;
static
uint16_t
winxpos
,
winypos
;
static
const
DWORD
style
=
WS_OVERLAPPEDWINDOW
|
WS_VISIBLE
;
static
HCURSOR
cursor
=
IDC_IBEAM
;
#define WM_USER_INVALIDATE WM_USER
#define WM_USER_SETSIZE (WM_USER + 1)
#define WM_USER_SETPOS (WM_USER + 2)
#define WM_USER_SETCURSOR (WM_USER + 3)
#define LCS_WINDOWS_COLOR_SPACE 0x57696E20
...
...
@@ -384,6 +386,17 @@ gdi_handle_mouse_wheel(int16_t distance, LPARAM lParam)
return
0
;
}
static
LRESULT
gdi_handle_activate
(
HWND
hwnd
,
WPARAM
wParam
)
{
static
LPCTSTR
lc
=
IDC_IBEAM
;
uint16_t
lw
=
wParam
&
0xffff
;
if
(
lw
!=
0
)
SetCursor
(
cursor
);
return
0
;
}
static
LRESULT
CALLBACK
gdi_WndProc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
switch
(
msg
)
{
...
...
@@ -418,6 +431,12 @@ gdi_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
return
gdi_handle_mouse_button
(
lParam
,
CIOLIB_BUTTON_PRESS
(
3
));
case
WM_RBUTTONUP
:
return
gdi_handle_mouse_button
(
lParam
,
CIOLIB_BUTTON_RELEASE
(
3
));
case
WM_ACTIVATE
:
return
gdi_handle_activate
(
hwnd
,
wParam
);
case
WM_SETCURSOR
:
case
WM_USER_SETCURSOR
:
SetCursor
(
cursor
);
return
0
;
}
return
DefWindowProcW
(
hwnd
,
msg
,
wParam
,
lParam
);
...
...
@@ -608,11 +627,12 @@ gdi_thread(void *arg)
wc
.
lpfnWndProc
=
gdi_WndProc
;
wc
.
hInstance
=
WinMainHInst
;
//wc.hIcon = ICON; // TODO: Icon from ciolib.rc
wc
.
hCursor
=
LoadCursor
(
0
,
IDC_IBEAM
);
wc
.
hCursor
=
LoadCursor
(
NULL
,
cursor
);
wc
.
hbrBackground
=
NULL
;
wc
.
lpszMenuName
=
NULL
;
wc
.
lpszClassName
=
L"SyncConsole"
;
cursor
=
wc
.
hCursor
;
RegisterClassW
(
&
wc
);
pthread_mutex_lock
(
&
vstatlock
);
// Now make the inside of the window the size we want (sigh)
...
...
@@ -871,7 +891,15 @@ gdi_flush(void)
int
gdi_mousepointer
(
enum
ciolib_mouse_ptr
type
)
{
// TODO
switch
(
type
)
{
case
CIOLIB_MOUSEPTR_ARROW
:
cursor
=
LoadCursor
(
NULL
,
IDC_ARROW
);
break
;
case
CIOLIB_MOUSEPTR_BAR
:
cursor
=
LoadCursor
(
NULL
,
IDC_IBEAM
);
break
;
}
PostMessageW
(
win
,
WM_USER_SETCURSOR
,
0
,
0
);
return
0
;
}
...
...
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