X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Futils.h;h=c6df93839488ee4c8569f5308ee0fa477fd961ff;hb=9e5b7db89f381c70232fab35dc21fd885863f998;hp=fa8dbf24c551b8e06d58ad579e39526e1dcffe25;hpb=3031a99364333b9adcc52c4922687477a1e62337;p=ardour.git diff --git a/gtk2_ardour/utils.h b/gtk2_ardour/utils.h index fa8dbf24c5..c6df938394 100644 --- a/gtk2_ardour/utils.h +++ b/gtk2_ardour/utils.h @@ -47,7 +47,7 @@ namespace ArdourCanvas { class Item; } -extern sigc::signal DPIReset; +namespace ARDOUR_UI_UTILS { gint just_hide_it (GdkEventAny*, Gtk::Window*); void add_item_with_sensitivity (Gtk::Menu_Helpers::MenuList &, Gtk::Menu_Helpers::MenuElem, bool); @@ -57,13 +57,15 @@ unsigned char* xpm2rgba (const char** xpm, uint32_t& w, uint32_t& h); ArdourCanvas::Points* get_canvas_points (std::string who, uint32_t npoints); +Pango::FontDescription sanitized_font (std::string const&); Pango::FontDescription get_font_for_style (std::string widgetname); -uint32_t rgba_from_style (std::string, uint32_t, uint32_t, uint32_t, uint32_t, std::string = "fg", int = Gtk::STATE_NORMAL, bool = true); - void decorate (Gtk::Window& w, Gdk::WMDecoration d); -void set_color (Gdk::Color&, int); +void set_color_from_rgb (Gdk::Color&, uint32_t); +void set_color_from_rgba (Gdk::Color&, uint32_t); +uint32_t gdk_color_to_rgba (Gdk::Color const&); +uint32_t contrasting_text_color (uint32_t c); bool relay_key_press (GdkEventKey* ev, Gtk::Window* win); bool forward_key_press (GdkEventKey* ev); @@ -71,14 +73,13 @@ bool key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev); bool emulate_key_event (Gtk::Widget*, unsigned int); Glib::RefPtr get_xpm (std::string); -std::string get_icon_path (const char*); -Glib::RefPtr get_icon (const char*); +std::vector get_icon_sets (); +std::string get_icon_path (const char*, std::string icon_set = std::string(), bool is_image = true); +Glib::RefPtr get_icon (const char*, std::string icon_set = std::string()); static std::map > xpm_map; const char* const *get_xpm_data (std::string path); std::string longest (std::vector&); bool key_is_legal_for_numeric_entry (guint keyval); -void reset_dpi (); -void set_pango_fontsize (); void resize_window_to_proportion_of_monitor (Gtk::Window*, int, int); @@ -87,4 +88,11 @@ std::string escape_angled_brackets (std::string const &); Gdk::Color unique_random_color (std::list &); +std::string rate_as_string (float r); + +bool windows_overlap (Gtk::Window *a, Gtk::Window *b); + +bool overwrite_file_dialog (Gtk::Window& parent, std::string title, std::string text); + +} // namespace #endif /* __ardour_gtk_utils_h__ */