wxMaxima
Loading...
Searching...
No Matches
Data Structures | Functions
Screenshot.h File Reference

Screenshots for the manual, made by wxMaxima itself (–screenshot). More...

#include <wx/arrstr.h>
#include <wx/confbase.h>
#include <wx/gdicmn.h>
#include <wx/image.h>
#include <wx/string.h>
#include <optional>
Include dependency graph for Screenshot.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  wxm::ScreenshotTarget
 What –screenshot-of asks to be shown and captured. More...
 
struct  wxm::ScreenshotScene
 Everything a scene's [Screenshot] group asks for. More...
 

Functions

std::optional< ScreenshotScene > wxm::ReadScreenshotScene (const wxConfigBase &config)
 Reads a scene's [Screenshot] group.
 
std::optional< ScreenshotTarget > wxm::ParseScreenshotTarget (const wxString &text)
 Reads the value of Screenshot/show.
 
wxImage wxm::ScreenRect (const wxRect &rect)
 What the screen shows inside rect (screen coordinates)
 
wxImage wxm::TrimToContent (const wxImage &image, int padding)
 The image cropped to everything that isn't its background, plus padding.
 

Detailed Description

Screenshots for the manual, made by wxMaxima itself (–screenshot).

The manual's screenshots used to be made by hand, on whatever desktop the person making them had, and so they aged: in 2026 the main window still showed version 19.10. info/screenshots/ describes each one as a scene (a worksheet, a configuration and what to show), and wxMaxima, started with –screenshot, opens the scene, evaluates it, waits until Maxima is idle and every image has been decoded, shows what was asked for, saves a PNG of it and exits. Doing that from inside the program means nothing has to guess how long evaluating or rendering takes.

The picture is read back from the screen, so it is meant to run under Xvfb (or any X11 display): a Wayland compositor does not let a program read the screen.

Function Documentation

◆ ParseScreenshotTarget()

std::optional< wxm::ScreenshotTarget > wxm::ParseScreenshotTarget ( const wxString &  text)

Reads the value of Screenshot/show.

Returns
the target, or no value if the text names none

◆ ReadScreenshotScene()

std::optional< wxm::ScreenshotScene > wxm::ReadScreenshotScene ( const wxConfigBase &  config)

Reads a scene's [Screenshot] group.

  • show: window (the default), worksheet, cells, pane:<name> or config:<page>
  • sidebars: the sidebars to show, by AUI pane name, separated by commas; every other one is hidden. Left out: the layout stays as it is.
  • sidebarWidth: the minimum width of every sidebar shown.
  • width, height: the size of the main window, or of the dialog shown.
Returns
the scene, or no value if show names nothing we can show

◆ ScreenRect()

wxImage wxm::ScreenRect ( const wxRect &  rect)

What the screen shows inside rect (screen coordinates)

Returns
the picture, or an invalid image if nothing could be read

◆ TrimToContent()

wxImage wxm::TrimToContent ( const wxImage &  image,
int  padding 
)

The image cropped to everything that isn't its background, plus padding.

The background is the colour of the top-left pixel. Padding stays within the image. An image that is all background is returned unchanged.