Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ngscopeclient/scopehal-apps
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f762625718f3
Choose a base ref
...
head repository: ngscopeclient/scopehal-apps
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 18880f35b1d7
Choose a head ref
  • 1 commit
  • 4 files changed
  • 1 contributor

Commits on Oct 28, 2020

  1. Copy the full SHA
    18880f3 View commit details
Showing with 38 additions and 20 deletions.
  1. +1 −1 lib
  2. +30 −18 src/glscopeclient/ProtocolAnalyzerWindow.cpp
  3. +1 −0 src/glscopeclient/ProtocolAnalyzerWindow.h
  4. +6 −1 src/glscopeclient/styles/glscopeclient.css
48 changes: 30 additions & 18 deletions src/glscopeclient/ProtocolAnalyzerWindow.cpp
Original file line number Diff line number Diff line change
@@ -359,6 +359,7 @@ ProtocolAnalyzerColumns::ProtocolAnalyzerColumns(PacketDecoder* decoder)
add(m_visible);
add(m_bgcolor);
add(m_fgcolor);
add(m_height);
add(m_timestamp);
add(m_capturekey);
add(m_offset);
@@ -408,17 +409,21 @@ ProtocolAnalyzerWindow::ProtocolAnalyzerWindow(
for(size_t i=0; i<headers.size(); i++)
m_tree.append_column(headers[i], m_columns.m_headers[i]);

int ncols = headers.size() + 1;
if(decoder->GetShowImageColumn())
{
m_tree.append_column("Image", m_columns.m_image);
m_tree.get_style_context()->add_class("video");
ncols ++;
}

int ncols = headers.size() + 1;
if(decoder->GetShowDataColumn())
{
m_tree.append_column("Data", m_columns.m_data);
ncols = headers.size() + 2;
ncols ++;
}

//Set background color
//Set up colors and images
for(int col=0; col<ncols; col ++)
{
auto pcol = m_tree.get_column(col);
@@ -427,6 +432,9 @@ ProtocolAnalyzerWindow::ProtocolAnalyzerWindow(
{
pcol->add_attribute(*c, "background-gdk", 1); //column 1 is bg color
pcol->add_attribute(*c, "foreground-gdk", 2); //column 2 is fg color

if(decoder->GetShowImageColumn())
pcol->add_attribute(*c, "height", 3); //column 3 is height
}
}

@@ -620,21 +628,25 @@ void ProtocolAnalyzerWindow::FillOutRow(
{
size_t rowsize = p->m_data.size();
size_t width = rowsize / 3;
size_t height = 24;

Glib::RefPtr<Gdk::Pixbuf> image = Gdk::Pixbuf::create(
Gdk::COLORSPACE_RGB,
false,
8,
width,
height);

//Make a 2D image
uint8_t* pixels = image->get_pixels();
for(size_t y=0; y<height; y++)
memcpy(pixels + y*rowsize, &p->m_data[0], rowsize);

row[m_columns.m_image] = image;
if(width > 0)
{
size_t height = 12;

Glib::RefPtr<Gdk::Pixbuf> image = Gdk::Pixbuf::create(
Gdk::COLORSPACE_RGB,
false,
8,
width,
height);

//Make a 2D image
uint8_t* pixels = image->get_pixels();
for(size_t y=0; y<height; y++)
memcpy(pixels + y*rowsize, &p->m_data[0], rowsize);

row[m_columns.m_image] = image;
row[m_columns.m_height] = height;
}
}
}

1 change: 1 addition & 0 deletions src/glscopeclient/ProtocolAnalyzerWindow.h
Original file line number Diff line number Diff line change
@@ -54,6 +54,7 @@ class ProtocolAnalyzerColumns : public Gtk::TreeModel::ColumnRecord
Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf>> m_image;
Gtk::TreeModelColumn<Gdk::Color> m_bgcolor;
Gtk::TreeModelColumn<Gdk::Color> m_fgcolor;
Gtk::TreeModelColumn<int> m_height;
Gtk::TreeModelColumn<bool> m_visible;
};

7 changes: 6 additions & 1 deletion src/glscopeclient/styles/glscopeclient.css
Original file line number Diff line number Diff line change
@@ -167,6 +167,12 @@ row
font-family: monospace;
}

.video
{
font-size: 8pt;
padding: 0px;
}

row:selected,
row:selected:focus,
.cell:selected,
@@ -177,7 +183,6 @@ row:selected:focus:hover,
background-color: @glscopeclient_highlight_color;
}


notebook,
notebook tab,
notebook header,