13
0

NO-OP: clang-format utils.cc

This commit is contained in:
Robin Gareus 2023-08-26 13:37:44 +02:00
parent 09e82c1607
commit c084c9dbfa
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -31,11 +31,11 @@
#include "gtk2ardour-config.h"
#endif
#include <cstdlib>
#include <clocale>
#include <cstring>
#include <cctype>
#include <clocale>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <list>
#include <sys/stat.h>
@ -52,11 +52,11 @@
#include "pbd/basename.h"
#include "pbd/file_utils.h"
#include "ardour/auditioner.h"
#include "ardour/audioengine.h"
#include "ardour/auditioner.h"
#include "ardour/filesystem_paths.h"
#include "ardour/session.h"
#include "ardour/search_paths.h"
#include "ardour/session.h"
#include "ardour/triggerbox.h"
#include "gtkmm2ext/colors.h"
@ -65,17 +65,18 @@
#include "canvas/item.h"
#include "actions.h"
#include "context_menu_helper.h"
#include "debug.h"
#include "public_editor.h"
#include "keyboard.h"
#include "main_clock.h"
#include "utils.h"
#include "pbd/i18n.h"
#include "gui_thread.h"
#include "ui_config.h"
#include "ardour_dialog.h"
#include "ardour_ui.h"
#include "context_menu_helper.h"
#include "debug.h"
#include "gui_thread.h"
#include "keyboard.h"
#include "main_clock.h"
#include "public_editor.h"
#include "ui_config.h"
#include "utils.h"
#include "pbd/i18n.h"
using namespace std;
using namespace Gtk;
@ -83,7 +84,8 @@ using namespace Glib;
using namespace PBD;
using Gtkmm2ext::Keyboard;
namespace ARDOUR_UI_UTILS {
namespace ARDOUR_UI_UTILS
{
sigc::signal<void> DPIReset;
}
@ -91,7 +93,6 @@ namespace ARDOUR_UI_UTILS {
#define random() rand ()
#endif
/** Add an element to a menu, settings its sensitivity.
* @param m Menu to add to.
* @param e Element to add.
@ -106,7 +107,6 @@ ARDOUR_UI_UTILS::add_item_with_sensitivity (Menu_Helpers::MenuList& m, Menu_Help
}
}
gint
ARDOUR_UI_UTILS::just_hide_it (GdkEventAny* /*ev*/, Gtk::Window* win)
{
@ -145,7 +145,6 @@ ARDOUR_UI_UTILS::engine_is_running ()
return false;
}
/* xpm2rgb copied from nixieclock, which bore the legend:
nixieclock - a nixie desktop timepiece
@ -184,11 +183,12 @@ ARDOUR_UI_UTILS::xpm2rgb (const char** xpm, uint32_t& w, uint32_t& h)
const char* p;
for (y = h - 1; y > 0; --y) {
for (p = xpm[1 + colors + (h - y - 1)], x = 0; x < w; x++, rgb += 3) {
val = vals[(int)*p++];
*(rgb+2) = val & 0xff; val >>= 8; // 2:B
*(rgb+1) = val & 0xff; val >>= 8; // 1:G
*(rgb + 2) = val & 0xff;
val >>= 8; // 2:B
*(rgb + 1) = val & 0xff;
val >>= 8; // 1:G
*(rgb + 0) = val & 0xff; // 0:R
}
}
@ -236,22 +236,22 @@ ARDOUR_UI_UTILS::xpm2rgba (const char** xpm, uint32_t& w, uint32_t& h)
const char* p;
for (y = h - 1; y > 0; --y) {
char alpha;
for (p = xpm[1 + colors + (h - y - 1)], x = 0; x < w; x++, rgb += 4) {
if (transparent && (*p++ == transparent)) {
alpha = 0;
val = 0;
} else {
alpha = 255;
alpha = 0xff;
val = vals[(int)*p];
}
*(rgb + 3) = alpha; // 3: alpha
*(rgb+2) = val & 0xff; val >>= 8; // 2:B
*(rgb+1) = val & 0xff; val >>= 8; // 1:G
*(rgb + 2) = val & 0xff;
val >>= 8; // 2:B
*(rgb + 1) = val & 0xff;
val >>= 8; // 1:G
*(rgb + 0) = val & 0xff; // 0:R
}
}
@ -300,8 +300,6 @@ ARDOUR_UI_UTILS::ardour_font (std::string const& name)
return fd;
}
Pango::FontDescription
ARDOUR_UI_UTILS::get_font_for_style (string widgetname)
{
@ -320,7 +318,6 @@ ARDOUR_UI_UTILS::get_font_for_style (string widgetname)
PangoFontDescription* pfd = const_cast<PangoFontDescription*> (pango_layout_get_font_description (const_cast<PangoLayout*> (layout->gobj ())));
if (!pfd) {
/* layout inherited its font description from a PangoContext */
PangoContext* ctxt = (PangoContext*)pango_layout_get_context (const_cast<PangoLayout*> (layout->gobj ()));
@ -345,8 +342,12 @@ ARDOUR_UI_UTILS::emulate_key_event (unsigned int keyval)
GdkKeymapKey* keymapkey = NULL;
gint n_keys;
if (!gdk_keymap_get_entries_for_keyval(keymap, keyval, &keymapkey, &n_keys)) return false;
if (n_keys !=1) { g_free(keymapkey); return false;}
if (!gdk_keymap_get_entries_for_keyval (keymap, keyval, &keymapkey, &n_keys))
return false;
if (n_keys != 1) {
g_free (keymapkey);
return false;
}
Gtk::Window& main_window (ARDOUR_UI::instance ()->main_window ());
@ -372,7 +373,6 @@ Glib::RefPtr<Gdk::Pixbuf>
ARDOUR_UI_UTILS::get_xpm (std::string name)
{
if (!xpm_map[name]) {
Searchpath spath (ARDOUR::ardour_data_search_path ());
spath.add_subdirectory_to_paths ("pixmaps");
@ -399,13 +399,11 @@ ARDOUR_UI_UTILS::get_color_themes (map<std::string,std::string>& themes)
Searchpath spath (ARDOUR::theme_search_path ());
for (vector<string>::iterator s = spath.begin (); s != spath.end (); ++s) {
vector<string> entries;
find_files_matching_pattern (entries, *s, string ("*") + UIConfiguration::color_file_suffix);
for (vector<string>::iterator e = entries.begin (); e != entries.end (); ++e) {
XMLTree tree;
tree.read ((*e).c_str ());
@ -441,7 +439,6 @@ ARDOUR_UI_UTILS::get_icon_sets ()
r.push_back (_("default"));
for (vector<string>::iterator s = spath.begin (); s != spath.end (); ++s) {
vector<string> entries;
get_paths (entries, *s, false, false);
@ -469,7 +466,6 @@ ARDOUR_UI_UTILS::get_icon_path (const char* cname, string icon_set, bool is_imag
Searchpath spath (ARDOUR::ardour_data_search_path ());
if (!icon_set.empty () && icon_set != _("default")) {
/* add "icons/icon_set" but .. not allowed to add both of these at once */
spath.add_subdirectory_to_paths ("icons");
spath.add_subdirectory_to_paths (icon_set);
@ -487,7 +483,6 @@ ARDOUR_UI_UTILS::get_icon_path (const char* cname, string icon_set, bool is_imag
}
if (is_image && data_file_path.empty ()) {
if (!icon_set.empty () && icon_set != _("default")) {
warning << string_compose (_("icon \"%1\" not found for icon set \"%2\", fallback to default"), cname, icon_set) << endmsg;
}
@ -519,7 +514,8 @@ ARDOUR_UI_UTILS::get_icon (const char* cname, string icon_set)
return img;
}
namespace ARDOUR_UI_UTILS {
namespace ARDOUR_UI_UTILS
{
Glib::RefPtr<Gdk::Pixbuf>
get_icon (const char* cname)
{
@ -534,7 +530,7 @@ get_icon (const char* cname)
return img;
}
}
} // namespace ARDOUR_UI_UTILS
string
ARDOUR_UI_UTILS::longest (vector<string>& strings)
@ -550,7 +546,6 @@ ARDOUR_UI_UTILS::longest (vector<string>& strings)
++i;
while (i != strings.end ()) {
string::size_type len = (*i).length ();
if (len > longest_length) {
@ -567,9 +562,7 @@ ARDOUR_UI_UTILS::longest (vector<string>& strings)
bool
ARDOUR_UI_UTILS::key_is_legal_for_numeric_entry (guint keyval)
{
/* we assume that this does not change over the life of the process
*/
/* we assume that this does not change over the life of the process */
static int comma_decimal = -1;
switch (keyval) {
@ -662,7 +655,6 @@ ARDOUR_UI_UTILS::resize_window_to_proportion_of_monitor (Gtk::Window* window, in
window->resize (w, h);
}
/** Replace _ with __ in a string; for use with menu item text to make underscores displayed correctly */
string
ARDOUR_UI_UTILS::escape_underscores (string const& s)
@ -703,7 +695,6 @@ ARDOUR_UI_UTILS::unique_random_color (list<Gdk::Color>& used_colors)
Gdk::Color newcolor;
while (1) {
double h, s, v;
h = fmod (random (), 360.0);
@ -797,7 +788,6 @@ ARDOUR_UI_UTILS::midi_channels_as_string (std::bitset<16> channels)
string rv;
for (int i = 0; i < 16; i++) {
bool prior = i < 1 ? false : channels.test (i - 1);
bool current = channels.test (i);
bool next = i > 14 ? false : channels.test (i + 1);
@ -834,7 +824,6 @@ ARDOUR_UI_UTILS::midi_channels_as_string (std::bitset<16> channels)
bool
ARDOUR_UI_UTILS::windows_overlap (Gtk::Window* a, Gtk::Window* b)
{
if (!a || !b) {
return false;
}