[med-svn] [aghermann] 08/85: ICM (see 61e02bf84ccef)

andrei zavada hmmr-guest at alioth.debian.org
Thu Sep 26 23:46:22 UTC 2013


This is an automated email from the git hooks/post-receive script.

hmmr-guest pushed a commit to branch master
in repository aghermann.

commit c643f0522f005a078e59e4d34ae93e49a4b0f39a
Author: Andrei Zavada <johnhommer at gmail.com>
Date:   Wed Sep 4 23:53:14 2013 +0300

    ICM (see 61e02bf84ccef)
---
 upstream/src/aghermann/ui/mf/mf-construct.cc       |  141 +++++++------------
 upstream/src/aghermann/ui/mf/mf.cc                 |  103 +++++++-------
 upstream/src/aghermann/ui/mf/mf.hh                 |   18 +--
 .../src/aghermann/ui/sf/d/artifacts-construct.cc   |   60 ++++----
 .../ui/sf/d/artifacts-simple-construct.cc          |    8 +-
 .../src/aghermann/ui/sf/d/filters-construct.cc     |   20 +--
 upstream/src/aghermann/ui/sf/d/filters.hh          |    5 +-
 .../src/aghermann/ui/sf/d/patterns-construct.cc    |  146 +++++++++++---------
 upstream/src/aghermann/ui/sf/d/patterns-draw.cc    |   33 +++--
 .../src/aghermann/ui/sf/d/patterns-profiles.cc     |   10 +-
 upstream/src/aghermann/ui/sf/d/patterns.cc         |   28 ++--
 upstream/src/aghermann/ui/sf/d/patterns.hh         |   24 ++--
 upstream/src/aghermann/ui/sf/d/patterns_cb.cc      |   13 +-
 .../src/aghermann/ui/sf/d/phasediff-construct.cc   |   25 ++--
 upstream/src/aghermann/ui/sf/d/phasediff.cc        |   37 ++---
 upstream/src/aghermann/ui/sf/d/phasediff.hh        |   15 +-
 upstream/src/aghermann/ui/sf/d/rk1968.hh           |   26 ++--
 upstream/src/aghermann/ui/sm/sm-construct.cc       |   45 +++---
 upstream/src/aghermann/ui/sm/sm.hh                 |   21 ++-
 upstream/src/aghermann/ui/sm/sm_cb.cc              |   31 ++---
 upstream/src/aghermann/ui/ui++.hh                  |    6 +-
 21 files changed, 400 insertions(+), 415 deletions(-)

diff --git a/upstream/src/aghermann/ui/mf/mf-construct.cc b/upstream/src/aghermann/ui/mf/mf-construct.cc
index caf6301..9dc9c8d 100644
--- a/upstream/src/aghermann/ui/mf/mf-construct.cc
+++ b/upstream/src/aghermann/ui/mf/mf-construct.cc
@@ -19,62 +19,40 @@ int
 SModelrunFacility::
 construct_widgets()
 {
-        if ( !(AGH_GBGETOBJ3 (builder, GtkWindow,        wModelrunFacility)) ||
-             !(AGH_GBGETOBJ3 (builder, GtkDrawingArea,        daMFProfile)) ||
-             !(AGH_GBGETOBJ3 (builder, GtkTextView,        lMFLog)) ||
-             !(AGH_GBGETOBJ3 (builder, GtkCheckButton,        eMFLiveUpdate)) ||
-             !(AGH_GBGETOBJ3 (builder, GtkCheckButton,        eMFHighlightWake)) ||
-             !(AGH_GBGETOBJ3 (builder, GtkCheckButton,        eMFHighlightNREM)) ||
-             !(AGH_GBGETOBJ3 (builder, GtkCheckButton,        eMFHighlightREM)) ||
-             !(AGH_GBGETOBJ3 (builder, GtkCheckButton,        eMFLiveUpdate)) ||
-             !(AGH_GBGETOBJ3 (builder, GtkScaleButton,        eMFSmooth)) ||
-             !(AGH_GBGETOBJ3 (builder, GtkHBox,                cMFControls)) ||
-             !(AGH_GBGETOBJ3 (builder, GtkLabel,        lMFCostFunction)) ||
-             !(AGH_GBGETOBJ3 (builder, GtkCheckButton,        eMFClassicFit)) ||
-             !(AGH_GBGETOBJ3 (builder, GtkLabel,        lMFClassicFit)) ||
-             !(AGH_GBGETOBJ3 (builder, GtkButton,        bMFRun)) ||
-             !(AGH_GBGETOBJ3 (builder, GtkButton,        bMFReset)) ||
-             !(AGH_GBGETOBJ3 (builder, GtkToolButton,        bMFAccept)) )
-                return -1;
-
-        g_signal_connect( wModelrunFacility, "delete-event",
-                          (GCallback)wModelrunFacility_delete_event_cb,
-                          this);
-        g_signal_connect( eMFSmooth, "value-changed",
-                          (GCallback)eMFSmooth_value_changed_cb,
-                          this);
-
-        g_signal_connect( eMFHighlightNREM, "toggled",
-                          (GCallback)eMFHighlightNREM_toggled_cb,
-                          this);
-        g_signal_connect( eMFHighlightREM, "toggled",
-                          (GCallback)eMFHighlightREM_toggled_cb,
-                          this);
-        g_signal_connect( eMFHighlightWake, "toggled",
-                          (GCallback)eMFHighlightWake_toggled_cb,
-                          this);
-        g_signal_connect( eMFClassicFit, "toggled",
-                          (GCallback)eMFClassicFit_toggled_cb,
-                          this);
-
-        if ( !(AGH_GBGETOBJ3 (builder, GtkCheckButton,        eMFDB1)) ||
-             !(AGH_GBGETOBJ3 (builder, GtkCheckButton,        eMFDB2)) ||
-             !(AGH_GBGETOBJ3 (builder, GtkCheckButton,        eMFAZ1)) ||
-             !(AGH_GBGETOBJ3 (builder, GtkCheckButton,        eMFAZ2)) )
-                return -1;
-
-        g_signal_connect( eMFDB1, "toggled",
-                          (GCallback)eMFDB1_toggled_cb,
-                          this);
-        g_signal_connect( eMFDB2, "toggled",
-                          (GCallback)eMFDB2_toggled_cb,
-                          this);
-        g_signal_connect( eMFAZ1, "toggled",
-                          (GCallback)eMFAZ1_toggled_cb,
-                          this);
-        g_signal_connect( eMFAZ2, "toggled",
-                          (GCallback)eMFAZ2_toggled_cb,
-                          this);
+        if ( !(AGH_GBGETOBJ3 (builder, GtkWindow,      wModelrunFacility)) ||
+             !(AGH_GBGETOBJ3 (builder, GtkDrawingArea, daMFProfile)) ||
+             !(AGH_GBGETOBJ3 (builder, GtkTextView,    lMFLog)) ||
+             !(AGH_GBGETOBJ3 (builder, GtkCheckButton, eMFLiveUpdate)) ||
+             !(AGH_GBGETOBJ3 (builder, GtkCheckButton, eMFHighlightWake)) ||
+             !(AGH_GBGETOBJ3 (builder, GtkCheckButton, eMFHighlightNREM)) ||
+             !(AGH_GBGETOBJ3 (builder, GtkCheckButton, eMFHighlightREM)) ||
+             !(AGH_GBGETOBJ3 (builder, GtkCheckButton, eMFLiveUpdate)) ||
+             !(AGH_GBGETOBJ3 (builder, GtkScaleButton, eMFSmooth)) ||
+             !(AGH_GBGETOBJ3 (builder, GtkHBox,        cMFControls)) ||
+             !(AGH_GBGETOBJ3 (builder, GtkLabel,       lMFCostFunction)) ||
+             !(AGH_GBGETOBJ3 (builder, GtkCheckButton, eMFClassicFit)) ||
+             !(AGH_GBGETOBJ3 (builder, GtkLabel,       lMFClassicFit)) ||
+             !(AGH_GBGETOBJ3 (builder, GtkButton,      bMFRun)) ||
+             !(AGH_GBGETOBJ3 (builder, GtkButton,      bMFReset)) ||
+             !(AGH_GBGETOBJ3 (builder, GtkToolButton,  bMFAccept)) ||
+             !(AGH_GBGETOBJ3 (builder, GtkCheckButton, eMFDB1)) ||
+             !(AGH_GBGETOBJ3 (builder, GtkCheckButton, eMFDB2)) ||
+             !(AGH_GBGETOBJ3 (builder, GtkCheckButton, eMFAZ1)) ||
+             !(AGH_GBGETOBJ3 (builder, GtkCheckButton, eMFAZ2)) )
+                throw runtime_error ("Failed to construct MF widgets (1)");
+
+        G_CONNECT_2 (wModelrunFacility, delete, event);
+        G_CONNECT_2 (eMFSmooth, value, changed);
+
+        G_CONNECT_1 (eMFHighlightNREM, toggled);
+        G_CONNECT_1 (eMFHighlightREM, toggled);
+        G_CONNECT_1 (eMFHighlightWake, toggled);
+        G_CONNECT_1 (eMFClassicFit, toggled);
+
+        G_CONNECT_1 (eMFDB1, toggled);
+        G_CONNECT_1 (eMFDB2, toggled);
+        G_CONNECT_1 (eMFAZ1, toggled);
+        G_CONNECT_1 (eMFAZ2, toggled);
 
         eMFVx[(GtkSpinButton*)gtk_builder_get_object( builder, "eMFVrs" )] = agh::ach::TTunable::rs ;
         eMFVx[(GtkSpinButton*)gtk_builder_get_object( builder, "eMFVrc" )] = agh::ach::TTunable::rc ;
@@ -101,16 +79,17 @@ construct_widgets()
                                   (GCallback)eMFVx_value_changed_cb,
                                   this);
 
-        g_object_set( (GObject*)lMFLog,
-                      "tabs", pango_tab_array_new_with_positions(
-                              6, TRUE,
-                              PANGO_TAB_LEFT, 50,
-                              PANGO_TAB_LEFT, 150,
-                              PANGO_TAB_LEFT, 240,
-                              PANGO_TAB_LEFT, 330,
-                              PANGO_TAB_LEFT, 420,
-                              PANGO_TAB_LEFT, 510),
-                      NULL);
+        g_object_set(
+                (GObject*)lMFLog,
+                "tabs", pango_tab_array_new_with_positions(
+                        6, TRUE,
+                        PANGO_TAB_LEFT, 50,
+                        PANGO_TAB_LEFT, 150,
+                        PANGO_TAB_LEFT, 240,
+                        PANGO_TAB_LEFT, 330,
+                        PANGO_TAB_LEFT, 420,
+                        PANGO_TAB_LEFT, 510),
+                NULL);
 
 
         auto font_desc = pango_font_description_from_string( "Mono 9");
@@ -119,28 +98,14 @@ construct_widgets()
 
         log_text_buffer = gtk_text_view_get_buffer( lMFLog);
 
-        g_signal_connect( daMFProfile, "configure-event",
-                          (GCallback)daMFProfile_configure_event_cb,
-                          this);
-        g_signal_connect( daMFProfile, "draw",
-                          (GCallback)daMFProfile_draw_cb,
-                          this);
-        g_signal_connect( daMFProfile, "button-press-event",
-                          (GCallback)daMFProfile_button_press_event_cb,
-                          this);
-        g_signal_connect( daMFProfile, "scroll-event",
-                          (GCallback)daMFProfile_scroll_event_cb,
-                          this);
-
-        g_signal_connect( bMFRun, "clicked",
-                          (GCallback)bMFRun_clicked_cb,
-                          this);
-        g_signal_connect( bMFReset, "clicked",
-                          (GCallback)bMFReset_clicked_cb,
-                          this);
-        g_signal_connect( bMFAccept, "clicked",
-                          (GCallback)bMFAccept_clicked_cb,
-                          this);
+        G_CONNECT_2 (daMFProfile, configure, event);
+        G_CONNECT_1 (daMFProfile, draw);
+        G_CONNECT_3 (daMFProfile, button, press, event);
+        G_CONNECT_2 (daMFProfile, scroll, event);
+
+        G_CONNECT_1 (bMFRun, clicked);
+        G_CONNECT_1 (bMFReset, clicked);
+        G_CONNECT_1 (bMFAccept, clicked);
 
         return 0;
 }
diff --git a/upstream/src/aghermann/ui/mf/mf.cc b/upstream/src/aghermann/ui/mf/mf.cc
index f1cdd3b..0e26b97 100644
--- a/upstream/src/aghermann/ui/mf/mf.cc
+++ b/upstream/src/aghermann/ui/mf/mf.cc
@@ -93,8 +93,8 @@ SModelrunFacility (agh::ach::CModelRun& csim, SExpDesignUI& parent)
         gtk_text_buffer_set_text( log_text_buffer, global::buf, -1);
 
         for ( auto &tuple : eMFVx ) {
-                auto        jdst = gtk_spin_button_get_adjustment( tuple.first);
-                auto        t = min((size_t)tuple.second, (size_t)agh::ach::TTunable::_basic_tunables - 1);
+                auto    jdst = gtk_spin_button_get_adjustment( tuple.first);
+                auto    t = min((size_t)tuple.second, (size_t)agh::ach::TTunable::_basic_tunables - 1);
                 gtk_adjustment_configure(
                         jdst,
                         csimulation.tx [t] * agh::ach::stock[t].display_scale_factor,
@@ -143,20 +143,20 @@ SModelrunFacility::
 draw_timeline( cairo_t *cr)
 {
       // empirical SWA
-        size_t        cur_ep;
+        size_t  cur_ep;
 
         if ( zoomed_episode != -1 ) {
-                size_t        ep_start = csimulation.nth_episode_start_page( zoomed_episode),
+                size_t  ep_start = csimulation.nth_episode_start_page( zoomed_episode),
                         ep_end   = csimulation.nth_episode_end_page  ( zoomed_episode);
-                draw_episode( cr,
-                              zoomed_episode,
-                              ep_start, ep_end,
-                              ep_start, ep_end);
+                draw_episode(
+                        cr, zoomed_episode,
+                        ep_start, ep_end,
+                        ep_start, ep_end);
                 draw_ticks( cr, ep_start, ep_end);
         } else {
               // draw day and night
                 {
-                        time_t        timeline_start = csimulation.mm_list().front()->start(),
+                        time_t  timeline_start = csimulation.mm_list().front()->start(),
                                 timeline_end   = csimulation.mm_list().back()->end();
 
                         cairo_pattern_t *cp = cairo_pattern_create_linear( 0., 0., da_wd, 0);
@@ -164,7 +164,7 @@ draw_timeline( cairo_t *cr)
                         memcpy( &clock_time, localtime( &timeline_start), sizeof(clock_time));
                         clock_time.tm_hour = 4;
                         clock_time.tm_min = clock_time.tm_sec = 0;
-                        time_t        dawn = mktime( &clock_time),
+                        time_t  dawn = mktime( &clock_time),
                                 t;
                         bool up = false;
 
@@ -180,22 +180,22 @@ draw_timeline( cairo_t *cr)
                 }
               // draw episodes
                 for ( cur_ep = 0; cur_ep < csimulation.mm_list().size(); ++cur_ep )
-                        draw_episode( cr,
-                                      cur_ep,
-                                      csimulation.nth_episode_start_page( cur_ep),
-                                      csimulation.nth_episode_end_page  ( cur_ep),
-                                      0, csimulation.timeline().size());
-              // Process S in one go for the entire timeline
+                        draw_episode(
+                                cr, cur_ep,
+                                csimulation.nth_episode_start_page( cur_ep),
+                                csimulation.nth_episode_end_page  ( cur_ep),
+                                0, csimulation.timeline().size());
+                // Process S in one go for the entire timeline
                 cairo_set_line_width( cr, 2.);
                 _p.CwB[SExpDesignUI::TColour::mf_process_s].set_source_rgba( cr);
                 cairo_move_to( cr, tl_pad + 0,
                                da_ht - lgd_margin-hypn_depth
                                - csimulation[csimulation.sim_start()].S * da_ht / SWA_max * display_factor);
                 for ( size_t i = csimulation.sim_start()+1; i < csimulation.timeline().size(); ++i )
-                        cairo_line_to( cr,
-                                       tl_pad + (float)i / csimulation.timeline().size() * da_wd_actual(),
-                                       da_ht - lgd_margin-hypn_depth
-                                       - csimulation[i].S * da_ht / SWA_max * display_factor);
+                        cairo_line_to(
+                                cr,
+                                tl_pad + (float)i / csimulation.timeline().size() * da_wd_actual(),
+                                da_ht - lgd_margin-hypn_depth - csimulation[i].S * da_ht / SWA_max * display_factor);
                 cairo_stroke( cr);
 
                 draw_ticks( cr, 0, csimulation.timeline().size());
@@ -238,7 +238,7 @@ draw_episode( cairo_t *cr,
         cairo_set_line_width( cr, 1.5);
         _p.CwB[SExpDesignUI::TColour::mf_swa].set_source_rgba( cr);
 
-        size_t        tl_len = tl_end - tl_start,
+        size_t  tl_len = tl_end - tl_start,
                 ep_len = ep_end - ep_start,
               // consider not displaying SWA-less wake pages at front
                 wakepages = (ep == 0 || zoomed_episode == -1) ? csimulation.sim_start() : 0;
@@ -251,9 +251,10 @@ draw_episode( cairo_t *cr,
               // smooth the SWA course
                 sigproc::smooth( swa, swa_smoothover);
 
-                cairo_move_to( cr, tl_pad + (float)(ep_start + wakepages - tl_start) / tl_len * da_wd_actual(),
-                               da_ht - lgd_margin-hypn_depth
-                               - swa[wakepages] / SWA_max * (float)da_ht * display_factor);
+                cairo_move_to(
+                        cr, tl_pad + (float)(ep_start + wakepages - tl_start) / tl_len * da_wd_actual(),
+                        da_ht - lgd_margin-hypn_depth
+                        - swa[wakepages] / SWA_max * (float)da_ht * display_factor);
                 for ( size_t i = wakepages+1; i < ep_len-1; ++i )
                         cairo_line_to( cr,
                                        tl_pad + (float)(ep_start - tl_start + i) / tl_len * da_wd_actual(),
@@ -272,14 +273,16 @@ draw_episode( cairo_t *cr,
       // simulated SWA
         cairo_set_line_width( cr, 2.5);
         _p.CwB[SExpDesignUI::TColour::mf_swa_sim].set_source_rgba( cr);
-        cairo_move_to( cr, tl_pad + (float)(ep_start + wakepages - tl_start) / tl_len * da_wd_actual(),
-                       da_ht - lgd_margin-hypn_depth
-                       - csimulation[ep_start + wakepages].metric_sim * da_ht / SWA_max * display_factor);
+        cairo_move_to(
+                cr, tl_pad + (float)(ep_start + wakepages - tl_start) / tl_len * da_wd_actual(),
+                da_ht - lgd_margin-hypn_depth
+                - csimulation[ep_start + wakepages].metric_sim * da_ht / SWA_max * display_factor);
         for ( size_t i = wakepages+1; i < ep_len; ++i )
-                cairo_line_to( cr,
-                               tl_pad + (float)(ep_start - tl_start + i) / tl_len * da_wd_actual(),
-                               da_ht - lgd_margin-hypn_depth
-                               - csimulation[ep_start + i].metric_sim * da_ht / SWA_max * display_factor);
+                cairo_line_to(
+                        cr,
+                        tl_pad + (float)(ep_start - tl_start + i) / tl_len * da_wd_actual(),
+                        da_ht - lgd_margin-hypn_depth
+                        - csimulation[ep_start + i].metric_sim * da_ht / SWA_max * display_factor);
         cairo_stroke( cr);
 
       // Process S
@@ -287,16 +290,18 @@ draw_episode( cairo_t *cr,
         if ( zoomed_episode != -1 ) {
                 cairo_set_line_width( cr, 3);
                 _p.CwB[SExpDesignUI::TColour::mf_process_s].set_source_rgba( cr);
-                cairo_move_to( cr, tl_pad + (float)(ep_start + wakepages - tl_start) / tl_len * da_wd_actual(),
-                               da_ht - lgd_margin-hypn_depth
-                               - csimulation[ep_start + wakepages].S * da_ht / SWA_max * display_factor);
+                cairo_move_to(
+                        cr, tl_pad + (float)(ep_start + wakepages - tl_start) / tl_len * da_wd_actual(),
+                        da_ht - lgd_margin-hypn_depth
+                        - csimulation[ep_start + wakepages].S * da_ht / SWA_max * display_factor);
                 size_t possible_end = ep_len +
                         ((zoomed_episode == (int)csimulation.mm_list().size() - 1) ? 0 : ((float)csimulation.timeline().size()/da_wd_actual() * tl_pad));
                 for ( size_t i = wakepages+1; i < possible_end; ++i )
-                        cairo_line_to( cr,
-                                       tl_pad + (float)(ep_start - tl_start + i) / tl_len * da_wd_actual(),
-                                       da_ht - lgd_margin-hypn_depth
-                                       - csimulation[ep_start + i].S * da_ht / SWA_max * display_factor);
+                        cairo_line_to(
+                                cr,
+                                tl_pad + (float)(ep_start - tl_start + i) / tl_len * da_wd_actual(),
+                                da_ht - lgd_margin-hypn_depth
+                                - csimulation[ep_start + i].S * da_ht / SWA_max * display_factor);
                 cairo_stroke( cr);
         }
 
@@ -328,9 +333,10 @@ draw_episode( cairo_t *cr,
                                 _p.CwB[ SExpDesignUI::score2colour(sco) ].pattern_add_color_stop_rgba( cp, 0., 0.50);
                                 _p.CwB[ SExpDesignUI::score2colour(sco) ].pattern_add_color_stop_rgba( cp, 1., 0.02);
                                 cairo_set_source( cr, cp);
-                                cairo_rectangle( cr,
-                                                 tl_pad + (float)(ep_start - tl_start + i) / tl_len * da_wd_actual(), 0.,
-                                                 1. / tl_len * da_wd_actual(), da_ht);
+                                cairo_rectangle(
+                                        cr,
+                                        tl_pad + (float)(ep_start - tl_start + i) / tl_len * da_wd_actual(), 0.,
+                                        1. / tl_len * da_wd_actual(), da_ht);
                                 cairo_fill( cr);
                                 cairo_stroke( cr);
                                 cairo_pattern_destroy( cp);
@@ -348,12 +354,12 @@ SModelrunFacility::
 draw_ticks( cairo_t *cr,
             size_t start, const size_t end)
 {
-      // ticks
-        guint        pph = 3600/csimulation.pagesize(),
+        static const float sizes[] = { NAN, .25, .5, 1, 2, 3, 4, 6, 12 };
+
+        guint   pph = 3600/csimulation.pagesize(),
                 pps = pph/2;
-        float        tick_spc_rough = (float)(end-start)/(da_wd/120.) / pph,
+        float   tick_spc_rough = (float)(end-start)/(da_wd/120.) / pph,
                 tick_spc;
-        float        sizes[] = { NAN, .25, .5, 1, 2, 3, 4, 6, 12 };
         size_t i = 8;
         while ( i > 0 && (tick_spc = sizes[i]) > tick_spc_rough )
                 --i;
@@ -370,9 +376,10 @@ draw_ticks( cairo_t *cr,
                 cairo_stroke( cr);
 
                 _p.CwB[SExpDesignUI::TColour::mf_labels].set_source_rgba( cr);
-                cairo_move_to( cr,
-                               (float)(i-start)/(end-start) * da_wd_actual() + 2,
-                               da_ht - hypn_depth-lgd_margin + 14);
+                cairo_move_to(
+                        cr,
+                        (float)(i-start)/(end-start) * da_wd_actual() + 2,
+                        da_ht - hypn_depth-lgd_margin + 14);
                 cairo_show_text( cr, snprintf_buf_ts_h( (double)i/pph));
                 cairo_stroke( cr);
         }
diff --git a/upstream/src/aghermann/ui/mf/mf.hh b/upstream/src/aghermann/ui/mf/mf.hh
index 058f7fd..403c0f3 100644
--- a/upstream/src/aghermann/ui/mf/mf.hh
+++ b/upstream/src/aghermann/ui/mf/mf.hh
@@ -34,11 +34,9 @@ struct SModelrunFacility {
         agh::ach::CModelRun&
                 csimulation;
 
-        double        cf;
+        double  cf;
         double snapshot()
-                {
-                        return cf = csimulation.snapshot();
-                }
+                { return cf = csimulation.snapshot(); }
 
         void draw_episode( cairo_t*, size_t ep,
                            size_t ep_start, size_t ep_end,
@@ -48,13 +46,13 @@ struct SModelrunFacility {
         void update_infobar();
         void siman_param_printer( void*);
 
-        double        SWA_max;
-        float        display_factor;
-        int        zoomed_episode;
+        double  SWA_max;
+        float   display_factor;
+        int     zoomed_episode;
         static size_t
                 swa_smoothover;  // one side
 
-        bool        _suppress_Vx_value_changed:1,
+        bool    _suppress_Vx_value_changed:1,
                 _tunables_header_printed:1,
                 highlight_nrem:1,
                 highlight_rem:1,
@@ -111,9 +109,7 @@ struct SModelrunFacility {
         static const int lgd_margin = 20;
         static const int hypn_depth = 35;
         int da_wd_actual() const
-                {
-                        return da_wd - 2 * tl_pad;
-                }
+                { return da_wd - 2 * tl_pad; }
 
         SExpDesignUI&
                 _p;
diff --git a/upstream/src/aghermann/ui/sf/d/artifacts-construct.cc b/upstream/src/aghermann/ui/sf/d/artifacts-construct.cc
index f7b0f62..a7115d0 100644
--- a/upstream/src/aghermann/ui/sf/d/artifacts-construct.cc
+++ b/upstream/src/aghermann/ui/sf/d/artifacts-construct.cc
@@ -26,36 +26,36 @@ SArtifactsDialogWidgets ()
                 throw runtime_error( "Failed to load SF::artifacts glade resource");
         gtk_builder_connect_signals( builder, NULL);
 
-        if ( !(AGH_GBGETOBJ (GtkDialog,                        wSFAD)) ||
-             !(AGH_GBGETOBJ (GtkComboBox,                eSFADProfiles)) ||
-             !(AGH_GBGETOBJ (GtkButton,                        bSFADProfileSave)) ||
-             !(AGH_GBGETOBJ (GtkButton,                        bSFADProfileDelete)) ||
-             !(AGH_GBGETOBJ (GtkSpinButton,                eSFADScope)) ||
-             !(AGH_GBGETOBJ (GtkSpinButton,                eSFADUpperThr)) ||
-             !(AGH_GBGETOBJ (GtkSpinButton,                eSFADLowerThr)) ||
-             !(AGH_GBGETOBJ (GtkSpinButton,                eSFADF0)) ||
-             !(AGH_GBGETOBJ (GtkSpinButton,                eSFADFc)) ||
-             !(AGH_GBGETOBJ (GtkSpinButton,                eSFADBandwidth)) ||
-             !(AGH_GBGETOBJ (GtkSpinButton,                eSFADMCGain)) ||
-             !(AGH_GBGETOBJ (GtkSpinButton,                eSFADBackpolate)) ||
-             !(AGH_GBGETOBJ (GtkSpinButton,                eSFADEValue)) ||
-             !(AGH_GBGETOBJ (GtkSpinButton,                eSFADHistRangeMin)) ||
-             !(AGH_GBGETOBJ (GtkSpinButton,                eSFADHistRangeMax)) ||
-             !(AGH_GBGETOBJ (GtkSpinButton,                eSFADHistBins)) ||
-             !(AGH_GBGETOBJ (GtkSpinButton,                eSFADSmoothSide)) ||
-             !(AGH_GBGETOBJ (GtkCheckButton,                eSFADSingleChannelPreview)) ||
-             !(AGH_GBGETOBJ (GtkCheckButton,                eSFADEstimateE)) ||
-             !(AGH_GBGETOBJ (GtkRadioButton,                eSFADUseThisRange)) ||
-             !(AGH_GBGETOBJ (GtkRadioButton,                eSFADUseComputedRange)) ||
-             !(AGH_GBGETOBJ (GtkTable,                        cSFADWhenEstimateEOn)) ||
-             !(AGH_GBGETOBJ (GtkTable,                        cSFADWhenEstimateEOff)) ||
-             !(AGH_GBGETOBJ (GtkLabel,                        lSFADInfo)) ||
-             !(AGH_GBGETOBJ (GtkLabel,                        lSFADDirtyPercent)) ||
-             !(AGH_GBGETOBJ (GtkToggleButton,                bSFADPreview)) ||
-             !(AGH_GBGETOBJ (GtkButton,                        bSFADApply)) ||
-             !(AGH_GBGETOBJ (GtkButton,                        bSFADCancel)) ||
-             !(AGH_GBGETOBJ (GtkDialog,                        wSFADSaveProfileName)) ||
-             !(AGH_GBGETOBJ (GtkEntry,                        eSFADSaveProfileNameName)) )
+        if ( !(AGH_GBGETOBJ (GtkDialog,        wSFAD)) ||
+             !(AGH_GBGETOBJ (GtkComboBox,      eSFADProfiles)) ||
+             !(AGH_GBGETOBJ (GtkButton,        bSFADProfileSave)) ||
+             !(AGH_GBGETOBJ (GtkButton,        bSFADProfileDelete)) ||
+             !(AGH_GBGETOBJ (GtkSpinButton,    eSFADScope)) ||
+             !(AGH_GBGETOBJ (GtkSpinButton,    eSFADUpperThr)) ||
+             !(AGH_GBGETOBJ (GtkSpinButton,    eSFADLowerThr)) ||
+             !(AGH_GBGETOBJ (GtkSpinButton,    eSFADF0)) ||
+             !(AGH_GBGETOBJ (GtkSpinButton,    eSFADFc)) ||
+             !(AGH_GBGETOBJ (GtkSpinButton,    eSFADBandwidth)) ||
+             !(AGH_GBGETOBJ (GtkSpinButton,    eSFADMCGain)) ||
+             !(AGH_GBGETOBJ (GtkSpinButton,    eSFADBackpolate)) ||
+             !(AGH_GBGETOBJ (GtkSpinButton,    eSFADEValue)) ||
+             !(AGH_GBGETOBJ (GtkSpinButton,    eSFADHistRangeMin)) ||
+             !(AGH_GBGETOBJ (GtkSpinButton,    eSFADHistRangeMax)) ||
+             !(AGH_GBGETOBJ (GtkSpinButton,    eSFADHistBins)) ||
+             !(AGH_GBGETOBJ (GtkSpinButton,    eSFADSmoothSide)) ||
+             !(AGH_GBGETOBJ (GtkCheckButton,   eSFADSingleChannelPreview)) ||
+             !(AGH_GBGETOBJ (GtkCheckButton,   eSFADEstimateE)) ||
+             !(AGH_GBGETOBJ (GtkRadioButton,   eSFADUseThisRange)) ||
+             !(AGH_GBGETOBJ (GtkRadioButton,   eSFADUseComputedRange)) ||
+             !(AGH_GBGETOBJ (GtkTable,         cSFADWhenEstimateEOn)) ||
+             !(AGH_GBGETOBJ (GtkTable,         cSFADWhenEstimateEOff)) ||
+             !(AGH_GBGETOBJ (GtkLabel,         lSFADInfo)) ||
+             !(AGH_GBGETOBJ (GtkLabel,         lSFADDirtyPercent)) ||
+             !(AGH_GBGETOBJ (GtkToggleButton,  bSFADPreview)) ||
+             !(AGH_GBGETOBJ (GtkButton,        bSFADApply)) ||
+             !(AGH_GBGETOBJ (GtkButton,        bSFADCancel)) ||
+             !(AGH_GBGETOBJ (GtkDialog,        wSFADSaveProfileName)) ||
+             !(AGH_GBGETOBJ (GtkEntry,         eSFADSaveProfileNameName)) )
                 throw runtime_error ("Failed to construct SF widgets (7)");
 
         mSFADProfiles = gtk_list_store_new( 1, G_TYPE_STRING);
diff --git a/upstream/src/aghermann/ui/sf/d/artifacts-simple-construct.cc b/upstream/src/aghermann/ui/sf/d/artifacts-simple-construct.cc
index 9490f7a..ea53f47 100644
--- a/upstream/src/aghermann/ui/sf/d/artifacts-simple-construct.cc
+++ b/upstream/src/aghermann/ui/sf/d/artifacts-simple-construct.cc
@@ -26,10 +26,10 @@ SArtifactsSimpleDialogWidgets ()
                 throw runtime_error( "Failed to load SF::artifacts-simple glade resource");
         gtk_builder_connect_signals( builder, NULL);
 
-        if ( !AGH_GBGETOBJ (GtkDialog,                wSFADS) ||
-             !AGH_GBGETOBJ (GtkSpinButton,        eSFADSMinFlatRegionSize) ||
-             !AGH_GBGETOBJ (GtkSpinButton,        eSFADSPad) )
-                throw runtime_error ("Failed to construct SF widgets (8)");
+        if ( !AGH_GBGETOBJ (GtkDialog,     wSFADS) ||
+             !AGH_GBGETOBJ (GtkSpinButton, eSFADSMinFlatRegionSize) ||
+             !AGH_GBGETOBJ (GtkSpinButton, eSFADSPad) )
+                throw runtime_error ("Failed to construct SArtifactsSimpleDialogWidgets");
 }
 
 
diff --git a/upstream/src/aghermann/ui/sf/d/filters-construct.cc b/upstream/src/aghermann/ui/sf/d/filters-construct.cc
index 848d6e7..6a565fc 100644
--- a/upstream/src/aghermann/ui/sf/d/filters-construct.cc
+++ b/upstream/src/aghermann/ui/sf/d/filters-construct.cc
@@ -27,16 +27,16 @@ SFiltersDialogWidgets ()
                 throw runtime_error( "Failed to load SF::artifacts glade resource");
         gtk_builder_connect_signals( builder, NULL);
 
-        if ( !AGH_GBGETOBJ (GtkDialog,                wSFFilters) ||
-             !AGH_GBGETOBJ (GtkLabel,                lSFFilterCaption) ||
-             !AGH_GBGETOBJ (GtkSpinButton,        eSFFilterLowPassCutoff) ||
-             !AGH_GBGETOBJ (GtkSpinButton,        eSFFilterLowPassOrder) ||
-             !AGH_GBGETOBJ (GtkSpinButton,        eSFFilterHighPassCutoff) ||
-             !AGH_GBGETOBJ (GtkSpinButton,        eSFFilterHighPassOrder) ||
-             !AGH_GBGETOBJ (GtkComboBox,        eSFFilterNotchFilter) ||
-             !AGH_GBGETOBJ (GtkListStore,        mSFFilterNotchFilter) ||
-             !AGH_GBGETOBJ (GtkButton,                bSFFilterOK) )
-                throw runtime_error ("Failed to construct SF widgets (10)");
+        if ( !AGH_GBGETOBJ (GtkDialog,     wSFFilters) ||
+             !AGH_GBGETOBJ (GtkLabel,      lSFFilterCaption) ||
+             !AGH_GBGETOBJ (GtkSpinButton, eSFFilterLowPassCutoff) ||
+             !AGH_GBGETOBJ (GtkSpinButton, eSFFilterLowPassOrder) ||
+             !AGH_GBGETOBJ (GtkSpinButton, eSFFilterHighPassCutoff) ||
+             !AGH_GBGETOBJ (GtkSpinButton, eSFFilterHighPassOrder) ||
+             !AGH_GBGETOBJ (GtkComboBox,   eSFFilterNotchFilter) ||
+             !AGH_GBGETOBJ (GtkListStore,  mSFFilterNotchFilter) ||
+             !AGH_GBGETOBJ (GtkButton,     bSFFilterOK) )
+                throw runtime_error ("Failed to construct SFiltersDialogWidgets");
 
         gtk_combo_box_set_model_properly(
                 eSFFilterNotchFilter, mSFFilterNotchFilter); // can't reuse _p.mNotchFilter
diff --git a/upstream/src/aghermann/ui/sf/d/filters.hh b/upstream/src/aghermann/ui/sf/d/filters.hh
index a1885e4..ea9b8d7 100644
--- a/upstream/src/aghermann/ui/sf/d/filters.hh
+++ b/upstream/src/aghermann/ui/sf/d/filters.hh
@@ -31,7 +31,8 @@ struct SFiltersDialogWidgets {
         SFiltersDialogWidgets ();
        ~SFiltersDialogWidgets ();
 
-        GtkBuilder *builder;
+        GtkBuilder
+                *builder;
 
         GtkDialog
                 *wSFFilters;
@@ -53,7 +54,7 @@ struct SScoringFacility::SFiltersDialog
 
         DELETE_DEFAULT_METHODS (SFiltersDialog);
 
-        SFiltersDialog (SScoringFacility&);
+        explicit SFiltersDialog (SScoringFacility&);
 
         sigfile::SFilterPack
                 P;
diff --git a/upstream/src/aghermann/ui/sf/d/patterns-construct.cc b/upstream/src/aghermann/ui/sf/d/patterns-construct.cc
index c9b6445..7794ca2 100644
--- a/upstream/src/aghermann/ui/sf/d/patterns-construct.cc
+++ b/upstream/src/aghermann/ui/sf/d/patterns-construct.cc
@@ -29,56 +29,56 @@ SPatternsDialogWidgets (SScoringFacility& SF)
         mSFFDChannels =
                 gtk_list_store_new( 1, G_TYPE_STRING);
 
-        if ( !AGH_GBGETOBJ (GtkDialog,                wSFFD) ||
-             !AGH_GBGETOBJ (GtkDrawingArea,        daSFFDThing) ||
-             !AGH_GBGETOBJ (GtkScrolledWindow,        swSFFDThing) ||
-             !AGH_GBGETOBJ (GtkDrawingArea,        daSFFDField) ||
-             !AGH_GBGETOBJ (GtkMenuBar,                iibSFFDMenu) ||
-             !AGH_GBGETOBJ (GtkMenu,                iiSFFDField) ||
-             !AGH_GBGETOBJ (GtkMenu,                iiSFFDFieldProfileTypes) ||
-             !AGH_GBGETOBJ (GtkCheckMenuItem,        iSFFDFieldDrawMatchIndex) ||
-             !AGH_GBGETOBJ (GtkRadioMenuItem,        iSFFDFieldProfileTypeRaw) ||
-             !AGH_GBGETOBJ (GtkRadioMenuItem,        iSFFDFieldProfileTypePSD) ||
-             !AGH_GBGETOBJ (GtkRadioMenuItem,        iSFFDFieldProfileTypeMC)  ||
-             !AGH_GBGETOBJ (GtkRadioMenuItem,        iSFFDFieldProfileTypeSWU) ||
-             !AGH_GBGETOBJ (GtkMenuItem,        iSFFDMarkPhasicEventSpindles) ||
-             !AGH_GBGETOBJ (GtkMenuItem,        iSFFDMarkPhasicEventKComplexes) ||
-             !AGH_GBGETOBJ (GtkMenuItem,        iSFFDMarkPlain) ||
-             !AGH_GBGETOBJ (GtkScrolledWindow,        swSFFDField) ||
-             !AGH_GBGETOBJ (GtkTable,                cSFFDSearchButton) ||
-             !AGH_GBGETOBJ (GtkTable,                cSFFDAgainButton) ||
-             !AGH_GBGETOBJ (GtkBox,                cSFFDSearching) ||
-             !AGH_GBGETOBJ (GtkTable,                cSFFDParameters) ||
-             !AGH_GBGETOBJ (GtkTable,                cSFFDCriteria) ||
-             !AGH_GBGETOBJ (GtkButton,                bSFFDSearch) ||
-             !AGH_GBGETOBJ (GtkButton,                bSFFDAgain) ||
-             !AGH_GBGETOBJ (GtkButton,                bSFFDProfileSave) ||
-             !AGH_GBGETOBJ (GtkButton,                bSFFDProfileDiscard) ||
-             !AGH_GBGETOBJ (GtkButton,                bSFFDProfileRevert) ||
-             !AGH_GBGETOBJ (GtkSpinButton,        eSFFDEnvTightness) ||
-             !AGH_GBGETOBJ (GtkSpinButton,        eSFFDBandPassOrder) ||
-             !AGH_GBGETOBJ (GtkSpinButton,        eSFFDBandPassFrom) ||
-             !AGH_GBGETOBJ (GtkSpinButton,        eSFFDBandPassUpto) ||
-             !AGH_GBGETOBJ (GtkSpinButton,        eSFFDDZCDFStep) ||
-             !AGH_GBGETOBJ (GtkSpinButton,        eSFFDDZCDFSigma) ||
-             !AGH_GBGETOBJ (GtkSpinButton,        eSFFDDZCDFSmooth) ||
-             !AGH_GBGETOBJ (GtkSpinButton,        eSFFDParameterA) ||
-             !AGH_GBGETOBJ (GtkSpinButton,        eSFFDParameterB) ||
-             !AGH_GBGETOBJ (GtkSpinButton,        eSFFDParameterC) ||
-             !AGH_GBGETOBJ (GtkSpinButton,        eSFFDParameterD) ||
-             !AGH_GBGETOBJ (GtkSpinButton,        eSFFDIncrement) ||
-             !AGH_GBGETOBJ (GtkHBox,                cSFFDLabelBox) ||
-             !AGH_GBGETOBJ (GtkLabel,                lSFFDParametersBrief) ||
-             !AGH_GBGETOBJ (GtkLabel,                lSFFDFoundInfo) ||
-             !AGH_GBGETOBJ (GtkComboBox,        eSFFDPatternList) ||
-             !AGH_GBGETOBJ (GtkComboBox,        eSFFDChannel) ||
-             !AGH_GBGETOBJ (GtkDialog,                wSFFDPatternSave) ||
-             !AGH_GBGETOBJ (GtkEntry,                eSFFDPatternSaveName) ||
-             !AGH_GBGETOBJ (GtkToggleButton,        eSFFDPatternSaveOriginSubject) ||
-             !AGH_GBGETOBJ (GtkToggleButton,        eSFFDPatternSaveOriginExperiment) ||
-             !AGH_GBGETOBJ (GtkToggleButton,        eSFFDPatternSaveOriginUser) ||
-             !AGH_GBGETOBJ (GtkButton,                bSFFDPatternSaveOK) )
-                throw runtime_error ("Failed to construct SF widgets (9)");
+        if ( !AGH_GBGETOBJ (GtkDialog,         wSFFD) ||
+             !AGH_GBGETOBJ (GtkDrawingArea,    daSFFDThing) ||
+             !AGH_GBGETOBJ (GtkScrolledWindow, swSFFDThing) ||
+             !AGH_GBGETOBJ (GtkDrawingArea,    daSFFDField) ||
+             !AGH_GBGETOBJ (GtkMenuBar,        iibSFFDMenu) ||
+             !AGH_GBGETOBJ (GtkMenu,           iiSFFDField) ||
+             !AGH_GBGETOBJ (GtkMenu,           iiSFFDFieldProfileTypes) ||
+             !AGH_GBGETOBJ (GtkCheckMenuItem,  iSFFDFieldDrawMatchIndex) ||
+             !AGH_GBGETOBJ (GtkRadioMenuItem,  iSFFDFieldProfileTypeRaw) ||
+             !AGH_GBGETOBJ (GtkRadioMenuItem,  iSFFDFieldProfileTypePSD) ||
+             !AGH_GBGETOBJ (GtkRadioMenuItem,  iSFFDFieldProfileTypeMC)  ||
+             !AGH_GBGETOBJ (GtkRadioMenuItem,  iSFFDFieldProfileTypeSWU) ||
+             !AGH_GBGETOBJ (GtkMenuItem,       iSFFDMarkPhasicEventSpindles) ||
+             !AGH_GBGETOBJ (GtkMenuItem,       iSFFDMarkPhasicEventKComplexes) ||
+             !AGH_GBGETOBJ (GtkMenuItem,       iSFFDMarkPlain) ||
+             !AGH_GBGETOBJ (GtkScrolledWindow, swSFFDField) ||
+             !AGH_GBGETOBJ (GtkTable,          cSFFDSearchButton) ||
+             !AGH_GBGETOBJ (GtkTable,          cSFFDAgainButton) ||
+             !AGH_GBGETOBJ (GtkBox,            cSFFDSearching) ||
+             !AGH_GBGETOBJ (GtkTable,          cSFFDParameters) ||
+             !AGH_GBGETOBJ (GtkTable,          cSFFDCriteria) ||
+             !AGH_GBGETOBJ (GtkButton,         bSFFDSearch) ||
+             !AGH_GBGETOBJ (GtkButton,         bSFFDAgain) ||
+             !AGH_GBGETOBJ (GtkButton,         bSFFDProfileSave) ||
+             !AGH_GBGETOBJ (GtkButton,         bSFFDProfileDiscard) ||
+             !AGH_GBGETOBJ (GtkButton,         bSFFDProfileRevert) ||
+             !AGH_GBGETOBJ (GtkSpinButton,     eSFFDEnvTightness) ||
+             !AGH_GBGETOBJ (GtkSpinButton,     eSFFDBandPassOrder) ||
+             !AGH_GBGETOBJ (GtkSpinButton,     eSFFDBandPassFrom) ||
+             !AGH_GBGETOBJ (GtkSpinButton,     eSFFDBandPassUpto) ||
+             !AGH_GBGETOBJ (GtkSpinButton,     eSFFDDZCDFStep) ||
+             !AGH_GBGETOBJ (GtkSpinButton,     eSFFDDZCDFSigma) ||
+             !AGH_GBGETOBJ (GtkSpinButton,     eSFFDDZCDFSmooth) ||
+             !AGH_GBGETOBJ (GtkSpinButton,     eSFFDParameterA) ||
+             !AGH_GBGETOBJ (GtkSpinButton,     eSFFDParameterB) ||
+             !AGH_GBGETOBJ (GtkSpinButton,     eSFFDParameterC) ||
+             !AGH_GBGETOBJ (GtkSpinButton,     eSFFDParameterD) ||
+             !AGH_GBGETOBJ (GtkSpinButton,     eSFFDIncrement) ||
+             !AGH_GBGETOBJ (GtkHBox,           cSFFDLabelBox) ||
+             !AGH_GBGETOBJ (GtkLabel,          lSFFDParametersBrief) ||
+             !AGH_GBGETOBJ (GtkLabel,          lSFFDFoundInfo) ||
+             !AGH_GBGETOBJ (GtkComboBox,       eSFFDPatternList) ||
+             !AGH_GBGETOBJ (GtkComboBox,       eSFFDChannel) ||
+             !AGH_GBGETOBJ (GtkDialog,         wSFFDPatternSave) ||
+             !AGH_GBGETOBJ (GtkEntry,          eSFFDPatternSaveName) ||
+             !AGH_GBGETOBJ (GtkToggleButton,   eSFFDPatternSaveOriginSubject) ||
+             !AGH_GBGETOBJ (GtkToggleButton,   eSFFDPatternSaveOriginExperiment) ||
+             !AGH_GBGETOBJ (GtkToggleButton,   eSFFDPatternSaveOriginUser) ||
+             !AGH_GBGETOBJ (GtkButton,         bSFFDPatternSaveOK) )
+                throw runtime_error ("Failed to construct SPatternsDialogWidgets");
 
         gtk_combo_box_set_model_properly( eSFFDPatternList, mSFFDPatterns);
         eSFFDPatternList_changed_cb_handler_id =
@@ -87,10 +87,13 @@ SPatternsDialogWidgets (SScoringFacility& SF)
         // filter channels we don't have
         for ( auto &H : SF.channels ) {
                 GtkTreeIter iter;
-                gtk_list_store_append( mSFFDChannels, &iter);
-                gtk_list_store_set( mSFFDChannels, &iter,
-                                    0, H.name(),
-                                    -1);
+                gtk_list_store_append(
+                        mSFFDChannels,
+                        &iter);
+                gtk_list_store_set(
+                        mSFFDChannels, &iter,
+                        0, H.name(),
+                        -1);
         }
         gtk_combo_box_set_model_properly( eSFFDChannel, mSFFDChannels);
         eSFFDChannel_changed_cb_handler_id =
@@ -118,25 +121,30 @@ SPatternsDialogWidgets (SScoringFacility& SF)
         for ( auto& W : {eSFFDEnvTightness,
                          eSFFDBandPassFrom, eSFFDBandPassUpto, eSFFDBandPassOrder,
                          eSFFDDZCDFStep, eSFFDDZCDFSigma, eSFFDDZCDFSmooth} )
-                g_signal_connect( W, "value-changed",
-                                  (GCallback)eSFFD_any_pattern_value_changed_cb,
-                                  this);
+                g_signal_connect(
+                        W, "value-changed",
+                        (GCallback)eSFFD_any_pattern_value_changed_cb,
+                        this);
         for ( auto& W : {eSFFDParameterA, eSFFDParameterB, eSFFDParameterC, eSFFDParameterD} ) {
-                g_signal_connect( W, "value-changed",
-                                  (GCallback)eSFFD_any_criteria_value_changed_cb,
-                                  this);
-                g_signal_connect( W, "focus-in-event",
-                                  (GCallback)eSFFD_any_criteria_focus_in_event_cb,
-                                  this);
+                g_signal_connect(
+                        W, "value-changed",
+                        (GCallback)eSFFD_any_criteria_value_changed_cb,
+                        this);
+                g_signal_connect(
+                        W, "focus-in-event",
+                        (GCallback)eSFFD_any_criteria_focus_in_event_cb,
+                        this);
         }
         for ( auto& W : {eSFFDPatternSaveOriginUser, eSFFDPatternSaveOriginExperiment, eSFFDPatternSaveOriginSubject} )
-                g_signal_connect( W, "toggled",
-                                  (GCallback)eSFFD_any_pattern_origin_toggled_cb,
-                                  this);
+                g_signal_connect(
+                        W, "toggled",
+                        (GCallback)eSFFD_any_pattern_origin_toggled_cb,
+                        this);
         for ( auto& W : {iSFFDFieldProfileTypeRaw, iSFFDFieldProfileTypePSD, iSFFDFieldProfileTypeMC, iSFFDFieldProfileTypeSWU} )
-                g_signal_connect( W, "toggled",
-                                  (GCallback)iSFFD_any_field_profile_type_toggled_cb,
-                                  this);
+                g_signal_connect(
+                        W, "toggled",
+                        (GCallback)iSFFD_any_field_profile_type_toggled_cb,
+                        this);
 
         G_CONNECT_1 (wSFFD, show);
         G_CONNECT_1 (wSFFD, hide);
diff --git a/upstream/src/aghermann/ui/sf/d/patterns-draw.cc b/upstream/src/aghermann/ui/sf/d/patterns-draw.cc
index 7183eba..fc40f3f 100644
--- a/upstream/src/aghermann/ui/sf/d/patterns-draw.cc
+++ b/upstream/src/aghermann/ui/sf/d/patterns-draw.cc
@@ -22,10 +22,11 @@ SScoringFacility::SPatternsDialog::
 set_thing_da_width( const int width)
 {
         static int scrollbar_width = 15;
-        g_object_set( (GObject*)daSFFDThing,
-                      "width-request", da_thing_wd = max( width-scrollbar_width, 600),
-                      "height-request", da_thing_ht,
-                      NULL);
+        g_object_set(
+                (GObject*)daSFFDThing,
+                "width-request", da_thing_wd = max( width-scrollbar_width, 600),
+                "height-request", da_thing_ht,
+                NULL);
 }
 
 void
@@ -33,10 +34,11 @@ SScoringFacility::SPatternsDialog::
 set_field_da_width( const int width)
 {
         static int scrollbar_width = 15;
-        g_object_set( (GObject*)daSFFDField,
-                      "width-request", da_field_wd = max( width-scrollbar_width, 600),
-                      "height-request", da_field_ht,
-                      NULL);
+        g_object_set(
+                (GObject*)daSFFDField,
+                "width-request", da_field_wd = max( width-scrollbar_width, 600),
+                "height-request", da_field_ht,
+                NULL);
 }
 
 
@@ -53,7 +55,7 @@ draw_thing( cairo_t *cr)
       // ticks
         cairo_select_font_face( cr, "sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
         cairo_set_font_size( cr, 9);
-        double        seconds = (double)current_pattern->thing.size() / current_pattern->samplerate;
+        double  seconds = (double)current_pattern->thing.size() / current_pattern->samplerate;
         for ( size_t i8 = 0; (float)i8 / 8 < seconds; ++i8 ) {
                 _p._p.CwB[SExpDesignUI::TColour::sf_ticks].set_source_rgba( cr);
                 cairo_set_line_width( cr, (i8%8 == 0) ? 1. : (i8%4 == 0) ? .6 : .3);
@@ -70,15 +72,16 @@ draw_thing( cairo_t *cr)
                 }
         }
 
-        size_t        run = current_pattern->pattern_size_essential();
+        size_t  run = current_pattern->pattern_size_essential();
 
       // thing
-        int        zeroline = da_thing_ht/2;
+        int     zeroline = da_thing_ht/2;
         cairo_set_source_rgb( cr, 0., 0., 0.);
         cairo_set_line_width( cr, .8);
-        cairo_draw_signal( cr, current_pattern->thing, 0, current_pattern->thing.size(),
-                           da_thing_wd, 0, zeroline,
-                           thing_display_scale);
+        cairo_draw_signal(
+                cr, current_pattern->thing, 0, current_pattern->thing.size(),
+                da_thing_wd, 0, zeroline,
+                thing_display_scale);
         cairo_stroke( cr);
 
         // lines marking out context
@@ -148,7 +151,7 @@ draw_thing( cairo_t *cr)
 
                         dzcdf = sigproc::dzcdf( sigproc::SSignalRef<TFloat> {current_pattern->thing, current_pattern->samplerate},
                                                 Pp2.dzcdf_step, Pp2.dzcdf_sigma, Pp2.dzcdf_smooth);
-                        float        dzcdf_display_scale = da_thing_ht/4. / dzcdf.max();
+                        float   dzcdf_display_scale = da_thing_ht/4. / dzcdf.max();
 
                         cairo_set_source_rgba( cr, 0.3, 0.3, 0.99, .8);
                         cairo_set_line_width( cr, 1.);
diff --git a/upstream/src/aghermann/ui/sf/d/patterns-profiles.cc b/upstream/src/aghermann/ui/sf/d/patterns-profiles.cc
index 09ba44b..1b06b24 100644
--- a/upstream/src/aghermann/ui/sf/d/patterns-profiles.cc
+++ b/upstream/src/aghermann/ui/sf/d/patterns-profiles.cc
@@ -24,8 +24,8 @@ SScoringFacility::SPatternsDialog::
 import_from_selection( SScoringFacility::SChannel& field)
 {
         // double check, possibly redundant after due check in callback
-        double        run_time = field.selection_end_time - field.selection_start_time;
-        size_t        run = field.selection_end - field.selection_start;
+        double  run_time = field.selection_end_time - field.selection_start_time;
+        size_t  run = field.selection_end - field.selection_start;
         if ( run == 0 )
                 return -1;
         if ( run_time > 60. ) {
@@ -43,7 +43,7 @@ import_from_selection( SScoringFacility::SChannel& field)
                      "Sure to proceed with search?") )
                 return -3;
 
-        size_t        context_before = // agh::alg::ensure_within(
+        size_t  context_before = // agh::alg::ensure_within(
                 (field.selection_start < current_pattern->context_pad)
                 ? pattern::SPattern<TFloat>::context_pad - field.selection_start
                 : pattern::SPattern<TFloat>::context_pad,
@@ -82,11 +82,13 @@ import_from_selection( SScoringFacility::SChannel& field)
 
 
 
-
+namespace {
 const char*
         origin_markers[5] = {
         "~", "[S]", "[E]", "[U]", "<S>",
 };
+}
+
 
 string
 make_system_patterns_location()
diff --git a/upstream/src/aghermann/ui/sf/d/patterns.cc b/upstream/src/aghermann/ui/sf/d/patterns.cc
index 47d1185..090d013 100644
--- a/upstream/src/aghermann/ui/sf/d/patterns.cc
+++ b/upstream/src/aghermann/ui/sf/d/patterns.cc
@@ -37,20 +37,20 @@ SPatternsDialog (SScoringFacility& parent)
         draw_match_index (true),
         _p (parent)
 {
-        W_V.reg( eSFFDEnvTightness,         &Pp2.env_scope);
-        W_V.reg( eSFFDBandPassOrder,        &Pp2.bwf_order);
-        W_V.reg( eSFFDBandPassFrom,         &Pp2.bwf_ffrom);
-        W_V.reg( eSFFDBandPassUpto,         &Pp2.bwf_fupto);
-        W_V.reg( eSFFDDZCDFStep,         &Pp2.dzcdf_step);
-        W_V.reg( eSFFDDZCDFSigma,         &Pp2.dzcdf_sigma);
-        W_V.reg( eSFFDDZCDFSmooth,         &Pp2.dzcdf_smooth);
+        W_V.reg( eSFFDEnvTightness,  &Pp2.env_scope);
+        W_V.reg( eSFFDBandPassOrder, &Pp2.bwf_order);
+        W_V.reg( eSFFDBandPassFrom,  &Pp2.bwf_ffrom);
+        W_V.reg( eSFFDBandPassUpto,  &Pp2.bwf_fupto);
+        W_V.reg( eSFFDDZCDFStep,     &Pp2.dzcdf_step);
+        W_V.reg( eSFFDDZCDFSigma,    &Pp2.dzcdf_sigma);
+        W_V.reg( eSFFDDZCDFSmooth,   &Pp2.dzcdf_smooth);
 
-        W_V.reg( eSFFDParameterA,         &get<0>(criteria));
-        W_V.reg( eSFFDParameterB,         &get<1>(criteria));
-        W_V.reg( eSFFDParameterC,         &get<2>(criteria));
-        W_V.reg( eSFFDParameterD,         &get<3>(criteria));
+        W_V.reg( eSFFDParameterA,    &get<0>(criteria));
+        W_V.reg( eSFFDParameterB,    &get<1>(criteria));
+        W_V.reg( eSFFDParameterC,    &get<2>(criteria));
+        W_V.reg( eSFFDParameterD,    &get<3>(criteria));
 
-        W_V.reg( eSFFDIncrement,         &increment);
+        W_V.reg( eSFFDIncrement,     &increment);
 
         atomic_up();
 
@@ -168,7 +168,7 @@ void
 SScoringFacility::SPatternsDialog::
 setup_controls_for_find()
 {
-        bool        have_any = current_pattern != patterns.end();
+        bool    have_any = current_pattern != patterns.end();
 
         gtk_widget_set_visible( (GtkWidget*)cSFFDSearchButton, have_any and TRUE);
         gtk_widget_set_visible( (GtkWidget*)cSFFDSearching, FALSE);
@@ -228,7 +228,7 @@ void
 SScoringFacility::SPatternsDialog::
 set_profile_manage_buttons_visibility()
 {
-        bool        have_any = current_pattern != patterns.end(),
+        bool    have_any = current_pattern != patterns.end(),
                 is_transient = have_any && current_pattern->origin == pattern::TOrigin::transient,
                 is_modified  = have_any && not (current_pattern->Pp == Pp2) and not (current_pattern->criteria == criteria);
         gtk_widget_set_visible( (GtkWidget*)bSFFDProfileSave, have_any);
diff --git a/upstream/src/aghermann/ui/sf/d/patterns.hh b/upstream/src/aghermann/ui/sf/d/patterns.hh
index 09e48d5..966bc84 100644
--- a/upstream/src/aghermann/ui/sf/d/patterns.hh
+++ b/upstream/src/aghermann/ui/sf/d/patterns.hh
@@ -27,10 +27,11 @@ namespace ui {
 
 struct SPatternsDialogWidgets {
 
-        SPatternsDialogWidgets (SScoringFacility&); // need access to mAllChannels
+        explicit SPatternsDialogWidgets (SScoringFacility&); // need access to mAllChannels
        ~SPatternsDialogWidgets ();
 
-        GtkBuilder *builder;
+        GtkBuilder
+                *builder;
 
         GtkListStore
                 *mSFFDPatterns,
@@ -77,8 +78,7 @@ struct SPatternsDialogWidgets {
                 *eSFFDParameterA, *eSFFDParameterB,
                 *eSFFDParameterC, *eSFFDParameterD,
                 *eSFFDIncrement;
-        GtkHBox
-                *cSFFDLabelBox;
+        GtkHBox *cSFFDLabelBox;
         GtkLabel
                 *lSFFDParametersBrief,
                 *lSFFDFoundInfo;
@@ -92,7 +92,7 @@ struct SPatternsDialogWidgets {
                 *eSFFDPatternSaveOriginUser;
         GtkButton
                 *bSFFDPatternSaveOK;
-        gulong        eSFFDChannel_changed_cb_handler_id,
+        gulong  eSFFDChannel_changed_cb_handler_id,
                 eSFFDPatternList_changed_cb_handler_id;
 };
 
@@ -103,7 +103,7 @@ struct SScoringFacility::SPatternsDialog
         DELETE_DEFAULT_METHODS (SPatternsDialog);
 
       // ctor, dtor
-        SPatternsDialog (SScoringFacility& parent);
+        explicit SPatternsDialog (SScoringFacility& parent);
        ~SPatternsDialog ();
 
       // saved patterns
@@ -123,7 +123,7 @@ struct SScoringFacility::SPatternsDialog
       // finding tool
           pattern::SPatternPPack<TFloat>
                 Pp2;
-        double        increment; // in seconds
+        double  increment; // in seconds
 
       // matches
         pattern::CMatch<TFloat>
@@ -132,11 +132,11 @@ struct SScoringFacility::SPatternsDialog
                 diff_line;
         vector<size_t>
                 occurrences;
-        size_t        highlighted_occurrence;
+        size_t  highlighted_occurrence;
         void search();
         size_t find_occurrences();
         size_t nearest_occurrence( double) const;
-        int        now_tweaking; // limit draw similarity index to this item
+        int     now_tweaking; // limit draw similarity index to this item
 
       // field
         SScoringFacility::SChannel
@@ -153,13 +153,13 @@ struct SScoringFacility::SPatternsDialog
         void update_field_check_menu_items();
 
       // draw
-        bool        suppress_w_v:1,
+        bool    suppress_w_v:1,
                 suppress_redraw:1,
                 draw_details:1,
                 draw_match_index:1;
         void draw_thing( cairo_t*);
         void draw_field( cairo_t*);
-        float        thing_display_scale,
+        float   thing_display_scale,
                 field_display_scale;
 
       // widgets
@@ -182,7 +182,7 @@ struct SScoringFacility::SPatternsDialog
         static const int
                 da_thing_ht = 200,
                 da_field_ht = 160;
-        int        da_thing_wd,
+        int     da_thing_wd,
                 da_field_wd;
         void set_thing_da_width( int);
         void set_field_da_width( int);
diff --git a/upstream/src/aghermann/ui/sf/d/patterns_cb.cc b/upstream/src/aghermann/ui/sf/d/patterns_cb.cc
index 5888814..bfc21c3 100644
--- a/upstream/src/aghermann/ui/sf/d/patterns_cb.cc
+++ b/upstream/src/aghermann/ui/sf/d/patterns_cb.cc
@@ -263,12 +263,13 @@ bSFFDSearch_clicked_cb(
         FD.setup_controls_for_tune();
         gtk_label_set_markup(
                 FD.lSFFDParametersBrief,
-                snprintf_buf( "A: <b>%g</b>  "
-                              "B: <b>%g</b>/<b>%g</b>/<b>%d</b>  "
-                              "C: <b>%g</b>/<b>%g</b>/<b>%d</b>",
-                              FD.Pp2.env_scope,
-                              FD.Pp2.bwf_ffrom, FD.Pp2.bwf_fupto, FD.Pp2.bwf_order,
-                              FD.Pp2.dzcdf_step, FD.Pp2.dzcdf_sigma, FD.Pp2.dzcdf_smooth));
+                snprintf_buf(
+                        "A: <b>%g</b>  "
+                        "B: <b>%g</b>/<b>%g</b>/<b>%d</b>  "
+                        "C: <b>%g</b>/<b>%g</b>/<b>%d</b>",
+                        FD.Pp2.env_scope,
+                        FD.Pp2.bwf_ffrom, FD.Pp2.bwf_fupto, FD.Pp2.bwf_order,
+                        FD.Pp2.dzcdf_step, FD.Pp2.dzcdf_sigma, FD.Pp2.dzcdf_smooth));
 
         gtk_widget_queue_draw( (GtkWidget*)FD.daSFFDField);
 
diff --git a/upstream/src/aghermann/ui/sf/d/phasediff-construct.cc b/upstream/src/aghermann/ui/sf/d/phasediff-construct.cc
index afb2675..a9eb0b3 100644
--- a/upstream/src/aghermann/ui/sf/d/phasediff-construct.cc
+++ b/upstream/src/aghermann/ui/sf/d/phasediff-construct.cc
@@ -28,23 +28,26 @@ SPhasediffDialogWidgets (SScoringFacility& SF)
         mSFPDChannels =
                 gtk_list_store_new( 1, G_TYPE_STRING);
 
-        if ( !(AGH_GBGETOBJ (GtkDialog,                wSFPD)) ||
-             !(AGH_GBGETOBJ (GtkDrawingArea,        daSFPD)) ||
-             !(AGH_GBGETOBJ (GtkComboBox,        eSFPDChannelA)) ||
-             !(AGH_GBGETOBJ (GtkComboBox,        eSFPDChannelB)) ||
-             !(AGH_GBGETOBJ (GtkSpinButton,        eSFPDFreqFrom)) ||
-             !(AGH_GBGETOBJ (GtkSpinButton,        eSFPDBandwidth)) ||
-             !(AGH_GBGETOBJ (GtkScaleButton,        eSFPDSmooth)) )
+        if ( !(AGH_GBGETOBJ (GtkDialog,      wSFPD)) ||
+             !(AGH_GBGETOBJ (GtkDrawingArea, daSFPD)) ||
+             !(AGH_GBGETOBJ (GtkComboBox,    eSFPDChannelA)) ||
+             !(AGH_GBGETOBJ (GtkComboBox,    eSFPDChannelB)) ||
+             !(AGH_GBGETOBJ (GtkSpinButton,  eSFPDFreqFrom)) ||
+             !(AGH_GBGETOBJ (GtkSpinButton,  eSFPDBandwidth)) ||
+             !(AGH_GBGETOBJ (GtkScaleButton, eSFPDSmooth)) )
                 throw runtime_error ("Failed to construct SF widgets (11)");
 
         // filter channels we don't have
         for ( auto &H : SF.channels )
                 if ( H.schannel().type() == sigfile::SChannel::TType::eeg ) {
                         GtkTreeIter iter;
-                        gtk_list_store_append( mSFPDChannels, &iter);
-                        gtk_list_store_set( mSFPDChannels, &iter,
-                                            0, H.name(),
-                                            -1);
+                        gtk_list_store_append(
+                                mSFPDChannels,
+                                &iter);
+                        gtk_list_store_set(
+                                mSFPDChannels, &iter,
+                                0, H.name(),
+                                -1);
                 }
 
         gtk_combo_box_set_model_properly(
diff --git a/upstream/src/aghermann/ui/sf/d/phasediff.cc b/upstream/src/aghermann/ui/sf/d/phasediff.cc
index 65bfb6e..899cc74 100644
--- a/upstream/src/aghermann/ui/sf/d/phasediff.cc
+++ b/upstream/src/aghermann/ui/sf/d/phasediff.cc
@@ -60,8 +60,9 @@ update_course()
         if ( course.size() == 0 )
                 course.resize( _p.total_pages());
         for ( size_t p = 0; p < course.size()-1; ++p ) {
-                size_t        pa = _p.pagesize() * channel1->samplerate() *  p,
+                size_t  pa = _p.pagesize() * channel1->samplerate() *  p,
                         pz = _p.pagesize() * channel1->samplerate() * (p+1);
+                auto sr = channel1 -> samplerate();
                 course[p] =
                         (channel1->artifacts.region_dirty_fraction(pa, pz) > .2 ||
                          channel2->artifacts.region_dirty_fraction(pa, pz) > .2)
@@ -69,11 +70,11 @@ update_course()
                         : sigproc::phase_diff(
                                 sigproc::SSignalRef<TFloat> {
                                         use_original_signal ? channel1->signal_original : channel1->signal_filtered,
-                                        channel1 -> samplerate()
+                                        sr
                                 },
                                 sigproc::SSignalRef<TFloat> {
                                         use_original_signal ? channel2->signal_original : channel2->signal_filtered,
-                                        channel1 -> samplerate()
+                                        sr
                                 },
                                 pa, pz,
                                 from, upto,
@@ -91,9 +92,10 @@ channel_from_cbox( GtkComboBox *cbox)
                 return nullptr;
 
         char *entry;
-        gtk_tree_model_get( gtk_combo_box_get_model( cbox), &iter,
-                            0, &entry,
-                            -1);
+        gtk_tree_model_get(
+                gtk_combo_box_get_model( cbox), &iter,
+                0, &entry,
+                -1);
         for ( auto &H : _p.channels )
                 if ( strcmp( entry, H.name()) == 0 )
                         return &H;
@@ -111,9 +113,10 @@ preselect_channel( GtkComboBox *cbox, const string& ch)
         valid = gtk_tree_model_get_iter_first( model, &iter);
         while ( valid ) {
                 char *entry;
-                gtk_tree_model_get( model, &iter,
-                                    0, &entry,
-                                    -1);
+                gtk_tree_model_get(
+                        model, &iter,
+                        0, &entry,
+                        -1);
                 unique_ptr<void,void(*)(void*)> entry_deleter (entry, free);
 
                 if ( entry == ch ) {
@@ -157,11 +160,11 @@ draw( cairo_t* cr, const int wd, const int ht)
 
       // psd course in selected freq range
         {
-                auto        C1 = channel1->crecording.psd_profile.course( from, upto);
-//                        C2 = channel2->crecording.psd_profile.course( from, upto) * display_scale + ht/2;
+                auto    C1 = channel1->crecording.psd_profile.course( from, upto);
+                      //C2 = channel2->crecording.psd_profile.course( from, upto) * display_scale + ht/2;
 
                 ED.CwB[SExpDesignUI::TColour::sf_profile_psd].set_source_rgba( cr, .5);
-                auto        scale =
+                auto    scale =
                         agh::alg::calibrate_display_scale( C1, C1.size(), ht/2.);
                 cairo_move_to( cr, 0, ht - C1[0]);
                 for ( size_t i = 1; i < C1.size(); ++i )
@@ -182,7 +185,7 @@ draw( cairo_t* cr, const int wd, const int ht)
                 cairo_stroke( cr);
 
                 cairo_set_font_size( cr, 10);
-                float        hours4 = channel1->crecording.F().recording_time() / 3600. * 4;
+                float   hours4 = channel1->crecording.F().recording_time() / 3600. * 4;
                 for ( size_t i = 1; i < hours4; ++i ) {
                         unsigned tick_pos = (float)i / hours4 * wd;
                         cairo_move_to( cr, tick_pos, 0);
@@ -210,10 +213,10 @@ draw( cairo_t* cr, const int wd, const int ht)
                 cairo_set_line_width( cr, .8);
                 for ( size_t p = 1; p < tmp.size()-1; ++p )
                         if ( isfinite(tmp[p-1]) && isfinite(tmp[p]) ) {
-                                cairo_move_to( cr,
-                                               (float)(p-1)/(tmp.size()-1) * wd, tmp[p-1] * 1000 * display_scale + ht/2);
-                                cairo_line_to( cr,
-                                               (float)(p  )/(tmp.size()-1) * wd, tmp[p  ] * 1000 * display_scale + ht/2);
+                                cairo_move_to(
+                                        cr, (float)(p-1)/(tmp.size()-1) * wd, tmp[p-1] * 1000 * display_scale + ht/2);
+                                cairo_line_to(
+                                        cr, (float)(p  )/(tmp.size()-1) * wd, tmp[p  ] * 1000 * display_scale + ht/2);
                                 cairo_stroke( cr);
                         }
         }
diff --git a/upstream/src/aghermann/ui/sf/d/phasediff.hh b/upstream/src/aghermann/ui/sf/d/phasediff.hh
index 6fa448a..caa09ea 100644
--- a/upstream/src/aghermann/ui/sf/d/phasediff.hh
+++ b/upstream/src/aghermann/ui/sf/d/phasediff.hh
@@ -25,10 +25,11 @@ namespace ui {
 
 struct SPhasediffDialogWidgets {
 
-        SPhasediffDialogWidgets (SScoringFacility&);
+        explicit SPhasediffDialogWidgets (SScoringFacility&);
        ~SPhasediffDialogWidgets ();
 
-        GtkBuilder *builder;
+        GtkBuilder
+                *builder;
 
         GtkListStore
                 *mSFPDChannels;
@@ -55,23 +56,23 @@ struct SScoringFacility::SPhasediffDialog
 
         DELETE_DEFAULT_METHODS (SPhasediffDialog);
 
-        SPhasediffDialog (SScoringFacility&);
+        explicit SPhasediffDialog (SScoringFacility&);
 
         const SScoringFacility::SChannel
                 *channel1,
                 *channel2;
-        bool        use_original_signal;
-        float        from,
+        bool    use_original_signal;
+        float   from,
                 upto;
 
         unsigned
                 bwf_order,
                 scope;
-        float        display_scale;
+        float   display_scale;
 
         valarray<TFloat>
                 course;
-        size_t        smooth_side;
+        size_t  smooth_side;
         void update_course();
 
         const SScoringFacility::SChannel* channel_from_cbox( GtkComboBox *cbox);
diff --git a/upstream/src/aghermann/ui/sf/d/rk1968.hh b/upstream/src/aghermann/ui/sf/d/rk1968.hh
index 3497e4d..3a05e6a 100644
--- a/upstream/src/aghermann/ui/sf/d/rk1968.hh
+++ b/upstream/src/aghermann/ui/sf/d/rk1968.hh
@@ -25,11 +25,11 @@ namespace aghui {
 
 struct SRK1968DialogWidgets {
 
-        SRK1968DialogWidgets (SScoringFacility&); // need access to mAllChannels
+        explicit SRK1968DialogWidgets (SScoringFacility&); // need access to mAllChannels
        ~SRK1968DialogWidgets ();
 
-        GtkBuilder *builder;
-
+        GtkBuilder
+                *builder;
         
         GtkListStore
                 *mSFFDPatterns,
@@ -47,13 +47,13 @@ struct SRK1968DialogWidgets {
                 *cSFFDCriteria,
                 *cSFFDSearchButton,
                 *cSFFDAgainButton;
-        GtkBox        *cSFFDSearching;
+        GtkBox  *cSFFDSearching;
         GtkDrawingArea
                 *daSFFDThing,
                 *daSFFDField;
         GtkMenuBar
                 *iibSFFDMenu;
-        GtkMenu        *iiSFFDField,
+        GtkMenu *iiSFFDField,
                 *iiSFFDFieldProfileTypes;
         GtkCheckMenuItem
                 *iSFFDFieldDrawMatchIndex;
@@ -91,7 +91,7 @@ struct SRK1968DialogWidgets {
                 *eSFFDPatternSaveOriginUser;
         GtkButton
                 *bSFFDPatternSaveOK;
-        gulong        eSFFDChannel_changed_cb_handler_id,
+        gulong  eSFFDChannel_changed_cb_handler_id,
                 eSFFDPatternList_changed_cb_handler_id;
 };
 
@@ -102,7 +102,7 @@ struct SScoringFacility::SPatternsDialog
         DELETE_DEFAULT_METHODS (SPatternsDialog);
 
       // ctor, dtor
-        SPatternsDialog (SScoringFacility& parent);
+        explicit SPatternsDialog (SScoringFacility& parent);
        ~SPatternsDialog ();
 
       // saved patterns
@@ -122,7 +122,7 @@ struct SScoringFacility::SPatternsDialog
       // finding tool
           pattern::SPatternPPack<TFloat>
                 Pp2;
-        double        increment; // in seconds
+        double  increment; // in seconds
 
       // matches
         pattern::CMatch<TFloat>
@@ -131,11 +131,11 @@ struct SScoringFacility::SPatternsDialog
                 diff_line;
         vector<size_t>
                 occurrences;
-        size_t        highlighted_occurrence;
+        size_t  highlighted_occurrence;
         void search();
         size_t find_occurrences();
         size_t nearest_occurrence( double) const;
-        int        now_tweaking; // limit draw similarity index to this item
+        int     now_tweaking; // limit draw similarity index to this item
 
       // field
         SScoringFacility::SChannel
@@ -152,13 +152,13 @@ struct SScoringFacility::SPatternsDialog
         void update_field_check_menu_items();
 
       // draw
-        bool        suppress_w_v:1,
+        bool    suppress_w_v:1,
                 suppress_redraw:1,
                 draw_details:1,
                 draw_match_index:1;
         void draw_thing( cairo_t*);
         void draw_field( cairo_t*);
-        float        thing_display_scale,
+        float   thing_display_scale,
                 field_display_scale;
 
       // widgets
@@ -181,7 +181,7 @@ struct SScoringFacility::SPatternsDialog
         static const int
                 da_thing_ht = 200,
                 da_field_ht = 160;
-        int        da_thing_wd,
+        int     da_thing_wd,
                 da_field_wd;
         void set_thing_da_width( int);
         void set_field_da_width( int);
diff --git a/upstream/src/aghermann/ui/sm/sm-construct.cc b/upstream/src/aghermann/ui/sm/sm-construct.cc
index 19a87f7..429ff0e 100644
--- a/upstream/src/aghermann/ui/sm/sm-construct.cc
+++ b/upstream/src/aghermann/ui/sm/sm-construct.cc
@@ -40,23 +40,24 @@ construct_widgets()
         mSessionChooserList =
                 gtk_list_store_new( 3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
 
-        if ( !(AGH_GBGETOBJ (GtkDialog,         wSessionChooser)) ||
-             !(AGH_GBGETOBJ (GtkTreeView,        tvSessionChooserList)) ||
-             !(AGH_GBGETOBJ (GtkButton,                bSessionChooserOpen)) ||
-             !(AGH_GBGETOBJ (GtkButton,                bSessionChooserClose)) ||
-             !(AGH_GBGETOBJ (GtkButton,                bSessionChooserCreateNew)) ||
-             !(AGH_GBGETOBJ (GtkButton,                bSessionChooserRemove)) ||
-             !(AGH_GBGETOBJ (GtkButton,                bSessionChooserQuit)) ||
-             !(AGH_GBGETOBJ (GtkStatusbar,        sbSessionChooserStatusBar)) )
+        if ( !(AGH_GBGETOBJ (GtkDialog,    wSessionChooser)) ||
+             !(AGH_GBGETOBJ (GtkTreeView,  tvSessionChooserList)) ||
+             !(AGH_GBGETOBJ (GtkButton,    bSessionChooserOpen)) ||
+             !(AGH_GBGETOBJ (GtkButton,    bSessionChooserClose)) ||
+             !(AGH_GBGETOBJ (GtkButton,    bSessionChooserCreateNew)) ||
+             !(AGH_GBGETOBJ (GtkButton,    bSessionChooserRemove)) ||
+             !(AGH_GBGETOBJ (GtkButton,    bSessionChooserQuit)) ||
+             !(AGH_GBGETOBJ (GtkStatusbar, sbSessionChooserStatusBar)) )
                 return -1;
 
         G_CONNECT_1 (wSessionChooser, show);
         G_CONNECT_1 (wSessionChooser, destroy);
 
         G_CONNECT_2 (tvSessionChooserList, row, activated);
-        g_signal_connect( gtk_tree_view_get_selection( tvSessionChooserList), "changed",
-                          (GCallback)tvSessionChooserList_changed_cb,
-                          this);
+        g_signal_connect(
+                gtk_tree_view_get_selection( tvSessionChooserList), "changed",
+                (GCallback)tvSessionChooserList_changed_cb,
+                this);
         G_CONNECT_1 (bSessionChooserOpen, clicked);
         G_CONNECT_1 (bSessionChooserClose, clicked);
         G_CONNECT_1 (bSessionChooserCreateNew, clicked);
@@ -74,15 +75,19 @@ construct_widgets()
         int c = 0;
         for ( auto& C : {"Last visited", "Recordings", "Directory"} ) {
                 renderer = gtk_cell_renderer_text_new();
-                g_object_set( (GObject*)renderer,
-                              "editable", FALSE,
-                              "xalign", (c != 2) ? 1. : 0.,
-                              NULL);
-                g_object_set_data( (GObject*)renderer, "column", GINT_TO_POINTER (c));
-                gtk_tree_view_insert_column_with_attributes( tvSessionChooserList,
-                                                             -1, C, renderer,
-                                                             "text", c,
-                                                             NULL);
+                g_object_set(
+                        (GObject*)renderer,
+                        "editable", FALSE,
+                        "xalign", (c != 2) ? 1. : 0.,
+                        NULL);
+                g_object_set_data(
+                        (GObject*)renderer,
+                        "column", GINT_TO_POINTER (c));
+                gtk_tree_view_insert_column_with_attributes(
+                        tvSessionChooserList,
+                        -1, C, renderer,
+                        "text", c,
+                        NULL);
                 ++c;
         }
 
diff --git a/upstream/src/aghermann/ui/sm/sm.hh b/upstream/src/aghermann/ui/sm/sm.hh
index b0a5cbf..cc6f230 100644
--- a/upstream/src/aghermann/ui/sm/sm.hh
+++ b/upstream/src/aghermann/ui/sm/sm.hh
@@ -31,12 +31,12 @@ namespace agh {
 namespace ui {
 
 struct SSession : public string {
-        size_t        n_groups,
+        size_t  n_groups,
                 n_subjects,
                 n_recordings;
-        time_t        last_visited;
+        time_t  last_visited;
         // possibly something else
-        SSession (string dir_)
+        explicit SSession (string dir_)
               : string (dir_),
                 n_groups (-1), n_subjects (-1), n_recordings (-1),
                 last_visited (0)
@@ -50,12 +50,12 @@ struct SSession : public string {
 struct SSessionChooser {
         DELETE_DEFAULT_METHODS (SSessionChooser);
 
-        SSessionChooser (const char*);
+        explicit SSessionChooser (const char*);
        ~SSessionChooser ();
 
-        string        title;
-        string        filename;
-        int        last_dir_no;
+        string  title;
+        string  filename;
+        int     last_dir_no;
         list<SSession>
                 sessions;
 
@@ -66,15 +66,14 @@ struct SSessionChooser {
         void write_sessionrc() const;
         string get_dir( int) const;
         string get_dir() const
-                {
-                        return get_dir( last_dir_no);
-                }
+                { return get_dir( last_dir_no); }
+
         int open_selected_session();
         void close_current_session();
 
         void buf_on_status_bar( bool ensure = true);
         void sb_progress_indicator( const char*, size_t n, size_t i);
-        guint        sbChooserContextIdGeneral;
+        guint   sbChooserContextIdGeneral;
 
         // widgets
         int construct_widgets();
diff --git a/upstream/src/aghermann/ui/sm/sm_cb.cc b/upstream/src/aghermann/ui/sm/sm_cb.cc
index 2d4eb8a..2eaa6ab 100644
--- a/upstream/src/aghermann/ui/sm/sm_cb.cc
+++ b/upstream/src/aghermann/ui/sm/sm_cb.cc
@@ -106,20 +106,7 @@ bSessionChooserQuit_clicked_cb(
         if ( SC.ed )
                 SC.close_current_session();
 
-        // GtkTreeSelection *selection = gtk_tree_view_get_selection( (GtkTreeView*)SC.tvSessionChooserList);
-        // GtkTreeModel *model;
-        // GList *paths = gtk_tree_selection_get_selected_rows( selection, &model);
-        // if ( paths ) {
-        //         GtkTreePath *path = (GtkTreePath*) g_list_nth_data( paths, 0);
-        //         g_list_free( paths);
-
-        //         SC.last_dir_no = gtk_tree_path_get_indices( path)[0];
-
-        //         // gtk_tree_path_free( path); // leak it
-        // }
-
         // user is quitting from the selector, not directly from an expdesign, so
-
         SC.write_sessionrc();
 
         gtk_main_quit();
@@ -162,9 +149,10 @@ bSessionChooserCreateNew_clicked_cb(
                         gtk_list_store_append(
                                 SC.mSessionChooserList, &iter);
 
-                gtk_list_store_set( SC.mSessionChooserList, &iter,
-                                    2, new_dir,
-                                    -1);
+                gtk_list_store_set(
+                        SC.mSessionChooserList, &iter,
+                        2, new_dir,
+                        -1);
 
                 if ( path )
                         gtk_tree_path_next( path);
@@ -203,10 +191,13 @@ bSessionChooserRemove_clicked_cb(
 
         GtkTreeIter iter;
         char *entry;
-        gtk_tree_model_get_iter( model, &iter, path);
-        gtk_tree_model_get( model, &iter,
-                            0, &entry,
-                            -1);
+        gtk_tree_model_get_iter(
+                model,
+                &iter, path);
+        gtk_tree_model_get(
+                model, &iter,
+                0, &entry,
+                -1);
         // SC.sessions.remove_if( [&entry]( SSession& S) { return S == entry; });
         gtk_list_store_remove( SC.mSessionChooserList, &iter);
         SC._sync_model_to_list();
diff --git a/upstream/src/aghermann/ui/ui++.hh b/upstream/src/aghermann/ui/ui++.hh
index dd130c7..c238c88 100644
--- a/upstream/src/aghermann/ui/ui++.hh
+++ b/upstream/src/aghermann/ui/ui++.hh
@@ -121,16 +121,16 @@ contrasting_to( const GdkColor* c)
 class SBusyBlock {
         DELETE_DEFAULT_METHODS (SBusyBlock);
     public:
-        SBusyBlock (GtkWidget* w_)
+        explicit SBusyBlock (GtkWidget* w_)
               : w (w_)
                 {
                         lock();
                 }
         // delegating ctors
-        SBusyBlock (GtkWindow* w)
+        explicit SBusyBlock (GtkWindow* w)
               : SBusyBlock ((GtkWidget*)w)
                 {}
-        SBusyBlock (GtkDialog* w)
+        explicit SBusyBlock (GtkDialog* w)
               : SBusyBlock ((GtkWidget*)w)
                 {}
 

-- 
Alioth's /git/debian-med/git-commit-notice on /srv/git.debian.org/git/debian-med/aghermann.git



More information about the debian-med-commit mailing list