# =========================================================================
# This makefile was generated by
-# Bakefile 0.2.7 (http://www.bakefile.org)
+# Bakefile 0.2.8 (http://www.bakefile.org)
# Do not modify, all changes will be overwritten!
# =========================================================================
monodll_src_cocoa_choice.o \
monodll_cocoa_clipbrd.o \
monodll_cocoa_colordlg.o \
- monodll_cocoa_colour.o \
+ monodll_src_cocoa_colour.o \
monodll_cocoa_combobox.o \
monodll_cocoa_control.o \
monodll_cocoa_cursor.o \
monodll_osx_cocoa_button.o \
monodll_osx_cocoa_checkbox.o \
monodll_osx_cocoa_choice.o \
+ monodll_osx_cocoa_colour.o \
monodll_osx_cocoa_dialog.o \
monodll_osx_cocoa_dirdlg.o \
monodll_osx_cocoa_evtloop.o \
monolib_src_cocoa_choice.o \
monolib_cocoa_clipbrd.o \
monolib_cocoa_colordlg.o \
- monolib_cocoa_colour.o \
+ monolib_src_cocoa_colour.o \
monolib_cocoa_combobox.o \
monolib_cocoa_control.o \
monolib_cocoa_cursor.o \
monolib_osx_cocoa_button.o \
monolib_osx_cocoa_checkbox.o \
monolib_osx_cocoa_choice.o \
+ monolib_osx_cocoa_colour.o \
monolib_osx_cocoa_dialog.o \
monolib_osx_cocoa_dirdlg.o \
monolib_osx_cocoa_evtloop.o \
coredll_src_cocoa_choice.o \
coredll_cocoa_clipbrd.o \
coredll_cocoa_colordlg.o \
- coredll_cocoa_colour.o \
+ coredll_src_cocoa_colour.o \
coredll_cocoa_combobox.o \
coredll_cocoa_control.o \
coredll_cocoa_cursor.o \
coredll_osx_cocoa_button.o \
coredll_osx_cocoa_checkbox.o \
coredll_osx_cocoa_choice.o \
+ coredll_osx_cocoa_colour.o \
coredll_osx_cocoa_dialog.o \
coredll_osx_cocoa_dirdlg.o \
coredll_osx_cocoa_evtloop.o \
corelib_src_cocoa_choice.o \
corelib_cocoa_clipbrd.o \
corelib_cocoa_colordlg.o \
- corelib_cocoa_colour.o \
+ corelib_src_cocoa_colour.o \
corelib_cocoa_combobox.o \
corelib_cocoa_control.o \
corelib_cocoa_cursor.o \
corelib_osx_cocoa_button.o \
corelib_osx_cocoa_checkbox.o \
corelib_osx_cocoa_choice.o \
+ corelib_osx_cocoa_colour.o \
corelib_osx_cocoa_dialog.o \
corelib_osx_cocoa_dirdlg.o \
corelib_osx_cocoa_evtloop.o \
monodll_osx_cocoa_choice.o: $(srcdir)/src/osx/cocoa/choice.mm $(MONODLL_ODEP)
$(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/choice.mm
+monodll_osx_cocoa_colour.o: $(srcdir)/src/osx/cocoa/colour.mm $(MONODLL_ODEP)
+ $(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/colour.mm
+
monodll_osx_cocoa_dialog.o: $(srcdir)/src/osx/cocoa/dialog.mm $(MONODLL_ODEP)
$(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/dialog.mm
monodll_cocoa_colordlg.o: $(srcdir)/src/cocoa/colordlg.mm $(MONODLL_ODEP)
$(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/cocoa/colordlg.mm
-monodll_cocoa_colour.o: $(srcdir)/src/cocoa/colour.mm $(MONODLL_ODEP)
+monodll_src_cocoa_colour.o: $(srcdir)/src/cocoa/colour.mm $(MONODLL_ODEP)
$(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/cocoa/colour.mm
monodll_cocoa_combobox.o: $(srcdir)/src/cocoa/combobox.mm $(MONODLL_ODEP)
monolib_osx_cocoa_choice.o: $(srcdir)/src/osx/cocoa/choice.mm $(MONOLIB_ODEP)
$(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/choice.mm
+monolib_osx_cocoa_colour.o: $(srcdir)/src/osx/cocoa/colour.mm $(MONOLIB_ODEP)
+ $(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/colour.mm
+
monolib_osx_cocoa_dialog.o: $(srcdir)/src/osx/cocoa/dialog.mm $(MONOLIB_ODEP)
$(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/dialog.mm
monolib_cocoa_colordlg.o: $(srcdir)/src/cocoa/colordlg.mm $(MONOLIB_ODEP)
$(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/cocoa/colordlg.mm
-monolib_cocoa_colour.o: $(srcdir)/src/cocoa/colour.mm $(MONOLIB_ODEP)
+monolib_src_cocoa_colour.o: $(srcdir)/src/cocoa/colour.mm $(MONOLIB_ODEP)
$(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/cocoa/colour.mm
monolib_cocoa_combobox.o: $(srcdir)/src/cocoa/combobox.mm $(MONOLIB_ODEP)
coredll_osx_cocoa_choice.o: $(srcdir)/src/osx/cocoa/choice.mm $(COREDLL_ODEP)
$(CXXC) -c -o $@ $(COREDLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/choice.mm
+coredll_osx_cocoa_colour.o: $(srcdir)/src/osx/cocoa/colour.mm $(COREDLL_ODEP)
+ $(CXXC) -c -o $@ $(COREDLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/colour.mm
+
coredll_osx_cocoa_dialog.o: $(srcdir)/src/osx/cocoa/dialog.mm $(COREDLL_ODEP)
$(CXXC) -c -o $@ $(COREDLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/dialog.mm
coredll_cocoa_colordlg.o: $(srcdir)/src/cocoa/colordlg.mm $(COREDLL_ODEP)
$(CXXC) -c -o $@ $(COREDLL_OBJCXXFLAGS) $(srcdir)/src/cocoa/colordlg.mm
-coredll_cocoa_colour.o: $(srcdir)/src/cocoa/colour.mm $(COREDLL_ODEP)
+coredll_src_cocoa_colour.o: $(srcdir)/src/cocoa/colour.mm $(COREDLL_ODEP)
$(CXXC) -c -o $@ $(COREDLL_OBJCXXFLAGS) $(srcdir)/src/cocoa/colour.mm
coredll_cocoa_combobox.o: $(srcdir)/src/cocoa/combobox.mm $(COREDLL_ODEP)
corelib_osx_cocoa_choice.o: $(srcdir)/src/osx/cocoa/choice.mm $(CORELIB_ODEP)
$(CXXC) -c -o $@ $(CORELIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/choice.mm
+corelib_osx_cocoa_colour.o: $(srcdir)/src/osx/cocoa/colour.mm $(CORELIB_ODEP)
+ $(CXXC) -c -o $@ $(CORELIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/colour.mm
+
corelib_osx_cocoa_dialog.o: $(srcdir)/src/osx/cocoa/dialog.mm $(CORELIB_ODEP)
$(CXXC) -c -o $@ $(CORELIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/dialog.mm
corelib_cocoa_colordlg.o: $(srcdir)/src/cocoa/colordlg.mm $(CORELIB_ODEP)
$(CXXC) -c -o $@ $(CORELIB_OBJCXXFLAGS) $(srcdir)/src/cocoa/colordlg.mm
-corelib_cocoa_colour.o: $(srcdir)/src/cocoa/colour.mm $(CORELIB_ODEP)
+corelib_src_cocoa_colour.o: $(srcdir)/src/cocoa/colour.mm $(CORELIB_ODEP)
$(CXXC) -c -o $@ $(CORELIB_OBJCXXFLAGS) $(srcdir)/src/cocoa/colour.mm
corelib_cocoa_combobox.o: $(srcdir)/src/cocoa/combobox.mm $(CORELIB_ODEP)
{
m_cgColour.reset( col );
size_t noComp = CGColorGetNumberOfComponents( col );
+
+ const CGFloat *components = NULL;
if ( noComp >= 1 && noComp <= 4 )
{
// TODO verify whether we really are on a RGB color space
m_alpha = wxALPHA_OPAQUE;
- const CGFloat *components = CGColorGetComponents( col );
- if ( noComp >= 3 )
- {
- m_red = (int)(components[0]*255+0.5);
- m_green = (int)(components[1]*255+0.5);
- m_blue = (int)(components[2]*255+0.5);
- if ( noComp == 4 )
- m_alpha = (int)(components[3]*255+0.5);
- }
- else
- {
- m_red = (int)(components[0]*255+0.5);
- m_green = (int)(components[0]*255+0.5);
- m_blue = (int)(components[0]*255+0.5);
- }
+ components = CGColorGetComponents( col );
}
- else
+ InitFromComponents(components, noComp);
+}
+
+void wxColour::InitFromComponents(const CGFloat* components, size_t numComponents )
+{
+ if ( numComponents < 1 || !components )
{
m_alpha = wxALPHA_OPAQUE;
m_red = m_green = m_blue = 0;
+ return;
+ }
+
+ if ( numComponents >= 3 )
+ {
+ m_red = (int)(components[0]*255+0.5);
+ m_green = (int)(components[1]*255+0.5);
+ m_blue = (int)(components[2]*255+0.5);
+ if ( numComponents == 4 )
+ m_alpha = (int)(components[3]*255+0.5);
+ }
+ else
+ {
+ m_red = (int)(components[0]*255+0.5);
+ m_green = (int)(components[0]*255+0.5);
+ m_blue = (int)(components[0]*255+0.5);
}
}