These cause a problem for GCC 14 which detects that there are no
corresponding copy constructors and assignment operators and gives
-Wdeprecated-copy-dtor due to their presence, e.g.
/home/fedora/swt2c/wxWidgets/bld/bk-deps g++ -c -o test_allheaders_allheaders.o -I/home/fedora/swt2c/wxWidgets/bld/lib/wx/include/gtk3-unicode-3.3 -I../../include -D_FILE_OFFSET_BITS=64 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/cairo -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/atk-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/at-spi2-atk/2.0 -I/usr/include/cloudproviders -I/usr/include/webp -I/usr/include/blkid -I/usr/include/at-spi-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/pixman-1 -I/usr/include/libxml2 -I/usr/include/fribidi -I/usr/include/sysprof-6 -pthread -I/usr/include/libpng16 -DWITH_GZFILEOP -D__WXGTK__ -I../../tests -DWXUSINGDLL -I../../tests/../samples -I../../3rdparty/catch/single_include -pthread -Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual -O2 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libmount -I/usr/include/libxml2 -I/usr/include/sysprof-6 -I/usr/include/libpng16 -DWITH_GZFILEOP -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/webp -I/usr/include/gtk-3.0/unix-print -I/usr/include/gtk-3.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/cloudproviders -I/usr/include/at-spi-2.0 -I/usr/include/gio-unix-2.0 -fvisibility=hidden -fvisibility-inlines-hidden -fPIC -DPIC ../../tests/allheaders.cpp
In file included from ../../include/wx/evtloop.h:13,
from ../../tests/testprec.h:5,
from ../../tests/allheaders.cpp:369:
../../include/wx/event.h: In copy constructor ‘wxSetCursorEvent::wxSetCursorEvent(const wxSetCursorEvent&)’:
../../include/wx/event.h:1943:11: error: implicitly-declared ‘wxCursor::wxCursor(const wxCursor&)’ is deprecated [-Werror=deprecated-copy-dtor]
1943 | m_cursor(event.m_cursor)
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../include/wx/cursor.h:51,
from ../../include/wx/event.h:21:
../../include/wx/gtk/cursor.h:37:13: note: because ‘wxCursor’ has user-provided ‘virtual wxCursor::~wxCursor()’
37 | virtual ~wxCursor();
| ^
../../include/wx/event.h: In member function ‘void wxSetCursorEvent::SetCursor(const wxCursor&)’:
../../include/wx/event.h:1949:57: error: implicitly-declared ‘wxCursor& wxCursor::operator=(const wxCursor&)’ is deprecated [-Werror=deprecated-copy-dtor]
1949 | void SetCursor(const wxCursor& cursor) { m_cursor = cursor; }
| ^~~~~~
../../include/wx/gtk/cursor.h:37:13: note: because ‘wxCursor’ has user-provided ‘virtual wxCursor::~wxCursor()’
37 | virtual ~wxCursor();
| ^
Fixes #24248.
Closes #24255.
157 lines
4.2 KiB
Objective-C
157 lines
4.2 KiB
Objective-C
/////////////////////////////////////////////////////////////////////////////
|
|
// Name: palette.h
|
|
// Purpose: interface of wxPalette
|
|
// Author: wxWidgets team
|
|
// Licence: wxWindows licence
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
/**
|
|
@class wxPalette
|
|
|
|
A palette is a table that maps pixel values to RGB colours. It allows the
|
|
colours of a low-depth bitmap, for example, to be mapped to the available
|
|
colours in a display. The notion of palettes is becoming more and more
|
|
obsolete nowadays and only the MSW port is still using a native palette.
|
|
All other ports use generic code which is basically just an array of
|
|
colours.
|
|
|
|
It is likely that in the future the only use for palettes within wxWidgets
|
|
will be for representing colour indices from images (such as GIF or PNG).
|
|
The image handlers for these formats have been modified to create a palette
|
|
if there is such information in the original image file (usually 256 or less
|
|
colour images). See wxImage for more information.
|
|
|
|
@library{wxcore}
|
|
@category{gdi}
|
|
|
|
@stdobjects
|
|
::wxNullPalette
|
|
|
|
@see wxDC::SetPalette(), wxBitmap
|
|
*/
|
|
class wxPalette : public wxGDIObject
|
|
{
|
|
public:
|
|
|
|
/**
|
|
Default constructor.
|
|
*/
|
|
wxPalette();
|
|
|
|
/**
|
|
Copy constructor, uses @ref overview_refcount.
|
|
|
|
@param palette
|
|
A reference to the palette to copy.
|
|
*/
|
|
wxPalette(const wxPalette& palette);
|
|
|
|
/**
|
|
Creates a palette from arrays of size @a n, one for each red, blue or
|
|
green component.
|
|
|
|
@param n
|
|
The number of indices in the palette.
|
|
@param red
|
|
An array of red values.
|
|
@param green
|
|
An array of green values.
|
|
@param blue
|
|
An array of blue values.
|
|
|
|
@beginWxPerlOnly
|
|
In wxPerl this method takes as parameters
|
|
3 array references (they must be of the same length).
|
|
@endWxPerlOnly
|
|
|
|
@see Create()
|
|
*/
|
|
wxPalette(int n, const unsigned char* red,
|
|
const unsigned char* green,
|
|
const unsigned char* blue);
|
|
|
|
/**
|
|
Creates a palette from arrays of size @a n, one for each red, blue or
|
|
green component.
|
|
|
|
@param n
|
|
The number of indices in the palette.
|
|
@param red
|
|
An array of red values.
|
|
@param green
|
|
An array of green values.
|
|
@param blue
|
|
An array of blue values.
|
|
|
|
@return @true if the creation was successful, @false otherwise.
|
|
|
|
@see wxPalette()
|
|
*/
|
|
bool Create(int n, const unsigned char* red,
|
|
const unsigned char* green,
|
|
const unsigned char* blue);
|
|
|
|
/**
|
|
Returns number of entries in palette.
|
|
*/
|
|
virtual int GetColoursCount() const;
|
|
|
|
/**
|
|
Returns a pixel value (index into the palette) for the given RGB values.
|
|
|
|
@param red
|
|
Red value.
|
|
@param green
|
|
Green value.
|
|
@param blue
|
|
Blue value.
|
|
|
|
@return The nearest palette index or @c wxNOT_FOUND for unexpected errors.
|
|
|
|
@see GetRGB()
|
|
*/
|
|
int GetPixel(unsigned char red, unsigned char green,
|
|
unsigned char blue) const;
|
|
|
|
/**
|
|
Returns RGB values for a given palette index.
|
|
|
|
@param pixel
|
|
The palette index.
|
|
@param red
|
|
Receives the red value.
|
|
@param green
|
|
Receives the green value.
|
|
@param blue
|
|
Receives the blue value.
|
|
|
|
@return @true if the operation was successful.
|
|
|
|
@beginWxPerlOnly
|
|
In wxPerl this method takes only the @a pixel parameter and
|
|
returns a 3-element list (or the empty list upon failure).
|
|
@endWxPerlOnly
|
|
|
|
@see GetPixel()
|
|
*/
|
|
bool GetRGB(int pixel, unsigned char* red, unsigned char* green,
|
|
unsigned char* blue) const;
|
|
|
|
/**
|
|
Returns @true if palette data is present.
|
|
*/
|
|
virtual bool IsOk() const;
|
|
|
|
/**
|
|
Assignment operator, using @ref overview_refcount.
|
|
*/
|
|
wxPalette& operator =(const wxPalette& palette);
|
|
};
|
|
|
|
|
|
/**
|
|
An empty palette.
|
|
*/
|
|
wxPalette wxNullPalette;
|
|
|
|
|