From 073e7239d17df606cce3b3c9587d9dafba36e0f7 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Sun, 11 Jul 2021 17:14:06 -0400 Subject: [PATCH] REF remove dead code --- core | 2 +- drawing/Common.lua | 164 ----------------------------------------- drawing/FileSystem.lua | 28 ------- drawing/Memory.lua | 26 ------- drawing/Processor.lua | 12 --- 5 files changed, 1 insertion(+), 231 deletions(-) diff --git a/core b/core index d21bbf5..b3e511f 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit d21bbf57059f91a63e01fdb874f02e2c603cb85b +Subproject commit b3e511fb82aa9886b8f24f520fce2c3cb8473121 diff --git a/drawing/Common.lua b/drawing/Common.lua index cf02023..ec0e140 100644 --- a/drawing/Common.lua +++ b/drawing/Common.lua @@ -12,8 +12,6 @@ local ScalePlot = require 'ScalePlot' local HEADER_HEIGHT = 45 local HEADER_FONT_SIZE = 15 -- TODO move all this font stuff to the theme file --- local HEADER_FONT_SLANT = CAIRO_FONT_SLANT_NORMAL --- local HEADER_FONT_WEIGHT = CAIRO_FONT_WEIGHT_BOLD local HEADER_UNDERLINE_CAP = CAIRO_LINE_CAP_ROUND local HEADER_UNDERLINE_OFFSET = -20 local HEADER_UNDERLINE_THICKNESS = 3 @@ -65,18 +63,6 @@ M.Header = function(x, y, w, s) local underline_y = bottom_y + HEADER_UNDERLINE_OFFSET local obj = { - -- text = _G_Widget_.Text{ - -- x = x, - -- y = y, - -- text = s, - -- font_spec = M.make_font_spec(_G_Patterns_.FONT, HEADER_FONT_SIZE, true), - -- -- font_size = HEADER_FONT_SIZE, - -- x_align = 'left', - -- y_align = 'top', - -- text_color = _G_Patterns_.HEADER_FG, - -- -- slant = HEADER_FONT_SLANT, - -- -- weight = HEADER_FONT_WEIGHT - -- }, text = _G_Widget_.plainText( _G_Widget_.make_point(x, y), s, @@ -88,13 +74,6 @@ M.Header = function(x, y, w, s) ) ), bottom_y = bottom_y, - -- underline = _G_Widget_.Line{ - -- p1 = {x = x, y = underline_y}, - -- p2 = {x = x + w, y = underline_y}, - -- thickness = HEADER_UNDERLINE_THICKNESS, - -- line_pattern = _G_Patterns_.HEADER_FG, - -- cap = HEADER_UNDERLINE_CAP - -- } underline = _G_Widget_.Line( _G_Widget_.make_point(x, underline_y), _G_Widget_.make_point(x + w, underline_y), @@ -135,18 +114,6 @@ M.percent_label_style = _G_Widget_.label_style( ) M.initThemedLabelPlot = function(x, y, w, h, label_style) - -- return _G_Widget_.LabelPlot{ - -- x = x, - -- y = y, - -- width = w, - -- height = h, - -- outline_pattern = _G_Patterns_.BORDER_FG, - -- intrvl_pattern = _G_Patterns_.BORDER_FG, - -- data_line_pattern = _G_Patterns_.PLOT_FILL_BORDER_PRIMARY, - -- data_fill_pattern = _G_Patterns_.PLOT_FILL_BG_PRIMARY, - -- label_color = _G_Patterns_.INACTIVE_TEXT_FG, - -- label_font_spec = M.label_font_spec, - -- } return _G_Widget_.LabelPlot( _G_Widget_.make_box(_G_Widget_.make_point(x, y), w, h), M.default_plot_style, @@ -159,14 +126,6 @@ end M.initPercentPlot = function(x, y, w, h, spacing, label) return { - -- label = _G_Widget_.Text{ - -- x = x, - -- y = y, - -- text = label, - -- x_align = 'left', - -- text_color = _G_Patterns_.INACTIVE_TEXT_FG, - -- font_spec = M.normal_font_spec, - -- }, label = _left_text(_G_Widget_.make_point(x, y), label), value = _G_Widget_.formattedThresholdText( _G_Widget_.make_point(x + w, y), @@ -178,17 +137,6 @@ M.initPercentPlot = function(x, y, w, h, spacing, label) 80 ) ), - -- value = _G_Widget_.CriticalText{ - -- x = x + w, - -- y = y, - -- x_align = 'right', - -- y_align = 'center', - -- append_end = '%', - -- critical_limit = 80, - -- text_color = _G_Patterns_.PRIMARY_FG, - -- critical_color = _G_Patterns_.PRIMARY_FG, - -- font_spec = M.normal_font_spec, - -- }, plot = M.initThemedLabelPlot( x, y + spacing, @@ -220,19 +168,6 @@ end M.base_2_scale_data = _G_Widget_.scale_data(2, 1, 0.9) M.initThemedScalePlot = function(x, y, w, h, f) - -- return _G_Widget_.ScalePlot{ - -- x = x, - -- y = y, - -- width = w, - -- height = h, - -- y_label_func = f, - -- outline_pattern = _G_Patterns_.BORDER_FG, - -- intrvl_pattern = _G_Patterns_.BORDER_FG, - -- data_line_pattern = _G_Patterns_.PLOT_FILL_BORDER_PRIMARY, - -- data_fill_pattern = _G_Patterns_.PLOT_FILL_BG_PRIMARY, - -- label_color = _G_Patterns_.INACTIVE_TEXT_FG, - -- label_font_spec = M.label_font_spec, - -- } return _G_Widget_.ScalePlot( _G_Widget_.make_box(_G_Widget_.make_point(x, y), w, h), M.default_plot_style, @@ -251,25 +186,10 @@ end M.initLabeledScalePlot = function(x, y, w, h, f, spacing, label) return { - -- label = _G_Widget_.Text{ - -- x = x, - -- y = y, - -- text = label, - -- x_align = 'left', - -- text_color = _G_Patterns_.INACTIVE_TEXT_FG, - -- font_spec = M.normal_font_spec, - -- }, label = _left_text( _G_Widget_.make_point(x, y), label ), - -- value = _G_Widget_.Text{ - -- x = x + w, - -- y = y, - -- x_align = 'right', - -- text_color = _G_Patterns_.PRIMARY_FG, - -- font_spec = M.normal_font_spec, - -- }, value = _right_text( _G_Widget_.make_point(x + w, y), label @@ -317,17 +237,6 @@ end M.initTextRing = function(x, y, r, fmt, limit) return { ring = M.initRing(x, y, r), - -- value = _G_Widget_.CriticalText{ - -- x = x, - -- y = y, - -- x_align = 'center', - -- y_align = 'center', - -- append_end = append_end, - -- critical_limit = limit, - -- text_color = _G_Patterns_.PRIMARY_FG, - -- critical_color = _G_Patterns_.CRITICAL_FG, - -- font_spec = M.normal_font_spec, - -- }, value = _G_Widget_.formattedThresholdText( _G_Widget_.make_point(x, y), nil, @@ -362,11 +271,6 @@ end -- separator (eg a horizontal line) M.initSeparator = function(x, y, w) - -- return _G_Widget_.Line{ - -- p1 = {x = x, y = y}, - -- p2 = {x = x + w, y = y}, - -- line_pattern = _G_Patterns_.BORDER_FG, - -- } return _G_Widget_.Line( _G_Widget_.make_point(x, y), _G_Widget_.make_point(x + w, y), @@ -384,26 +288,10 @@ end M.initTextRow = function(x, y, w, label) return { - -- label = _G_Widget_.Text{ - -- x = x, - -- y = y, - -- x_align = 'left', - -- text_color = _G_Patterns_.INACTIVE_TEXT_FG, - -- text = label, - -- font_spec = M.normal_font_spec, - -- }, label = _left_text( _G_Widget_.make_point(x, y), label ), - -- value = _G_Widget_.Text{ - -- x = x + w, - -- y = y, - -- x_align = 'right', - -- text_color = _G_Patterns_.PRIMARY_FG, - -- text = "", - -- font_spec = M.normal_font_spec, - -- } value = _right_text( _G_Widget_.make_point(x + w, y), nil @@ -429,30 +317,10 @@ end -- TODO add limit to this M.initTextRowCrit = function(x, y, w, label, append_end, limit) return{ - -- label = _G_Widget_.Text{ - -- x = x, - -- y = y, - -- text = label, - -- x_align = 'left', - -- text_color = _G_Patterns_.INACTIVE_TEXT_FG, - -- font_spec = M.normal_font_spec, - -- }, label = _left_text( _G_Widget_.make_point(x, y), label ), - -- value = _G_Widget_.CriticalText{ - -- x = x + w, - -- y = y, - -- x_align = 'right', - -- y_align = 'center', - -- text_color = _G_Patterns_.PRIMARY_FG, - -- critical_color = _G_Patterns_.CRITICAL_FG, - -- critical_limit = limit, - -- append_end = append_end, - -- text = '', - -- font_spec = M.normal_font_spec, - -- } value = _G_Widget_.formattedThresholdText( _G_Widget_.make_point(x + w, y), nil, @@ -487,30 +355,12 @@ end M.initTextRows = function(x, y, w, spacing, labels) return { labels = _G_Widget_.TextColumn( - -- x = x, - -- y = y, - -- spacing = spacing, - -- x_align = 'left', - -- y_align = 'center', - -- text_color = _G_Patterns_.INACTIVE_TEXT_FG, - -- font_spec = M.normal_font_spec, - -- table.unpack(labels), _G_Widget_.make_point(x, y), labels, M.left_text_style, nil, spacing ), - -- values = _G_Widget_.TextColumn{ - -- x = x + w, - -- y = y, - -- spacing = spacing, - -- x_align = 'right', - -- y_align = 'center', - -- text_color = _G_Patterns_.PRIMARY_FG, - -- font_spec = M.normal_font_spec, - -- num_rows = #labels, - -- } values = _G_Widget_.initTextColumnN( _G_Widget_.make_point(x + w, y), #labels, @@ -562,20 +412,6 @@ M.default_table_style = _G_Widget_.table_style( ) M.initTable = function(x, y, w, h, n, labels) - -- return _G_Widget_.Table{ - -- x = x, - -- y = y, - -- width = w, - -- height = h, - -- num_rows = n, - -- body_color = _G_Patterns_.INACTIVE_TEXT_FG, - -- header_color = _G_Patterns_.PRIMARY_FG, - -- line_pattern = _G_Patterns_.BORDER_FG, - -- separator_pattern = _G_Patterns_.BORDER_FG, - -- body_font_spec = M.make_font_spec(_G_Patterns_.FONT, 11, false), - -- header_font_spec = M.make_font_spec(_G_Patterns_.FONT, 11, false), - -- table.unpack(labels), - -- } return _G_Widget_.Table( _G_Widget_.make_box(_G_Widget_.make_point(x, y), w, h), n, diff --git a/drawing/FileSystem.lua b/drawing/FileSystem.lua index 586d4a6..ceee143 100644 --- a/drawing/FileSystem.lua +++ b/drawing/FileSystem.lua @@ -45,19 +45,6 @@ local separator = Common.initSeparator( local _BAR_Y_ = _SEP_Y_ + _SEPARATOR_SPACING_ --- local bars = _G_Widget_.CompoundBar{ --- x = _G_INIT_DATA_.RIGHT_X + _BAR_PAD_, --- y = _BAR_Y_, --- length = _G_INIT_DATA_.SECTION_WIDTH - _BAR_PAD_, --- spacing = _SPACING_, --- num_bars = FS_NUM, --- -- thickness = 12, --- critical_limit = 0.8, --- indicator_pattern = Patterns.INDICATOR_FG_PRIMARY, --- critical_pattern = Patterns.INDICATOR_FG_CRITICAL, --- line_pattern = Patterns.INDICATOR_BG, --- } - local bars = _G_Widget_.CompoundBar( _G_Widget_.make_point( _G_INIT_DATA_.RIGHT_X + _BAR_PAD_, @@ -79,21 +66,6 @@ local bars = _G_Widget_.CompoundBar( false ) --- local labels = _G_Widget_.TextColumn{ --- x = _G_INIT_DATA_.RIGHT_X, --- y = _BAR_Y_, --- spacing = _SPACING_, --- text_color = _G_Patterns_.INACTIVE_TEXT_FG, --- font_spec = Common.normal_font_spec, --- x_align = 'left', --- y_align = 'center', --- 'root', --- 'boot', --- 'home', --- 'data', --- 'dcache', --- 'tmpfs', --- } local labels = _G_Widget_.TextColumn( _G_Widget_.make_point( _G_INIT_DATA_.RIGHT_X, diff --git a/drawing/Memory.lua b/drawing/Memory.lua index 2585be2..55e4b6a 100644 --- a/drawing/Memory.lua +++ b/drawing/Memory.lua @@ -106,32 +106,6 @@ local swap = Common.initTextRowCrit( 80 ) --- local cache = { --- labels = _G_Widget_.TextColumn{ --- x = _TEXT_LEFT_X_, --- y = _LINE_1_Y_ + _TEXT_SPACING_, --- spacing = _TEXT_SPACING_, --- text_color = _G_Patterns_.INACTIVE_TEXT_FG, --- font_spec = Common.normal_font_spec, --- x_align = 'left', --- y_align = 'center', --- 'Page Cache', --- 'Buffers', --- 'Kernel Slab' --- }, --- percents = _G_Widget_.TextColumn{ --- x = _RIGHT_X_, --- y = _LINE_1_Y_ + _TEXT_SPACING_, --- x_align = 'right', --- y_align = 'center', --- append_end = ' %', --- text_color = _G_Patterns_.SECONDARY_FG, --- font_spec = Common.normal_font_spec, --- '', --- '', --- '' --- }, --- } local cache = { labels = _G_Widget_.TextColumn( _G_Widget_.make_point( diff --git a/drawing/Processor.lua b/drawing/Processor.lua index 15efc56..f18a713 100644 --- a/drawing/Processor.lua +++ b/drawing/Processor.lua @@ -56,18 +56,6 @@ local _create_core_ = function(cores, id, x, y) end cores[id +1] = { - -- dials = _G_Widget_.CompoundDial{ - -- x = x, - -- y = y, - -- inner_radius = _DIAL_INNER_RADIUS_, - -- outer_radius = _DIAL_OUTER_RADIUS_, - -- spacing = _DIAL_SPACING_, - -- num_dials = NUM_THREADS_PER_CORE, - -- critical_limit = 0.8, - -- critical_pattern = _G_Patterns_.INDICATOR_FG_CRITICAL, - -- dial_pattern = _G_Patterns_.INDICATOR_FG_PRIMARY, - -- arc_pattern = _G_Patterns_.INDICATOR_BG - -- }, dials = _G_Widget_.CompoundDial( _G_Widget_.make_semicircle( _G_Widget_.make_point(x, y),