/*
 * This file is part of roccat-tools.
 *
 * roccat-tools 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.
 *
 * roccat-tools 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 roccat-tools. If not, see <http://www.gnu.org/licenses/>.
 */

#include "konepure_color_palette_button.h"
#include "konepure.h"

#define KONEPURE_COLOR_PALETTE_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), KONEPURE_COLOR_PALETTE_BUTTON_TYPE, KonepureColorPaletteButtonClass))
#define IS_KONEPURE_COLOR_PALETTE_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), KONEPURE_COLOR_PALETTE_BUTTON_TYPE))

typedef struct _KonepureColorPaletteButtonClass KonepureColorPaletteButtonClass;

struct _KonepureColorPaletteButton {
	RoccatColorPaletteButton parent;
};

struct _KonepureColorPaletteButtonClass {
	RoccatColorPaletteButtonClass parent_class;
};

G_DEFINE_TYPE(KonepureColorPaletteButton, konepure_color_palette_button, ROCCAT_COLOR_PALETTE_BUTTON_TYPE);

/* these are the colors for on screen display, which differ from the device colors */
static GdkColor const colors[KONEPURE_RMP_LIGHT_INFO_COLORS_NUM] = {
	{0, 0x06 * 256, 0x90 * 256, 0xfd * 256},
	{0, 0x00 * 256, 0x73 * 256, 0xff * 256},
	{0, 0x24 * 256, 0x00 * 256, 0xff * 256},
	{0, 0x5c * 256, 0x18 * 256, 0xe9 * 256},
	{0, 0x80 * 256, 0x17 * 256, 0xe5 * 256},
	{0, 0xc6 * 256, 0x18 * 256, 0xeb * 256},
	{0, 0xff * 256, 0x05 * 256, 0x81 * 256},
	{0, 0xfb * 256, 0x15 * 256, 0x00 * 256},
	{0, 0xfc * 256, 0x7c * 256, 0x00 * 256},
	{0, 0xfe * 256, 0xf2 * 256, 0x00 * 256},
	{0, 0xce * 256, 0xfb * 256, 0x18 * 256},
	{0, 0x27 * 256, 0xfe * 256, 0x03 * 256},
	{0, 0x1c * 256, 0xa7 * 256, 0x30 * 256},
	{0, 0x15 * 256, 0xea * 256, 0x96 * 256},
	{0, 0x0e * 256, 0xeb * 256, 0xe2 * 256},
	{0, 0x00 * 256, 0xc5 * 256, 0xfa * 256},
};

GtkWidget *konepure_color_palette_button_new(void) {
	KonepureColorPaletteButton *button;

	button = KONEPURE_COLOR_PALETTE_BUTTON(g_object_new(KONEPURE_COLOR_PALETTE_BUTTON_TYPE,
			NULL));

	roccat_color_palette_button_set_colors(ROCCAT_COLOR_PALETTE_BUTTON(button), colors, KONEPURE_RMP_LIGHT_INFO_COLORS_NUM);

	return GTK_WIDGET(button);
}

static void konepure_color_palette_button_init(KonepureColorPaletteButton *button) {}

static void konepure_color_palette_button_class_init(KonepureColorPaletteButtonClass *klass) {}
