/*
 * 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 "koneplus_color_palette_button.h"
#include "roccat/koneplus.h"

#define KONEPLUS_COLOR_PALETTE_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), KONEPLUS_COLOR_PALETTE_BUTTON_TYPE, KoneplusColorPaletteButtonClass))
#define IS_KONEPLUS_COLOR_PALETTE_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), KONEPLUS_COLOR_PALETTE_BUTTON_TYPE))

typedef struct _KoneplusColorPaletteButtonClass KoneplusColorPaletteButtonClass;

struct _KoneplusColorPaletteButton {
	RoccatColorPaletteButton parent;
};

struct _KoneplusColorPaletteButtonClass {
	RoccatColorPaletteButtonClass parent_class;
};

G_DEFINE_TYPE(KoneplusColorPaletteButton, koneplus_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[KONEPLUS_RMP_LIGHT_INFO_COLORS_NUM] = {
	{0, 0xb4 * 257, 0x00 * 257, 0x01 * 257},
	{0, 0xfe * 257, 0x00 * 257, 0x00 * 257},
	{0, 0xff * 257, 0x47 * 257, 0x00 * 257},
	{0, 0xff * 257, 0x6b * 257, 0x01 * 257},
	{0, 0xff * 257, 0x9d * 257, 0x48 * 257},
	{0, 0xff * 257, 0xbb * 257, 0x5a * 257},
	{0, 0xf9 * 257, 0xe9 * 257, 0x00 * 257},
	{0, 0xf6 * 257, 0xff * 257, 0x4e * 257},
	{0, 0xc9 * 257, 0xff * 257, 0x4f * 257},
	{0, 0xa5 * 257, 0xff * 257, 0x4f * 257},
	{0, 0x84 * 257, 0xff * 257, 0x4e * 257},
	{0, 0x00 * 257, 0xff * 257, 0x01 * 257},
	{0, 0x00 * 257, 0xcf * 257, 0x37 * 257},
	{0, 0x01 * 257, 0xa6 * 257, 0x2d * 257},
	{0, 0x00 * 257, 0xd0 * 257, 0x7c * 257},
	{0, 0x00 * 257, 0xd0 * 257, 0x9f * 257},
	{0, 0x00 * 257, 0xca * 257, 0xce * 257},
	{0, 0x6b * 257, 0xe1 * 257, 0xe3 * 257},
	{0, 0x29 * 257, 0xc5 * 257, 0xfe * 257},
	{0, 0x4c * 257, 0xb3 * 257, 0xee * 257},
	{0, 0x63 * 257, 0x9d * 257, 0xef * 257},
	{0, 0x24 * 257, 0x84 * 257, 0xea * 257},
	{0, 0x00 * 257, 0x48 * 257, 0xff * 257},
	{0, 0x10 * 257, 0x0f * 257, 0xff * 257},
	{0, 0x0f * 257, 0x0f * 257, 0xbd * 257},
	{0, 0x59 * 257, 0x07 * 257, 0xff * 257},
	{0, 0x79 * 257, 0x0c * 257, 0xff * 257},
	{0, 0xa1 * 257, 0x0c * 257, 0xfe * 257},
	{0, 0xaa * 257, 0x6c * 257, 0xe9 * 257},
	{0, 0xb3 * 257, 0x0a * 257, 0xd7 * 257},
	{0, 0xc9 * 257, 0x0b * 257, 0xff * 257},
	{0, 0xce * 257, 0x0a * 257, 0xda * 257},
	{0, 0xd9 * 257, 0x0a * 257, 0x7c * 257},
};

GtkWidget *koneplus_color_palette_button_new(void) {
	KoneplusColorPaletteButton *button;

	button = KONEPLUS_COLOR_PALETTE_BUTTON(g_object_new(KONEPLUS_COLOR_PALETTE_BUTTON_TYPE,
			NULL));

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

	return GTK_WIDGET(button);
}

static void koneplus_color_palette_button_init(KoneplusColorPaletteButton *button) {}

static void koneplus_color_palette_button_class_init(KoneplusColorPaletteButtonClass *klass) {}
