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

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) {}
