| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #endif | 35 #endif |
| 36 #elif PLATFORM(WIN) | 36 #elif PLATFORM(WIN) |
| 37 typedef struct HICON__* HICON; | 37 typedef struct HICON__* HICON; |
| 38 #elif PLATFORM(QT) | 38 #elif PLATFORM(QT) |
| 39 #include <QIcon> | 39 #include <QIcon> |
| 40 #elif PLATFORM(GTK) | 40 #elif PLATFORM(GTK) |
| 41 typedef struct _GdkPixbuf GdkPixbuf; | 41 typedef struct _GdkPixbuf GdkPixbuf; |
| 42 #elif PLATFORM(EFL) | 42 #elif PLATFORM(EFL) |
| 43 #include <Evas.h> | 43 #include <Evas.h> |
| 44 #elif PLATFORM(CHROMIUM) | 44 #elif PLATFORM(CHROMIUM) |
| 45 #include "Image.h" |
| 45 #include "PlatformIcon.h" | 46 #include "PlatformIcon.h" |
| 46 #endif | 47 #endif |
| 47 | 48 |
| 48 namespace WebCore { | 49 namespace WebCore { |
| 49 | 50 |
| 50 class GraphicsContext; | 51 class GraphicsContext; |
| 51 class IntRect; | 52 class IntRect; |
| 52 class String; | 53 class String; |
| 53 | 54 |
| 54 class Icon : public RefCounted<Icon> { | 55 class Icon : public RefCounted<Icon> { |
| 55 public: | 56 public: |
| 56 static PassRefPtr<Icon> createIconForFiles(const Vector<String>& filenames); | 57 static PassRefPtr<Icon> createIconForFiles(const Vector<String>& filenames); |
| 57 | 58 |
| 58 ~Icon(); | 59 ~Icon(); |
| 59 | 60 |
| 60 void paint(GraphicsContext*, const IntRect&); | 61 void paint(GraphicsContext*, const IntRect&); |
| 61 | 62 |
| 62 #if PLATFORM(WIN) | 63 #if PLATFORM(WIN) |
| 63 static PassRefPtr<Icon> create(HICON hIcon) { return adoptRef(new Icon(hIcon
)); } | 64 static PassRefPtr<Icon> create(HICON hIcon) { return adoptRef(new Icon(hIcon
)); } |
| 65 #elif PLATFORM(CHROMIUM) |
| 66 static PassRefPtr<Icon> create(PassRefPtr<PlatformIcon> icon) { return adopt
Ref(new Icon(icon)); } |
| 64 #endif | 67 #endif |
| 65 | 68 |
| 66 private: | 69 private: |
| 67 #if PLATFORM(MAC) | 70 #if PLATFORM(MAC) |
| 68 Icon(NSImage*); | 71 Icon(NSImage*); |
| 69 RetainPtr<NSImage> m_nsImage; | 72 RetainPtr<NSImage> m_nsImage; |
| 70 #elif PLATFORM(WIN) | 73 #elif PLATFORM(WIN) |
| 71 Icon(HICON); | 74 Icon(HICON); |
| 72 HICON m_hIcon; | 75 HICON m_hIcon; |
| 73 #elif PLATFORM(QT) | 76 #elif PLATFORM(QT) |
| 74 Icon(); | 77 Icon(); |
| 75 QIcon m_icon; | 78 QIcon m_icon; |
| 76 #elif PLATFORM(GTK) | 79 #elif PLATFORM(GTK) |
| 77 Icon(); | 80 Icon(); |
| 78 GdkPixbuf* m_icon; | 81 GdkPixbuf* m_icon; |
| 79 #elif PLATFORM(EFL) | 82 #elif PLATFORM(EFL) |
| 80 Icon(); | 83 Icon(); |
| 81 Evas_Object* m_icon; | 84 Evas_Object* m_icon; |
| 82 #elif PLATFORM(CHROMIUM) | 85 #elif PLATFORM(CHROMIUM) |
| 83 Icon(const PlatformIcon&); | 86 Icon(PassRefPtr<PlatformIcon>); |
| 84 PlatformIcon m_icon; | 87 RefPtr<PlatformIcon> m_icon; |
| 85 #endif | 88 #endif |
| 86 }; | 89 }; |
| 87 | 90 |
| 88 } | 91 } |
| 89 | 92 |
| 90 #endif | 93 #endif |
| OLD | NEW |