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