1// This file is part of BOINC.
2// http://boinc.berkeley.edu
3// Copyright (C) 2017 University of California
4//
5// BOINC is free software; you can redistribute it and/or modify it
6// under the terms of the GNU Lesser General Public License
7// as published by the Free Software Foundation,
8// either version 3 of the License, or (at your option) any later version.
9//
10// BOINC is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13// See the GNU Lesser General Public License for more details.
14//
15// You should have received a copy of the GNU Lesser General Public License
16// along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
17
18#ifndef _MACGUI_H_
19#define _MACGUI_H_
20/*
21 *  MacGUI.pch
22 *  BOINCManager precompiled headers file for Mac
23 */
24
25// To use the debugging features of the Development (Debug) build of
26// wxCocoa (trace, Asserts, etc.):
27// (1) Set USE_DEBUG_WXMAC and wxUSE_LOG_TRACE as desired in this source file.
28// (2) In the Project menu, set the Active Target to "mgr_boinc".
29// (3) In the Product menu, select "Build" or "Build For Running", or click on the
30//      "Run" icon at top left of the Xcode toolbar.
31//
32// This assumes wxWidgets-3.0 was built using the buildWxMac.sh script.
33//
34// NOTE: normally, wxWidgets internal asserts are always enabled when running the
35// Development build, and USE_DEBUG_WXMAC afects only wxAssert() calls in the
36// BOINC Manager code.  However, you can disable ALL wxAssert() calls by BOTH:
37// [1] calling wxSetAssertHandler(NULL) in the code AND
38// [2] setting USE_DEBUG_WXMAC to 1.
39// (While setting USE_DEBUG_WXMAC to 1 seems counterintuitive in this case, it
40// is needed because wxSetAssertHandler() is ignored when wxDEBUG_LEVEL==0.)
41
42// Set USE_DEBUG_WXMAC to 0 to disable wxAssert() calls in Manager Development builds.
43// Set USE_DEBUG_WXMAC to 1 to enable wxAssert() calls in Manager Development builds.
44// See the note above for a special exception.
45//
46#define USE_DEBUG_WXMAC 1
47
48// Set wxUSE_LOG_TRACE to 0 to disable wxLogTrace() calls in Manager Development builds.
49// Set both USE_DEBUG_WXMAC to 1 and wxUSE_LOG_TRACE to 1 to enable wxLogTrace() calls
50// in Manager Development builds.
51//
52// We are now building wxWidgets with wxDEBUG_LEVEL set to 0 in deployment builds, so all
53// debugging, including wxLogTrace() calls, is always disabled in Manager Deployment builds.
54#define wxUSE_LOG_TRACE 0
55
56#define __WXOSX_COCOA__
57#define __WX__
58#define wxUSE_BASE 1
59#define MACOS_CLASSIC
60#define __WXMAC_XCODE__ 1
61#define SCI_LEXER
62#define WX_PRECOMP 1
63#define wxUSE_UNICODE_UTF8 1
64
65#define TARGET_COCOA 1
66#define wxUSE_UNICODE 1
67#define HAVE_WCSLEN 1
68
69#include <wchar.h>
70
71
72#ifdef _DEBUG
73#undef wxDEBUG_LEVEL
74#define wxDEBUG_LEVEL USE_DEBUG_WXMAC
75#else
76#define wxDEBUG_LEVEL 0
77#endif
78
79#include <wx/wxprec.h>
80#include "stdwx.h"
81
82// Allow the BOINC definitions of these instead of the wxWidgets ones
83#undef PACKAGE_BUGREPORT
84#undef PACKAGE_NAME
85#undef PACKAGE_STRING
86#undef PACKAGE_TARNAME
87#undef PACKAGE_VERSION
88
89#include "config.h"
90
91#include <stdlib.h>
92
93// system() is deprecated in Mac OS 10.10.
94// Apple says to call posix_spawn instead.
95#undef system
96#define system(x) callPosixSpawn(x)
97
98extern int callPosixSpawn(const char *cmdline);
99
100// Prototypes for Mac_GUI.cpp
101Boolean Mac_Authorize(void);
102// void MacLocalizeBOINCMenu();
103Boolean IsWindowOnScreen(int iLeft, int iTop, int iWidth, int iHeight);
104
105#endif
106