mirror of
https://github.com/gryf/wmaker.git
synced 2026-03-20 18:33:31 +01:00
Add a screenshot capture feature
This patch adds a feature to take screenshots directly from Window Maker. Having the feature embeded direclty inside Window Maker allows us to take advantage of how Window Maker is managing and handling Windows. Three new actions can be bound to a key shortcut from WPrefs. The screenshot files are saved in ~/GNUstep/Library/WindowMaker/Screenshots/ dir, with a "screenshot_%Y-%m-%d_at_%H:%M:%S" format followed by the extension. Preferably as a PNG or JPG file if available. Meaning, to work Window Maker via WRaster needs to support at least one of those format. "Capture the entire screen" is quite standard, it takes a screenshot of the whole screen area (even in multiheads env). "Capture a portion of the screen" requires the user to draw a rectangle which will be captured. Those two first are quite straightforward, just taking a live picture of the screen. The last one is "Capture a window" which works in best effort mode, it catures the focused window. As Window Maker by default is not using any compositor (like for example Xcompmgr) it can only dump the content displayed on the screen. If a window is minimized or out of the screen, there is high chance the image will be split or some area greyed in case other windows overlapped it.
This commit is contained in:
committed by
Carlos R. Mafra
parent
6c69dc32a0
commit
d045ffcf7d
10
src/screen.h
10
src/screen.h
@@ -27,6 +27,9 @@
|
||||
|
||||
#include <WINGs/WUtil.h>
|
||||
|
||||
#define PRINT_SCREEN 1
|
||||
#define PRINT_WINDOW 2
|
||||
#define PRINT_PARTIAL 3
|
||||
|
||||
typedef struct {
|
||||
WMRect *screens;
|
||||
@@ -271,6 +274,11 @@ typedef struct _WScreen {
|
||||
WMHandlerID *workspace_name_timer;
|
||||
struct WorkspaceNameData *workspace_name_data;
|
||||
|
||||
/* mini screenshot data */
|
||||
Window mini_screenshot;
|
||||
time_t mini_screenshot_timeout;
|
||||
WMHandlerID *mini_screenshot_timer;
|
||||
|
||||
/* for raise-delay */
|
||||
WMHandlerID *autoRaiseTimer;
|
||||
Window autoRaiseWindow; /* window that is scheduled to be
|
||||
@@ -314,7 +322,7 @@ void wScreenRestoreState(WScreen *scr);
|
||||
|
||||
int wScreenBringInside(WScreen *scr, int *x, int *y, int width, int height);
|
||||
int wScreenKeepInside(WScreen *scr, int *x, int *y, int width, int height);
|
||||
|
||||
void ScreenCapture(WScreen *scr, int mode);
|
||||
|
||||
/* in startup.c */
|
||||
WScreen *wScreenWithNumber(int i);
|
||||
|
||||
Reference in New Issue
Block a user