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
3da872da
Commit
3da872da
authored
Nov 10, 2000
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed language handling. Removed some dependencies on Wine internals.
parent
4bbc0b3a
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
28 additions
and
133 deletions
+28
-133
language.c
programs/clock/language.c
+0
-18
language.h
programs/clock/language.h
+0
-1
license.c
programs/clock/license.c
+6
-31
license.h
programs/clock/license.h
+2
-2
main.c
programs/clock/main.c
+4
-7
main.h
programs/clock/main.h
+0
-1
dialog.c
programs/notepad/dialog.c
+4
-8
language.c
programs/notepad/language.c
+0
-19
language.h
programs/notepad/language.h
+0
-1
license.c
programs/notepad/license.c
+6
-31
license.h
programs/notepad/license.h
+2
-2
main.c
programs/notepad/main.c
+4
-7
main.h
programs/notepad/main.h
+0
-1
winhelp.c
programs/winhelp/winhelp.c
+0
-4
No files found.
programs/clock/language.c
View file @
3da872da
...
...
@@ -10,9 +10,6 @@
#include "main.h"
#include "language.h"
#include "winnls.h"
#ifdef WINELIB
#include "options.h"
#endif
CHAR
STRING_MENU_Xx
[]
=
"MENU_Xx"
;
...
...
@@ -124,7 +121,6 @@ VOID LANGUAGE_SelectByNumber(UINT num)
/* Get Language id */
LoadString
(
Globals
.
hInstance
,
IDS_LANGUAGE_ID
,
szLanguage
,
sizeof
(
szLanguage
));
Globals
.
lpszLanguage
=
szLanguage
;
/* Change Resource names */
lstrcpyn
(
STRING_MENU_Xx
+
sizeof
(
STRING_MENU_Xx
)
-
3
,
szLanguage
,
3
);
...
...
@@ -170,20 +166,6 @@ VOID LANGUAGE_DefaultHandle(WPARAM wParam)
else
printf
(
"Unimplemented menu command %i
\n
"
,
wParam
);
}
VOID
LANGUAGE_Init
(
VOID
)
{
CHAR
szBuffer
[
MAX_PATHNAME_LEN
];
if
(
Globals
.
lpszLanguage
==
"En"
)
{
PROFILE_GetWineIniString
(
"programs"
,
"language"
,
"En"
,
szBuffer
,
sizeof
(
szBuffer
));
Globals
.
lpszLanguage
=
LocalLock
(
LocalAlloc
(
LMEM_FIXED
,
lstrlen
(
szBuffer
)
+
1
));
/* hmemcpy(Globals.lpszLanguage, szBuffer, 1+lstrlen(szBuffer)); */
lstrcpyn
(
Globals
.
lpszLanguage
,
szBuffer
,
strlen
(
szBuffer
)
+
1
);
}
}
/* Local Variables: */
/* c-file-style: "GNU" */
/* End: */
programs/clock/language.h
View file @
3da872da
...
...
@@ -10,7 +10,6 @@ VOID LANGUAGE_UpdateMenuCheckmarks(VOID);
VOID
LANGUAGE_SelectByNumber
(
UINT
num
);
VOID
LANGUAGE_SelectByName
(
LPCSTR
lang
);
VOID
LANGUAGE_DefaultHandle
(
WPARAM
wParam
);
VOID
LANGUAGE_Init
(
VOID
);
/* Local Variables: */
/* c-file-style: "GNU" */
...
...
programs/clock/license.c
View file @
3da872da
...
...
@@ -8,44 +8,19 @@
#include "windows.h"
#include "license.h"
static
LICENSE
*
SelectLanguage
(
LPCSTR
Language
)
VOID
WineLicense
(
HWND
Wnd
)
{
/*
if (lstrcmp(Language, "Ca")) return(&WineLicense_Ca);
if (lstrcmp(Language, "Cz")) return(&WineLicense_Cz);
if (lstrcmp(Language, "Da")) return(&WineLicense_Da);
if (lstrcmp(Language, "De")) return(&WineLicense_De);
if (lstrcmp(Language, "En")) return(&WineLicense_En);
if (lstrcmp(Language, "Eo")) return(&WineLicense_Eo);
if (lstrcmp(Language, "Es")) return(&WineLicense_Es);
if (lstrcmp(Language, "Fi")) return(&WineLicense_Fi);
if (lstrcmp(Language, "Fr")) return(&WineLicense_Fr);
if (lstrcmp(Language, "Hu")) return(&WineLicense_Hu);
if (lstrcmp(Language, "It")) return(&WineLicense_It);
if (lstrcmp(Langauge, "Ko")) return(&WineLicense_Ko);
if (lstrcmp(Language, "No")) return(&WineLicense_No);
if (lstrcmp(Language, "Pl")) return(&WineLicense_Pl);
if (lstrcmp(Language, "Po")) return(&WineLicense_Po);
if (lstrcmp(Language, "Sw")) return(&WineLicense_Sw);
if (lstrcmp(Language, "Va")) return(&WineLicense_Va);
*/
return
(
&
WineLicense_En
);
}
VOID
WineLicense
(
HWND
Wnd
,
LPCSTR
Language
)
{
LICENSE
*
License
=
SelectLanguage
(
Language
);
/* FIXME: should load strings from resources */
LICENSE
*
License
=
&
WineLicense_En
;
MessageBox
(
Wnd
,
License
->
License
,
License
->
LicenseCaption
,
MB_ICONINFORMATION
|
MB_OK
);
}
VOID
WineWarranty
(
HWND
Wnd
,
LPCSTR
Language
)
VOID
WineWarranty
(
HWND
Wnd
)
{
LICENSE
*
License
=
SelectLanguage
(
Language
);
/* FIXME: should load strings from resources */
LICENSE
*
License
=
&
WineLicense_En
;
MessageBox
(
Wnd
,
License
->
Warranty
,
License
->
WarrantyCaption
,
MB_ICONEXCLAMATION
|
MB_OK
);
}
programs/clock/license.h
View file @
3da872da
...
...
@@ -8,8 +8,8 @@
/* function prototypes */
VOID
WineLicense
(
HWND
hWnd
,
LPCSTR
lpszLanguage
);
VOID
WineWarranty
(
HWND
hWnd
,
LPCSTR
language
);
VOID
WineLicense
(
HWND
hWnd
);
VOID
WineWarranty
(
HWND
hWnd
);
/* typedefs */
...
...
programs/clock/main.c
View file @
3da872da
...
...
@@ -70,11 +70,11 @@ int CLOCK_MenuCommand (WPARAM wParam)
break
;
}
case
CL_INFO_LICENSE
:
{
WineLicense
(
Globals
.
hMainWnd
,
Globals
.
lpszLanguage
);
WineLicense
(
Globals
.
hMainWnd
);
break
;
}
case
CL_INFO_NO_WARRANTY
:
{
WineWarranty
(
Globals
.
hMainWnd
,
Globals
.
lpszLanguage
);
WineWarranty
(
Globals
.
hMainWnd
);
break
;
}
case
CL_INFO_ABOUT_WINE
:
{
...
...
@@ -119,7 +119,7 @@ VOID MAIN_FileChooseFont(VOID) {
* CLOCK_WndProc
*/
LRESULT
CLOCK_WndProc
(
HWND
hWnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
LRESULT
WINAPI
CLOCK_WndProc
(
HWND
hWnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
PAINTSTRUCT
ps
;
HDC
context
;
...
...
@@ -203,9 +203,6 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show
Globals
.
lpszIniFile
=
"clock.ini"
;
Globals
.
lpszIcoFile
=
"clock.ico"
;
/* Select Language */
LANGUAGE_Init
();
Globals
.
hInstance
=
hInstance
;
Globals
.
hMainIcon
=
ExtractIcon
(
Globals
.
hInstance
,
Globals
.
lpszIcoFile
,
0
);
...
...
@@ -232,7 +229,7 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show
CW_USEDEFAULT
,
CW_USEDEFAULT
,
Globals
.
MaxX
,
Globals
.
MaxY
,
0
,
LoadMenu
(
Globals
.
hInstance
,
STRING_MENU_Xx
),
Globals
.
hInstance
,
0
);
LANGUAGE_SelectByName
(
Globals
.
lpszLanguage
);
LANGUAGE_SelectByName
(
"En"
);
SetMenu
(
Globals
.
hMainWnd
,
Globals
.
hMainMenu
);
LANGUAGE_UpdateMenuCheckmarks
();
...
...
programs/clock/main.h
View file @
3da872da
...
...
@@ -28,7 +28,6 @@ typedef struct
HMENU
hPopupMenu1
;
LPCSTR
lpszIniFile
;
LPCSTR
lpszIcoFile
;
LPSTR
lpszLanguage
;
UINT
wStringTableOffset
;
BOOL
bAnalog
;
...
...
programs/notepad/dialog.c
View file @
3da872da
...
...
@@ -11,10 +11,6 @@
#include <commdlg.h>
#include <winerror.h>
#ifdef WINELIB
#include "options.h"
#endif
#include "main.h"
#include "license.h"
#include "language.h"
...
...
@@ -28,7 +24,7 @@
#include "winnls.h"
#endif
static
LRESULT
DIALOG_PAGESETUP_DlgProc
(
HWND
hDlg
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
);
static
LRESULT
WINAPI
DIALOG_PAGESETUP_DlgProc
(
HWND
hDlg
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
);
...
...
@@ -593,12 +589,12 @@ VOID DIALOG_HelpHelp(VOID)
VOID
DIALOG_HelpLicense
(
VOID
)
{
WineLicense
(
Globals
.
hMainWnd
,
Globals
.
lpszLanguage
);
WineLicense
(
Globals
.
hMainWnd
);
}
VOID
DIALOG_HelpNoWarranty
(
VOID
)
{
WineWarranty
(
Globals
.
hMainWnd
,
Globals
.
lpszLanguage
);
WineWarranty
(
Globals
.
hMainWnd
);
}
VOID
DIALOG_HelpAboutWine
(
VOID
)
...
...
@@ -629,7 +625,7 @@ VOID DIALOG_PageSetup(VOID)
* DIALOG_PAGESETUP_DlgProc
*/
static
LRESULT
DIALOG_PAGESETUP_DlgProc
(
HWND
hDlg
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
static
LRESULT
WINAPI
DIALOG_PAGESETUP_DlgProc
(
HWND
hDlg
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
switch
(
msg
)
...
...
programs/notepad/language.c
View file @
3da872da
...
...
@@ -10,10 +10,6 @@
#include "main.h"
#include "language.h"
#ifdef WINELIB
#include "options.h"
#endif
CHAR
STRING_MENU_Xx
[]
=
"MENU_Xx"
;
CHAR
STRING_PAGESETUP_Xx
[]
=
"DIALOG_PAGESETUP_Xx"
;
...
...
@@ -97,7 +93,6 @@ VOID LANGUAGE_SelectByNumber(UINT num)
/* Get Language id */
LoadString
(
Globals
.
hInstance
,
IDS_LANGUAGE_ID
,
lang
,
sizeof
(
lang
));
Globals
.
lpszLanguage
=
lang
;
/* Set frame caption */
LANGUAGE_UpdateWindowCaption
();
...
...
@@ -135,17 +130,3 @@ VOID LANGUAGE_DefaultHandle(WPARAM wParam)
LANGUAGE_SelectByNumber
(
wParam
-
NP_FIRST_LANGUAGE
);
else
printf
(
"Unimplemented menu command %i
\n
"
,
wParam
);
}
VOID
LANGUAGE_Init
(
VOID
)
{
CHAR
buffer
[
MAX_PATHNAME_LEN
],
*
p
;
#ifndef LCC
PROFILE_GetWineIniString
(
"programs"
,
"language"
,
"language"
,
buffer
,
sizeof
(
buffer
));
#endif
Globals
.
lpszLanguage
=
p
=
LocalLock
(
LocalAlloc
(
LMEM_FIXED
,
lstrlen
(
buffer
)
+
1
));
strcpy
(
p
,
buffer
);
/* hmemcpy(p, buffer, 1 + lstrlen(buffer)); */
}
programs/notepad/language.h
View file @
3da872da
...
...
@@ -9,5 +9,4 @@ VOID LANGUAGE_UpdateWindowCaption(VOID);
VOID
LANGUAGE_SelectByNumber
(
UINT
num
);
VOID
LANGUAGE_SelectByName
(
LPCSTR
lang
);
VOID
LANGUAGE_DefaultHandle
(
WPARAM
wParam
);
VOID
LANGUAGE_Init
(
VOID
);
programs/notepad/license.c
View file @
3da872da
...
...
@@ -8,44 +8,19 @@
#include "windows.h"
#include "license.h"
static
LICENSE
*
SelectLanguage
(
LPCSTR
Language
)
VOID
WineLicense
(
HWND
Wnd
)
{
/*
if (lstrcmp(Language, "Ca")) return(&WineLicense_Ca);
if (lstrcmp(Language, "Cz")) return(&WineLicense_Cz);
if (lstrcmp(Language, "Da")) return(&WineLicense_Da);
if (lstrcmp(Language, "De")) return(&WineLicense_En);
if (lstrcmp(Language, "En")) return(&WineLicense_En);
if (lstrcmp(Language, "Eo")) return(&WineLicense_Eo);
if (lstrcmp(Language, "Es")) return(&WineLicense_Es);
if (lstrcmp(Language, "Fi")) return(&WineLicense_Fi);
if (lstrcmp(Language, "Fr")) return(&WineLicense_Fr);
if (lstrcmp(Language, "Hu")) return(&WineLicense_Hu);
if (lstrcmp(Language, "It")) return(&WineLicense_It);
if (lstrcmp(Langauge, "Ko")) return(&WineLicense_Ko);
if (lstrcmp(Language, "No")) return(&WineLicense_No);
if (lstrcmp(Language, "Pl")) return(&WineLicense_Pl);
if (lstrcmp(Language, "Po")) return(&WineLicense_Po);
if (lstrcmp(Language, "Va")) return(&WineLicense_Va);
if (lstrcmp(Language, "Sw")) return(&WineLicense_Sw);
*/
return
(
&
WineLicense_En
);
}
VOID
WineLicense
(
HWND
Wnd
,
LPCSTR
Language
)
{
LICENSE
*
License
=
SelectLanguage
(
Language
);
/* FIXME: should load strings from resources */
LICENSE
*
License
=
&
WineLicense_En
;
MessageBox
(
Wnd
,
License
->
License
,
License
->
LicenseCaption
,
MB_ICONINFORMATION
|
MB_OK
);
}
VOID
WineWarranty
(
HWND
Wnd
,
LPCSTR
Language
)
VOID
WineWarranty
(
HWND
Wnd
)
{
LICENSE
*
License
=
SelectLanguage
(
Language
);
/* FIXME: should load strings from resources */
LICENSE
*
License
=
&
WineLicense_En
;
MessageBox
(
Wnd
,
License
->
Warranty
,
License
->
WarrantyCaption
,
MB_ICONEXCLAMATION
|
MB_OK
);
}
...
...
programs/notepad/license.h
View file @
3da872da
...
...
@@ -5,8 +5,8 @@
* To be distributed under the Wine License
*/
VOID
WineLicense
(
HWND
hWnd
,
LPCSTR
lpszLanguage
);
VOID
WineWarranty
(
HWND
hWnd
,
LPCSTR
language
);
VOID
WineLicense
(
HWND
hWnd
);
VOID
WineWarranty
(
HWND
hWnd
);
typedef
struct
{
...
...
programs/notepad/main.c
View file @
3da872da
...
...
@@ -443,12 +443,12 @@ DWORD CreateLine(
*/
void
LoadBufferFromFile
(
LPCSTR
szFileName
)
{
H
FI
LE
hFile
;
H
AND
LE
hFile
;
OFSTRUCT
ofs
;
CHAR
*
pTemp
;
DWORD
size
,
i
,
len
,
bytes_left
,
bytes_read
;
hFile
=
OpenFile
(
szFileName
,
&
ofs
,
OF_READ
);
hFile
=
(
HANDLE
)
OpenFile
(
szFileName
,
&
ofs
,
OF_READ
);
if
(
hFile
==
INVALID_HANDLE_VALUE
)
return
;
size
=
BUFFERCHUNKSIZE
;
...
...
@@ -749,7 +749,7 @@ int NOTEPAD_MenuCommand (WPARAM wParam)
* NOTEPAD_WndProc
*/
LRESULT
NOTEPAD_WndProc
(
HWND
hWnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
LRESULT
WINAPI
NOTEPAD_WndProc
(
HWND
hWnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
PAINTSTRUCT
ps
;
HDC
hContext
;
...
...
@@ -861,9 +861,6 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show
char
className
[]
=
"NPClass"
;
/* To make sure className >= 0x10000 */
char
winName
[]
=
"Notepad"
;
/* Select Language */
LANGUAGE_Init
();
/* setup buffer */
InitBuffer
();
...
...
@@ -918,7 +915,7 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show
Globals
.
hFindReplaceDlg
=
0
;
LANGUAGE_SelectByN
ame
(
Globals
.
lpszLanguage
);
LANGUAGE_SelectByN
umber
(
0
);
SetMenu
(
Globals
.
hMainWnd
,
Globals
.
hMainMenu
);
...
...
programs/notepad/main.h
View file @
3da872da
...
...
@@ -33,7 +33,6 @@ typedef struct
HMENU
hHelpMenu
;
LPCSTR
lpszIniFile
;
LPCSTR
lpszIcoFile
;
LPCSTR
lpszLanguage
;
UINT
wStringTableOffset
;
BOOL
bWrapLongLines
;
CHAR
szFindText
[
MAX_PATHNAME_LEN
];
...
...
programs/winhelp/winhelp.c
View file @
3da872da
...
...
@@ -10,10 +10,6 @@
#include "windowsx.h"
#include "winhelp.h"
#ifdef WINELIB
#include "options.h"
#endif
static
BOOL
WINHELP_RegisterWinClasses
();
static
LRESULT
CALLBACK
WINHELP_MainWndProc
(
HWND
,
UINT
,
WPARAM
,
LPARAM
);
static
LRESULT
CALLBACK
WINHELP_TextWndProc
(
HWND
,
UINT
,
WPARAM
,
LPARAM
);
...
...
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