/usr/include/wx-3.0/wx/wxPython/i_files/_icon.i is in python-wxgtk3.0-dev 3.0.2.0+dfsg-7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 | /////////////////////////////////////////////////////////////////////////////
// Name: _icon.i
// Purpose: SWIG interface for wxIcon and related classes
//
// Author: Robin Dunn
//
// Created: 7-July-1997
// RCS-ID: $Id$
// Copyright: (c) 2003 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// Not a %module
//---------------------------------------------------------------------------
%{
#include <wx/iconbndl.h>
#include "wx/wxPython/pyistream.h"
%}
//---------------------------------------------------------------------------
MustHaveApp(wxIcon);
class wxIcon : public wxGDIObject
{
public:
wxIcon(const wxString& name, wxBitmapType type=wxBITMAP_TYPE_ANY,
int desiredWidth = -1, int desiredHeight = -1);
~wxIcon();
// alternate constructors
%RenameCtor(EmptyIcon, wxIcon());
%RenameCtor(IconFromLocation, wxIcon(const wxIconLocation& loc));
%extend {
%RenameCtor(IconFromBitmap, wxIcon(const wxBitmap& bmp))
{
wxIcon* icon = new wxIcon();
icon->CopyFromBitmap(bmp);
return icon;
}
%RenameCtor(IconFromXPMData, wxIcon(PyObject* listOfStrings))
{
char** cArray = NULL;
wxIcon* icon;
cArray = ConvertListOfStrings(listOfStrings);
if (! cArray)
return NULL;
icon = new wxIcon(cArray);
delete [] cArray;
return icon;
}
}
#ifndef __WXMAC__
bool LoadFile(const wxString& name, wxBitmapType type);
#endif
// wxGDIImage methods
#ifdef __WXMSW__
long GetHandle();
%extend {
void SetHandle(long handle) { self->SetHandle((WXHANDLE)handle); }
}
#endif
bool IsOk();
%pythoncode { Ok = IsOk }
int GetWidth();
int GetHeight();
int GetDepth();
void SetWidth(int w);
void SetHeight(int h);
void SetDepth(int d);
#ifdef __WXMSW__
void SetSize(const wxSize& size);
#endif
void CopyFromBitmap(const wxBitmap& bmp);
%pythoncode { def __nonzero__(self): return self.IsOk() }
%property(Depth, GetDepth, SetDepth, doc="See `GetDepth` and `SetDepth`");
%property(Height, GetHeight, SetHeight, doc="See `GetHeight` and `SetHeight`");
%property(Width, GetWidth, SetWidth, doc="See `GetWidth` and `SetWidth`");
};
//---------------------------------------------------------------------------
class wxIconLocation
{
public:
// ctor takes the name of the file where the icon is
%extend {
wxIconLocation(const wxString* filename = &wxPyEmptyString, int num = 0) {
#ifdef __WXMSW__
return new wxIconLocation(*filename, num);
#else
return new wxIconLocation(*filename);
#endif
}
}
~wxIconLocation();
// returns True if this object is valid/initialized
bool IsOk() const;
%pythoncode { def __nonzero__(self): return self.IsOk() }
// set/get the icon file name
void SetFileName(const wxString& filename);
const wxString& GetFileName() const;
%extend {
void SetIndex(int num) {
#ifdef __WXMSW__
self->SetIndex(num);
#else
// do nothing
#endif
}
int GetIndex() {
#ifdef __WXMSW__
return self->GetIndex();
#else
return -1;
#endif
}
}
%property(FileName, GetFileName, SetFileName, doc="See `GetFileName` and `SetFileName`");
%property(Index, GetIndex, SetIndex, doc="See `GetIndex` and `SetIndex`");
};
//---------------------------------------------------------------------------
class wxIconBundle
{
public:
// Flags that determine what happens if GetIcon() doesn't find the icon of
// exactly the requested size.
enum
{
// Return invalid icon if exact size is not found.
FALLBACK_NONE = 0,
// Return the icon of the system icon size if exact size is not found.
// May be combined with other non-NONE enum elements to determine what
// happens if the system icon size is not found neither.
FALLBACK_SYSTEM = 1,
// Return the icon of closest larger size or, if there is no icon of
// larger size in the bundle, the closest icon of smaller size.
FALLBACK_NEAREST_LARGER = 2
};
// default constructor
wxIconBundle();
// initializes the bundle with the icon(s) found in the file
%RenameCtor(IconBundleFromFile, wxIconBundle(
const wxString& file, wxBitmapType type = wxBITMAP_TYPE_ANY
));
// initializes the bundle with a single icon
%RenameCtor(IconBundleFromIcon, wxIconBundle( const wxIcon& icon ));
%RenameCtor(IconBundleFromStream, wxIconBundle(
wxInputStream& stream, wxBitmapType type = wxBITMAP_TYPE_ANY
));
~wxIconBundle();
virtual bool IsOk() const;
%pythoncode { def __nonzero__(self): return self.IsOk() }
DocDeclStr(
void , AddIcon( const wxIcon& icon ),
"Adds the icon to the collection, if the collection already contains an
icon with the same width and height, it is replaced", "");
DocDeclStrName(
void , AddIcon( const wxString& file, wxBitmapType type = wxBITMAP_TYPE_ANY ),
"Adds all the icons contained in the file to the collection, if the
collection already contains icons with the same width and height, they
are replaced", "",
AddIconFromFile);
DocDeclStrName(
void , AddIcon(wxInputStream& stream, wxBitmapType type = wxBITMAP_TYPE_ANY),
"Just like `AddIconFromFile` but pulls icons from a file-liek object.", "",
AddIconFromStream);
DocDeclStr(
const wxIcon& , GetIcon( const wxSize& size, int flags = wxIconBundle::FALLBACK_SYSTEM ) const,
"Returns the icon with the given size; if no such icon exists, returns
the icon with size wxSYS_ICON_[XY]; if no such icon exists, returns
the first icon in the bundle", "");
DocDeclStr(
wxIcon , GetIconOfExactSize(const wxSize& size) const,
"Returns the icon exactly of the specified size or wxNullIcon if no
icon of exactly given size are available.", "");
DocDeclStr(
size_t , GetIconCount() const,
"return the number of available icons", "");
DocDeclStr(
wxIcon , GetIconByIndex(size_t n) const,
"Return the icon at index (must be < GetIconCount())", "");
DocDeclStr(
bool , IsEmpty() const,
"Check if we have any icons at all", "");
};
//---------------------------------------------------------------------------
|