/*****************************************************************************/

/*
 *      support.c -- REALmagic calibration application 
 *
 *      Copyright (C) 2000 Sigma Designs
 *                    written by Nicolas Vignal <nicolas_vignal@sdesigns.com>
 *                    modified by Emmanuel Michon <emmanuel_michon@sdesigns.com>
 *
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *
 *      This program 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 General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include "define.h"

GtkWidget* create_pixmap(GtkWidget *widget, char *filename[])
{
	GtkWidget *pixmap;
  GdkPixmap *gdkpixmap;
  GdkBitmap *mask;
  GdkColormap *colormap;

  colormap = gtk_widget_get_colormap (widget);
  gdkpixmap = gdk_pixmap_colormap_create_from_xpm_d (NULL, colormap, &mask, NULL, filename );
  pixmap = gtk_pixmap_new (gdkpixmap, mask);

  return pixmap;
}


void set_window_icon(GtkWidget *widget, char *filename[])
{
	GdkPixmap *gdk_pixmap;
	GdkBitmap *gdk_mask;
	
 	gtk_widget_realize(widget);

	gdk_pixmap = gdk_pixmap_create_from_xpm_d (widget->window, &gdk_mask, NULL, filename);

	gdk_window_set_icon(widget->window, NULL, gdk_pixmap, gdk_mask);
}
