wxWidgets / wxWidgets

Cross-Platform C++ GUI Library
https://www.wxwidgets.org/
5.78k stars 1.7k forks source link

compilation fix for OS X after recent Ribbon changes #11203

Closed wxtrac closed 14 years ago

wxtrac commented 14 years ago

Issue migrated from trac ticket # 11203

component: old wxOSX/Carbon port | priority: normal | resolution: fixed

2009-09-17 01:13:21: @discnl created the issue


Using a default configure and make resulted in:

../src/ribbon/art_aui.cpp: In constructor 'wxRibbonAUIArtProvider::wxRibbonAUIArtProvider()': ../src/ribbon/art_aui.cpp:41: error: 'kThemeBrushToolbarBackground' was not declared in this scope ../src/ribbon/art_aui.cpp:41: error: 'wxMacCreateCGColorFromHITheme' was not declared in this scope

Attached is a patch adding a missing #include.

wxtrac commented 14 years ago

2009-09-17 01:14:07: @discnl uploaded file osx_ribbon_compilo.patch (0.4 KiB)

wxtrac commented 14 years ago

2009-09-17 01:19:04: @vadz changed status from new to closed

2009-09-17 01:19:04: @vadz changed resolution from * to fixed*

2009-09-17 01:19:04: @vadz commented

(In [61949]) Ribbon compilation fixes for OS X.

Forward declare wxWindow and wxDC classes in wx/ribbon/art.h to avoid errors in (PCH-less?) buildbot builds.

Also include header containing declarations of private Mac functions in implementation file (closes #11203).

wxtrac commented 14 years ago

2009-09-18 12:49:36: @discnl changed status from closed to reopened

2009-09-18 12:49:36: @discnl changed resolution from fixed to **

2009-09-18 12:49:36: @discnl commented

I should have been more thorough, Cocoa also doesn't compile because it (by default) doesn't include Carbon/Carbon.h which is also required (in addition to private.h). I'm attaching a patch next.

wxtrac commented 14 years ago

2009-09-18 12:50:21: @discnl uploaded file cocoa_ribbon_compilo.patch (0.4 KiB)

wxtrac commented 14 years ago

2009-09-18 14:37:48: @vadz changed status from reopened to confirmed

2009-09-18 14:37:48: @vadz commented

I'll apply this for now to fix the build but I wonder if it's really correct to use Carbon/Carbon.h from Cocoa build. OTOH wxMacCreateCGColorFromHITheme() does seem to be defined for both Carbon and Cocoa...

Stefan, could you please look at this to check if we're not doing something stupid here?

TIA!

wxtrac commented 14 years ago

2009-09-18 15:59:15: @csomor commented


yes, that's ok, I'm doing it the same way, as I haven't found a neat way to just pull in the header we need because it is deep inside the Carbon Framework, which would work on all SDKs from 10.4

wxtrac commented 14 years ago

2009-09-18 16:30:34: @discnl commented


I was hesitant about this myself (I thought any usage of the Carbon Framework ruled out 64-bit GUI apps), but I saw it (conditionally) being included in include/wx/osx/cocoa/private.h so it seemed fine. Sorry for not mentioning it right away.

wxtrac commented 14 years ago

2009-09-18 17:09:01: @csomor commented


some carbon APIs that still don't have a counterpart in 64bit cocoa are 64bit capable like HITheme (and below the covers, there are even carbon technologies that are used the for the implementation of the cocoa frameworks eg the menu manager, but these are now private)

wxtrac commented 14 years ago

2009-09-20 23:34:12: @vadz changed status from confirmed to closed

2009-09-20 23:34:12: @vadz changed resolution from * to fixed*

2009-09-20 23:34:12: @vadz commented

This (including the 2nd part) was already applied but somehow not closed.

Stefan: thanks for confirmation, maybe we ought to have some wx wrapper file without "carbon" in its name which could include just the Carbon stuff safe for use in 64 bit code?

wxtrac commented 14 years ago

2009-09-21 14:06:10: @csomor commented


yes, I'll just turn it on in the private.h header for cocoa, it's just too often now, and remove the direct include from all places