1 /* GIMP - The GNU Image Manipulation Program 2 * Copyright (C) 1995 Spencer Kimball and Peter Mattis 3 * 4 * This program is free software: you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 3 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program. If not, see <https://www.gnu.org/licenses/>. 16 */ 17 18 #ifndef __GIMP_PALETTE_EDITOR_H__ 19 #define __GIMP_PALETTE_EDITOR_H__ 20 21 22 #include "gimpdataeditor.h" 23 24 25 #define GIMP_TYPE_PALETTE_EDITOR (gimp_palette_editor_get_type ()) 26 #define GIMP_PALETTE_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_PALETTE_EDITOR, GimpPaletteEditor)) 27 #define GIMP_PALETTE_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PALETTE_EDITOR, GimpPaletteEditorClass)) 28 #define GIMP_IS_PALETTE_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_PALETTE_EDITOR)) 29 #define GIMP_IS_PALETTE_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PALETTE_EDITOR)) 30 #define GIMP_PALETTE_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_PALETTE_EDITOR, GimpPaletteEditorClass)) 31 32 33 typedef struct _GimpPaletteEditorClass GimpPaletteEditorClass; 34 35 struct _GimpPaletteEditor 36 { 37 GimpDataEditor parent_instance; 38 39 GtkWidget *view; 40 41 GtkWidget *index_label; 42 GtkWidget *color_name; 43 GtkAdjustment *columns_adj; 44 45 GtkWidget *color_dialog; 46 47 GimpPaletteEntry *color; 48 49 gdouble zoom_factor; /* range from 0.1 to 4.0 */ 50 gint col_width; 51 gint last_width; 52 gint columns; 53 }; 54 55 struct _GimpPaletteEditorClass 56 { 57 GimpDataEditorClass parent_class; 58 }; 59 60 61 GType gimp_palette_editor_get_type (void) G_GNUC_CONST; 62 63 GtkWidget * gimp_palette_editor_new (GimpContext *context, 64 GimpMenuFactory *menu_factory); 65 66 void gimp_palette_editor_edit_color (GimpPaletteEditor *editor); 67 void gimp_palette_editor_pick_color (GimpPaletteEditor *editor, 68 const GimpRGB *color, 69 GimpColorPickState pick_state); 70 void gimp_palette_editor_zoom (GimpPaletteEditor *editor, 71 GimpZoomType zoom_type); 72 73 gint gimp_palette_editor_get_index (GimpPaletteEditor *editor, 74 const GimpRGB *search); 75 gboolean gimp_palette_editor_set_index (GimpPaletteEditor *editor, 76 gint index, 77 GimpRGB *color); 78 79 gint gimp_palette_editor_max_index (GimpPaletteEditor *editor); 80 81 82 #endif /* __GIMP_PALETTE_EDITOR_H__ */ 83