wxjpeg_jquant1.o \
wxjpeg_jquant2.o \
wxjpeg_jdmerge.o
-WXTIFF_CFLAGS = $(CPPFLAGS) $(CFLAGS)
+WXTIFF_CFLAGS = $(__INC_ZLIB_p) $(__INC_JPEG_p) $(CPPFLAGS) $(CFLAGS)
WXTIFF_OBJECTS = \
$(__TIFF_PLATFORM_SRC_OBJECTS) \
wxtiff_tif_aux.o \
wx/x11/window.h
@COND_TOOLKIT_X11@LOWLEVEL_HDR = $(COND_TOOLKIT_X11_LOWLEVEL_HDR)
COND_TOOLKIT_COCOA_GUI_HDR = \
+ wx/cocoa/NSApplication.h \
wx/cocoa/NSBox.h \
wx/cocoa/NSButton.h \
wx/cocoa/NSControl.h \
wx/cocoa/radiobox.h \
wx/cocoa/radiobut.h \
wx/cocoa/region.h \
+ wx/cocoa/slider.h \
wx/cocoa/spinbutt.h \
wx/cocoa/statbmp.h \
wx/cocoa/statbox.h \
wx/cocoa/toplevel.h \
wx/cocoa/window.h \
wx/generic/caret.h \
+ wx/generic/dirdlgg.h \
wx/generic/fdrepdlg.h \
wx/generic/fontdlgg.h \
wx/generic/imaglist.h \
@COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@monodll_icon.o: $(srcdir)/src/mac/icon.cpp $(MONODLL_ODEP)
@COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $<
-@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@monodll_icon.o: $(srcdir)/src/cocoa/icon.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@monodll_icon.o: $(srcdir)/src/cocoa/icon.mm $(MONODLL_ODEP)
@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $<
@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@monodll_icon.o: $(srcdir)/src/os2/icon.cpp $(MONODLL_ODEP)
@COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@monolib_icon.o: $(srcdir)/src/mac/icon.cpp $(MONOLIB_ODEP)
@COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $<
-@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@monolib_icon.o: $(srcdir)/src/cocoa/icon.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@monolib_icon.o: $(srcdir)/src/cocoa/icon.mm $(MONOLIB_ODEP)
@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $<
@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@monolib_icon.o: $(srcdir)/src/os2/icon.cpp $(MONOLIB_ODEP)
@COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@coredll_icon.o: $(srcdir)/src/mac/icon.cpp $(COREDLL_ODEP)
@COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $<
-@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@coredll_icon.o: $(srcdir)/src/cocoa/icon.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@coredll_icon.o: $(srcdir)/src/cocoa/icon.mm $(COREDLL_ODEP)
@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $<
@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@coredll_icon.o: $(srcdir)/src/os2/icon.cpp $(COREDLL_ODEP)
@COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@corelib_icon.o: $(srcdir)/src/mac/icon.cpp $(CORELIB_ODEP)
@COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $<
-@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@corelib_icon.o: $(srcdir)/src/cocoa/icon.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@corelib_icon.o: $(srcdir)/src/cocoa/icon.mm $(CORELIB_ODEP)
@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $<
@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@corelib_icon.o: $(srcdir)/src/os2/icon.cpp $(CORELIB_ODEP)
src/cocoa/frame.mm
src/cocoa/gauge.mm
src/cocoa/gdiobj.cpp
- src/cocoa/icon.cpp
+ src/cocoa/icon.mm
src/cocoa/listbox.mm
src/cocoa/main.cpp
src/cocoa/mbarman.mm
// Convert from wxImage:
wxBitmap(const wxImage& image, int depth = -1)
{ CreateFromImage(image, depth); }
+ // Convert from wxIcon
+ wxBitmap(const wxIcon& icon) { CopyFromIcon(icon); }
+
// destructor
~wxBitmap();
/////////////////////////////////////////////////////////////////////////////
// Name: wx/cocoa/icon.h
// Purpose: wxIcon class
-// Author: AUTHOR
+// Author: David Elliott
// Modified by:
-// Created: ??/??/98
+// Created: 2003/08/11
// RCS-ID: $Id$
-// Copyright: (c) AUTHOR
+// Copyright: (c) 2003 David Elliott
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef _WX_ICON_H_
-#define _WX_ICON_H_
+#ifndef _WX_COCOA_ICON_H__
+#define _WX_COCOA_ICON_H__
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma interface "icon.h"
-#endif
+#include "wx/gdicmn.h"
+#include "wx/gdiobj.h"
-#include "wx/bitmap.h"
-
-// Icon
-class WXDLLEXPORT wxIcon: public wxBitmap
+// ========================================================================
+// wxIcon
+// ========================================================================
+class WXDLLEXPORT wxIcon: public wxGDIObject
{
- DECLARE_DYNAMIC_CLASS(wxIcon)
-
+ DECLARE_DYNAMIC_CLASS(wxIcon)
public:
- wxIcon();
-
- // Copy constructors
- wxIcon(const wxIcon& icon)
- : wxBitmap()
- { Ref(icon); }
-
- wxIcon(const char **data);
- wxIcon(char **data);
- wxIcon(const char bits[], int width , int height );
- wxIcon(const wxString& name, int flags = wxBITMAP_TYPE_ICON_RESOURCE,
- int desiredWidth = -1, int desiredHeight = -1);
- wxIcon(const wxIconLocation& loc)
- {
- LoadFile(loc.GetFileName(), wxBITMAP_TYPE_ICON);
- }
- ~wxIcon();
-
- bool LoadFile(const wxString& name, wxBitmapType flags /* = wxBITMAP_TYPE_ICON_RESOURCE */ ,
- int desiredWidth /* = -1 */ , int desiredHeight = -1);
- bool LoadFile(const wxString& name ,wxBitmapType flags = wxBITMAP_TYPE_ICON_RESOURCE )
- { return LoadFile( name , flags , -1 , -1 ) ; }
-
- wxIcon& operator=(const wxIcon& icon)
- { if (this != &icon) Ref(icon); return *this; }
- bool operator==(const wxIcon& icon) const { return m_refData == icon.m_refData; }
- bool operator!=(const wxIcon& icon) const { return !(*this == icon); }
-
- // create from bitmap (which should have a mask unless it's monochrome):
- // there shouldn't be any implicit bitmap -> icon conversion (i.e. no
- // ctors, assignment operators...), but it's ok to have such function
- void CopyFromBitmap(const wxBitmap& bmp);
+ wxIcon();
+
+ // Copy constructors
+ wxIcon(const wxIcon& icon)
+ { Ref(icon); }
+
+ wxIcon(const char **data) { CreateFromXpm(data); }
+ wxIcon(char **data) { CreateFromXpm((const char**)data); }
+ wxIcon(const char bits[], int width , int height );
+ wxIcon(const wxString& name, int flags = wxBITMAP_TYPE_ICON_RESOURCE,
+ int desiredWidth = -1, int desiredHeight = -1);
+ wxIcon(const wxIconLocation& loc)
+ {
+ LoadFile(loc.GetFileName(), wxBITMAP_TYPE_ICON);
+ }
+ ~wxIcon();
+
+ bool LoadFile(const wxString& name, wxBitmapType flags /* = wxBITMAP_TYPE_ICON_RESOURCE */ ,
+ int desiredWidth /* = -1 */ , int desiredHeight = -1);
+ bool LoadFile(const wxString& name, wxBitmapType flags = wxBITMAP_TYPE_ICON_RESOURCE )
+ { return LoadFile( name , flags , -1 , -1 ) ; }
+
+ wxIcon& operator=(const wxIcon& icon)
+ { if (this != &icon) Ref(icon); return *this; }
+ bool operator==(const wxIcon& icon) const
+ { return m_refData == icon.m_refData; }
+ bool operator!=(const wxIcon& icon) const { return !(*this == icon); }
+
+ // create from bitmap (which should have a mask unless it's monochrome):
+ // there shouldn't be any implicit bitmap -> icon conversion (i.e. no
+ // ctors, assignment operators...), but it's ok to have such function
+ void CopyFromBitmap(const wxBitmap& bmp);
+
+ bool Ok() const;
+ int GetWidth() const;
+ int GetHeight() const;
+
+ WX_NSImage GetNSImage() const;
+ bool CreateFromXpm(const char **bits);
};
-#endif
- // _WX_ICON_H_
+#endif // _WX_COCOA_ICON_H__
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: icon.cpp
-// Purpose: wxIcon class
-// Author: AUTHOR
-// Modified by:
-// Created: ??/??/98
-// RCS-ID: $Id$
-// Copyright: (c) AUTHOR
-// Licence: wxWindows licence
-/////////////////////////////////////////////////////////////////////////////
-
-#ifdef __GNUG__
-#pragma implementation "icon.h"
-#endif
-
-#include "wx/icon.h"
-
-#if !USE_SHARED_LIBRARIES
-IMPLEMENT_DYNAMIC_CLASS(wxIcon, wxBitmap)
-#endif
-
-/*
- * Icons
- */
-
-
-wxIcon::wxIcon()
-{
-}
-
-wxIcon::wxIcon(const char **xpm)
-{
-}
-
-wxIcon::wxIcon(char **xpm)
-{
-}
-
-wxIcon::wxIcon(const char WXUNUSED(bits)[], int WXUNUSED(width), int WXUNUSED(height))
-{
-}
-
-wxIcon::wxIcon(const wxString& icon_file, int flags,
- int desiredWidth, int desiredHeight)
-
-{
- LoadFile(icon_file, (wxBitmapType)flags, desiredWidth, desiredHeight);
-}
-
-wxIcon::~wxIcon()
-{
-}
-
-bool wxIcon::LoadFile(const wxString& filename, wxBitmapType type,
- int desiredWidth, int desiredHeight)
-{
- UnRef();
-
- return FALSE;
-}
-
-void wxIcon::CopyFromBitmap(const wxBitmap& icno)
-{
-}
-
--- /dev/null
+/////////////////////////////////////////////////////////////////////////////
+// Name: src/cocoa/icon.mm
+// Purpose: wxIcon class
+// Author: David Elliott
+// Modified by:
+// Created: 2003/08/11
+// RCS-ID: $Id$
+// Copyright: (c) 2003 David Elliott
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#include "wx/wxprec.h"
+#ifndef WX_PRECOMP
+ #include "wx/icon.h"
+#endif //WX_PRECOMP
+#include "wx/bitmap.h"
+
+#import <AppKit/NSImage.h>
+
+// ========================================================================
+// wxIconRefData
+// ========================================================================
+class wxIconRefData: public wxGDIRefData
+{
+ friend class wxIcon;
+public:
+ wxIconRefData();
+ wxIconRefData( const wxIconRefData& data );
+ virtual ~wxIconRefData();
+
+protected:
+ int m_width;
+ int m_height;
+ int m_depth;
+ bool m_ok;
+ int m_numColors;
+ int m_quality;
+ WX_NSImage m_cocoaNSImage;
+};
+
+#define M_ICONDATA ((wxIconRefData *)m_refData)
+
+wxIconRefData::wxIconRefData()
+{
+ m_ok = FALSE;
+ m_width = 0;
+ m_height = 0;
+ m_depth = 0;
+ m_quality = 0;
+ m_numColors = 0;
+ m_cocoaNSImage = nil;
+}
+
+wxIconRefData::wxIconRefData( const wxIconRefData& data)
+{
+ m_width = data.m_width;
+ m_height = data.m_height;
+ m_depth = data.m_depth;
+ m_ok = data.m_ok;
+ m_numColors = data.m_numColors;
+ m_quality = data.m_quality;
+ m_cocoaNSImage = [data.m_cocoaNSImage copyWithZone:nil];
+}
+
+wxIconRefData::~wxIconRefData()
+{
+ [m_cocoaNSImage release];
+ m_cocoaNSImage = NULL;
+}
+
+
+// ========================================================================
+// wxIcon
+// ========================================================================
+IMPLEMENT_DYNAMIC_CLASS(wxIcon, wxGDIObject)
+
+wxIcon::wxIcon()
+{
+}
+
+wxIcon::wxIcon(const char WXUNUSED(bits)[], int WXUNUSED(width), int WXUNUSED(height))
+{
+}
+
+wxIcon::wxIcon(const wxString& icon_file, int flags,
+ int desiredWidth, int desiredHeight)
+
+{
+ LoadFile(icon_file, (wxBitmapType)flags, desiredWidth, desiredHeight);
+}
+
+wxIcon::~wxIcon()
+{
+}
+
+bool wxIcon::CreateFromXpm(const char **xpm)
+{
+ wxBitmap bitmap(xpm);
+ CopyFromBitmap(bitmap);
+ return Ok();
+}
+
+bool wxIcon::LoadFile(const wxString& filename, wxBitmapType type,
+ int desiredWidth, int desiredHeight)
+{
+ UnRef();
+
+ m_refData = new wxIconRefData;
+ M_ICONDATA->m_width = 5;
+ M_ICONDATA->m_height = 5;
+ M_ICONDATA->m_cocoaNSImage = [[NSImage alloc] initWithSize:NSMakeSize(5,5)];
+ M_ICONDATA->m_ok = true;
+ M_ICONDATA->m_numColors = 0;
+ M_ICONDATA->m_quality = 0;
+
+ return FALSE;
+}
+
+void wxIcon::CopyFromBitmap(const wxBitmap& bitmap)
+{
+ UnRef();
+ m_refData = new wxIconRefData;
+ M_ICONDATA->m_width = bitmap.GetWidth();
+ M_ICONDATA->m_height = bitmap.GetHeight();
+ M_ICONDATA->m_cocoaNSImage = bitmap.GetNSImage(true);
+ M_ICONDATA->m_ok = bitmap.Ok();
+ M_ICONDATA->m_numColors = 0;
+ M_ICONDATA->m_quality = 0;
+}
+
+bool wxIcon::Ok() const
+{
+ return m_refData && M_ICONDATA->m_ok;
+}
+
+int wxIcon::GetWidth() const
+{
+ if(!m_refData)
+ return 0;
+ return M_ICONDATA->m_width;
+}
+
+int wxIcon::GetHeight() const
+{
+ if(!m_refData)
+ return 0;
+ return M_ICONDATA->m_height;
+}
+
+WX_NSImage wxIcon::GetNSImage() const
+{
+ if(!M_ICONDATA)
+ return nil;
+ return M_ICONDATA->m_cocoaNSImage;
+}
+