X11 Work Bench Toolkit  1.0
window_dressing.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <memory.h>
#include <string.h>
#include <strings.h>
#include <errno.h>
#include <X11/Xlib.h>
#include "window_dressing.h"
#include "pixmap_helper.h"
#include "conf_help.h"
#include "draw_text.h"

Go to the source code of this file.

Macros

#define LOAD_COLOR0(X, Y)   if(CHGetResourceString(WBGetDefaultDisplay(), X, Y, sizeof(Y)) > 0) { }
 macro to load a color, mostly for readability
 
#define LOAD_COLOR(X, Y, Z)   if(CHGetResourceString(WBGetDefaultDisplay(), X, Y, sizeof(Y)) <= 0){ WB_WARN_PRINT("%s - WARNING: can't find color %s, using default value %s\n", __FUNCTION__, X, Z); strcpy(Y,Z); }
 macro to load a color with a fallback, mostly for readability
 

Functions

static void CheckInitScrollColors (void)
 internal utility to check and initialize scroll bar standard colors
 
static unsigned char isqrt (unsigned char iVal)
 integer square root of a value 0-255
 
static unsigned char icos (unsigned char iVal)
 integer 255 * cos(iVal * pi / 512) calculation via lookup table
 
void WBCalcHScrollBar (WB_SCROLLINFO *pScrollInfo, WB_GEOM *pgeomClient, int iVScrollWidth, int iHScrollHeight, int nListItems, int nPos)
 Calculate the parameters for a horizontal scroll bar. More...
 
int WBCalcVScrollDragPos (WB_SCROLLINFO *pScrollInfo, int iY)
 Calculate and assign the correct vertical scroll bar position from mouse coordinates. More...
 
int WBCalcHScrollDragPos (WB_SCROLLINFO *pScrollInfo, int iX)
 Calculate and assign the correct horizontal scroll bar position from mouse coordinates. More...
 
void WBCalcVScrollBar (WB_SCROLLINFO *pScrollInfo, WB_GEOM *pgeomClient, int iVScrollWidth, int iHScrollHeight, int nListItems, int nPos)
 Calculate the parameters for a vertical scroll bar. More...
 
void WBDrawBorderRect (Display *pDisplay, Drawable wID, GC gc, WB_GEOM *pgeomBorder, unsigned long lBorderColor)
 Draw a 'border' rectangle. More...
 
void WBDraw3DBorderRect (Display *pDisplay, Drawable wID, GC gc, WB_GEOM *pgeomBorder, unsigned long lBorderColor1, unsigned long lBorderColor2)
 Draw a 3D 'border' rectangle. More...
 
void WBDrawDashedRect (Display *pDisplay, Drawable wID, GC gc, WB_GEOM *pgeomRect, unsigned long lColor)
 Draw a 'dashed' rectangle. More...
 
void WBPaintVScrollBar (WB_SCROLLINFO *pScrollInfo, Display *pDisplay, Drawable wID, GC gc, WB_GEOM *pgeomClient)
 Paint the vertical scroll bar within a window based on WB_SCROLLINFO. More...
 
void WBPaintHScrollBar (WB_SCROLLINFO *pScrollInfo, Display *pDisplay, Drawable wID, GC gc, WB_GEOM *pgeomClient)
 Paint the horizontal scroll bar within a window based on WB_SCROLLINFO. More...
 
void WBDrawLeftArrow (Display *pDisplay, Drawable wID, GC gc, WB_GEOM *pgeomRect, unsigned long lColor)
 Draw a left arrow in a window within a specified geometry. More...
 
void WBDrawUpArrow (Display *pDisplay, Drawable wID, GC gc, WB_GEOM *pgeomRect, unsigned long lColor)
 Draw an up arrow in a window within a specified geometry. More...
 
void WBDrawRightArrow (Display *pDisplay, Drawable wID, GC gc, WB_GEOM *pgeomRect, unsigned long lColor)
 Draw a right arrow in a window within a specified geometry. More...
 
void WBDrawDownArrow (Display *pDisplay, Drawable wID, GC gc, WB_GEOM *pgeomRect, unsigned long lColor)
 Draw a down arrow in a window within a specified geometry. More...
 
void WBDraw3DBorderTab (Display *pDisplay, Drawable dw, GC gc, WB_GEOM *pgeomOutline, int fFocus, unsigned long lFGColor, unsigned long lBGColor, unsigned long lBorderColor1, unsigned long lBorderColor2, unsigned long lHighlightColor, XFontSet fontSet, XFontSet fontSetBold, Atom aGraphic, const char *szText)
 Draw a 'tab' within a specified 'outline' rectangle. More...
 

Variables

static XColor clrScrollFG
 foreground scroll bar color
 
static XColor clrScrollBG
 background scroll bar color
 
static XColor clrScrollAFG
 active foreground scroll bar color
 
static XColor clrScrollABG
 active background scroll bar color
 
static XColor clrScrollHFG
 highlight foreground scroll bar color
 
static XColor clrScrollHBG
 highlight background scroll bar color
 
static XColor clrScrollBD
 standard scroll bar border color
 
static XColor clrScrollBD2
 3D highlight scroll bar border color (light)
 
static XColor clrScrollBD3
 3D highlight scroll bar border color (dark)
 
static int iInitScrollColorFlag
 initialization flag for scroll colors. when zero, colors not yet initialized
 

Detailed Description

Utilities for painting and handling standard components of windows

Definition in file window_dressing.c.