Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

fxpriv.h

00001 /********************************************************************************
00002 *                                                                               *
00003 *              P r i v a t e   I n t e r n a l   F u n c t i o n s              *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2000,2002 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or                 *
00009 * modify it under the terms of the GNU Lesser General Public                    *
00010 * License as published by the Free Software Foundation; either                  *
00011 * version 2.1 of the License, or (at your option) any later version.            *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU             *
00016 * Lesser General Public License for more details.                               *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public              *
00019 * License along with this library; if not, write to the Free Software           *
00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    *
00021 *********************************************************************************
00022 * $Id: fxpriv.h,v 1.16 2002/01/18 22:43:08 jeroen Exp $                         *
00023 ********************************************************************************/
00024 
00025 
00026 // DND protocol version
00027 #define XDND_PROTOCOL_VERSION   4
00028 
00029 // Definitions for DND messages for Windows
00030 #ifdef WIN32
00031 #define WM_DND_REQUEST          (WM_APP+1)
00032 #define WM_DND_ENTER            (WM_APP+2)
00033 #define WM_DND_LEAVE            (WM_APP+3)
00034 #define WM_DND_POSITION_REJECT  (WM_APP+4)
00035 #define WM_DND_POSITION_COPY    (WM_APP+5)
00036 #define WM_DND_POSITION_MOVE    (WM_APP+6)
00037 #define WM_DND_POSITION_LINK    (WM_APP+7)
00038 #define WM_DND_POSITION_PRIVATE (WM_APP+8)
00039 #define WM_DND_STATUS_REJECT    (WM_APP+9)
00040 #define WM_DND_STATUS_COPY      (WM_APP+10)
00041 #define WM_DND_STATUS_MOVE      (WM_APP+11)
00042 #define WM_DND_STATUS_LINK      (WM_APP+12)
00043 #define WM_DND_STATUS_PRIVATE   (WM_APP+13)
00044 #define WM_DND_DROP             (WM_APP+14)
00045 #define WM_DND_FINISH           (WM_APP+15)
00046 #define WM_DND_REPLY            (WM_APP+16)
00047 #endif
00048 
00049 // Definitions for Motif-style WM Hints.
00050 #ifndef WIN32
00051 #define MWM_HINTS_FUNCTIONS (1L << 0)       // Definitions for FXMotifHints.flags
00052 #define MWM_HINTS_DECORATIONS (1L << 1)
00053 #define MWM_HINTS_INPUT_MODE  (1L << 2)
00054 #define MWM_HINTS_ALL           (MWM_HINTS_FUNCTIONS|MWM_HINTS_DECORATIONS|MWM_HINTS_INPUT_MODE)
00055 
00056 #define MWM_FUNC_ALL    (1L << 0)       // Definitions for FXMotifHints.functions
00057 #define MWM_FUNC_RESIZE   (1L << 1)
00058 #define MWM_FUNC_MOVE   (1L << 2)
00059 #define MWM_FUNC_MINIMIZE (1L << 3)
00060 #define MWM_FUNC_MAXIMIZE (1L << 4)
00061 #define MWM_FUNC_CLOSE    (1L << 5)
00062 
00063 #define MWM_DECOR_ALL   (1L << 0)       // Definitions for FXMotifHints.decorations
00064 #define MWM_DECOR_BORDER  (1L << 1)
00065 #define MWM_DECOR_RESIZEH (1L << 2)
00066 #define MWM_DECOR_TITLE   (1L << 3)
00067 #define MWM_DECOR_MENU    (1L << 4)
00068 #define MWM_DECOR_MINIMIZE  (1L << 5)
00069 #define MWM_DECOR_MAXIMIZE  (1L << 6)
00070 
00071 #define MWM_INPUT_MODELESS        0   // Values for FXMotifHints.inputmode
00072 #define MWM_INPUT_PRIMARY_APPLICATION_MODAL 1
00073 #define MWM_INPUT_SYSTEM_MODAL        2
00074 #define MWM_INPUT_FULL_APPLICATION_MODAL    3
00075 #endif
00076 
00077 // Named color
00078 struct FXNamedColor {
00079   const FXchar *name;
00080   FXColor       color;
00081   };
00082 
00083 
00084 
00085 // X11 helpers
00086 #ifndef WIN32
00087 extern FXAPI Atom fxsendrequest(Display *display,Window window,Atom selection,Atom prop,Atom type,FXuint time);
00088 extern FXAPI Atom fxsendreply(Display *display,Window window,Atom selection,Atom prop,Atom target,FXuint time);
00089 extern FXAPI Atom fxsendtypes(Display *display,Window window,Atom prop,FXDragType* types,FXuint numtypes);
00090 extern FXAPI Atom fxrecvtypes(Display *display,Window window,Atom prop,FXDragType*& types,FXuint& numtypes);
00091 extern FXAPI Atom fxsenddata(Display *display,Window window,Atom prop,Atom type,FXuchar* data,FXuint size);
00092 extern FXAPI Atom fxrecvdata(Display *display,Window window,Atom prop,Atom,FXuchar*& data,FXuint& size);
00093 #endif
00094 
00095 // Windows helpers
00096 #ifdef WIN32
00097 extern FXAPI HANDLE fxsendrequest(HWND window,HWND requestor,WPARAM type);
00098 extern FXAPI HANDLE fxsenddata(HWND window,FXuchar* data,FXuint size);
00099 extern FXAPI HANDLE fxrecvdata(HANDLE hMap,FXuchar*& data,FXuint& size);
00100 extern FXAPI unsigned int fxmodifierkeys();
00101 extern FXAPI int fxpointsize_to_height(HDC hdc,unsigned size);
00102 extern FXAPI unsigned fxheight_to_pointsize(HDC hdc,int height);
00103 extern FXAPI FXbool fxisconsole(const FXchar *path);
00104 extern UINT wkbGetCodePage();
00105 extern FXuint wkbMapKeyCode(HWND hWnd, UINT iMsg, WPARAM uVirtKey, LPARAM lParam);
00106 extern FXAPI FXbool wkbTranslateMessage(HWND hWnd, UINT iMsg, WPARAM wParam,LPARAM lParam);
00107 #endif
00108 
00109 
00110 // List of color names
00111 extern FXAPI const FXNamedColor fxcolornames[];
00112 
00113 
00114 // Number of color names
00115 extern FXAPI const FXuint fxnumcolornames;
00116 
00117 
00118 // Floyd-Steinberg quantization full 24 bpp to less than or equal to 256 colors
00119 extern FXbool fxfsquantize(FXuchar* p8,const FXuchar* p24,FXuchar* rmap,FXuchar* gmap,FXuchar* bmap,FXint& actualcolors,FXint w,FXint h,FXint maxcolors);
00120 
00121 // EZ quantization may be used if w*h<=maxcolors, or if the actual colors used is
00122 // less than maxcolors; using fxezquantize assures that no loss of data occurs
00123 // repeatedly loading and saving the same file!
00124 extern FXbool fxezquantize(FXuchar* p8,const FXuchar* p24,FXuchar* rmap,FXuchar* gmap,FXuchar* bmap,FXint& actualcolors,FXint w,FXint h,FXint maxcolors);
00125