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
b6d902ee
Commit
b6d902ee
authored
Jan 21, 2013
by
Ken Thomases
Committed by
Alexandre Julliard
Jan 21, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Add a simple ERR() logging macro that can be used from Cocoa code.
parent
dadcacf9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
0 deletions
+33
-0
cocoa_app.h
dlls/winemac.drv/cocoa_app.h
+6
-0
cocoa_app.m
dlls/winemac.drv/cocoa_app.m
+24
-0
macdrv_cocoa.h
dlls/winemac.drv/macdrv_cocoa.h
+2
-0
macdrv_main.c
dlls/winemac.drv/macdrv_main.c
+1
-0
No files found.
dlls/winemac.drv/cocoa_app.h
View file @
b6d902ee
...
@@ -23,6 +23,9 @@
...
@@ -23,6 +23,9 @@
#include "macdrv_cocoa.h"
#include "macdrv_cocoa.h"
#define ERR(...) do { if (macdrv_err_on) LogError(__func__, __VA_ARGS__); } while (false)
@interface
WineApplication
:
NSApplication
<
NSApplicationDelegate
>
@interface
WineApplication
:
NSApplication
<
NSApplicationDelegate
>
-
(
void
)
transformProcessToForeground
;
-
(
void
)
transformProcessToForeground
;
...
@@ -31,3 +34,6 @@
...
@@ -31,3 +34,6 @@
void
OnMainThread
(
dispatch_block_t
block
);
void
OnMainThread
(
dispatch_block_t
block
);
void
OnMainThreadAsync
(
dispatch_block_t
block
);
void
OnMainThreadAsync
(
dispatch_block_t
block
);
void
LogError
(
const
char
*
func
,
NSString
*
format
,
...);
void
LogErrorv
(
const
char
*
func
,
NSString
*
format
,
va_list
args
);
dlls/winemac.drv/cocoa_app.m
View file @
b6d902ee
...
@@ -21,6 +21,9 @@
...
@@ -21,6 +21,9 @@
#import "cocoa_app.h"
#import "cocoa_app.h"
int
macdrv_err_on
;
@implementation
WineApplication
@implementation
WineApplication
-
(
void
)
transformProcessToForeground
-
(
void
)
transformProcessToForeground
...
@@ -87,3 +90,24 @@ void OnMainThreadAsync(dispatch_block_t block)
...
@@ -87,3 +90,24 @@ void OnMainThreadAsync(dispatch_block_t block)
{
{
dispatch_async
(
dispatch_get_main_queue
(),
block
);
dispatch_async
(
dispatch_get_main_queue
(),
block
);
}
}
/***********************************************************************
* LogError
*/
void
LogError
(
const
char
*
func
,
NSString
*
format
,
...)
{
va_list
args
;
va_start
(
args
,
format
);
LogErrorv
(
func
,
format
,
args
);
va_end
(
args
);
}
/***********************************************************************
* LogErrorv
*/
void
LogErrorv
(
const
char
*
func
,
NSString
*
format
,
va_list
args
)
{
NSString
*
message
=
[[
NSString
alloc
]
initWithFormat
:
format
arguments
:
args
];
fprintf
(
stderr
,
"err:%s:%s"
,
func
,
[
message
UTF8String
]);
[
message
release
];
}
dlls/winemac.drv/macdrv_cocoa.h
View file @
b6d902ee
...
@@ -109,6 +109,8 @@ struct macdrv_display {
...
@@ -109,6 +109,8 @@ struct macdrv_display {
/* main */
/* main */
extern
int
macdrv_err_on
;
extern
int
macdrv_start_cocoa_app
(
void
)
DECLSPEC_HIDDEN
;
extern
int
macdrv_start_cocoa_app
(
void
)
DECLSPEC_HIDDEN
;
...
...
dlls/winemac.drv/macdrv_main.c
View file @
b6d902ee
...
@@ -36,6 +36,7 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
...
@@ -36,6 +36,7 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
switch
(
reason
)
switch
(
reason
)
{
{
case
DLL_PROCESS_ATTACH
:
case
DLL_PROCESS_ATTACH
:
macdrv_err_on
=
ERR_ON
(
macdrv
);
if
(
macdrv_start_cocoa_app
())
if
(
macdrv_start_cocoa_app
())
{
{
ERR
(
"Failed to start Cocoa app main loop
\n
"
);
ERR
(
"Failed to start Cocoa app main loop
\n
"
);
...
...
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