+
+
+wxString
+bitmap_path (string name)
+{
+ boost::filesystem::path base;
+
+#ifdef DCPOMATIC_DEBUG
+ /* Hack to allow Linux and OS X to find icons when running from the source tree */
+ char* path = getenv ("DCPOMATIC_GRAPHICS");
+ if (path) {
+ base = path;
+ } else {
+ base = resources_path();
+ }
+#else
+ base = resources_path();
+#endif
+
+ auto p = base / name;
+ return std_to_wx (p.string());
+}
+
+
+wxSize
+small_button_size (wxWindow* parent, wxString text)
+{
+ wxClientDC dc (parent);
+ auto size = dc.GetTextExtent (text);
+ size.SetHeight (-1);
+ size.IncBy (32, 0);
+ return size;
+}
+
+
+bool
+gui_is_dark ()
+{
+#if defined(DCPOMATIC_OSX) && wxCHECK_VERSION(3, 1, 0)
+ auto appearance = wxSystemSettings::GetAppearance();
+ return appearance.IsDark();
+#else
+ return false;
+#endif
+}
+
+
+#if wxCHECK_VERSION(3,1,0)
+double
+dpi_scale_factor (wxWindow* window)
+{
+ return window->GetDPIScaleFactor();
+}
+#else
+double
+dpi_scale_factor (wxWindow*)
+{
+ return 1;
+}
+#endif
+
+
+
+int
+search_ctrl_height ()
+{
+#ifdef __WXGTK3__
+ return 30;
+#else
+ return -1;
+#endif
+}
+