-bool
-ThemeManager::button_press_event (GdkEventButton* ev)
-{
- TreeIter iter;
- TreeModel::Path path;
- TreeViewColumn* column;
- int cellx;
- int celly;
-
- UIConfigVariable<uint32_t> *ccvar;
-
- if (!color_display.get_path_at_pos ((int)ev->x, (int)ev->y, path, column, cellx, celly)) {
- return false;
- }
-
- switch (GPOINTER_TO_UINT (column->get_data (X_("colnum")))) {
- case 0:
- /* allow normal processing to occur */
- return false;
-
- case 1: /* color */
- if ((iter = color_list->get_iter (path))) {
-
- UIConfigVariable<uint32_t>* var = (*iter)[columns.pVar];
- if (!var) {
- /* parent row, do nothing */
- return false;
- }
-
- int r,g, b, a;
- uint32_t rgba = (*iter)[columns.rgba];
- Gdk::Color color;
-
- UINT_TO_RGBA (rgba, &r, &g, &b, &a);
- color.set_rgb_p (r / 255.0, g / 255.0, b / 255.0);
- color_dialog.get_colorsel()->set_previous_color (color);
- color_dialog.get_colorsel()->set_current_color (color);
- color_dialog.get_colorsel()->set_previous_alpha (a * 256);
- color_dialog.get_colorsel()->set_current_alpha (a * 256);
-
- ResponseType result = (ResponseType) color_dialog.run();
-
- switch (result) {
- case RESPONSE_CANCEL:
- break;
- case RESPONSE_ACCEPT:
- color = color_dialog.get_colorsel()->get_current_color();
- a = color_dialog.get_colorsel()->get_current_alpha();
- r = (int) floor (color.get_red_p() * 255.0);
- g = (int) floor (color.get_green_p() * 255.0);
- b = (int) floor (color.get_blue_p() * 255.0);
-
- rgba = RGBA_TO_UINT(r,g,b,a>>8);
- (*iter)[columns.rgba] = rgba;
- (*iter)[columns.gdkcolor] = color;
-
- ccvar = (*iter)[columns.pVar];
- ccvar->set(rgba);
- /* mark dirty ... */
- ARDOUR_UI::config()->set_dirty ();
- /* but save it immediately */
- ARDOUR_UI::config()->save_state ();
-
- ColorsChanged(); //EMIT SIGNAL
- break;
-
- default:
- break;
-
- }
-
- color_dialog.hide ();
- }
- return true;
-
- default:
- break;
- }
-
- return false;
-}
-
-void
-load_rc_file (const string& filename, bool themechange)
-{
- std::string rc_file_path;
-
- if (!find_file_in_search_path (ardour_config_search_path(), filename, rc_file_path)) {
- warning << string_compose (_("Unable to find UI style file %1 in search path %2. %3 will look strange"),
- filename, ardour_config_search_path().to_string(), PROGRAM_NAME)
- << endmsg;
- return;
- }
-
- info << "Loading ui configuration file " << rc_file_path << endmsg;
-
- Gtkmm2ext::UI::instance()->load_rcfile (rc_file_path, themechange);
-}
-
-/* hmm, this is a problem. the profile doesn't
- exist when the theme manager is constructed
- and toggles buttons during "normal" GTK setup.
-
- a better solution will be to make all Profile
- methods static or something.
-
- XXX FIX ME
-*/
-
-#define HACK_PROFILE_IS_SAE() (getenv("ARDOUR_SAE")!=0)
-