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
9f69d893
Commit
9f69d893
authored
Feb 26, 1999
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated for new naming conventions.
parent
a3960292
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
32 deletions
+28
-32
DEVELOPERS-HINTS
DEVELOPERS-HINTS
+28
-32
No files found.
DEVELOPERS-HINTS
View file @
9f69d893
...
...
@@ -80,10 +80,10 @@ To implement this call, you need to do the following four things.
1. Find the appropriate parameters for the call, and add a prototype to
[include/windows.h]. In this case, it might look like
BOOL
32 WINAPI PolyBezierTo32(HDC32
, LPCVOID, DWORD);
#define PolyBezierTo WINELIB_NAME(PolyBezierTo)
Note the use of the #define for Winelib. See below for discussion of
function naming conventions.
BOOL
WINAPI PolyBezierTo(HDC
, LPCVOID, DWORD);
If the function has both an ASCII and a Unicode version, you need to
define both and add a #define WINELIB_NAME_AW declaration. See below
f
or discussion of f
unction naming conventions.
2. Modify the .spec file to tell Wine that the function has an
implementation, what the parameters look like and what Wine function
...
...
@@ -91,13 +91,13 @@ to use for the implementation. In Win32, things are simple--everything
is 32-bits. However, the relay code handles pointers and pointers to
strings slightly differently, so you should use 'str' and 'wstr' for
strings, 'ptr' for other pointer types, and 'long' for everything else.
269 stdcall PolyBezierTo(long ptr long) PolyBezierTo
32
The 'PolyBezierTo
32
' at the end of the line is which Wine function to use
269 stdcall PolyBezierTo(long ptr long) PolyBezierTo
The 'PolyBezierTo' at the end of the line is which Wine function to use
for the implementation.
3. Implement the function as a stub. Once you add the function to the .spec
file, you must add the function to the Wine source before it will link.
Add a function called 'PolyBezierTo
32
' somewhere. Good things to put
Add a function called 'PolyBezierTo' somewhere. Good things to put
into a stub:
o a correct prototype, including the WINAPI
o header comments, including full documentation for the function and
...
...
@@ -106,12 +106,12 @@ into a stub:
put in a stub.
/************************************************************
* PolyBezierTo
32
(GDI32.269) Draw many Bezier curves
* PolyBezierTo (GDI32.269) Draw many Bezier curves
*
* BUGS
* Unimplemented
*/
BOOL
32 WINAPI PolyBezierTo32(HDC32
hdc, LPCVOID p, DWORD count) {
BOOL
WINAPI PolyBezierTo(HDC
hdc, LPCVOID p, DWORD count) {
/* tell the user they've got a substandard implementation */
FIXME(gdi, ":(%x,%p,%d): stub\n", hdc, p, count);
/* some programs may be able to compensate,
...
...
@@ -195,47 +195,43 @@ code, the following convention must be used in naming all API
functions and types. If the Windows API uses the name 'xxx', the Wine
code must use:
- 'xxx16' for the
16-bit
version,
- 'xxx
32' for the 32-bit
version when no ASCII/Unicode strings are
- 'xxx16' for the
Win16
version,
- 'xxx
' for the Win32
version when no ASCII/Unicode strings are
involved,
- 'xxx
32A' for the 32-bit
version with ASCII strings,
- 'xxx
32W' for the 32-bit
version with Unicode strings.
- 'xxx
A' for the Win32
version with ASCII strings,
- 'xxx
W' for the Win32
version with Unicode strings.
You should then use the macros WINELIB_NAME[_AW](xxx) or
DECL_WINELIB_TYPE[_AW](xxx) (defined in include/wintypes.h) to define
the correct 'xxx' function or type for Winelib. When compiling Wine
itself, 'xxx' is _not_ defined, meaning that code inside of Wine must
always specify explicitly the 16-bit or 32-bit version.
If the function has both ASCII and Unicode version, you should then
use the macros WINELIB_NAME_AW(xxx) or DECL_WINELIB_TYPE_AW(xxx)
(defined in include/wintypes.h) to define the correct 'xxx' function
or type for Winelib. When compiling Wine itself, 'xxx' is _not_
defined, meaning that code inside of Wine must always specify
explicitly the ASCII or Unicode version.
If 'xxx' is the same in Win16 and Win32,
or if 'xxx' is Win16 only,
you can simply use the same name as Windows, i.e. just 'xxx'. If
'xxx' is Win32 only, you can use 'xxx' if there are no strings
involved, otherwise you must use the 'xxx32A' and 'xxx32W' forms
.
If 'xxx' is the same in Win16 and Win32,
you can simply use the same
name as Windows, i.e. just 'xxx'. If 'xxx' is Win16 only, you could
use the name as is, but it's preferable to use 'xxx16' to make it
clear it is a Win16 function
.
Examples:
typedef short INT16;
typedef int INT32;
DECL_WINELIB_TYPE(INT);
typedef struct { /* Win32 ASCII data structure */ } WNDCLASS32A;
typedef struct { /* Win32 Unicode data structure */ } WNDCLASS32W;
typedef struct { /* Win32 ASCII data structure */ } WNDCLASSA;
typedef struct { /* Win32 Unicode data structure */ } WNDCLASSW;
typedef struct { /* Win16 data structure */ } WNDCLASS16;
DECL_WINELIB_TYPE_AW(WNDCLASS);
ATOM RegisterClass16( WNDCLASS16 * );
ATOM RegisterClass
32A( WNDCLASS32
A * );
ATOM RegisterClass
32W( WNDCLASS32
W * );
ATOM RegisterClass
A( WNDCLASS
A * );
ATOM RegisterClass
W( WNDCLASS
W * );
#define RegisterClass WINELIB_NAME_AW(RegisterClass)
The Winelib user can then say:
INT i;
WNDCLASS wc = { ... };
RegisterClass( &wc );
and this will use the correct declaration depending on the definition
of the
symbols WINELIB and UNICODE
.
of the
UNICODE symbol
.
API ENTRY POINTS
...
...
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