Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
9d59fb72
Commit
9d59fb72
authored
Jul 11, 2003
by
Richard Cohen
Committed by
Alexandre Julliard
Jul 11, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- remove escaped newlines, bogus "exit", printf's
- start at a sensible size - tidy up WndProc - use a timer instead of sleeping in the message loop (Ugh!)
parent
eede817d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
45 deletions
+37
-45
README
programs/clock/README
+2
-9
TODO
programs/clock/TODO
+0
-3
language.c
programs/clock/language.c
+10
-10
main.c
programs/clock/main.c
+25
-22
winclock.c
programs/clock/winclock.c
+0
-1
No files found.
programs/clock/README
View file @
9d59fb72
...
...
@@ -3,13 +3,6 @@
==============
This is a first attempt to realize a desktop clock for Wine as done in
Windows. It'
a an early release and most
of the code is still broken.
Windows. It'
s an early release and some
of the code is still broken.
Please see file TODO for things to do and keep the file ChangeLog
up to date.
Code is currently under heavy construction. Please direct patches and
additions to my personal email address <mbaur@g26.ethz.ch>
If you think that the compiled binary is too big, you can reduce its size
with the command 'strip clock' (please don't try this on libraries).
Originally contributed by <mbaur@g26.ethz.ch>
programs/clock/TODO
View file @
9d59fb72
...
...
@@ -8,9 +8,6 @@ Some ideas for improvements:
- Font Handling of Digital Clock.
(Does not work probably due to Winelib)
- Implement Timer Mechanism instead Polling.
Clock does not run if menu is being selected (?).
- Complete translation for the following languages : Pt,Sk
- Add new .rc resources for all languages you know. That's in fact very easy.
...
...
programs/clock/language.c
View file @
9d59fb72
...
...
@@ -33,11 +33,11 @@ VOID LANGUAGE_UpdateMenuCheckmarks(VOID) {
/* analog clock */
CheckMenuItem
(
Globals
.
hPropertiesMenu
,
0x100
,
\
CheckMenuItem
(
Globals
.
hPropertiesMenu
,
0x100
,
MF_BYCOMMAND
|
MF_CHECKED
);
CheckMenuItem
(
Globals
.
hPropertiesMenu
,
0x101
,
\
CheckMenuItem
(
Globals
.
hPropertiesMenu
,
0x101
,
MF_BYCOMMAND
|
MF_UNCHECKED
);
EnableMenuItem
(
Globals
.
hPropertiesMenu
,
0x103
,
\
EnableMenuItem
(
Globals
.
hPropertiesMenu
,
0x103
,
MF_BYCOMMAND
|
MF_GRAYED
);
}
else
...
...
@@ -45,22 +45,22 @@ VOID LANGUAGE_UpdateMenuCheckmarks(VOID) {
/* digital clock */
CheckMenuItem
(
Globals
.
hPropertiesMenu
,
0x100
,
\
CheckMenuItem
(
Globals
.
hPropertiesMenu
,
0x100
,
MF_BYCOMMAND
|
MF_UNCHECKED
);
CheckMenuItem
(
Globals
.
hPropertiesMenu
,
0x101
,
\
CheckMenuItem
(
Globals
.
hPropertiesMenu
,
0x101
,
MF_BYCOMMAND
|
MF_CHECKED
);
EnableMenuItem
(
Globals
.
hPropertiesMenu
,
0x103
,
\
EnableMenuItem
(
Globals
.
hPropertiesMenu
,
0x103
,
MF_BYCOMMAND
);
}
CheckMenuItem
(
Globals
.
hPropertiesMenu
,
0x105
,
MF_BYCOMMAND
|
\
CheckMenuItem
(
Globals
.
hPropertiesMenu
,
0x105
,
MF_BYCOMMAND
|
(
Globals
.
bWithoutTitle
?
MF_CHECKED
:
MF_UNCHECKED
));
CheckMenuItem
(
Globals
.
hSystemMenu
,
0x10D
,
MF_BYCOMMAND
|
\
CheckMenuItem
(
Globals
.
hSystemMenu
,
0x10D
,
MF_BYCOMMAND
|
(
Globals
.
bAlwaysOnTop
?
MF_CHECKED
:
MF_UNCHECKED
));
CheckMenuItem
(
Globals
.
hPropertiesMenu
,
0x107
,
MF_BYCOMMAND
|
\
CheckMenuItem
(
Globals
.
hPropertiesMenu
,
0x107
,
MF_BYCOMMAND
|
(
Globals
.
bSeconds
?
MF_CHECKED
:
MF_UNCHECKED
));
CheckMenuItem
(
Globals
.
hPropertiesMenu
,
0x108
,
MF_BYCOMMAND
|
\
CheckMenuItem
(
Globals
.
hPropertiesMenu
,
0x108
,
MF_BYCOMMAND
|
(
Globals
.
bDate
?
MF_CHECKED
:
MF_UNCHECKED
));
}
...
...
programs/clock/main.c
View file @
9d59fb72
...
...
@@ -33,6 +33,10 @@
#include "winclock.h"
#include "commdlg.h"
#define INITIAL_WINDOW_SIZE 200
#define TIMER_ID 1
#define TIMER_PERIOD 50
/* milliseconds */
CLOCK_GLOBALS
Globals
;
/***********************************************************************
...
...
@@ -153,18 +157,13 @@ VOID MAIN_FileChooseFont(VOID) {
LRESULT
WINAPI
CLOCK_WndProc
(
HWND
hWnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
PAINTSTRUCT
ps
;
HDC
context
;
switch
(
msg
)
{
case
WM_CREATE
:
{
printf
(
"WM_CREATE
\n
"
);
break
;
}
case
WM_RBUTTONUP
:
{
printf
(
"WM_RBUTTONUP
\n
"
);
Globals
.
bWithoutTitle
=
!
Globals
.
bWithoutTitle
;
LANGUAGE_UpdateMenuCheckmarks
();
LANGUAGE_UpdateWindowCaption
();
...
...
@@ -173,7 +172,9 @@ LRESULT WINAPI CLOCK_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
}
case
WM_PAINT
:
{
printf
(
"WM_PAINT
\n
"
);
PAINTSTRUCT
ps
;
HDC
context
;
context
=
BeginPaint
(
hWnd
,
&
ps
);
if
(
Globals
.
bAnalog
)
{
DrawFace
(
context
);
...
...
@@ -188,7 +189,6 @@ LRESULT WINAPI CLOCK_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
}
case
WM_SIZE
:
{
printf
(
"WM_SIZE
\n
"
);
Globals
.
MaxX
=
LOWORD
(
lParam
);
Globals
.
MaxY
=
HIWORD
(
lParam
);
OldHour
.
DontRedraw
=
TRUE
;
...
...
@@ -202,8 +202,12 @@ LRESULT WINAPI CLOCK_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
break
;
}
case
WM_TIMER
:
{
Idle
(
0
);
break
;
}
case
WM_DESTROY
:
{
printf
(
"WM_DESTROY
\n
"
);
PostQuitMessage
(
0
);
break
;
}
...
...
@@ -211,7 +215,7 @@ LRESULT WINAPI CLOCK_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
default:
return
DefWindowProc
(
hWnd
,
msg
,
wParam
,
lParam
);
}
return
0
l
;
return
0
;
}
...
...
@@ -257,9 +261,16 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show
if
(
!
RegisterClass
(
&
class
))
return
FALSE
;
Globals
.
MaxX
=
Globals
.
MaxY
=
INITIAL_WINDOW_SIZE
;
Globals
.
hMainWnd
=
CreateWindow
(
szClassName
,
szWinName
,
WS_OVERLAPPEDWINDOW
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
Globals
.
MaxX
,
Globals
.
MaxY
,
0
,
LoadMenu
(
Globals
.
hInstance
,
STRING_MENU_Xx
),
Globals
.
hInstance
,
0
);
CW_USEDEFAULT
,
CW_USEDEFAULT
,
Globals
.
MaxX
,
Globals
.
MaxY
,
0
,
0
,
Globals
.
hInstance
,
0
);
if
(
!
SetTimer
(
Globals
.
hMainWnd
,
TIMER_ID
,
TIMER_PERIOD
,
NULL
))
{
MessageBox
(
0
,
"No available timers"
,
szWinName
,
MB_ICONEXCLAMATION
|
MB_OK
);
return
FALSE
;
}
LANGUAGE_LoadMenus
();
SetMenu
(
Globals
.
hMainWnd
,
Globals
.
hMainMenu
);
...
...
@@ -269,18 +280,10 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show
ShowWindow
(
Globals
.
hMainWnd
,
show
);
UpdateWindow
(
Globals
.
hMainWnd
);
while
(
TRUE
)
{
Sleep
(
1
);
if
(
PeekMessage
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
{
if
(
msg
.
message
==
WM_QUIT
)
return
msg
.
wParam
;
TranslateMessage
(
&
msg
);
DispatchMessage
(
&
msg
);
Idle
(
NULL
);
}
else
Idle
(
NULL
);
while
(
GetMessage
(
&
msg
,
0
,
0
,
0
))
{
TranslateMessage
(
&
msg
);
DispatchMessage
(
&
msg
);
}
/* We will never reach the following statement ! */
return
0
;
}
programs/clock/winclock.c
View file @
9d59fb72
...
...
@@ -205,7 +205,6 @@ void AnalogClock(HDC dc) {
GetLocalTime
(
&
st
);
S
=
st
.
wSecond
;
if
(
nLastSecond
==
S
)
{
exit
;
}
nLastSecond
=
S
;
H
=
st
.
wHour
;
M
=
st
.
wMinute
;
...
...
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