mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-26 09:56:32 +08:00
Trim trailing whitespace from all sources
This whitespace was annoying as it was getting automatically removed by
the contributors working with the editors respecting the settings in our
own .editorconfig and so resulting in patches that mixed significant and
whitespace-only changes.
Remove it once again (this has been already done before in 8fbca5cb70
(Remove all trailing spaces, 2019-01-30) but apparently only partially)
to avoid the problem.
This commit is contained in:
@@ -111,7 +111,7 @@ public:
|
||||
static double GetCTSlant( CTFontDescriptorRef font );
|
||||
|
||||
CTFontDescriptorRef GetCTFontDescriptor() const;
|
||||
|
||||
|
||||
void RealizeResource() const;
|
||||
private:
|
||||
// attributes for regenerating a CTFontDescriptor, stay close to native values
|
||||
|
||||
@@ -61,10 +61,10 @@ class wxWidgetCocoaNativeKeyDownSuspender
|
||||
public:
|
||||
// stops sending keydown events for text inserted into this widget
|
||||
explicit wxWidgetCocoaNativeKeyDownSuspender(wxWidgetCocoaImpl *target);
|
||||
|
||||
|
||||
// resumes sending keydown events
|
||||
~wxWidgetCocoaNativeKeyDownSuspender();
|
||||
|
||||
|
||||
private:
|
||||
wxWidgetCocoaImpl *m_target;
|
||||
NSEvent* m_nsevent;
|
||||
@@ -263,7 +263,7 @@ protected:
|
||||
bool m_hasEditor;
|
||||
|
||||
friend class wxWidgetCocoaNativeKeyDownSuspender;
|
||||
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxWidgetCocoaImpl);
|
||||
};
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#define WX_OSX_BRIDGE __bridge
|
||||
#else
|
||||
#define WX_OSX_BRIDGE_RETAINED
|
||||
#define WX_OSX_BRIDGE
|
||||
#define WX_OSX_BRIDGE
|
||||
#endif
|
||||
|
||||
// #include <CoreFoundation/CFBase.h>
|
||||
@@ -354,7 +354,7 @@ public:
|
||||
m_ptr = nullptr;
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
// Autorelease the pointer, i.e. during the next cleanup it will be released
|
||||
refType autorelease()
|
||||
{
|
||||
|
||||
@@ -1082,7 +1082,7 @@ public:
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
wxNSObjRef& operator=( T ptr )
|
||||
{
|
||||
if (get() != ptr)
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
operator NativeFormat() const { return m_format; }
|
||||
|
||||
void SetId(NativeFormat format);
|
||||
|
||||
|
||||
// string ids are used for custom types - this SetId() must be used for
|
||||
// application-specific formats
|
||||
wxString GetId() const;
|
||||
|
||||
@@ -60,7 +60,7 @@ class WXDLLIMPEXP_CORE wxDropTarget: public wxDropTargetBase
|
||||
virtual wxDataFormat GetMatchingPair();
|
||||
|
||||
bool CurrentDragHasSupportedFormat() ;
|
||||
|
||||
|
||||
void SetCurrentDragSource( wxOSXDataSource* dragpasteboard ) { m_currentDragPasteboard = dragpasteboard ; }
|
||||
protected :
|
||||
wxOSXDataSource* m_currentDragPasteboard ;
|
||||
|
||||
@@ -28,5 +28,5 @@ public:
|
||||
virtual wxColour GetTransparentColour(unsigned int frame) const;
|
||||
|
||||
protected:
|
||||
virtual bool DoCanRead(wxInputStream& stream) const;
|
||||
virtual bool DoCanRead(wxInputStream& stream) const;
|
||||
};
|
||||
|
||||
@@ -117,7 +117,7 @@ public:
|
||||
wxColourDialogEvent(wxEventType evtType,
|
||||
wxColourDialog* dialog,
|
||||
const wxColour& colour);
|
||||
|
||||
|
||||
/**
|
||||
Retrieve the colour the user has just selected.
|
||||
*/
|
||||
|
||||
@@ -340,8 +340,8 @@ public:
|
||||
static unsigned char AlphaBlend(unsigned char fg, unsigned char bg, double alpha);
|
||||
|
||||
/**
|
||||
Utility function that simply darkens or lightens a color, based on the specified
|
||||
percentage @a ialpha. @a ialpha of 0 would be make the color completely black,
|
||||
Utility function that simply darkens or lightens a color, based on the specified
|
||||
percentage @a ialpha. @a ialpha of 0 would be make the color completely black,
|
||||
200 completely white and 100 would not change the color.
|
||||
@since 2.9.0
|
||||
*/
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
@code
|
||||
wxDataViewCtrl *musicCtrl = new wxDataViewCtrl(this, wxID_ANY);
|
||||
wxObjectDataPtr<wxDataViewModel> musicModel(new MyMusicModel);
|
||||
|
||||
|
||||
musicCtrl->AssociateModel(musicModel.get());
|
||||
|
||||
// add columns now
|
||||
|
||||
@@ -29,6 +29,6 @@ public:
|
||||
virtual wxColour GetTransparentColour(unsigned int frame) const;
|
||||
|
||||
protected:
|
||||
virtual bool DoCanRead(wxInputStream& stream) const;
|
||||
virtual bool DoCanRead(wxInputStream& stream) const;
|
||||
};
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
@library{wxcore}
|
||||
@category{data}
|
||||
|
||||
@see wxAutomationObject, wxVariantDataSafeArray, wxVariant
|
||||
@see wxAutomationObject, wxVariantDataSafeArray, wxVariant
|
||||
*/
|
||||
template <VARTYPE varType>
|
||||
class wxSafeArray<varType>
|
||||
|
||||
@@ -2154,7 +2154,7 @@ protected:
|
||||
Clear cells associated with property.
|
||||
|
||||
@param ignoreWithFlags
|
||||
Cells will not be cleared for properties having these flags set.
|
||||
Cells will not be cleared for properties having these flags set.
|
||||
|
||||
@param recursively
|
||||
If @true, apply this operation recursively in child properties.
|
||||
|
||||
+1
-1
@@ -2451,7 +2451,7 @@ wxWindow* wxAuiNotebook::DoRemovePage(size_t page_idx)
|
||||
wxCHECK_MSG(page_idx < GetPageCount(), nullptr, "invalid page index");
|
||||
|
||||
// Lock the window for changes to avoid flicker when
|
||||
// removing the active page (there is a noticeable
|
||||
// removing the active page (there is a noticeable
|
||||
// flicker from the active tab is closed and until a
|
||||
// new one is selected) - this is noticeable on MSW
|
||||
wxWindowUpdateLocker locker { this };
|
||||
|
||||
@@ -132,7 +132,7 @@ long wxListbook::GetListCtrlFlags(bool hasImages) const
|
||||
{
|
||||
flags |= wxLC_LIST;
|
||||
}
|
||||
|
||||
|
||||
#ifdef __WXQT__
|
||||
flags |= wxLC_NO_HEADER;
|
||||
#endif
|
||||
|
||||
@@ -156,7 +156,7 @@ wxNotificationMessageWindow::wxNotificationMessageWindow(wxGenericNotificationMe
|
||||
|
||||
// Create title and message sizers
|
||||
wxSizer* textSizer = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
|
||||
m_messageTitle = new wxStaticText(m_messagePanel, wxID_ANY, wxString());
|
||||
m_messageTitle->SetFont(m_messageTitle->GetFont().MakeBold());
|
||||
textSizer->Add(m_messageTitle, wxSizerFlags(0).Border());
|
||||
|
||||
@@ -567,7 +567,7 @@ double wxSpinCtrlGenericBase::AdjustAndSnap(double val) const
|
||||
val = m_min;
|
||||
if ( val > m_max )
|
||||
val = m_max;
|
||||
|
||||
|
||||
if ( m_snap_to_ticks && (m_increment != 0) )
|
||||
{
|
||||
double snap_value = val / m_increment;
|
||||
|
||||
+1
-1
@@ -394,7 +394,7 @@ static int gs_busyCount = 0;
|
||||
static void UpdateCursors(wxWindow* win, GdkCursor* globalCursor)
|
||||
{
|
||||
win->GTKUpdateCursor(globalCursor);
|
||||
const wxWindowList& children = win->GetChildren();
|
||||
const wxWindowList& children = win->GetChildren();
|
||||
wxWindowList::const_iterator i = children.begin();
|
||||
for (size_t n = children.size(); n--; ++i)
|
||||
UpdateCursors(*i, globalCursor);
|
||||
|
||||
+2
-2
@@ -308,7 +308,7 @@ wxFontStyle wxFont::GetStyle() const
|
||||
int wxFont::GetNumericWeight() const
|
||||
{
|
||||
wxCHECK_MSG( IsOk(), wxFONTWEIGHT_MAX, "invalid font" );
|
||||
|
||||
|
||||
return M_FONTDATA->m_nativeFontInfo.GetNumericWeight();
|
||||
}
|
||||
|
||||
@@ -376,7 +376,7 @@ void wxFont::SetStyle(wxFontStyle style)
|
||||
void wxFont::SetNumericWeight(int weight)
|
||||
{
|
||||
AllocExclusive();
|
||||
|
||||
|
||||
M_FONTDATA->SetNumericWeight(weight);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -490,7 +490,7 @@ void wxRegionIterator::CreateRects( const wxRegion& region )
|
||||
if (cairoRegion == nullptr)
|
||||
return;
|
||||
m_numRects = cairo_region_num_rectangles(cairoRegion);
|
||||
|
||||
|
||||
if (m_numRects)
|
||||
{
|
||||
m_rects = new wxRect[m_numRects];
|
||||
|
||||
@@ -46,7 +46,7 @@ wxgtk_webview_webkit_load_status(GtkWidget* widget,
|
||||
//We have to check if we are actually storing history
|
||||
//If the item isn't added we add it ourselves, it isn't added otherwise
|
||||
//with a custom scheme.
|
||||
if(!item || (WEBKIT_IS_WEB_HISTORY_ITEM(item) &&
|
||||
if(!item || (WEBKIT_IS_WEB_HISTORY_ITEM(item) &&
|
||||
webkit_web_history_item_get_uri(item) != url))
|
||||
{
|
||||
WebKitWebHistoryItem*
|
||||
@@ -483,7 +483,7 @@ bool wxWebViewWebKit::Create(wxWindow *parent,
|
||||
g_signal_connect_after(m_web_view, "resource-request-starting",
|
||||
G_CALLBACK(wxgtk_webview_webkit_resource_req), this);
|
||||
|
||||
#if WEBKIT_CHECK_VERSION(1, 10, 0)
|
||||
#if WEBKIT_CHECK_VERSION(1, 10, 0)
|
||||
g_signal_connect_after(m_web_view, "context-menu",
|
||||
G_CALLBACK(wxgtk_webview_webkit_context_menu), this);
|
||||
#endif
|
||||
@@ -947,7 +947,7 @@ void wxWebViewWebKit::RegisterHandler(wxSharedPtr<wxWebViewHandler> handler)
|
||||
void wxWebViewWebKit::EnableContextMenu(bool enable)
|
||||
{
|
||||
#if !WEBKIT_CHECK_VERSION(1, 10, 0) //If we are using an older version
|
||||
g_object_set(webkit_web_view_get_settings(m_web_view),
|
||||
g_object_set(webkit_web_view_get_settings(m_web_view),
|
||||
"enable-default-context-menu", enable, nullptr);
|
||||
#endif
|
||||
wxWebView::EnableContextMenu(enable);
|
||||
@@ -956,7 +956,7 @@ void wxWebViewWebKit::EnableContextMenu(bool enable)
|
||||
long wxWebViewWebKit::Find(const wxString& text, int flags)
|
||||
{
|
||||
bool newSearch = false;
|
||||
if(text != m_findText ||
|
||||
if(text != m_findText ||
|
||||
(flags & wxWEBVIEW_FIND_MATCH_CASE) != (m_findFlags & wxWEBVIEW_FIND_MATCH_CASE))
|
||||
{
|
||||
newSearch = true;
|
||||
@@ -1007,7 +1007,7 @@ long wxWebViewWebKit::Find(const wxString& text, int flags)
|
||||
|
||||
//Highlight them if needed
|
||||
bool highlight = flags & wxWEBVIEW_FIND_HIGHLIGHT_RESULT ? true : false;
|
||||
webkit_web_view_set_highlight_text_matches(m_web_view, highlight);
|
||||
webkit_web_view_set_highlight_text_matches(m_web_view, highlight);
|
||||
|
||||
if(!webkit_web_view_search_text(m_web_view, text.utf8_str(), matchCase, forward, wrap))
|
||||
{
|
||||
|
||||
@@ -625,7 +625,7 @@ void wxHtmlImageCell::Draw(wxDC& dc, int x, int y,
|
||||
image.Rescale(m_Width, m_Height, wxIMAGE_QUALITY_HIGH);
|
||||
(*m_bitmap) = wxBitmap(image);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (m_Width != m_bitmap->GetLogicalWidth())
|
||||
imageScaleX = (double) m_Width / (double) m_bitmap->GetLogicalWidth();
|
||||
@@ -710,7 +710,7 @@ TAG_HANDLER_BEGIN(IMG, "IMG,MAP,AREA")
|
||||
scaleHDPI = 2.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (!str)
|
||||
str = m_WParser->OpenURL(wxHTML_URL_IMAGE, tmp);
|
||||
|
||||
@@ -276,7 +276,7 @@ void wxBalloonNotifMsgImpl::SetUpIcon(wxWindow *win)
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
bool
|
||||
wxBalloonNotifMsgImpl::Show(int timeout)
|
||||
{
|
||||
// timout active event
|
||||
|
||||
@@ -290,7 +290,7 @@ int wxSystemSettingsNative::GetMetric(wxSystemMetric index, const wxWindow* win)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
if ( blinkTime == INFINITE ) // caret does not blink
|
||||
{
|
||||
return 0;
|
||||
|
||||
@@ -358,7 +358,7 @@ bool wxSpinButton::MSWOnNotify(int WXUNUSED(idCtrl), WXLPARAM lParam, WXLPARAM *
|
||||
NM_UPDOWN *lpnmud = (NM_UPDOWN *)lParam;
|
||||
|
||||
if ( lpnmud->hdr.hwndFrom != GetHwnd() || // make sure it is the right control
|
||||
lpnmud->hdr.code != UDN_DELTAPOS ) // and the right notification
|
||||
lpnmud->hdr.code != UDN_DELTAPOS ) // and the right notification
|
||||
return false;
|
||||
|
||||
int newVal = lpnmud->iPos + lpnmud->iDelta;
|
||||
|
||||
@@ -32,7 +32,7 @@ bool wxBitmapButton::Create( wxWindow *parent,
|
||||
const wxString& name )
|
||||
{
|
||||
DontCreatePeer();
|
||||
|
||||
|
||||
if ( !wxBitmapButtonBase::Create(parent, id, pos, size, style,
|
||||
validator, name) )
|
||||
return false;
|
||||
|
||||
+14
-14
@@ -269,7 +269,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
|
||||
-NSShowAllViews YES. Cocoa picks these up from the real argv so
|
||||
our removal of them from the wx copy of it does not affect Cocoa's
|
||||
ability to see them.
|
||||
|
||||
|
||||
We basically just assume that any "-NS" option and its following
|
||||
argument needs to be removed from argv. We hope that user code does
|
||||
not expect to see -NS options and indeed it's probably a safe bet
|
||||
@@ -477,7 +477,7 @@ void wxApp::MacHandleUnhandledEvent( WXEVENTREF WXUNUSED(evr) )
|
||||
CGKeyCode wxCharCodeWXToOSX(wxKeyCode code)
|
||||
{
|
||||
CGKeyCode keycode;
|
||||
|
||||
|
||||
switch (code)
|
||||
{
|
||||
// Clang warns about switch values not of the same type as (enumerated)
|
||||
@@ -515,7 +515,7 @@ CGKeyCode wxCharCodeWXToOSX(wxKeyCode code)
|
||||
case 'x': case 'X': keycode = kVK_ANSI_X; break;
|
||||
case 'y': case 'Y': keycode = kVK_ANSI_Y; break;
|
||||
case 'z': case 'Z': keycode = kVK_ANSI_Z; break;
|
||||
|
||||
|
||||
case '0': keycode = kVK_ANSI_0; break;
|
||||
case '1': keycode = kVK_ANSI_1; break;
|
||||
case '2': keycode = kVK_ANSI_2; break;
|
||||
@@ -530,19 +530,19 @@ CGKeyCode wxCharCodeWXToOSX(wxKeyCode code)
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif // __clang__
|
||||
|
||||
|
||||
case WXK_BACK: keycode = kVK_Delete; break;
|
||||
case WXK_TAB: keycode = kVK_Tab; break;
|
||||
case WXK_RETURN: keycode = kVK_Return; break;
|
||||
case WXK_ESCAPE: keycode = kVK_Escape; break;
|
||||
case WXK_SPACE: keycode = kVK_Space; break;
|
||||
case WXK_DELETE: keycode = kVK_ForwardDelete; break;
|
||||
|
||||
|
||||
case WXK_SHIFT: keycode = kVK_Shift; break;
|
||||
case WXK_ALT: keycode = kVK_Option; break;
|
||||
case WXK_RAW_CONTROL: keycode = kVK_Control; break;
|
||||
case WXK_CONTROL: keycode = kVK_Command; break;
|
||||
|
||||
|
||||
case WXK_CAPITAL: keycode = kVK_CapsLock; break;
|
||||
case WXK_END: keycode = kVK_End; break;
|
||||
case WXK_HOME: keycode = kVK_Home; break;
|
||||
@@ -550,10 +550,10 @@ CGKeyCode wxCharCodeWXToOSX(wxKeyCode code)
|
||||
case WXK_UP: keycode = kVK_UpArrow; break;
|
||||
case WXK_RIGHT: keycode = kVK_RightArrow; break;
|
||||
case WXK_DOWN: keycode = kVK_DownArrow; break;
|
||||
|
||||
|
||||
case WXK_HELP: keycode = kVK_Help; break;
|
||||
|
||||
|
||||
|
||||
|
||||
case WXK_NUMPAD0: keycode = kVK_ANSI_Keypad0; break;
|
||||
case WXK_NUMPAD1: keycode = kVK_ANSI_Keypad1; break;
|
||||
case WXK_NUMPAD2: keycode = kVK_ANSI_Keypad2; break;
|
||||
@@ -584,10 +584,10 @@ CGKeyCode wxCharCodeWXToOSX(wxKeyCode code)
|
||||
case WXK_F18: keycode = kVK_F18; break;
|
||||
case WXK_F19: keycode = kVK_F19; break;
|
||||
case WXK_F20: keycode = kVK_F20; break;
|
||||
|
||||
|
||||
case WXK_PAGEUP: keycode = kVK_PageUp; break;
|
||||
case WXK_PAGEDOWN: keycode = kVK_PageDown; break;
|
||||
|
||||
|
||||
case WXK_NUMPAD_DELETE: keycode = kVK_ANSI_KeypadClear; break;
|
||||
case WXK_NUMPAD_EQUAL: keycode = kVK_ANSI_KeypadEquals; break;
|
||||
case WXK_NUMPAD_MULTIPLY: keycode = kVK_ANSI_KeypadMultiply; break;
|
||||
@@ -595,12 +595,12 @@ CGKeyCode wxCharCodeWXToOSX(wxKeyCode code)
|
||||
case WXK_NUMPAD_SUBTRACT: keycode = kVK_ANSI_KeypadMinus; break;
|
||||
case WXK_NUMPAD_DECIMAL: keycode = kVK_ANSI_KeypadDecimal; break;
|
||||
case WXK_NUMPAD_DIVIDE: keycode = kVK_ANSI_KeypadDivide; break;
|
||||
|
||||
|
||||
default:
|
||||
wxLogDebug( "Unrecognised keycode %d", code );
|
||||
keycode = static_cast<CGKeyCode>(-1);
|
||||
}
|
||||
|
||||
|
||||
return keycode;
|
||||
}
|
||||
|
||||
@@ -818,7 +818,7 @@ bool wxApp::MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers
|
||||
void wxApp::MacCreateKeyEvent( wxKeyEvent& event, wxWindow* focus , long keymessage , long modifiers , long when , wxChar uniChar )
|
||||
{
|
||||
#if wxOSX_USE_COCOA_OR_CARBON
|
||||
|
||||
|
||||
short keycode, keychar ;
|
||||
|
||||
keychar = short(keymessage & charCodeMask);
|
||||
|
||||
+21
-21
@@ -96,7 +96,7 @@ wxDataFormat::NativeFormat wxDataFormat::GetFormatForType(wxDataFormatId type)
|
||||
case wxDF_TEXT:
|
||||
f = kUTTypeTraditionalMacText;
|
||||
break;
|
||||
|
||||
|
||||
case wxDF_UNICODETEXT:
|
||||
#ifdef wxNEEDS_UTF8_FOR_TEXT_DATAOBJ
|
||||
f = kUTTypeUTF8PlainText;
|
||||
@@ -106,23 +106,23 @@ wxDataFormat::NativeFormat wxDataFormat::GetFormatForType(wxDataFormatId type)
|
||||
#error "one of wxNEEDS_UTF{8,16}_FOR_TEXT_DATAOBJ must be defined"
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
||||
case wxDF_HTML:
|
||||
f = kUTTypeHTML;
|
||||
break;
|
||||
|
||||
|
||||
case wxDF_BITMAP:
|
||||
f = kUTTypeTIFF;
|
||||
break;
|
||||
|
||||
|
||||
case wxDF_METAFILE:
|
||||
f = kUTTypePDF;
|
||||
break;
|
||||
|
||||
|
||||
case wxDF_FILENAME:
|
||||
f = kUTTypeFileURL;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
wxFAIL_MSG( wxS("unsupported data format") );
|
||||
break;
|
||||
@@ -350,7 +350,7 @@ void wxDataObject::WriteToSink(wxOSXDataSink * datatransfer) const
|
||||
if ( thisFormat.GetType() == wxDF_FILENAME )
|
||||
{
|
||||
wxString filenames;
|
||||
|
||||
|
||||
filenames = wxString( (const char*)buf, *wxConvFileName );
|
||||
wxArrayString files = wxStringTokenize( filenames, wxT("\n"), wxTOKEN_STRTOK );
|
||||
|
||||
@@ -374,7 +374,7 @@ void wxDataObject::WriteToSink(wxOSXDataSink * datatransfer) const
|
||||
bool wxDataObject::ReadFromSource(wxDataObject * source)
|
||||
{
|
||||
bool transferred = false;
|
||||
|
||||
|
||||
size_t formatcount = source->GetFormatCount();
|
||||
wxScopedArray<wxDataFormat> array(formatcount);
|
||||
source->GetAllFormats( array.get() );
|
||||
@@ -385,7 +385,7 @@ bool wxDataObject::ReadFromSource(wxDataObject * source)
|
||||
{
|
||||
int size = source->GetDataSize( format );
|
||||
transferred = true;
|
||||
|
||||
|
||||
if (size == 0)
|
||||
{
|
||||
SetData( format, 0, nullptr );
|
||||
@@ -421,11 +421,11 @@ bool wxDataObject::ReadFromSource(wxOSXDataSource * source)
|
||||
wxCFMutableArrayRef<CFStringRef> typesarray;
|
||||
dataFormat.AddSupportedTypesForSetting(typesarray);
|
||||
size_t itemCount = source->GetItemCount();
|
||||
|
||||
|
||||
for ( size_t itemIndex = 0; itemIndex < itemCount && !transferred; ++itemIndex)
|
||||
{
|
||||
std::unique_ptr<const wxOSXDataSourceItem> sitem(source->GetItem(itemIndex));
|
||||
|
||||
|
||||
wxDataFormat::NativeFormat nativeFormat = sitem->AvailableType(typesarray);
|
||||
CFDataRef flavorData = sitem->DoGetData(nativeFormat);
|
||||
if (flavorData)
|
||||
@@ -460,21 +460,21 @@ bool wxDataObject::ReadFromSource(wxOSXDataSource * source)
|
||||
databuf.UngetWriteBuf(flavorDataSize);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (dataFormat.GetType() == wxDF_FILENAME)
|
||||
{
|
||||
// revert the translation and decomposition to arrive at a proper utf8 string again
|
||||
|
||||
|
||||
wxCFRef<CFURLRef> url = CFURLCreateWithBytes(kCFAllocatorDefault, (UInt8*) buf, flavorDataSize, kCFStringEncodingUTF8, nullptr);
|
||||
wxCFStringRef cfString = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle);
|
||||
|
||||
|
||||
CFMutableStringRef cfMutableString = CFStringCreateMutableCopy(nullptr, 0, cfString);
|
||||
CFStringNormalize(cfMutableString, kCFStringNormalizationFormC);
|
||||
// cfMutableString is released by the wxCFStringRef
|
||||
wxString path = wxCFStringRef(cfMutableString).AsString();
|
||||
if (!path.empty())
|
||||
filenamesPassed += path + wxS("\n");
|
||||
|
||||
|
||||
// if it's the last item, we set the wx data
|
||||
if ( itemIndex + 1 == itemCount )
|
||||
{
|
||||
@@ -486,7 +486,7 @@ bool wxDataObject::ReadFromSource(wxOSXDataSource * source)
|
||||
else
|
||||
{
|
||||
// because some data implementation expect trailing a trailing NUL, we add some headroom
|
||||
|
||||
|
||||
if (dataFormat.GetType() == wxDF_TEXT)
|
||||
{
|
||||
for (char* p = static_cast<char*>(buf); *p; p++)
|
||||
@@ -516,7 +516,7 @@ wxDataFormat wxDataObject::GetSupportedFormatInSource(wxDataObject *source) cons
|
||||
wxDataFormat format;
|
||||
size_t formatcount = source->GetFormatCount();
|
||||
wxScopedArray<wxDataFormat> array(formatcount);
|
||||
|
||||
|
||||
source->GetAllFormats( array.get() );
|
||||
for (size_t i = 0; i < formatcount; i++)
|
||||
{
|
||||
@@ -534,23 +534,23 @@ wxDataFormat wxDataObject::GetSupportedFormatInSource(wxDataObject *source) cons
|
||||
wxDataFormat wxDataObject::GetSupportedFormatInSource(wxOSXDataSource *source) const
|
||||
{
|
||||
wxDataFormat format;
|
||||
|
||||
|
||||
size_t formatcount = GetFormatCount(wxDataObject::Set);
|
||||
wxScopedArray<wxDataFormat> array(formatcount);
|
||||
GetAllFormats(array.get(), wxDataObject::Set);
|
||||
|
||||
|
||||
for (size_t i = 0; i < formatcount; i++)
|
||||
{
|
||||
// go through the data in our order of preference
|
||||
wxDataFormat dataFormat = array[i];
|
||||
|
||||
|
||||
if (source->IsSupported(dataFormat))
|
||||
{
|
||||
format = dataFormat;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return format;
|
||||
}
|
||||
|
||||
|
||||
@@ -139,11 +139,11 @@ wxClientDCImpl::wxClientDCImpl( wxDC *owner, wxWindow *window ) :
|
||||
m_window->GetClientSize( &m_width , &m_height);
|
||||
if ( !m_window->IsShownOnScreen() )
|
||||
m_width = m_height = 0;
|
||||
|
||||
|
||||
int x0,y0;
|
||||
DoGetDeviceOrigin(&x0,&y0);
|
||||
SetDeviceOrigin( m_origin.x + x0, m_origin.y + y0 );
|
||||
|
||||
|
||||
DoSetClippingRegion( 0 , 0 , m_width , m_height ) ;
|
||||
}
|
||||
|
||||
|
||||
@@ -329,7 +329,7 @@ void wxFontRefData::AllocIfNeeded() const
|
||||
void wxFontRefData::Alloc()
|
||||
{
|
||||
wxCHECK_RET(m_info.GetPointSize() > 0, wxT("Point size should not be zero."));
|
||||
|
||||
|
||||
// use font caching, we cache a font with a certain size and a font with just any size for faster creation
|
||||
wxString lookupnameNoSize = wxString::Format("%s_%d_%d", m_info.GetPostScriptName(), (int)m_info.GetStyle(), m_info.GetNumericWeight());
|
||||
|
||||
@@ -976,7 +976,7 @@ void wxNativeFontInfo::CreateCTFontDescriptor()
|
||||
wxASSERT(descriptor != nullptr);
|
||||
|
||||
m_descriptor = descriptor;
|
||||
|
||||
|
||||
wxCFTypeRef(CTFontDescriptorCopyAttribute(m_descriptor, kCTFontFamilyNameAttribute)).GetValue(m_familyName);
|
||||
|
||||
#if wxDEBUG_LEVEL >= 2
|
||||
@@ -986,15 +986,15 @@ void wxNativeFontInfo::CreateCTFontDescriptor()
|
||||
wxCFTypeRef(CTFontDescriptorCopyAttribute(m_descriptor, kCTFontFamilyNameAttribute)).GetValue(familyname);
|
||||
wxLogTrace(TRACE_CTFONT,"****** CreateCTFontDescriptor ******");
|
||||
wxLogTrace(TRACE_CTFONT,"Descriptor FontFamilyName: %s",familyname);
|
||||
|
||||
|
||||
wxString name;
|
||||
wxCFTypeRef(CTFontDescriptorCopyAttribute(m_descriptor, kCTFontNameAttribute)).GetValue(name);
|
||||
wxLogTrace(TRACE_CTFONT,"Descriptor FontName: %s",name);
|
||||
|
||||
|
||||
wxString display;
|
||||
wxCFTypeRef(CTFontDescriptorCopyAttribute(m_descriptor, kCTFontDisplayNameAttribute)).GetValue(display);
|
||||
wxLogTrace(TRACE_CTFONT,"Descriptor DisplayName: %s",display);
|
||||
|
||||
|
||||
wxString style;
|
||||
wxCFTypeRef(CTFontDescriptorCopyAttribute(m_descriptor, kCTFontStyleNameAttribute)).GetValue(style);
|
||||
wxLogTrace(TRACE_CTFONT,"Descriptor StyleName: %s",style);
|
||||
@@ -1002,11 +1002,11 @@ void wxNativeFontInfo::CreateCTFontDescriptor()
|
||||
wxString psname;
|
||||
wxCFTypeRef(CTFontCopyPostScriptName(font)).GetValue(psname);
|
||||
wxLogTrace(TRACE_CTFONT,"Created Font PostScriptName: %s",psname);
|
||||
|
||||
|
||||
wxString fullname;
|
||||
wxCFTypeRef(CTFontCopyFullName(font)).GetValue(fullname);
|
||||
wxLogTrace(TRACE_CTFONT,"Created Font FullName: %s",fullname);
|
||||
|
||||
|
||||
wxLogTrace(TRACE_CTFONT,"************************************");
|
||||
#endif
|
||||
}
|
||||
@@ -1366,7 +1366,7 @@ bool wxNativeFontInfo::SetPostScriptName(const wxString& postScriptName)
|
||||
Free();
|
||||
m_postScriptName = postScriptName;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -260,9 +260,9 @@ int RunMixedFontDialog(wxFontDialog* dialog)
|
||||
else
|
||||
[[NSColorPanel sharedColorPanel] setColor:[NSColor blackColor]];
|
||||
#endif
|
||||
|
||||
|
||||
[NSApp runModalForWindow:fontPanel];
|
||||
|
||||
|
||||
// if we don't reenable it, FPShowHideFontPanel does not work
|
||||
[[fontPanel standardWindowButton:NSWindowCloseButton] setEnabled:YES] ;
|
||||
// we must pick the selection before closing, otherwise a native textcontrol interferes
|
||||
|
||||
@@ -57,12 +57,12 @@ bool wxPopupWindow::Show(bool show)
|
||||
{
|
||||
if ( !wxWindow::Show(show) )
|
||||
return false;
|
||||
|
||||
|
||||
if ( m_nowpeer && show)
|
||||
m_nowpeer->ShowWithoutActivating();
|
||||
else if ( m_nowpeer )
|
||||
m_nowpeer->Show(false);
|
||||
|
||||
|
||||
if ( show )
|
||||
{
|
||||
// because apps expect a size event to occur at this moment
|
||||
@@ -70,7 +70,7 @@ bool wxPopupWindow::Show(bool show)
|
||||
event.SetEventObject(this);
|
||||
HandleWindowEvent(event);
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+77
-77
@@ -110,18 +110,18 @@ wxRegion::wxRegion(const wxRect& rect)
|
||||
#if OSX_USE_SCANLINES
|
||||
|
||||
/*
|
||||
|
||||
|
||||
Copyright 1987, 1998 The Open Group
|
||||
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
@@ -129,12 +129,12 @@ wxRegion::wxRegion(const wxRect& rect)
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
Except as contained in this notice, the name of The Open Group shall
|
||||
not be used in advertising or otherwise to promote the sale, use or
|
||||
other dealings in this Software without prior written authorization
|
||||
from The Open Group.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/* miscanfill.h */
|
||||
@@ -457,7 +457,7 @@ miInsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline,
|
||||
EdgeTableEntry *start, *prev;
|
||||
ScanLineList *pSLL, *pPrevSLL;
|
||||
ScanLineListBlock *tmpSLLBlock;
|
||||
|
||||
|
||||
/*
|
||||
* find the right bucket to put the edge into
|
||||
*/
|
||||
@@ -468,7 +468,7 @@ miInsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline,
|
||||
pPrevSLL = pSLL;
|
||||
pSLL = pSLL->next;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* reassign pSLL (pointer to ScanLineList) if necessary
|
||||
*/
|
||||
@@ -486,13 +486,13 @@ miInsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline,
|
||||
*iSLLBlock = 0;
|
||||
}
|
||||
pSLL = &((*SLLBlock)->SLLs[(*iSLLBlock)++]);
|
||||
|
||||
|
||||
pSLL->next = pPrevSLL->next;
|
||||
pSLL->edgelist = (EdgeTableEntry *)nullptr;
|
||||
pPrevSLL->next = pSLL;
|
||||
}
|
||||
pSLL->scanline = scanline;
|
||||
|
||||
|
||||
/*
|
||||
* now insert the edge in the right bucket
|
||||
*/
|
||||
@@ -504,7 +504,7 @@ miInsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline,
|
||||
start = start->next;
|
||||
}
|
||||
ETE->next = start;
|
||||
|
||||
|
||||
if (prev)
|
||||
prev->next = ETE;
|
||||
else
|
||||
@@ -544,11 +544,11 @@ miCreateETandAET(int count, const wxPoint * pts, EdgeTable *ET, EdgeTableEntry *
|
||||
const wxPoint* top, *bottom;
|
||||
const wxPoint* PrevPt, *CurrPt;
|
||||
int iSLLBlock = 0;
|
||||
|
||||
|
||||
int dy;
|
||||
|
||||
|
||||
if (count < 2) return TRUE;
|
||||
|
||||
|
||||
/*
|
||||
* initialize the Active Edge Table
|
||||
*/
|
||||
@@ -556,7 +556,7 @@ miCreateETandAET(int count, const wxPoint * pts, EdgeTable *ET, EdgeTableEntry *
|
||||
AET->back = (EdgeTableEntry *)nullptr;
|
||||
AET->nextWETE = (EdgeTableEntry *)nullptr;
|
||||
AET->bres.minor = INT_MIN;
|
||||
|
||||
|
||||
/*
|
||||
* initialize the Edge Table.
|
||||
*/
|
||||
@@ -564,9 +564,9 @@ miCreateETandAET(int count, const wxPoint * pts, EdgeTable *ET, EdgeTableEntry *
|
||||
ET->ymax = INT_MIN;
|
||||
ET->ymin = INT_MAX;
|
||||
pSLLBlock->next = (ScanLineListBlock *)nullptr;
|
||||
|
||||
|
||||
PrevPt = &pts[count-1];
|
||||
|
||||
|
||||
/*
|
||||
* for each vertex in the array of points.
|
||||
* In this loop we are dealing with two vertices at
|
||||
@@ -575,7 +575,7 @@ miCreateETandAET(int count, const wxPoint * pts, EdgeTable *ET, EdgeTableEntry *
|
||||
while (count--)
|
||||
{
|
||||
CurrPt = pts++;
|
||||
|
||||
|
||||
/*
|
||||
* find out which point is above and which is below.
|
||||
*/
|
||||
@@ -589,31 +589,31 @@ miCreateETandAET(int count, const wxPoint * pts, EdgeTable *ET, EdgeTableEntry *
|
||||
bottom = CurrPt; top = PrevPt;
|
||||
pETEs->ClockWise = 1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* don't add horizontal edges to the Edge table.
|
||||
*/
|
||||
if (bottom->y != top->y)
|
||||
{
|
||||
pETEs->ymax = bottom->y-1; /* -1 so we don't get last scanline */
|
||||
|
||||
|
||||
/*
|
||||
* initialize integer edge algorithm
|
||||
*/
|
||||
dy = bottom->y - top->y;
|
||||
BRESINITPGONSTRUCT(dy, top->x, bottom->x, pETEs->bres);
|
||||
|
||||
|
||||
if (!miInsertEdgeInET(ET, pETEs, top->y, &pSLLBlock, &iSLLBlock))
|
||||
{
|
||||
miFreeStorage(pSLLBlock->next);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
ET->ymax = wxMax(ET->ymax, PrevPt->y);
|
||||
ET->ymin = wxMin(ET->ymin, PrevPt->y);
|
||||
pETEs++;
|
||||
}
|
||||
|
||||
|
||||
PrevPt = CurrPt;
|
||||
}
|
||||
return TRUE;
|
||||
@@ -633,7 +633,7 @@ miloadAET(EdgeTableEntry *AET, EdgeTableEntry *ETEs)
|
||||
{
|
||||
EdgeTableEntry *pPrevAET;
|
||||
EdgeTableEntry *tmp;
|
||||
|
||||
|
||||
pPrevAET = AET;
|
||||
AET = AET->next;
|
||||
while (ETEs)
|
||||
@@ -650,7 +650,7 @@ miloadAET(EdgeTableEntry *AET, EdgeTableEntry *ETEs)
|
||||
ETEs->back = pPrevAET;
|
||||
pPrevAET->next = ETEs;
|
||||
pPrevAET = ETEs;
|
||||
|
||||
|
||||
ETEs = tmp;
|
||||
}
|
||||
}
|
||||
@@ -681,7 +681,7 @@ micomputeWAET(EdgeTableEntry *AET)
|
||||
EdgeTableEntry *pWETE;
|
||||
int inside = 1;
|
||||
int isInside = 0;
|
||||
|
||||
|
||||
AET->nextWETE = (EdgeTableEntry *)nullptr;
|
||||
pWETE = AET;
|
||||
AET = AET->next;
|
||||
@@ -691,7 +691,7 @@ micomputeWAET(EdgeTableEntry *AET)
|
||||
isInside++;
|
||||
else
|
||||
isInside--;
|
||||
|
||||
|
||||
if ((!inside && !isInside) ||
|
||||
( inside && isInside))
|
||||
{
|
||||
@@ -720,7 +720,7 @@ miInsertionSort(EdgeTableEntry *AET)
|
||||
EdgeTableEntry *pETEinsert;
|
||||
EdgeTableEntry *pETEchaseBackTMP;
|
||||
int changed = 0;
|
||||
|
||||
|
||||
AET = AET->next;
|
||||
while (AET)
|
||||
{
|
||||
@@ -728,7 +728,7 @@ miInsertionSort(EdgeTableEntry *AET)
|
||||
pETEchase = AET;
|
||||
while (pETEchase->back->bres.minor > AET->bres.minor)
|
||||
pETEchase = pETEchase->back;
|
||||
|
||||
|
||||
AET = AET->next;
|
||||
if (pETEchase != pETEinsert)
|
||||
{
|
||||
@@ -753,8 +753,8 @@ static void
|
||||
miFreeStorage(ScanLineListBlock *pSLLBlock)
|
||||
{
|
||||
ScanLineListBlock *tmpSLLBlock;
|
||||
|
||||
while (pSLLBlock)
|
||||
|
||||
while (pSLLBlock)
|
||||
{
|
||||
tmpSLLBlock = pSLLBlock->next;
|
||||
free(pSLLBlock);
|
||||
@@ -786,10 +786,10 @@ scanFillGeneralPoly( wxRegion* rgn,
|
||||
EdgeTableEntry *pETEs; /* Edge Table Entries buff */
|
||||
ScanLineListBlock SLLBlock; /* header for ScanLineList */
|
||||
int fixWAET = 0;
|
||||
|
||||
|
||||
if (count < 3)
|
||||
return(TRUE);
|
||||
|
||||
|
||||
if(!(pETEs = (EdgeTableEntry *)
|
||||
malloc(sizeof(EdgeTableEntry) * count)))
|
||||
return(FALSE);
|
||||
@@ -801,7 +801,7 @@ scanFillGeneralPoly( wxRegion* rgn,
|
||||
return(FALSE);
|
||||
}
|
||||
pSLL = ET.scanlines.next;
|
||||
|
||||
|
||||
if (fillStyle == wxODDEVEN_RULE)
|
||||
{
|
||||
/*
|
||||
@@ -820,7 +820,7 @@ scanFillGeneralPoly( wxRegion* rgn,
|
||||
}
|
||||
pPrevAET = &AET;
|
||||
pAET = AET.next;
|
||||
|
||||
|
||||
/*
|
||||
* for each active edge
|
||||
*/
|
||||
@@ -830,7 +830,7 @@ scanFillGeneralPoly( wxRegion* rgn,
|
||||
ptsOut++->y = y;
|
||||
*width++ = pAET->next->bres.minor - pAET->bres.minor;
|
||||
nPts++;
|
||||
|
||||
|
||||
/*
|
||||
* send out the buffer when its full
|
||||
*/
|
||||
@@ -838,7 +838,7 @@ scanFillGeneralPoly( wxRegion* rgn,
|
||||
{
|
||||
// (*pgc->ops->FillSpans)(dst, pgc,
|
||||
// nPts, FirstPoint, FirstWidth,1);
|
||||
|
||||
|
||||
for ( int i = 0 ; i < nPts; ++i)
|
||||
{
|
||||
wxRect rect;
|
||||
@@ -878,7 +878,7 @@ scanFillGeneralPoly( wxRegion* rgn,
|
||||
pPrevAET = &AET;
|
||||
pAET = AET.next;
|
||||
pWETE = pAET;
|
||||
|
||||
|
||||
/*
|
||||
* for each active edge
|
||||
*/
|
||||
@@ -895,7 +895,7 @@ scanFillGeneralPoly( wxRegion* rgn,
|
||||
ptsOut++->y = y;
|
||||
*width++ = pAET->nextWETE->bres.minor - pAET->bres.minor;
|
||||
nPts++;
|
||||
|
||||
|
||||
/*
|
||||
* send out the buffer
|
||||
*/
|
||||
@@ -916,7 +916,7 @@ scanFillGeneralPoly( wxRegion* rgn,
|
||||
width = FirstWidth;
|
||||
nPts = 0;
|
||||
}
|
||||
|
||||
|
||||
pWETE = pWETE->nextWETE;
|
||||
while (pWETE != pAET)
|
||||
EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET);
|
||||
@@ -924,7 +924,7 @@ scanFillGeneralPoly( wxRegion* rgn,
|
||||
}
|
||||
EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* reevaluate the Winding active edge table if we
|
||||
* just had to resort it or if we just exited an edge.
|
||||
@@ -936,7 +936,7 @@ scanFillGeneralPoly( wxRegion* rgn,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get any spans that we missed by buffering
|
||||
*/
|
||||
@@ -961,41 +961,41 @@ scanFillGeneralPoly( wxRegion* rgn,
|
||||
|
||||
wxRegion::wxRegion(size_t n, const wxPoint *points, wxPolygonFillMode fillStyle)
|
||||
{
|
||||
// Set the region to a polygon shape generically using a bitmap with the
|
||||
// polygon drawn on it.
|
||||
|
||||
m_refData = new wxRegionRefData();
|
||||
|
||||
// Set the region to a polygon shape generically using a bitmap with the
|
||||
// polygon drawn on it.
|
||||
|
||||
m_refData = new wxRegionRefData();
|
||||
|
||||
#if OSX_USE_SCANLINES
|
||||
scanFillGeneralPoly(this,n,points,fillStyle);
|
||||
#else
|
||||
wxCoord mx = 0;
|
||||
wxCoord my = 0;
|
||||
wxPoint p;
|
||||
size_t idx;
|
||||
|
||||
// Find the max size needed to draw the polygon
|
||||
for (idx=0; idx<n; idx++)
|
||||
{
|
||||
wxPoint pt = points[idx];
|
||||
if (pt.x > mx)
|
||||
mx = pt.x;
|
||||
if (pt.y > my)
|
||||
my = pt.y;
|
||||
}
|
||||
|
||||
// Make the bitmap
|
||||
wxBitmap bmp(mx, my);
|
||||
wxMemoryDC dc(bmp);
|
||||
dc.SetBackground(*wxBLACK_BRUSH);
|
||||
dc.Clear();
|
||||
dc.SetPen(*wxWHITE_PEN);
|
||||
dc.SetBrush(*wxWHITE_BRUSH);
|
||||
dc.DrawPolygon(n, (wxPoint*)points, 0, 0, fillStyle);
|
||||
dc.SelectObject(wxNullBitmap);
|
||||
bmp.SetMask(new wxMask(bmp, *wxBLACK));
|
||||
|
||||
// Use it to set this region
|
||||
wxCoord mx = 0;
|
||||
wxCoord my = 0;
|
||||
wxPoint p;
|
||||
size_t idx;
|
||||
|
||||
// Find the max size needed to draw the polygon
|
||||
for (idx=0; idx<n; idx++)
|
||||
{
|
||||
wxPoint pt = points[idx];
|
||||
if (pt.x > mx)
|
||||
mx = pt.x;
|
||||
if (pt.y > my)
|
||||
my = pt.y;
|
||||
}
|
||||
|
||||
// Make the bitmap
|
||||
wxBitmap bmp(mx, my);
|
||||
wxMemoryDC dc(bmp);
|
||||
dc.SetBackground(*wxBLACK_BRUSH);
|
||||
dc.Clear();
|
||||
dc.SetPen(*wxWHITE_PEN);
|
||||
dc.SetBrush(*wxWHITE_BRUSH);
|
||||
dc.DrawPolygon(n, (wxPoint*)points, 0, 0, fillStyle);
|
||||
dc.SelectObject(wxNullBitmap);
|
||||
bmp.SetMask(new wxMask(bmp, *wxBLACK));
|
||||
|
||||
// Use it to set this region
|
||||
Union(bmp);
|
||||
#endif
|
||||
}
|
||||
@@ -1048,12 +1048,12 @@ bool wxRegion::DoUnionWithRect(const wxRect& rect)
|
||||
m_refData = new wxRegionRefData(rect.x , rect.y , rect.width , rect.height);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
AllocExclusive();
|
||||
|
||||
|
||||
CGRect r = CGRectMake(rect.x , rect.y , rect.width , rect.height);
|
||||
HIShapeUnionWithRect(M_REGION , &r);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -192,7 +192,7 @@ WXImage wxOSXGetSystemImage(const wxString& name)
|
||||
return symbol;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
NSImage* nsimage = [NSImage imageNamed:cfname.AsNSString()];
|
||||
return nsimage;
|
||||
}
|
||||
|
||||
@@ -25,9 +25,9 @@ bool wxCheckBox::Create(wxWindow *parent,
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
{
|
||||
DontCreatePeer();
|
||||
|
||||
|
||||
if ( !wxCheckBoxBase::Create(parent, id, pos, size, style, validator, name) )
|
||||
return false;
|
||||
|
||||
@@ -108,7 +108,7 @@ bool wxCheckBox::OSXHandleClicked( double WXUNUSED(timestampsec) )
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (newState == origState)
|
||||
sendEvent = false;
|
||||
else
|
||||
@@ -123,7 +123,7 @@ bool wxCheckBox::OSXHandleClicked( double WXUNUSED(timestampsec) )
|
||||
Set3StateValue( newState );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (sendEvent)
|
||||
{
|
||||
wxCommandEvent event( wxEVT_CHECKBOX, m_windowId );
|
||||
|
||||
@@ -54,8 +54,8 @@ bool wxCheckListBox::Create(
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name )
|
||||
{
|
||||
|
||||
{
|
||||
|
||||
wxASSERT_MSG( !(style & wxLB_MULTIPLE) || !(style & wxLB_EXTENDED),
|
||||
wxT("only one of listbox selection modes can be specified") );
|
||||
|
||||
|
||||
@@ -62,9 +62,9 @@ bool wxChoice::Create(wxWindow *parent,
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name )
|
||||
{
|
||||
{
|
||||
DontCreatePeer();
|
||||
|
||||
|
||||
if ( !wxChoiceBase::Create( parent, id, pos, size, style, validator, name ) )
|
||||
return false;
|
||||
|
||||
|
||||
@@ -33,12 +33,12 @@
|
||||
[iv setImage:[NSApplication sharedApplication].applicationIconImage];
|
||||
[m_dockTile setContentView:iv];
|
||||
[iv release];
|
||||
|
||||
|
||||
m_progIndicator = [[NSProgressIndicator alloc] initWithFrame:NSMakeRect(0, 16, m_dockTile.size.width, 24)];
|
||||
m_progIndicator.style = NSProgressIndicatorBarStyle;
|
||||
[m_progIndicator setIndeterminate:NO];
|
||||
[iv addSubview:m_progIndicator];
|
||||
|
||||
|
||||
[m_progIndicator setBezeled:YES];
|
||||
[m_progIndicator setMinValue:0];
|
||||
[m_progIndicator setMaxValue:1];
|
||||
@@ -58,7 +58,7 @@
|
||||
[m_progIndicator setHidden:NO];
|
||||
[m_progIndicator setIndeterminate:NO];
|
||||
[m_progIndicator setDoubleValue:value];
|
||||
|
||||
|
||||
[m_dockTile display];
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ wxAppProgressIndicator::wxAppProgressIndicator(wxWindow* WXUNUSED(parent), int m
|
||||
m_maxValue(maxValue)
|
||||
{
|
||||
wxAppProgressDockIcon* dockIcon = [[wxAppProgressDockIcon alloc] init];
|
||||
|
||||
|
||||
m_dockIcon = dockIcon;
|
||||
}
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ void wxButtonCocoaImpl::SetBitmap(const wxBitmapBundle& bitmap)
|
||||
{
|
||||
[GetNSButton() setBezelStyle:NSRoundedBezelStyle];
|
||||
}
|
||||
|
||||
|
||||
wxWidgetCocoaImpl::SetBitmap(bitmap);
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ void wxButtonCocoaImpl::SetLabelMarkup(const wxString& markup)
|
||||
{
|
||||
wxMarkupToAttrString toAttr(GetWXPeer()->GetFont(), markup);
|
||||
NSMutableAttributedString *attrString = toAttr.GetNSAttributedString();
|
||||
|
||||
|
||||
// Button text is always centered.
|
||||
NSMutableParagraphStyle *
|
||||
paragraphStyle = [[NSMutableParagraphStyle alloc] init];
|
||||
@@ -118,7 +118,7 @@ void wxButtonCocoaImpl::SetLabelMarkup(const wxString& markup)
|
||||
value:paragraphStyle
|
||||
range:NSMakeRange(0, [attrString length])];
|
||||
[paragraphStyle release];
|
||||
|
||||
|
||||
[GetNSButton() setAttributedTitle:attrString];
|
||||
}
|
||||
#endif // wxUSE_MARKUP
|
||||
@@ -167,7 +167,7 @@ void wxButtonCocoaImpl::SetAcceleratorFromLabel(const wxString& label)
|
||||
NSButton *wxButtonCocoaImpl::GetNSButton() const
|
||||
{
|
||||
wxASSERT( [m_osxView isKindOfClass:[NSButton class]] );
|
||||
|
||||
|
||||
return static_cast<NSButton *>(m_osxView);
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
{
|
||||
delete m_popUpMenu;
|
||||
}
|
||||
|
||||
|
||||
void InsertItem( size_t pos, int itemid, const wxString& text) override
|
||||
{
|
||||
m_popUpMenu->Insert( pos, itemid, text );
|
||||
|
||||
+15
-15
@@ -18,28 +18,28 @@ class wxNSColorRefData : public wxColourRefData
|
||||
{
|
||||
public:
|
||||
wxNSColorRefData(WX_NSColor color);
|
||||
|
||||
|
||||
wxNSColorRefData(const wxNSColorRefData& other);
|
||||
|
||||
virtual ~wxNSColorRefData();
|
||||
|
||||
|
||||
virtual CGFloat Red() const override;
|
||||
virtual CGFloat Green() const override;
|
||||
virtual CGFloat Blue() const override;
|
||||
virtual CGFloat Alpha() const override;
|
||||
|
||||
|
||||
virtual bool IsSolid() const override;
|
||||
|
||||
CGColorRef GetCGColor() const override;
|
||||
|
||||
|
||||
virtual wxColourRefData* Clone() const override { return new wxNSColorRefData(*this); }
|
||||
|
||||
|
||||
virtual WX_NSColor GetNSColor() const override;
|
||||
virtual WX_NSImage GetNSPatternImage() const override;
|
||||
private:
|
||||
static CGFloat GetCGColorComponent(CGColorRef col, int rgbaIndex);
|
||||
WX_NSColor m_nsColour;
|
||||
|
||||
|
||||
wxDECLARE_NO_ASSIGN_CLASS(wxNSColorRefData);
|
||||
};
|
||||
|
||||
@@ -66,16 +66,16 @@ WX_NSColor wxNSColorRefData::GetNSColor() const
|
||||
CGFloat wxNSColorRefData::GetCGColorComponent(CGColorRef col, int rgbaIndex)
|
||||
{
|
||||
CGFloat value = 0.0;
|
||||
|
||||
|
||||
if ( col )
|
||||
{
|
||||
wxCFRef<CGColorRef> rgbacol;
|
||||
CGColorSpaceModel model = CGColorSpaceGetModel(CGColorGetColorSpace(col));
|
||||
size_t noComp = CGColorGetNumberOfComponents(col);
|
||||
const CGFloat* components = CGColorGetComponents(col);
|
||||
|
||||
|
||||
bool isRGB = true;
|
||||
|
||||
|
||||
if (model == kCGColorSpaceModelMonochrome)
|
||||
{
|
||||
wxASSERT_MSG(1 <= noComp && noComp <= 2, "Monochrome Color unexpected components");
|
||||
@@ -99,7 +99,7 @@ CGFloat wxNSColorRefData::GetCGColorComponent(CGColorRef col, int rgbaIndex)
|
||||
isRGB = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (isRGB)
|
||||
{
|
||||
wxASSERT_MSG(3 <= noComp && noComp <= 4, "RGB Color unexpected components");
|
||||
@@ -110,7 +110,7 @@ CGFloat wxNSColorRefData::GetCGColorComponent(CGColorRef col, int rgbaIndex)
|
||||
value = components[rgbaIndex];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ CGFloat wxNSColorRefData::Red() const
|
||||
wxOSXEffectiveAppearanceSetter helper;
|
||||
if ( NSColor* colRGBA = [m_nsColour colorUsingColorSpaceName:NSCalibratedRGBColorSpace] )
|
||||
return [colRGBA redComponent];
|
||||
|
||||
|
||||
return GetCGColorComponent([m_nsColour CGColor], 0);
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ CGFloat wxNSColorRefData::Green() const
|
||||
wxOSXEffectiveAppearanceSetter helper;
|
||||
if ( NSColor* colRGBA = [m_nsColour colorUsingColorSpaceName:NSCalibratedRGBColorSpace] )
|
||||
return [colRGBA greenComponent];
|
||||
|
||||
|
||||
return GetCGColorComponent([m_nsColour CGColor], 1);
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ CGFloat wxNSColorRefData::Blue() const
|
||||
wxOSXEffectiveAppearanceSetter helper;
|
||||
if ( NSColor* colRGBA = [m_nsColour colorUsingColorSpaceName:NSCalibratedRGBColorSpace] )
|
||||
return [colRGBA blueComponent];
|
||||
|
||||
|
||||
return GetCGColorComponent([m_nsColour CGColor], 2);
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ CGFloat wxNSColorRefData::Alpha() const
|
||||
wxOSXEffectiveAppearanceSetter helper;
|
||||
if ( NSColor* colRGBA = [m_nsColour colorUsingColorSpaceName:NSCalibratedRGBColorSpace] )
|
||||
return [colRGBA alphaComponent];
|
||||
|
||||
|
||||
return GetCGColorComponent([m_nsColour CGColor], 3);
|
||||
}
|
||||
|
||||
|
||||
+17
-17
@@ -40,7 +40,7 @@
|
||||
+ (void)initialize
|
||||
{
|
||||
static BOOL initialized = NO;
|
||||
if (!initialized)
|
||||
if (!initialized)
|
||||
{
|
||||
initialized = YES;
|
||||
wxOSXCocoaClassAddWXMethods( self );
|
||||
@@ -144,11 +144,11 @@
|
||||
{
|
||||
wxUnusedVar(textView);
|
||||
wxUnusedVar(control);
|
||||
|
||||
|
||||
BOOL handled = NO;
|
||||
|
||||
// send back key events wx' common code knows how to handle
|
||||
|
||||
|
||||
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
|
||||
if ( impl )
|
||||
{
|
||||
@@ -193,7 +193,7 @@ void wxNSComboBoxControl::mouseEvent(WX_NSEvent event, WXWidget slf, void *_cmd)
|
||||
// NSComboBox has its own event loop, which reacts very badly to our synthetic
|
||||
// events used to signal when a wxEvent is posted, so during that time we switch
|
||||
// the wxEventLoop::WakeUp implementation to a lower-level version
|
||||
|
||||
|
||||
bool reset = false;
|
||||
wxEventLoop* const loop = (wxEventLoop*) wxEventLoopBase::GetActive();
|
||||
|
||||
@@ -202,10 +202,10 @@ void wxNSComboBoxControl::mouseEvent(WX_NSEvent event, WXWidget slf, void *_cmd)
|
||||
reset = true;
|
||||
loop->OSXUseLowLevelWakeup(true);
|
||||
}
|
||||
|
||||
|
||||
wxOSX_EventHandlerPtr superimpl = (wxOSX_EventHandlerPtr) [[slf superclass] instanceMethodForSelector:(SEL)_cmd];
|
||||
superimpl(slf, (SEL)_cmd, event);
|
||||
|
||||
|
||||
if ( reset )
|
||||
{
|
||||
loop->OSXUseLowLevelWakeup(false);
|
||||
@@ -324,13 +324,13 @@ void wxNSComboBoxControl::SetEditable(bool editable)
|
||||
[m_comboBox setSelectable:YES];
|
||||
}
|
||||
|
||||
wxWidgetImplType* wxWidgetImpl::CreateComboBox( wxComboBox* wxpeer,
|
||||
wxWindowMac* WXUNUSED(parent),
|
||||
wxWindowID WXUNUSED(id),
|
||||
wxWidgetImplType* wxWidgetImpl::CreateComboBox( wxComboBox* wxpeer,
|
||||
wxWindowMac* WXUNUSED(parent),
|
||||
wxWindowID WXUNUSED(id),
|
||||
wxMenu* WXUNUSED(menu),
|
||||
const wxPoint& pos,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
long style,
|
||||
long WXUNUSED(extraStyle))
|
||||
{
|
||||
NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
|
||||
@@ -354,26 +354,26 @@ wxSize wxComboBox::DoGetBestSize() const
|
||||
wxSize baseSize = wxWindow::DoGetBestSize();
|
||||
int lbHeight = baseSize.y;
|
||||
int wLine;
|
||||
|
||||
|
||||
{
|
||||
wxInfoDC dc(const_cast<wxComboBox*>(this));
|
||||
|
||||
|
||||
// Find the widest line
|
||||
for(unsigned int i = 0; i < GetCount(); i++)
|
||||
{
|
||||
wxString str(GetString(i));
|
||||
|
||||
|
||||
wxCoord width, height ;
|
||||
dc.GetTextExtent( str , &width, &height);
|
||||
wLine = width ;
|
||||
|
||||
|
||||
lbWidth = wxMax( lbWidth, wLine ) ;
|
||||
}
|
||||
|
||||
|
||||
// Add room for the popup arrow
|
||||
lbWidth += 2 * lbHeight ;
|
||||
}
|
||||
|
||||
|
||||
return wxSize( lbWidth, lbHeight );
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ public:
|
||||
virtual void SetDateTime(const wxDateTime& dt) override
|
||||
{
|
||||
wxDateTime dtFrom, dtTo;
|
||||
|
||||
|
||||
if ( GetDateRange(&dtFrom,&dtTo) == false ||
|
||||
( (!dtFrom.IsValid() || dtFrom <= dt) &&
|
||||
(!dtTo.IsValid() || dt <= dtTo ) ) )
|
||||
|
||||
@@ -23,14 +23,14 @@
|
||||
extern wxList wxModalDialogs;
|
||||
|
||||
void wxDialog::DoShowWindowModal()
|
||||
{
|
||||
{
|
||||
wxTopLevelWindow* parent = static_cast<wxTopLevelWindow*>(wxGetTopLevelParent(GetParent()));
|
||||
|
||||
|
||||
wxASSERT_MSG(parent, "ShowWindowModal requires the dialog to have a parent.");
|
||||
|
||||
|
||||
NSWindow* parentWindow = parent->GetWXWindow();
|
||||
NSWindow* theWindow = GetWXWindow();
|
||||
|
||||
|
||||
[parentWindow beginSheet:theWindow completionHandler:
|
||||
^(NSModalResponse returnCode)
|
||||
{
|
||||
|
||||
@@ -188,7 +188,7 @@ void wxOSXPasteboard::DeleteSinkItems()
|
||||
void wxOSXPasteboard::Clear()
|
||||
{
|
||||
[m_pasteboard clearContents];
|
||||
DeleteSinkItems();
|
||||
DeleteSinkItems();
|
||||
}
|
||||
|
||||
void wxOSXPasteboard::Flush()
|
||||
@@ -227,7 +227,7 @@ const wxOSXDataSourceItem* wxOSXPasteboard::GetItem(size_t pos) const
|
||||
{
|
||||
return new wxOSXPasteboardSourceItem([[m_pasteboard pasteboardItems] objectAtIndex: pos], m_pasteboard);
|
||||
}
|
||||
|
||||
|
||||
// data source methods
|
||||
|
||||
wxOSXPasteboard* wxOSXPasteboard::GetGeneralClipboard()
|
||||
|
||||
+34
-34
@@ -59,10 +59,10 @@ static NSUInteger CalculateNSEventMaskFromEventCategory(wxEventCategory cat)
|
||||
{
|
||||
// the masking system doesn't really help, as only the lowlevel UI events
|
||||
// are split in a useful way, all others are way to broad
|
||||
|
||||
|
||||
if ( (cat | wxEVT_CATEGORY_USER_INPUT) && (cat | (~wxEVT_CATEGORY_USER_INPUT) ) )
|
||||
return NSAnyEventMask;
|
||||
|
||||
|
||||
NSUInteger mask = 0;
|
||||
|
||||
if ( cat | wxEVT_CATEGORY_USER_INPUT )
|
||||
@@ -95,17 +95,17 @@ static NSUInteger CalculateNSEventMaskFromEventCategory(wxEventCategory cat)
|
||||
NSEventMaskEndGesture |
|
||||
0;
|
||||
}
|
||||
|
||||
|
||||
if ( cat | (~wxEVT_CATEGORY_USER_INPUT) )
|
||||
{
|
||||
mask |=
|
||||
mask |=
|
||||
NSAppKitDefinedMask |
|
||||
NSSystemDefinedMask |
|
||||
NSApplicationDefinedMask |
|
||||
NSPeriodicMask |
|
||||
NSCursorUpdateMask;
|
||||
}
|
||||
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ bool wxGUIEventLoop::Pending() const
|
||||
// as otherwise we end up in a tight loop when idle events are responded
|
||||
// to by RequestMore(true)
|
||||
wxMacAutoreleasePool autoreleasepool;
|
||||
|
||||
|
||||
return [[NSApplication sharedApplication]
|
||||
nextEventMatchingMask: NSAnyEventMask
|
||||
untilDate: nil
|
||||
@@ -182,7 +182,7 @@ bool wxGUIEventLoop::Dispatch()
|
||||
{
|
||||
if (wxTheApp)
|
||||
wxTheApp->ProcessPendingEvents();
|
||||
|
||||
|
||||
if ( wxTheApp->ProcessIdle() )
|
||||
m_sleepTime = 0.0 ;
|
||||
else
|
||||
@@ -208,8 +208,8 @@ int wxGUIEventLoop::DoDispatchTimeout(unsigned long timeout)
|
||||
if ( m_modalSession )
|
||||
{
|
||||
NSInteger response = [NSApp runModalSession:(NSModalSession)m_modalSession];
|
||||
|
||||
switch (response)
|
||||
|
||||
switch (response)
|
||||
{
|
||||
case NSModalResponseContinue:
|
||||
{
|
||||
@@ -222,7 +222,7 @@ int wxGUIEventLoop::DoDispatchTimeout(unsigned long timeout)
|
||||
inMode: NSDefaultRunLoopMode
|
||||
dequeue: NO] != nil )
|
||||
return 1;
|
||||
|
||||
|
||||
return -1;
|
||||
}
|
||||
case NSModalResponseStop:
|
||||
@@ -234,14 +234,14 @@ int wxGUIEventLoop::DoDispatchTimeout(unsigned long timeout)
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else
|
||||
{
|
||||
NSEvent *event = [NSApp
|
||||
nextEventMatchingMask:NSAnyEventMask
|
||||
untilDate:[NSDate dateWithTimeIntervalSinceNow: timeout/1000.0]
|
||||
inMode:NSDefaultRunLoopMode
|
||||
dequeue: YES];
|
||||
|
||||
|
||||
if ( event == nil )
|
||||
return -1;
|
||||
|
||||
@@ -365,24 +365,24 @@ void wxGUIEventLoop::WakeUp()
|
||||
{
|
||||
// NSEvent* cevent = [NSApp currentEvent];
|
||||
// NSString* mode = [[NSRunLoop mainRunLoop] currentMode];
|
||||
|
||||
|
||||
// when already in a mouse event handler, don't add higher level event
|
||||
// if ( cevent != nil && [cevent type] <= NSMouseMoved && )
|
||||
if ( m_osxLowLevelWakeUp /* [NSEventTrackingRunLoopMode isEqualToString:mode] */ )
|
||||
{
|
||||
// NSLog(@"event for wakeup %@ in mode %@",cevent,mode);
|
||||
wxCFEventLoop::WakeUp();
|
||||
wxCFEventLoop::WakeUp();
|
||||
}
|
||||
else
|
||||
{
|
||||
wxMacAutoreleasePool autoreleasepool;
|
||||
NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined
|
||||
location:NSMakePoint(0.0, 0.0)
|
||||
modifierFlags:0
|
||||
timestamp:0
|
||||
windowNumber:0
|
||||
NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined
|
||||
location:NSMakePoint(0.0, 0.0)
|
||||
modifierFlags:0
|
||||
timestamp:0
|
||||
windowNumber:0
|
||||
context:nil
|
||||
subtype:0 data1:0 data2:0];
|
||||
subtype:0 data1:0 data2:0];
|
||||
[NSApp postEvent:event atStart:FALSE];
|
||||
}
|
||||
}
|
||||
@@ -456,7 +456,7 @@ void wxGUIEventLoop::BeginModalSession( wxWindow* modalWindow )
|
||||
if ( m_modalNestedLevel > 1 )
|
||||
{
|
||||
wxModalSessionStack* stack = nullptr;
|
||||
|
||||
|
||||
if ( m_modalNestedLevel == 2 )
|
||||
{
|
||||
stack = new wxModalSessionStack;
|
||||
@@ -466,28 +466,28 @@ void wxGUIEventLoop::BeginModalSession( wxWindow* modalWindow )
|
||||
{
|
||||
stack = gs_modalSessionStackMap[this];
|
||||
}
|
||||
|
||||
|
||||
wxModalSessionStackElement element;
|
||||
element.dummyWindow = m_dummyWindow;
|
||||
element.modalSession = m_modalSession;
|
||||
|
||||
|
||||
stack->push_back(element);
|
||||
|
||||
|
||||
// shortcut if nothing changed in this level
|
||||
|
||||
|
||||
if ( m_modalWindow == modalWindow )
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
m_modalWindow = modalWindow;
|
||||
|
||||
|
||||
if ( modalWindow )
|
||||
{
|
||||
// we must show now, otherwise beginModalSessionForWindow does it but it
|
||||
// also would do a centering of the window before overriding all our position
|
||||
if ( !modalWindow->IsShownOnScreen() )
|
||||
modalWindow->Show();
|
||||
|
||||
|
||||
wxNonOwnedWindow* now = dynamic_cast<wxNonOwnedWindow*> (modalWindow);
|
||||
wxASSERT_MSG( now != nullptr, "must pass in a toplevel window for modal event loop" );
|
||||
nsnow = now ? now->GetWXWindow() : nil;
|
||||
@@ -511,7 +511,7 @@ void wxGUIEventLoop::BeginModalSession( wxWindow* modalWindow )
|
||||
void wxGUIEventLoop::EndModalSession()
|
||||
{
|
||||
wxASSERT_MSG(m_modalSession != nullptr, "no modal session active");
|
||||
|
||||
|
||||
wxASSERT_MSG(m_modalNestedLevel > 0, "incorrect modal nesting level");
|
||||
|
||||
m_modalWindow = nullptr;
|
||||
@@ -533,19 +533,19 @@ void wxGUIEventLoop::EndModalSession()
|
||||
wxModalSessionStack* stack = gs_modalSessionStackMap[this];
|
||||
wxModalSessionStackElement element = stack->back();
|
||||
stack->pop_back();
|
||||
|
||||
|
||||
if( m_modalNestedLevel == 1 )
|
||||
{
|
||||
gs_modalSessionStackMap.erase(this);
|
||||
delete stack;
|
||||
}
|
||||
|
||||
|
||||
if ( m_modalSession != element.modalSession )
|
||||
{
|
||||
[NSApp endModalSession:(NSModalSession)m_modalSession];
|
||||
m_modalSession = element.modalSession;
|
||||
}
|
||||
|
||||
|
||||
if ( m_dummyWindow != element.dummyWindow )
|
||||
{
|
||||
if ( m_dummyWindow )
|
||||
@@ -560,7 +560,7 @@ void wxGUIEventLoop::EndModalSession()
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
void wxWindowDisabler::AfterDisable(wxWindow* winToSkip)
|
||||
|
||||
+14
-14
@@ -252,7 +252,7 @@ void wxFileDialog::ShowWindowModal()
|
||||
wxCFStringRef file( m_fileName );
|
||||
|
||||
wxNonOwnedWindow* parentWindow = nullptr;
|
||||
|
||||
|
||||
m_modality = wxDIALOG_MODALITY_WINDOW_MODAL;
|
||||
|
||||
if (GetParent())
|
||||
@@ -339,10 +339,10 @@ void wxFileDialog::ShowWindowModal()
|
||||
this->ModalFinishedCallback(sPanel, returnCode);
|
||||
}];
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
NSOpenPanel* oPanel = [NSOpenPanel openPanel];
|
||||
|
||||
|
||||
SetupExtraControls(oPanel);
|
||||
|
||||
[oPanel setTreatsFilePackagesAsDirectories:NO];
|
||||
@@ -403,7 +403,7 @@ wxWindow* wxFileDialog::CreateFilterPanel(wxWindow *extracontrol)
|
||||
: static_cast<wxWindow*>(new wxPanel(this));
|
||||
|
||||
wxBoxSizer *verticalSizer = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
|
||||
// the file type control
|
||||
{
|
||||
wxBoxSizer *horizontalSizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
@@ -422,7 +422,7 @@ wxWindow* wxFileDialog::CreateFilterPanel(wxWindow *extracontrol)
|
||||
}
|
||||
m_filterChoice->Bind(wxEVT_CHOICE, &wxFileDialog::OnFilterSelected, this);
|
||||
}
|
||||
|
||||
|
||||
if(extracontrol)
|
||||
{
|
||||
// Either use an extra control's existing sizer or the extra control
|
||||
@@ -484,7 +484,7 @@ void wxFileDialog::SetupExtraControls(WXWindow nativeWindow)
|
||||
// workaround for crashes we don't support those yet
|
||||
if ( [panel contentView] == nil || getenv("APP_SANDBOX_CONTAINER_ID") != nullptr )
|
||||
return;
|
||||
|
||||
|
||||
wxNonOwnedWindow::Create( GetParent(), nativeWindow );
|
||||
|
||||
// This won't do anything if there are no extra controls to create and
|
||||
@@ -562,7 +562,7 @@ int wxFileDialog::ShowModal()
|
||||
wxCFEventLoopPauseIdleEvents pause;
|
||||
|
||||
wxMacAutoreleasePool autoreleasepool;
|
||||
|
||||
|
||||
wxCFStringRef cf( m_message );
|
||||
|
||||
wxCFStringRef dir( m_dir );
|
||||
@@ -587,7 +587,7 @@ int wxFileDialog::ShowModal()
|
||||
if( HasFlag(wxFD_OPEN) )
|
||||
{
|
||||
if ( !(wxSystemOptions::HasOption( wxOSX_FILEDIALOG_ALWAYS_SHOW_TYPES ) && (wxSystemOptions::GetOptionInt( wxOSX_FILEDIALOG_ALWAYS_SHOW_TYPES ) == 1)) )
|
||||
m_useFileTypeFilter = false;
|
||||
m_useFileTypeFilter = false;
|
||||
}
|
||||
|
||||
m_firstFileTypeFilter = -1;
|
||||
@@ -659,7 +659,7 @@ int wxFileDialog::ShowModal()
|
||||
else
|
||||
{
|
||||
NSOpenPanel* oPanel = [NSOpenPanel openPanel];
|
||||
|
||||
|
||||
SetupExtraControls(oPanel);
|
||||
|
||||
wxOpenSavePanelDelegate* del = [[wxOpenSavePanelDelegate alloc]init];
|
||||
@@ -692,13 +692,13 @@ int wxFileDialog::ShowModal()
|
||||
[oPanel setAllowedFileTypes: types];
|
||||
}
|
||||
if ( !m_dir.IsEmpty() )
|
||||
[oPanel setDirectoryURL:[NSURL fileURLWithPath:dir.AsNSString()
|
||||
[oPanel setDirectoryURL:[NSURL fileURLWithPath:dir.AsNSString()
|
||||
isDirectory:YES]];
|
||||
returnCode = [oPanel runModal];
|
||||
|
||||
|
||||
ModalFinishedCallback(oPanel, returnCode);
|
||||
}
|
||||
|
||||
|
||||
OSXEndModalDialog();
|
||||
|
||||
|
||||
@@ -760,7 +760,7 @@ void wxFileDialog::ModalFinishedCallback(void* panel, int returnCode)
|
||||
}
|
||||
|
||||
SetReturnCode(wasAccepted ? wxID_OK : wxID_CANCEL);
|
||||
|
||||
|
||||
// workaround for sandboxed app, see above, must be executed before window modal handler
|
||||
// because there this instance will be deleted
|
||||
if ( m_isNativeWindowWrapper )
|
||||
@@ -768,7 +768,7 @@ void wxFileDialog::ModalFinishedCallback(void* panel, int returnCode)
|
||||
|
||||
if (GetModality() == wxDIALOG_MODALITY_WINDOW_MODAL)
|
||||
SendWindowModalDialogEvent ( wxEVT_WINDOW_MODAL_DIALOG_CLOSED );
|
||||
|
||||
|
||||
[sPanel setAccessoryView:nil];
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ protected:
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
wxWidgetImplType* wxWidgetImpl::CreateGauge( wxWindowMac* wxpeer,
|
||||
|
||||
@@ -163,15 +163,15 @@ bool wxGLCanvas::DoCreate(wxWindow *parent,
|
||||
const wxString& name)
|
||||
{
|
||||
DontCreatePeer();
|
||||
|
||||
|
||||
if ( !wxWindow::Create(parent, id, pos, size, style, name) )
|
||||
return false;
|
||||
|
||||
|
||||
|
||||
NSRect r = wxOSXGetFrameForControl( this, pos , size ) ;
|
||||
wxNSCustomOpenGLView* v = [[wxNSCustomOpenGLView alloc] initWithFrame:r];
|
||||
[v setWantsBestResolutionOpenGLSurface:YES];
|
||||
|
||||
|
||||
wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( this, v, wxWidgetImpl::Widget_UserKeyEvents | wxWidgetImpl::Widget_UserMouseEvents );
|
||||
SetPeer(c);
|
||||
MacPostControlCreate(pos, size) ;
|
||||
|
||||
@@ -440,7 +440,7 @@ wxListWidgetColumn* wxListWidgetCocoaImpl::InsertCheckColumn( unsigned pos , con
|
||||
|
||||
[[col1 dataCell] setControlSize:size];
|
||||
// although there is no text, it may help to get the correct vertical layout
|
||||
[[col1 dataCell] setFont:list->GetFont().OSXGetNSFont()];
|
||||
[[col1 dataCell] setFont:list->GetFont().OSXGetNSFont()];
|
||||
}
|
||||
|
||||
[checkbox release];
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user