diff options
Diffstat (limited to 'libs/gtkmm2/gdk/src/colormap.ccg')
-rw-r--r-- | libs/gtkmm2/gdk/src/colormap.ccg | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/libs/gtkmm2/gdk/src/colormap.ccg b/libs/gtkmm2/gdk/src/colormap.ccg new file mode 100644 index 0000000000..12958f4cd6 --- /dev/null +++ b/libs/gtkmm2/gdk/src/colormap.ccg @@ -0,0 +1,51 @@ +// -*- c++ -*- +/* $Id: colormap.ccg,v 1.3 2005/11/29 16:38:10 murrayc Exp $ */ + +/* + * + * Copyright 1998-2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <gdk/gdkcolor.h> + +namespace Gdk +{ + +Colormap::Colormap(const Glib::RefPtr<Visual>& visual, bool allocate) +: Glib::Object( G_OBJECT( gdk_colormap_new(visual->gobj(), (gboolean)allocate) ) ) + {} + +_DEPRECATE_IFDEF_START +int Colormap::alloc_colors(ArrayHandle_Color& colors, int ncolors, bool writeable, bool best_match, Glib::ArrayHandle<bool>& success) +{ + return gdk_colormap_alloc_colors(gobj(), const_cast<GdkColor*>(colors.data()), ncolors, static_cast<int>(writeable), static_cast<int>(best_match), (gboolean*)(success.data())); +} + +void Colormap::free_colors(Color& colors, int ncolors) +{ + gdk_colormap_free_colors(gobj(), (colors).gobj(), ncolors); +} +_DEPRECATE_IFDEF_END + +void Colormap::free_color(Color& color) +{ + gdk_colormap_free_colors(gobj(), color.gobj(), 1); +} + +} // namespace Gdk + + |