]> git.saurik.com Git - wxWidgets.git/blame - include/wx/x11/privx.h
wxX11:
[wxWidgets.git] / include / wx / x11 / privx.h
CommitLineData
5e29f97a
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: privx.h
3// Purpose: Private declarations common to X11 and Motif ports
4// Author: Julian Smart
5// Modified by:
6// Created: 17/09/98
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_PRIVATE_H_
13#define _WX_PRIVATE_H_
14
15#include "wx/defs.h"
16#include "wx/utils.h"
17#include "X11/Xlib.h"
18#include "X11/Xatom.h"
19#include "X11/Xutil.h"
20
21class wxMouseEvent;
22class wxKeyEvent;
23class wxWindow;
24
25// ----------------------------------------------------------------------------
26// key events related functions
27// ----------------------------------------------------------------------------
28
29extern int wxCharCodeXToWX(KeySym keySym);
30extern KeySym wxCharCodeWXToX(int id);
31
32int wxGetBestMatchingPixel(Display *display, XColor *desiredColor, Colormap cmap);
33Pixmap XCreateInsensitivePixmap( Display *display, Pixmap pixmap );
34
35extern XColor g_itemColors[];
36extern int wxComputeColours (Display *display, wxColour * back, wxColour * fore);
37
38// For convenience
39inline Display* wxGlobalDisplay() { return (Display*) wxGetDisplay(); }
40
41#define wxNO_COLORS 0x00
42#define wxBACK_COLORS 0x01
43#define wxFORE_COLORS 0x02
44
45extern XColor itemColors[5] ;
46
47#define wxBACK_INDEX 0
48#define wxFORE_INDEX 1
49#define wxSELE_INDEX 2
50#define wxTOPS_INDEX 3
51#define wxBOTS_INDEX 4
52
53#define wxMAX_RGB 0xff
54#define wxMAX_SV 1000
55#define wxSIGN(x) ((x < 0) ? -x : x)
56#define wxH_WEIGHT 4
57#define wxS_WEIGHT 1
58#define wxV_WEIGHT 2
59
60typedef struct wx_hsv {
61 int h,s,v;
62 } wxHSV;
63
64#define wxMax3(x,y,z) ((x > y) ? ((x > z) ? x : z) : ((y > z) ? y : z))
65#define wxMin3(x,y,z) ((x < y) ? ((x < z) ? x : z) : ((y < z) ? y : z))
66
67void wxHSVToXColor(wxHSV *hsv,XColor *xcolor);
68void wxXColorToHSV(wxHSV *hsv,XColor *xcolor);
69void wxAllocNearestColor(Display *display,Colormap colormap,XColor *xcolor);
70void wxAllocColor(Display *display,Colormap colormap,XColor *xcolor);
71
72#endif
73// _WX_PRIVATE_H_