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
debde8a8
Commit
debde8a8
authored
18 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Missing bits of seticon() from last night.
parent
7c40f05a
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/conio/sdl_con.c
+34
-0
34 additions, 0 deletions
src/conio/sdl_con.c
src/conio/sdl_con.h
+1
-0
1 addition, 0 deletions
src/conio/sdl_con.h
with
35 additions
and
0 deletions
src/conio/sdl_con.c
+
34
−
0
View file @
debde8a8
...
...
@@ -52,6 +52,7 @@ int sdl_exitcode=0;
SDL_Surface
*
sdl_font
=
NULL
;
SDL_Surface
*
sdl_cursor
=
NULL
;
SDL_Surface
*
sdl_icon
=
NULL
;
static
int
lastcursor_x
=
0
;
static
int
lastcursor_y
=
0
;
...
...
@@ -91,6 +92,7 @@ enum {
SDL_USEREVENT_UPDATERECT
,
SDL_USEREVENT_SETTITLE
,
SDL_USEREVENT_SETNAME
,
SDL_USEREVENT_SETICON
,
SDL_USEREVENT_SETVIDMODE
,
SDL_USEREVENT_SHOWMOUSE
,
SDL_USEREVENT_HIDEMOUSE
...
...
@@ -259,6 +261,15 @@ void sdl_user_func(int func, ...)
}
while
(
sdl
.
PeepEvents
(
&
ev
,
1
,
SDL_ADDEVENT
,
0xffffffff
)
!=
1
);
break
;
case
SDL_USEREVENT_SETICON
:
ev
.
user
.
data1
=
va_arg
(
argptr
,
void
*
);
if
((
ev
.
user
.
data2
=
(
unsigned
long
*
)
malloc
(
sizeof
(
unsigned
long
)))
==
NULL
)
{
va_end
(
argptr
);
return
;
}
*
(
unsigned
long
*
)
ev
.
user
.
data2
=
va_arg
(
argptr
,
unsigned
long
);
while
(
sdl
.
PeepEvents
(
&
ev
,
1
,
SDL_ADDEVENT
,
0xffffffff
)
!=
1
);
break
;
case
SDL_USEREVENT_SETTITLE
:
if
((
ev
.
user
.
data1
=
strdup
(
va_arg
(
argptr
,
char
*
)))
==
NULL
)
{
va_end
(
argptr
);
...
...
@@ -861,6 +872,13 @@ int sdl_setname(const char *name)
return
(
0
);
}
/* Called from main thread only (Passes Event) */
int
sdl_seticon
(
const
void
*
icon
,
unsigned
long
size
)
{
sdl_user_func
(
SDL_USEREVENT_SETICON
,
icon
,
size
);
return
(
0
);
}
/* Called from main thread only (Passes Event) */
int
sdl_settitle
(
const
char
*
title
)
{
...
...
@@ -1757,6 +1775,22 @@ int sdl_video_event_thread(void *data)
sdl
.
WM_SetCaption
((
char
*
)
ev
.
user
.
data1
,(
char
*
)
ev
.
user
.
data1
);
free
(
ev
.
user
.
data1
);
break
;
case
SDL_USEREVENT_SETICON
:
if
(
sdl_icon
!=
NULL
)
sdl
.
FreeSurface
(
sdl_icon
);
sdl_icon
=
sdl
.
CreateRGBSurfaceFrom
(
ev
.
user
.
data1
,
*
(
unsigned
long
*
)
ev
.
user
.
data2
,
*
(
unsigned
long
*
)
ev
.
user
.
data2
,
32
,
*
(
unsigned
long
*
)
ev
.
user
.
data2
*
4
,
*
(
DWORD
*
)
"
\377\0\0\0
"
,
*
(
DWORD
*
)
"
\0\377\0\0
"
,
*
(
DWORD
*
)
"
\0\0\377\0
"
,
*
(
DWORD
*
)
"
\0\0\0\377
"
);
sdl
.
WM_SetIcon
(
sdl_icon
,
NULL
);
free
(
ev
.
user
.
data2
);
break
;
case
SDL_USEREVENT_SETTITLE
:
sdl
.
WM_SetCaption
((
char
*
)
ev
.
user
.
data1
,
NULL
);
free
(
ev
.
user
.
data1
);
...
...
This diff is collapsed.
Click to expand it.
src/conio/sdl_con.h
+
1
−
0
View file @
debde8a8
...
...
@@ -30,6 +30,7 @@ int sdl_getche(void);
int
sdl_beep
(
void
);
void
sdl_textmode
(
int
mode
);
void
sdl_setname
(
const
char
*
name
);
void
sdl_seticon
(
const
void
*
,
unsigned
long
size
);
void
sdl_settitle
(
const
char
*
title
);
int
sdl_hidemouse
(
void
);
int
sdl_showmouse
(
void
);
...
...
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