From a041d9898e6d699bd8c0c25482ec574feb03c547 Mon Sep 17 00:00:00 2001 From: "John Ankarstr\\xf6m" Date: Sat, 29 May 2021 12:54:47 +0200 Subject: First commit This is the original state of the released tarball for JWM 1.8, which will serve as my starting point for further modifications. --- src/outline.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 src/outline.c (limited to 'src/outline.c') diff --git a/src/outline.c b/src/outline.c new file mode 100644 index 0000000..b42e70a --- /dev/null +++ b/src/outline.c @@ -0,0 +1,73 @@ +/**************************************************************************** + * Outlines for moving and resizing. + * Copyright (C) 2004 Joe Wingbermuehle + ****************************************************************************/ + +#include "jwm.h" +#include "outline.h" +#include "main.h" + +static GC outlineGC; + +static int lastX, lastY; +static int lastWidth, lastHeight; +static int outlineDrawn; + +/**************************************************************************** + ****************************************************************************/ +void InitializeOutline() { +} + +/**************************************************************************** + ****************************************************************************/ +void StartupOutline() { + + XGCValues gcValues; + + gcValues.function = GXinvert; + gcValues.subwindow_mode = IncludeInferiors; + gcValues.line_width = 2; + outlineGC = JXCreateGC(display, rootWindow, + GCFunction | GCSubwindowMode | GCLineWidth, &gcValues); + outlineDrawn = 0; + +} + +/**************************************************************************** + ****************************************************************************/ +void ShutdownOutline() { + JXFreeGC(display, outlineGC); +} + +/**************************************************************************** + ****************************************************************************/ +void DestroyOutline() { +} + +/**************************************************************************** + ****************************************************************************/ +void DrawOutline(int x, int y, int width, int height) { + if(!outlineDrawn) { + JXSync(display, False); + JXGrabServer(display); + JXDrawRectangle(display, rootWindow, outlineGC, x, y, width, height); + lastX = x; + lastY = y; + lastWidth = width; + lastHeight = height; + outlineDrawn = 1; + } +} + +/**************************************************************************** + ****************************************************************************/ +void ClearOutline() { + if(outlineDrawn) { + JXDrawRectangle(display, rootWindow, outlineGC, + lastX, lastY, lastWidth, lastHeight); + outlineDrawn = 0; + JXUngrabServer(display); + JXSync(display, False); + } +} + -- cgit v1.2.3