1 #include <gtk/gtk.h> 2 3 #define USER_COLOR "user" 4 #define SYSTEM_COLOR "system" 5 #define FILE_ERROR "An error occurred trying to open file \"%s\" for %s access!\n\n" \ 6 "Please check the file permissions and try again." 7 #define FILE_READ "read" 8 #define FILE_WRITE "write" 9 10 /* possible locations of the rgb file */ 11 #define SYSTEM_FILE_1 "/usr/X11R6/lib/X11/rgb.txt" 12 #define SYSTEM_FILE_2 "/usr/lib/X11/rgb.txt" 13 #define SYSTEM_FILE_3 "/etc/X11/rgb.txt" 14 #define SYSTEM_FILE_4 "/usr/openwin/lib/X11/rgb.txt" 15 16 /* about dialog text */ 17 #define ABOUT_CREDITS_TEXT "Developer:\n" \ 18 "Justin Spadea <justin@j-z-s.com>\n\n" \ 19 "Special Thanks To:\n" \ 20 "Eugenia Loli-Queru <eloli@hotmail.com>\n" \ 21 "\t\302\267 Insight on the UI design\n" \ 22 "\t\302\267 Provided the icon\n" \ 23 "Ricardo Veguilla <veguilla@hpcf.upr.edu>\n" \ 24 "\t\302\267 Provided spec file\n\n" \ 25 "Official Website:\n" \ 26 "http://gcolor2.sourceforge.net" 27 #define ABOUT_NOTES_TEXT "Known Issues:\n" \ 28 "For some colors, you may notice the hex value " \ 29 "displayed in the color selector is slightly " \ 30 "different than the hex value that is saved. This " \ 31 "has to do with the color selector adding " \ 32 "(unnecessary) rounding math to the display; " \ 33 "the color is essentially the same.\n\n" \ 34 "Changes In This Release:\n" \ 35 "\302\267 Color list columns now sortable\n" \ 36 "\302\267 Color list uses alternate colored rows\n" \ 37 "\302\267 Typeahead searching on color list " \ 38 "uses 'Name' column instead of hex color\n" \ 39 "\302\267 Look in multiple locations for X11 " \ 40 "rgb.txt file\n" \ 41 "\302\267 Usability / user interface enhancements\n" \ 42 "\302\267 Code cleanup" 43 44 extern GtkWidget *gcolor2; 45 extern GtkWidget *menu; 46 extern GdkColor colorvalue; 47 48 enum 49 { 50 COLOR, 51 COLOR_VALUE, 52 COLOR_NAME, 53 COLOR_TYPE, 54 N_COLUMNS 55 }; 56 57 gchar* get_user_file(); 58 59 void show_file_error (gchar* message); 60 61 void destroy_aboutdialog (GtkObject *object, gpointer user_data); 62 63 void on_about_button_clicked (GtkButton *button, gpointer user_data); 64 65 void on_colorselection_color_changed (GtkColorSelection *colorselection, gpointer user_data); 66 67 void on_save_entry_changed (GtkEditable *editable, gpointer user_data); 68 69 void on_list_selection_changed (GtkTreeSelection *selection, gpointer user_data); 70 71 void on_copy_color_to_clipboard_activate (GtkMenuItem *menuitem, gpointer user_data); 72 73 void on_show_system_colors_activate (GtkMenuItem *menuitem, gpointer user_data); 74 75 void show_popup_menu (GtkWidget *treeview, GdkEventButton *event, gpointer user_data); 76 77 gboolean on_treeview_button_press_event (GtkWidget *widget, GdkEventButton *event, 78 gpointer user_data); 79 80 gboolean on_treeview_popup_menu (GtkWidget *widget, gpointer user_data); 81 82 void on_save_button_clicked (GtkButton *button, gpointer user_data); 83 84 void add_color_to_treeview (); 85 86 gboolean save_selected_color (); 87 88 void on_delete_button_clicked (GtkButton *button, gpointer user_data); 89 90 gboolean delete_color (gchar* color_name, gchar* color_value); 91 92 void on_gcolor2_destroy (GtkObject *object, gpointer user_data); 93 94 void on_quit_button_clicked (GtkButton *button, gpointer user_data); 95 96 gchar* hex_value (GdkColor color); 97