fox-1.6.49/ 0000775 0001750 0001750 00000000000 12130343100 007375 5 0000000 0000000 fox-1.6.49/include/ 0000775 0001750 0001750 00000000000 12130343073 011031 5 0000000 0000000 fox-1.6.49/include/FXSize.h 0000664 0001750 0001750 00000010757 12130340076 012304 0000000 0000000 /********************************************************************************
* *
* S i z e C l a s s *
* *
*********************************************************************************
* Copyright (C) 1994,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXSize.h,v 1.15 2006/01/22 17:58:09 fox Exp $ *
********************************************************************************/
#ifndef FXSIZE_H
#define FXSIZE_H
namespace FX {
/// Size
class FXAPI FXSize {
public:
FXshort w;
FXshort h;
public:
/// Constructors
FXSize(){ }
FXSize(const FXSize& s):w(s.w),h(s.h){ }
FXSize(FXshort ww,FXshort hh):w(ww),h(hh){ }
/// Test if empty
bool empty() const { return w<=0 || h<=0; }
/// Test if zero
bool operator!() const { return w==0 && h==0; }
/// Equality
bool operator==(const FXSize& s) const { return w==s.w && h==s.h; }
bool operator!=(const FXSize& s) const { return w!=s.w || h!=s.h; }
/// Grow by amount
FXSize& grow(FXshort margin);
FXSize& grow(FXshort hormargin,FXshort vermargin);
FXSize& grow(FXshort leftmargin,FXshort rightmargin,FXshort topmargin,FXshort bottommargin);
/// Shrink by amount
FXSize& shrink(FXshort margin);
FXSize& shrink(FXshort hormargin,FXshort vermargin);
FXSize& shrink(FXshort leftmargin,FXshort rightmargin,FXshort topmargin,FXshort bottommargin);
/// Assignment
FXSize& operator=(const FXSize& s){ w=s.w; h=s.h; return *this; }
/// Set value from another size
FXSize& set(const FXSize& s){ w=s.w; h=s.h; return *this; }
/// Set value from components
FXSize& set(FXshort ww,FXshort hh){ w=ww; h=hh; return *this; }
/// Assignment operators
FXSize& operator+=(const FXSize& s){ w+=s.w; h+=s.h; return *this; }
FXSize& operator-=(const FXSize& s){ w-=s.w; h-=s.h; return *this; }
FXSize& operator*=(FXshort c){ w*=c; h*=c; return *this; }
FXSize& operator/=(FXshort c){ w/=c; h/=c; return *this; }
/// Negation
FXSize operator-(){ return FXSize(-w,-h); }
/// Addition operators
FXSize operator+(const FXSize& s) const { return FXSize(w+s.w,h+s.h); }
FXSize operator-(const FXSize& s) const { return FXSize(w-s.w,h-s.h); }
/// Scale operators
friend inline FXSize operator*(const FXSize& s,FXshort c);
friend inline FXSize operator*(FXshort c,const FXSize& s);
friend inline FXSize operator/(const FXSize& s,FXshort c);
friend inline FXSize operator/(FXshort c,const FXSize& s);
/// Save object to a stream
friend FXAPI FXStream& operator<<(FXStream& store,const FXSize& s);
/// Load object from a stream
friend FXAPI FXStream& operator>>(FXStream& store,FXSize& s);
};
inline FXSize operator*(const FXSize& s,FXshort c){ return FXSize(s.w*c,s.h*c); }
inline FXSize operator*(FXshort c,const FXSize& s){ return FXSize(c*s.w,c*s.h); }
inline FXSize operator/(const FXSize& s,FXshort c){ return FXSize(s.w/c,s.h/c); }
inline FXSize operator/(FXshort c,const FXSize& s){ return FXSize(c/s.w,c/s.h); }
extern FXAPI FXStream& operator<<(FXStream& store,const FXSize& s);
extern FXAPI FXStream& operator>>(FXStream& store,FXSize& s);
}
#endif
fox-1.6.49/include/FXRecentFiles.h 0000664 0001750 0001750 00000011656 12130340076 013574 0000000 0000000 /********************************************************************************
* *
* R e c e n t F i l e s L i s t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXRecentFiles.h,v 1.24 2006/01/22 17:58:08 fox Exp $ *
********************************************************************************/
#ifndef FXRECENTFILES_H
#define FXRECENTFILES_H
#ifndef FXOBJECT_H
#include "FXObject.h"
#endif
namespace FX {
class FXApp;
/**
* The recent files object manages a most recently used (MRU) file list by
* means of the standard system registry.
* When connected to a widget, like a menu command, the recent files object
* updates the menu commands label to the associated recent file name; when
* the menu command is invoked, the recent file object sends its target a
* SEL_COMMAND message with the message data set to the associated file name,
* of the type const char*.
* When adding or removing file names, the recent files object automatically
* updates the system registry to record these changes.
*/
class FXAPI FXRecentFiles : public FXObject {
FXDECLARE(FXRecentFiles)
private:
FXApp *app; // Backlink to application
FXObject *target; // Target object to send message
FXSelector message; // Message to send
FXString group; // MRU File group
FXint maxfiles; // Maximum number of files to track
private:
FXRecentFiles(const FXRecentFiles&);
FXRecentFiles &operator=(const FXRecentFiles&);
public:
long onCmdClear(FXObject*,FXSelector,void*);
long onCmdFile(FXObject*,FXSelector,void*);
long onUpdFile(FXObject*,FXSelector,void*);
long onUpdAnyFiles(FXObject*,FXSelector,void*);
public:
enum{
ID_CLEAR,
ID_ANYFILES,
ID_FILE_1,
ID_FILE_2,
ID_FILE_3,
ID_FILE_4,
ID_FILE_5,
ID_FILE_6,
ID_FILE_7,
ID_FILE_8,
ID_FILE_9,
ID_FILE_10,
ID_LAST
};
public:
/// Make new recent files group, using global application instance
FXRecentFiles();
/// Make new recent files group with default groupname
FXRecentFiles(FXApp* a);
/// Make new recent files group with groupname gp
FXRecentFiles(FXApp* a,const FXString& gp,FXObject *tgt=NULL,FXSelector sel=0);
/// Get application
FXApp* getApp() const { return app; }
/// Change number of files we're tracking
void setMaxFiles(FXint mx){ maxfiles=mx; }
/// Return the maximum number of files being tracked
FXint getMaxFiles() const { return maxfiles; }
/// Set group name
void setGroupName(const FXString& name){ group=name; }
/// Return group name
FXString getGroupName() const { return group; }
/// Change the target
void setTarget(FXObject *t){ target=t; }
/// Get the target
FXObject *getTarget() const { return target; }
/// Change the message
void setSelector(FXSelector sel){ message=sel; }
/// Return the message id
FXSelector getSelector() const { return message; }
/// Obtain the filename at index
FXString getFile(FXint index) const;
/// Change the filename at index
void setFile(FXint index,const FXString& filename);
/// Append a file
void appendFile(const FXString& filename);
/// Remove a file
void removeFile(const FXString& filename);
/// Clear the list of files
void clear();
/// Save to a stream
virtual void save(FXStream& store) const;
/// Load from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXRecentFiles();
};
}
#endif
fox-1.6.49/include/FXPipe.h 0000664 0001750 0001750 00000005547 12130340076 012270 0000000 0000000 /********************************************************************************
* *
* P i p e C l a s s *
* *
*********************************************************************************
* Copyright (C) 2005,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXPipe.h,v 1.7.2.1 2007/08/02 21:31:17 fox Exp $ *
********************************************************************************/
#ifndef FXPIPE_H
#define FXPIPE_H
#ifndef FXIO_H
#include "FXIO.h"
#endif
//////////////////////////// UNDER DEVELOPMENT ////////////////////////////////
namespace FX {
/**
* Pipe i/o device.
*/
class FXAPI FXPipe : public FXIO {
private:
FXPipe(const FXPipe&);
FXPipe &operator=(const FXPipe&);
public:
/// Construct socket
FXPipe(){ }
/// Construct file and attach existing handle h
FXPipe(FXInputHandle handle,FXuint mode);
/// Open device with access mode and handle
virtual bool open(FXInputHandle handle,FXuint mode);
/// Read block of bytes, returning number of bytes read
virtual FXival readBlock(void* data,FXival count);
/// Write block of bytes, returning number of bytes written
virtual FXival writeBlock(const void* data,FXival count);
/// Close socket
virtual bool close();
/// Create a named pipe
static bool create(const FXString& file,FXuint perm=FXIO::OwnerReadWrite|FXIO::GroupReadWrite|FXIO::OtherReadWrite);
/// Destroy
virtual ~FXPipe();
};
}
#endif
fox-1.6.49/include/FXSpring.h 0000664 0001750 0001750 00000010446 12130340076 012627 0000000 0000000 /********************************************************************************
* *
* S p r i n g C o n t a i n e r W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2003,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXSpring.h,v 1.8 2006/01/22 17:58:10 fox Exp $ *
********************************************************************************/
#ifndef FXSPRING_H
#define FXSPRING_H
#ifndef FXPACKER_H
#include "FXPacker.h"
#endif
namespace FX {
/**
* The spring widgets, when properly embedded side by side in a horizontal
* frame or vertical frame widget, behave like a set of connected springs
* of various lengths (hence the name!). The parameters relw (or relh)
* determines the length of the spring. The actual length is not really
* important; the only thing that counts is the relative length of one
* spring widget to that of another, although the length does determine
* the default size. The special value zero may be given for relw (or relh)
* to cause the spring to calculate its default width (height) normally,
* just like the Packer base class does.
* In a typical scenario, either the relative width or height is set to
* zero, an the flag LAYOUT_FILL_X or LAYOUT_FILL_Y is passed. When
* placed inside a horizontal frame, the LAYOUT_FILL_X together with
* the relative widths of the springs will cause a fixed width-ratio
* between the springs.
* You also can mix normal controls and springs together in a horizontal
* or vertical frames to provide arbitrary stretchable spacing between
* widgets; in this case, the springs do not need to have any children.
* Since the spring widget is derived from the packer layout manager,
* it provides the same layout behavior as packer.
*/
class FXAPI FXSpring : public FXPacker {
FXDECLARE(FXSpring)
protected:
FXint relWidth; // Relative width
FXint relHeight; // Relative height
protected:
FXSpring(){}
private:
FXSpring(const FXSpring&);
FXSpring &operator=(const FXSpring&);
public:
/// Construct packer layout manager
FXSpring(FXComposite *p,FXuint opts=0,FXint relw=0,FXint relh=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_SPACING,FXint pr=DEFAULT_SPACING,FXint pt=DEFAULT_SPACING,FXint pb=DEFAULT_SPACING,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING);
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Change relative width
void setRelativeWidth(FXint relw);
/// Return relative width
FXint getRelativeWidth() const { return relWidth; }
/// Change relative height
void setRelativeHeight(FXint relh);
/// Return relative height
FXint getRelativeHeight() const { return relHeight; }
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
};
}
#endif
fox-1.6.49/include/FXTextField.h 0000664 0001750 0001750 00000032250 12130340076 013252 0000000 0000000 /********************************************************************************
* *
* T e x t F i e l d W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXTextField.h,v 1.62 2006/01/22 17:58:11 fox Exp $ *
********************************************************************************/
#ifndef FXTEXTFIELD_H
#define FXTEXTFIELD_H
#ifndef FXFRAME_H
#include "FXFrame.h"
#endif
namespace FX {
/// Textfield styles
enum {
TEXTFIELD_PASSWD = 0x00080000, /// Password mode
TEXTFIELD_INTEGER = 0x00100000, /// Integer mode
TEXTFIELD_REAL = 0x00200000, /// Real mode
TEXTFIELD_READONLY = 0x00400000, /// NOT editable
TEXTFIELD_ENTER_ONLY = 0x00800000, /// Only callback when enter hit
TEXTFIELD_LIMITED = 0x01000000, /// Limit entry to given number of columns
TEXTFIELD_OVERSTRIKE = 0x02000000, /// Overstrike mode
TEXTFIELD_AUTOGRAY = 0x04000000, /// Automatically gray out text field when not updated
TEXTFIELD_AUTOHIDE = 0x08000000, /// Automatically hide text field when not updated
TEXTFIELD_NORMAL = FRAME_SUNKEN|FRAME_THICK
};
/**
* A text field is a single-line text entry widget.
* The text field widget supports clipboard for cut-and-paste
* operations.
* Text input may be constrained to a certain format; the built-in
* capabilities support integer and real number entry constraints;
* additional constraints on the input may be implemented by intercepting
* the SEL_VERIFY message; a custom handler should examine the tentative
* input string passed as type const FXchar* in the message data, and return
* a value of "0" if the new input is accepted.
* During text entry, the text field sends a SEL_CHANGED message to its target,
* with the message data set to the current text value of type const FXchar*.
* When the text is accepted by hitting ENTER, the SEL_COMMAND message is sent.
* The text field also sends SEL_COMMAND when the focus moves to another control.
* TEXTFIELD_ENTER_ONLY can be passed to suppress this feature. Typically, this
* flag is used in dialogs that close when ENTER is hit in a text field.
*/
class FXAPI FXTextField : public FXFrame {
FXDECLARE(FXTextField)
protected:
FXString contents; // Edited text
const FXchar *delimiters; // Set of delimiters
FXFont *font; // Text font
FXColor textColor; // Text color
FXColor selbackColor; // Selected background color
FXColor seltextColor; // Selected text color
FXColor cursorColor; // Color of the Cursor
FXint cursor; // Cursor position
FXint anchor; // Anchor position
FXint columns; // Number of columns visible
FXint shift; // Shift amount
FXString clipped; // Clipped text
FXString help; // Help string
FXString tip; // Tooltip
protected:
FXTextField();
FXint index(FXint x) const;
FXint coord(FXint i) const;
void drawCursor(FXuint state);
void drawTextRange(FXDCWindow& dc,FXint fm,FXint to);
void drawTextFragment(FXDCWindow& dc,FXint x,FXint y,FXint fm,FXint to);
void drawPWDTextFragment(FXDCWindow& dc,FXint x,FXint y,FXint fm,FXint to);
FXint rightWord(FXint pos) const;
FXint leftWord(FXint pos) const;
FXint wordStart(FXint pos) const;
FXint wordEnd(FXint pos) const;
private:
FXTextField(const FXTextField&);
FXTextField& operator=(const FXTextField&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onUpdate(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onMiddleBtnPress(FXObject*,FXSelector,void*);
long onMiddleBtnRelease(FXObject*,FXSelector,void*);
long onVerify(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onSelectionLost(FXObject*,FXSelector,void*);
long onSelectionGained(FXObject*,FXSelector,void*);
long onSelectionRequest(FXObject*,FXSelector,void* ptr);
long onClipboardLost(FXObject*,FXSelector,void*);
long onClipboardGained(FXObject*,FXSelector,void*);
long onClipboardRequest(FXObject*,FXSelector,void*);
long onFocusSelf(FXObject*,FXSelector,void*);
long onFocusIn(FXObject*,FXSelector,void*);
long onFocusOut(FXObject*,FXSelector,void*);
long onBlink(FXObject*,FXSelector,void*);
long onAutoScroll(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetIntValue(FXObject*,FXSelector,void*);
long onCmdSetRealValue(FXObject*,FXSelector,void*);
long onCmdSetStringValue(FXObject*,FXSelector,void*);
long onCmdGetIntValue(FXObject*,FXSelector,void*);
long onCmdGetRealValue(FXObject*,FXSelector,void*);
long onCmdGetStringValue(FXObject*,FXSelector,void*);
long onCmdCursorHome(FXObject*,FXSelector,void*);
long onCmdCursorEnd(FXObject*,FXSelector,void*);
long onCmdCursorRight(FXObject*,FXSelector,void*);
long onCmdCursorLeft(FXObject*,FXSelector,void*);
long onCmdCursorWordLeft(FXObject*,FXSelector,void*);
long onCmdCursorWordRight(FXObject*,FXSelector,void*);
long onCmdCursorWordStart(FXObject*,FXSelector,void*);
long onCmdCursorWordEnd(FXObject*,FXSelector,void*);
long onCmdMark(FXObject*,FXSelector,void*);
long onCmdExtend(FXObject*,FXSelector,void*);
long onCmdSelectAll(FXObject*,FXSelector,void*);
long onCmdDeselectAll(FXObject*,FXSelector,void*);
long onCmdCutSel(FXObject*,FXSelector,void*);
long onCmdCopySel(FXObject*,FXSelector,void*);
long onCmdPasteSel(FXObject*,FXSelector,void*);
long onCmdPasteMiddle(FXObject*,FXSelector,void*);
long onCmdDeleteSel(FXObject*,FXSelector,void*);
long onCmdDeleteAll(FXObject*,FXSelector,void*);
long onCmdOverstString(FXObject*,FXSelector,void*);
long onCmdInsertString(FXObject*,FXSelector,void*);
long onCmdBackspace(FXObject*,FXSelector,void*);
long onCmdDelete(FXObject*,FXSelector,void*);
long onCmdToggleEditable(FXObject*,FXSelector,void*);
long onUpdToggleEditable(FXObject*,FXSelector,void*);
long onCmdToggleOverstrike(FXObject*,FXSelector,void*);
long onUpdToggleOverstrike(FXObject*,FXSelector,void*);
long onUpdHaveSelection(FXObject*,FXSelector,void*);
long onUpdSelectAll(FXObject*,FXSelector,void*);
long onCmdSetHelp(FXObject*,FXSelector,void*);
long onCmdGetHelp(FXObject*,FXSelector,void*);
long onCmdSetTip(FXObject*,FXSelector,void*);
long onCmdGetTip(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
public:
/// Default text delimiters
static const FXchar textDelimiters[];
public:
enum{
ID_CURSOR_HOME=FXFrame::ID_LAST,
ID_CURSOR_END,
ID_CURSOR_RIGHT,
ID_CURSOR_LEFT,
ID_CURSOR_WORD_LEFT,
ID_CURSOR_WORD_RIGHT,
ID_CURSOR_WORD_START,
ID_CURSOR_WORD_END,
ID_MARK,
ID_EXTEND,
ID_SELECT_ALL,
ID_DESELECT_ALL,
ID_CUT_SEL,
ID_COPY_SEL,
ID_PASTE_SEL,
ID_PASTE_MIDDLE,
ID_DELETE_SEL,
ID_DELETE_ALL,
ID_OVERST_STRING,
ID_INSERT_STRING,
ID_BACKSPACE,
ID_DELETE,
ID_TOGGLE_EDITABLE,
ID_TOGGLE_OVERSTRIKE,
ID_BLINK,
ID_LAST
};
public:
/// Construct text field wide enough to display ncols columns
FXTextField(FXComposite* p,FXint ncols,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=TEXTFIELD_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Create server-side resources
virtual void create();
/// Perform layout
virtual void layout();
/// Enable text field
virtual void enable();
/// Disable text field
virtual void disable();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Yes, text field may receive focus
virtual bool canFocus() const;
/// Move the focus to this window
virtual void setFocus();
/// Remove the focus from this window
virtual void killFocus();
/// Set editable mode
void setEditable(FXbool edit=TRUE);
/// Return TRUE if text field may be edited
FXbool isEditable() const;
/// Set overstrike mode
void setOverstrike(FXbool over=TRUE);
/// Return TRUE if overstrike mode in effect
FXbool isOverstrike() const;
/// Set cursor position
void setCursorPos(FXint pos);
/// Return cursor position
FXint getCursorPos() const { return cursor; }
/// Change anchor position
void setAnchorPos(FXint pos);
/// Return anchor position
FXint getAnchorPos() const { return anchor; }
/// Change the text and move cursor to end
void setText(const FXString& text,FXbool notify=FALSE);
/// Get the text for this label
FXString getText() const { return contents; }
/// Set the text font
void setFont(FXFont* fnt);
/// Get the text font
FXFont* getFont() const { return font; }
/// Change text color
void setTextColor(FXColor clr);
/// Return text color
FXColor getTextColor() const { return textColor; }
/// Change selected background color
void setSelBackColor(FXColor clr);
/// Return selected background color
FXColor getSelBackColor() const { return selbackColor; }
/// Change selected text color
void setSelTextColor(FXColor clr);
/// Return selected text color
FXColor getSelTextColor() const { return seltextColor; }
/// Changes the cursor color
void setCursorColor(FXColor clr);
/// Return the cursor color
FXColor getCursorColor() const { return cursorColor; }
/**
* Change the default width of the text field in terms of a number
* of columns times the width of the numeral '8'.
*/
void setNumColumns(FXint cols);
/// Return number of columns
FXint getNumColumns() const { return columns; }
/**
* Change text justification mode. The justify mode is a combination of
* horizontal justification (JUSTIFY_LEFT, JUSTIFY_RIGHT, or JUSTIFY_CENTER_X),
* and vertical justification (JUSTIFY_TOP, JUSTIFY_BOTTOM, JUSTIFY_CENTER_Y).
* Note that JUSTIFY_CENTER_X can not be set from the constructor since by
* default text fields are left-justified.
*/
void setJustify(FXuint mode);
/// Return text justification mode
FXuint getJustify() const;
/// Change word delimiters
void setDelimiters(const FXchar* delims=textDelimiters){ delimiters=delims; }
/// Return word delimiters
const FXchar* getDelimiters() const { return delimiters; }
/// Set the status line help text for this label
void setHelpText(const FXString& text){ help=text; }
/// Get the status line help text for this label
const FXString& getHelpText() const { return help; }
/// Set the tool tip message for this text field
void setTipText(const FXString& text){ tip=text; }
/// Get the tool tip message for this text field
const FXString& getTipText() const { return tip; }
/// Change text style
void setTextStyle(FXuint style);
/// Return text style
FXuint getTextStyle() const;
/// Select all text
FXbool selectAll();
/// Select len characters starting at given position pos
FXbool setSelection(FXint pos,FXint len);
/// Extend the selection from the anchor to the given position
FXbool extendSelection(FXint pos);
/// Unselect the text
FXbool killSelection();
/// Return TRUE if position pos is selected
FXbool isPosSelected(FXint pos) const;
/// Return TRUE if position is fully visible
FXbool isPosVisible(FXint pos) const;
/// Scroll text to make the given position visible
void makePositionVisible(FXint pos);
/// Save text field to a stream
virtual void save(FXStream& store) const;
/// Load text field from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXTextField();
};
}
#endif
fox-1.6.49/include/fxascii.h 0000664 0001750 0001750 00000005561 12130340076 012557 0000000 0000000 /********************************************************************************
* *
* A S C I I C h a r a c t e r I n f o *
* *
*********************************************************************************
* Copyright (C) 2005,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: fxascii.h,v 1.3 2006/01/22 17:58:13 fox Exp $ *
********************************************************************************/
#ifndef FXASCII_H
#define FXASCII_H
namespace FX {
namespace Ascii {
/// Get numeric value of character (this includes hex value)
extern FXAPI FXint digitValue(FXchar asc);
/// Ascii-only common functions
extern FXAPI bool hasCase(FXchar asc);
extern FXAPI bool isUpper(FXchar asc);
extern FXAPI bool isLower(FXchar asc);
extern FXAPI bool isTitle(FXchar asc);
extern FXAPI bool isAscii(FXchar asc);
extern FXAPI bool isLetter(FXchar asc);
extern FXAPI bool isDigit(FXchar asc);
extern FXAPI bool isAlphaNumeric(FXchar asc);
extern FXAPI bool isControl(FXchar asc);
extern FXAPI bool isSpace(FXchar asc);
extern FXAPI bool isBlank(FXchar asc);
extern FXAPI bool isPunct(FXchar asc);
extern FXAPI bool isGraph(FXchar asc);
extern FXAPI bool isPrint(FXchar asc);
extern FXAPI bool isHexDigit(FXchar asc);
extern FXAPI bool isSymbol(FXchar asc);
extern FXAPI bool isSep(FXchar asc);
/// Case conversion
extern FXAPI FXchar toUpper(FXchar asc);
extern FXAPI FXchar toLower(FXchar asc);
extern FXAPI FXchar toTitle(FXchar asc);
}
}
#endif
fox-1.6.49/include/FXTGAImage.h 0000664 0001750 0001750 00000006144 12130340076 012743 0000000 0000000 /********************************************************************************
* *
* T A R G A I m a g e O b j e c t *
* *
*********************************************************************************
* Copyright (C) 2001,2006 by Janusz Ganczarski. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXTGAImage.h,v 1.18 2006/01/22 17:58:10 fox Exp $ *
********************************************************************************/
#ifndef FXTGAIMAGE_H
#define FXTGAIMAGE_H
#ifndef FXIMAGE_H
#include "FXImage.h"
#endif
namespace FX {
/// TARGA graphics file
class FXAPI FXTGAImage : public FXImage {
FXDECLARE(FXTGAImage)
protected:
FXTGAImage(){}
private:
FXTGAImage(const FXTGAImage&);
FXTGAImage &operator=(const FXTGAImage&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct image from memory stream formatted in TARGA file
FXTGAImage(FXApp* a,const void *pix=NULL,FXuint opts=0,FXint w=1,FXint h=1);
/// Save pixels into stream in TARGA file
virtual bool savePixels(FXStream& store) const;
/// Load pixels from stream in TARGA format
virtual bool loadPixels(FXStream& store);
/// Destroy image
virtual ~FXTGAImage();
};
/**
* Check if stream contains a TARGA, return TRUE if so.
*/
extern FXAPI bool fxcheckTGA(FXStream& store);
/**
* Load an TARGA file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadTGA(FXStream& store,FXColor*& data,FXint& width,FXint& height);
/**
* Save an TARGA file to a stream.
*/
extern FXAPI bool fxsaveTGA(FXStream& store,const FXColor *data,FXint width,FXint height);
}
#endif
fox-1.6.49/include/FXKnob.h 0000664 0001750 0001750 00000016221 12130340076 012253 0000000 0000000 /********************************************************************************
* *
* K n o b W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2005,2006 by Leandro Nini. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXKnob.h,v 1.7 2006/01/22 17:58:05 fox Exp $ *
********************************************************************************/
#ifndef FXKNOB_H
#define FXKNOB_H
#ifndef FXFRAME_H
#include "FXFrame.h"
#endif
namespace FX {
/// Knob Control styles
enum {
KNOB_NEEDLE = 0, /// Use a needle as indicator
KNOB_DOT = 0x00008000, /// Use a dot as indicator
KNOB_TICKS = 0x00010000, /// Show ticks around the knob
KNOB_INDICATOR = 0x00020000, /// Show only the indicator (like a speedometer)
KNOB_NORMAL = (KNOB_NEEDLE|KNOB_TICKS) /// Normal knob looks
};
/**
* The knob widget is a valuator widget which provides simple linear value range.
* While being moved, the knob sends SEL_CHANGED messages to its target;
* at the end of the interaction, a final SEL_COMMAND message is sent.
* The message data represents the current knob value, of type FXint.
*/
class FXAPI FXKnob : public FXFrame {
FXDECLARE(FXKnob)
protected:
FXint range[2]; // Reported data range
FXdouble limits[2]; // Starting and ending positions
FXColor lineColor; // Color of indicator needle
FXint pos; // Reported data position
FXint incr; // Increment when auto-sliding
FXint delta; // Interval between ticks
FXString help; // Help string
FXString tip; // Tip string
protected:
FXKnob();
FXint calcValue(FXint x,FXint y);
private:
FXKnob(const FXKnob&);
FXKnob &operator=(const FXKnob&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onMiddleBtnPress(FXObject*,FXSelector,void*);
long onMiddleBtnRelease(FXObject*,FXSelector,void*);
long onMouseWheel(FXObject*,FXSelector,void*);
long onUngrabbed(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onFocusIn(FXObject*,FXSelector,void*);
long onFocusOut(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onAutoSlide(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetIntValue(FXObject*,FXSelector,void*);
long onCmdGetIntValue(FXObject*,FXSelector,void*);
long onCmdSetRealValue(FXObject*,FXSelector,void*);
long onCmdGetRealValue(FXObject*,FXSelector,void*);
long onCmdSetIntRange(FXObject*,FXSelector,void*);
long onCmdGetIntRange(FXObject*,FXSelector,void*);
long onCmdSetRealRange(FXObject*,FXSelector,void*);
long onCmdGetRealRange(FXObject*,FXSelector,void*);
long onCmdSetHelp(FXObject*,FXSelector,void*);
long onCmdGetHelp(FXObject*,FXSelector,void*);
long onCmdSetTip(FXObject*,FXSelector,void*);
long onCmdGetTip(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
public:
enum{
ID_AUTOSLIDE=FXFrame::ID_LAST,
ID_LAST
};
public:
/// Construct a knob widget
FXKnob(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=KNOB_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Returns true because a knob can receive focus
virtual bool canFocus() const;
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Perform layout
virtual void layout();
/// Enable the knob
virtual void enable();
/// Disable the knob
virtual void disable();
/// Change knob value
void setValue(FXint value,FXbool notify=FALSE);
/// Return knob value
FXint getValue() const { return pos; }
/// Change the knob's range
void setRange(FXint lo,FXint hi,FXbool notify=FALSE);
/// Get the knob's current range
void getRange(FXint& lo,FXint& hi) const { lo=range[0]; hi=range[1]; }
/**
* Change the knob's movement limits (start and ending angles)
* accept values in degrees from 0 (south) to 360.
*/
void setLimits(FXint start,FXint end,FXbool notify=FALSE);
/// Get the knob's current limits
void getLimits(FXint& start,FXint& end);
/// Change the knob style
FXuint getKnobStyle() const;
/// Get the current knob style
void setKnobStyle(FXuint style);
/// Get the knob's auto-increment/decrement value
FXint getIncrement() const { return incr; }
/// Change the knob's auto-increment/decrement value
void setIncrement(FXint inc){ incr=inc; }
/// Change the delta between ticks
void setTickDelta(FXint dist);
/// Get delta between ticks
FXint getTickDelta() const { return delta; }
/// Change the indicator needle color
void setLineColor(FXColor clr);
/// Get the current indicator needle color
FXColor getLineColor() const { return lineColor; }
/// Set the help text to be displayed on the status line
void setHelpText(const FXString& text){ help=text; }
/// Get the current help text
const FXString& getHelpText() const { return help; }
/// Set the tip text to be displayed in the tooltip
void setTipText(const FXString& text){ tip=text; }
/// Get the current tooltip text value
const FXString& getTipText() const { return tip; }
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
/// Destroy the knob
virtual ~FXKnob();
};
}
#endif
fox-1.6.49/include/FXFileDialog.h 0000664 0001750 0001750 00000014665 12130340076 013373 0000000 0000000 /********************************************************************************
* *
* F i l e S e l e c t i o n D i a l o g *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXFileDialog.h,v 1.34 2006/01/23 06:03:15 fox Exp $ *
********************************************************************************/
#ifndef FXFILEDIALOG_H
#define FXFILEDIALOG_H
#ifndef FXDIALOGBOX_H
#include "FXDialogBox.h"
#endif
namespace FX {
class FXFileSelector;
/// File selection dialog
class FXAPI FXFileDialog : public FXDialogBox {
FXDECLARE(FXFileDialog)
protected:
FXFileSelector *filebox;
protected:
FXFileDialog(){}
void initdialog();
private:
FXFileDialog(const FXFileDialog&);
FXFileDialog &operator=(const FXFileDialog&);
public:
/// Construct file dialog box
FXFileDialog(FXWindow* owner,const FXString& name,FXuint opts=0,FXint x=0,FXint y=0,FXint w=500,FXint h=300);
/// Construct free-floating file dialog box
FXFileDialog(FXApp* a,const FXString& name,FXuint opts=0,FXint x=0,FXint y=0,FXint w=500,FXint h=300);
/// Hide this window
virtual void hide();
/// Change file name
void setFilename(const FXString& path);
/// Return file name, if any
FXString getFilename() const;
/// Return empty-string terminated list of selected file names, or NULL if none selected
FXString* getFilenames() const;
/// Change file pattern
void setPattern(const FXString& ptrn);
/// Return file pattern
FXString getPattern() const;
/**
* Change the list of file patterns shown in the file dialog.
* Each pattern comprises an optional name, followed by a pattern in
* parentheses. The patterns are separated by newlines.
* For example,
*
* "*\n*.cpp,*.cc\n*.hpp,*.hh,*.h"
*
* and
*
* "All Files (*)\nC++ Sources (*.cpp,*.cc)\nC++ Headers (*.hpp,*.hh,*.h)"
*
* will set the same three patterns, but the former shows no pattern names.
*/
void setPatternList(const FXString& patterns);
/// Return list of patterns
FXString getPatternList() const;
/**
* After setting the list of patterns, this call will
* initially select pattern n as the active one.
*/
void setCurrentPattern(FXint n);
/// Return current pattern number
FXint getCurrentPattern() const;
/// Get pattern text for given pattern number
FXString getPatternText(FXint patno) const;
/// Change pattern text for pattern number
void setPatternText(FXint patno,const FXString& text);
/// Return number of patterns
FXint getNumPatterns() const;
/// Allow pattern entry
void allowPatternEntry(FXbool allow);
/// Return TRUE if pattern entry is allowed
FXbool allowPatternEntry() const;
/// Change directory
void setDirectory(const FXString& path);
/// Return directory
FXString getDirectory() const;
/// Set the inter-item spacing (in pixels)
void setItemSpace(FXint s);
/// Return the inter-item spacing (in pixels)
FXint getItemSpace() const;
/// Change file selection mode
void setSelectMode(FXuint mode);
/// Return file selection mode
FXuint getSelectMode() const;
/// Change wildcard matching mode
void setMatchMode(FXuint mode);
/// Return wildcard matching mode
FXuint getMatchMode() const;
/// Return TRUE if showing hidden files
FXbool showHiddenFiles() const;
/// Show or hide hidden files
void showHiddenFiles(FXbool showing);
/// Return TRUE if image preview on
FXbool showImages() const;
/// Show or hide preview images
void showImages(FXbool showing);
/// Return images preview size
FXint getImageSize() const;
/// Change images preview size
void setImageSize(FXint size);
/// Show readonly button
void showReadOnly(FXbool show);
/// Return TRUE if readonly is shown
FXbool shownReadOnly() const;
/// Set initial state of readonly button
void setReadOnly(FXbool state);
/// Get readonly state
FXbool getReadOnly() const;
/// Change File List style
void setFileBoxStyle(FXuint style);
/// Return File List style
FXuint getFileBoxStyle() const;
/// Allow or disallow navigation
void allowNavigation(FXbool navigable);
/// Is navigation allowed?
FXbool allowNavigation() const;
/// Open existing filename
static FXString getOpenFilename(FXWindow* owner,const FXString& caption,const FXString& path,const FXString& patterns="*",FXint initial=0);
/// Open multiple existing files
static FXString* getOpenFilenames(FXWindow* owner,const FXString& caption,const FXString& path,const FXString& patterns="*",FXint initial=0);
/// Save to filename
static FXString getSaveFilename(FXWindow* owner,const FXString& caption,const FXString& path,const FXString& patterns="*",FXint initial=0);
/// Open directory name
static FXString getOpenDirectory(FXWindow* owner,const FXString& caption,const FXString& path);
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXFileDialog();
};
}
#endif
fox-1.6.49/include/FXDate.h 0000664 0001750 0001750 00000013244 12130340076 012241 0000000 0000000 /********************************************************************************
* *
* D a t e C l a s s *
* *
*********************************************************************************
* Copyright (C) 2005,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXDate.h,v 1.10.2.1 2006/07/17 17:57:30 fox Exp $ *
********************************************************************************/
#ifndef FXDATE_H
#define FXDATE_H
namespace FX {
/**
* Gregorian date object.
*/
class FXAPI FXDate {
private:
FXuint julian;
private:
static const FXchar shortMonthName[12][4];
static const FXchar longMonthName[12][10];
static const FXchar shortWeekDay[7][4];
static const FXchar longWeekDay[7][10];
protected:
static void greg2jul(FXuint& jd,FXint y,FXint m,FXint d);
static void jul2greg(FXuint jd,FXint& y,FXint& m,FXint& d);
public:
/// Names for the months
enum {
Jan=1,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec
};
/// Names for the weekdays
enum {
Sun=0,Mon,Tue,Wed,Thu,Fri,Sat
};
public:
/// Default constructor
FXDate(){}
/// Copy constructor
FXDate(const FXDate& date):julian(date.julian){}
/// Initialize with year, month, and day
FXDate(FXint y,FXint m,FXint d);
/// Initialize with julian day number
FXDate(FXuint j):julian(j){}
/// Set julian day number
void setJulian(FXuint d){ julian=d; }
/// Get julian day number
FXuint getJulian() const { return julian; }
/// Set to year, month, and day
void setDate(FXint y,FXint m,FXint d);
/// Get year, month, and day
void getDate(FXint& y,FXint& m,FXint& d) const;
/// Return day of the month
FXint day() const;
/// Return month
FXint month() const;
/// Return year
FXint year() const;
/// Return day of the week
FXint dayOfWeek() const;
/// Return day of year
FXint dayOfYear() const;
/// Return days in this month
FXint daysInMonth() const;
/// Return true if leap year
bool leapYear() const;
/// Is the value a leap year
static bool leapYear(FXint y);
/// Get the name of the month
static const FXchar *monthName(FXint m){ return longMonthName[m-1]; }
/// Get the abbreviated name of the month
static const FXchar *monthNameShort(FXint m){ return shortMonthName[m-1]; }
/// Get the name of the day
static const FXchar *dayName(FXint d){ return longWeekDay[d]; }
/// Get the abbreviated name of the day
static const FXchar *dayNameShort(FXint d){ return shortWeekDay[d]; }
/// Return current local date
static FXDate localDate();
/// Return current UTC (Zulu) date
static FXDate zuluDate();
/// Assignment
FXDate& operator=(const FXDate& date){julian=date.julian;return *this;}
/// Assignment operators
FXDate& operator+=(FXint x){ julian+=x; return *this; }
FXDate& operator-=(FXint x){ julian-=x; return *this; }
/// Increment and decrement
FXDate& operator++(){ julian++; return *this; }
FXDate& operator--(){ julian--; return *this; }
/// Equality tests
bool operator==(const FXDate& date) const { return julian==date.julian;}
bool operator!=(const FXDate& date) const { return julian!=date.julian;}
/// Inequality tests
bool operator<(const FXDate& date) const { return julian(const FXDate& date) const { return julian>date.julian;}
bool operator>=(const FXDate& date) const { return julian>=date.julian;}
/// Add days to date yielding another date
friend inline FXDate operator+(const FXDate& d,FXint x);
friend inline FXDate operator+(FXint x,const FXDate& d);
/// Substract dates yielding days
friend inline FXint operator-(const FXDate& a,const FXDate& b);
/// save to stream
friend FXAPI FXStream& operator<<(FXStream& store,const FXDate& d);
/// load from stream
friend FXAPI FXStream& operator>>(FXStream& store,FXDate& d);
};
inline FXDate operator+(const FXDate& d,FXint x){ return FXDate(d.julian+x); }
inline FXDate operator+(FXint x,const FXDate& d){ return FXDate(x+d.julian); }
inline FXint operator-(const FXDate& a,const FXDate& b){return a.julian-b.julian; }
extern FXAPI FXStream& operator<<(FXStream& store,const FXDate& d);
extern FXAPI FXStream& operator>>(FXStream& store,FXDate& d);
}
#endif
fox-1.6.49/include/FXExtentd.h 0000664 0001750 0001750 00000011403 12130340076 012772 0000000 0000000 /********************************************************************************
* *
* D o u b l e - P r e c i s i o n E x t e n t C l a s s *
* *
*********************************************************************************
* Copyright (C) 2004,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXExtentd.h,v 1.8.2.1 2006/07/25 01:35:36 fox Exp $ *
********************************************************************************/
#ifndef FXEXTENTD_H
#define FXEXTENTD_H
namespace FX {
/// Extent
class FXAPI FXExtentd {
public:
FXVec2d lower;
FXVec2d upper;
public:
/// Default constructor
FXExtentd(){}
/// Copy constructor
FXExtentd(const FXExtentd& ext):lower(ext.lower),upper(ext.upper){}
/// Initialize from two vectors
FXExtentd(const FXVec2d& lo,const FXVec2d& hi):lower(lo),upper(hi){}
/// Initialize from six numbers
FXExtentd(FXdouble xlo,FXdouble xhi,FXdouble ylo,FXdouble yhi):lower(xlo,ylo),upper(xhi,yhi){}
/// Assignment
FXExtentd& operator=(const FXExtentd& ext){ lower=ext.lower; upper=ext.upper; return *this; }
/// Indexing with 0..1
FXVec2d& operator[](FXint i){ return (&lower)[i]; }
/// Indexing with 0..1
const FXVec2d& operator[](FXint i) const { return (&lower)[i]; }
/// Comparison
bool operator==(const FXExtentd& ext) const { return lower==ext.lower && upper==ext.upper;}
bool operator!=(const FXExtentd& ext) const { return lower!=ext.lower || upper!=ext.upper;}
/// Width of box
FXdouble width() const { return upper.x-lower.x; }
/// Height of box
FXdouble height() const { return upper.y-lower.y; }
/// Longest side
FXdouble longest() const;
/// shortest side
FXdouble shortest() const;
/// Length of diagonal
FXdouble diameter() const;
/// Get radius of box
FXdouble radius() const;
/// Compute diagonal
FXVec2d diagonal() const;
/// Get center of box
FXVec2d center() const;
/// Test if empty
bool empty() const;
/// Test if box contains point x,y
bool contains(FXdouble x,FXdouble y) const;
/// Test if box contains point p
bool contains(const FXVec2d& p) const;
/// Test if box properly contains another box
bool contains(const FXExtentd& ext) const;
/// Include point
FXExtentd& include(FXdouble x,FXdouble y);
/// Include point
FXExtentd& include(const FXVec2d& v);
/// Include given range into extent
FXExtentd& include(const FXExtentd& ext);
/// Test if bounds overlap
friend FXAPI bool overlap(const FXExtentd& a,const FXExtentd& b);
/// Get corner number 0..3
FXVec2d corner(FXint c) const { return FXVec2d((&lower)[c&1].x, (&lower)[(c>>1)&1].y); }
/// Union of two boxes
friend FXAPI FXExtentd unite(const FXExtentd& a,const FXExtentd& b);
/// Intersection of two boxes
friend FXAPI FXExtentd intersect(const FXExtentd& a,const FXExtentd& b);
/// Save object to a stream
friend FXAPI FXStream& operator<<(FXStream& store,const FXExtentd& ext);
/// Load object from a stream
friend FXAPI FXStream& operator>>(FXStream& store,FXExtentd& ext);
};
extern FXAPI bool overlap(const FXExtentd& a,const FXExtentd& b);
extern FXAPI FXExtentd unite(const FXExtentd& a,const FXExtentd& b);
extern FXAPI FXExtentd intersect(const FXExtentd& a,const FXExtentd& b);
extern FXAPI FXStream& operator<<(FXStream& store,const FXExtentd& ext);
extern FXAPI FXStream& operator>>(FXStream& store,FXExtentd& ext);
}
#endif
fox-1.6.49/include/FXCP1255Codec.h 0000644 0001750 0001750 00000001106 11637250333 013140 0000000 0000000 #ifndef FXCP1255CODEC_H
#define FXCP1255CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// CP1255 Codec
class FXAPI FXCP1255Codec : public FXTextCodec {
FXDECLARE(FXCP1255Codec)
public:
FXCP1255Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FXCP1255Codec(){}
};
}
#endif
fox-1.6.49/include/FXCP437Codec.h 0000644 0001750 0001750 00000001077 11637250333 013070 0000000 0000000 #ifndef FXCP437CODEC_H
#define FXCP437CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// CP437 Codec
class FXAPI FXCP437Codec : public FXTextCodec {
FXDECLARE(FXCP437Codec)
public:
FXCP437Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FXCP437Codec(){}
};
}
#endif
fox-1.6.49/include/FXSpinner.h 0000664 0001750 0001750 00000016367 12130340076 013013 0000000 0000000 /********************************************************************************
* *
* S p i n B u t t o n W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Lyle Johnson. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXSpinner.h,v 1.46 2006/02/06 03:03:40 fox Exp $ *
********************************************************************************/
#ifndef FXSPINNER_H
#define FXSPINNER_H
#ifndef FXPACKER_H
#include "FXPacker.h"
#endif
namespace FX {
/// Spinner Options
enum {
SPIN_NORMAL = 0, /// Normal, non-cyclic
SPIN_CYCLIC = 0x00020000, /// Cyclic spinner
SPIN_NOTEXT = 0x00040000, /// No text visible
SPIN_NOMAX = 0x00080000, /// Spin all the way up to infinity
SPIN_NOMIN = 0x00100000 /// Spin all the way down to -infinity
};
class FXTextField;
class FXArrowButton;
/// Spinner control
class FXAPI FXSpinner : public FXPacker {
FXDECLARE(FXSpinner)
protected:
FXTextField *textField; // Text field
FXArrowButton *upButton; // The up button
FXArrowButton *downButton; // The down button
FXint range[2]; // Reported data range
FXint incr; // Increment
FXint pos; // Current position
protected:
FXSpinner();
private:
FXSpinner(const FXSpinner&);
FXSpinner& operator=(const FXSpinner&);
public:
long onUpdIncrement(FXObject*,FXSelector,void*);
long onCmdIncrement(FXObject*,FXSelector,void*);
long onUpdDecrement(FXObject*,FXSelector,void*);
long onCmdDecrement(FXObject*,FXSelector,void*);
long onCmdEntry(FXObject*,FXSelector,void*);
long onChgEntry(FXObject*,FXSelector,void*);
long onWheelEntry(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetIntValue(FXObject*,FXSelector,void*);
long onCmdGetIntValue(FXObject*,FXSelector,void*);
long onCmdSetIntRange(FXObject*,FXSelector,void*);
long onCmdGetIntRange(FXObject*,FXSelector,void*);
long onFocusSelf(FXObject*,FXSelector,void*);
public:
enum{
ID_INCREMENT=FXPacker::ID_LAST,
ID_DECREMENT,
ID_ENTRY,
ID_LAST
};
public:
/// Construct a spinner
FXSpinner(FXComposite *p,FXint cols,FXObject *tgt=NULL,FXSelector sel=0,FXuint opts=SPIN_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Perform layout
virtual void layout();
/// Disable spinner
virtual void disable();
/// Enable spinner
virtual void enable();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Increment spinner
void increment(FXbool notify=FALSE);
/// Increment spinner by certain amount
void incrementByAmount(FXint amount,FXbool notify=FALSE);
/// Decrement spinner
void decrement(FXbool notify=FALSE);
/// Decrement spinner by certain amount
void decrementByAmount(FXint amount, FXbool notify=FALSE);
/// Return TRUE if in cyclic mode
FXbool isCyclic() const;
/// Set to cyclic mode, i.e. wrap around at maximum/minimum
void setCyclic(FXbool cyclic);
/// Return TRUE if text is visible
FXbool isTextVisible() const;
/// Set text visible flag
void setTextVisible(FXbool shown);
/// Change current value
virtual void setValue(FXint value,FXbool notify=FALSE);
/// Return current value
FXint getValue() const { return pos; }
/// Change the spinner's range
void setRange(FXint lo,FXint hi,FXbool notify=FALSE);
/// Get the spinner's current range
void getRange(FXint& lo,FXint& hi) const { lo=range[0]; hi=range[1]; }
/// Change spinner increment
void setIncrement(FXint increment);
/// Return spinner increment
FXint getIncrement() const { return incr; }
/// Set the text font
void setFont(FXFont *fnt);
/// Get the text font
FXFont *getFont() const;
/// Set the status line help text for this spinner
void setHelpText(const FXString& text);
/// Get the status line help text for this spinner
const FXString& getHelpText() const;
/// Set the tool tip message for this spinner
void setTipText(const FXString& text);
/// Get the tool tip message for this spinner
const FXString& getTipText() const;
/// Change spinner style
void setSpinnerStyle(FXuint style);
/// Return current spinner style
FXuint getSpinnerStyle() const;
/// Allow editing of the text field
void setEditable(FXbool edit=TRUE);
/// Return TRUE if text field is editable
FXbool isEditable() const;
/// Change color of the up arrow
void setUpArrowColor(FXColor clr);
/// Return color of the up arrow
FXColor getUpArrowColor() const;
/// Change color of the down arrow
void setDownArrowColor(FXColor clr);
/// Return color of the the down arrow
FXColor getDownArrowColor() const;
/// Change text color
void setTextColor(FXColor clr);
/// Return text color
FXColor getTextColor() const;
/// Change selected background color
void setSelBackColor(FXColor clr);
/// Return selected background color
FXColor getSelBackColor() const;
/// Change selected text color
void setSelTextColor(FXColor clr);
/// Return selected text color
FXColor getSelTextColor() const;
/// Changes the cursor color
void setCursorColor(FXColor clr);
/// Return the cursor color
FXColor getCursorColor() const;
/// Change width of text field in terms of number of columns * `m'
void setNumColumns(FXint cols);
/// Return number of columns
FXint getNumColumns() const;
/// Save spinner to a stream
virtual void save(FXStream& store) const;
/// Load spinner from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXSpinner();
};
}
#endif
fox-1.6.49/include/FXURL.h 0000664 0001750 0001750 00000004506 12130340076 012027 0000000 0000000 /********************************************************************************
* *
* U R L M a n i p u l a t i o n *
* *
*********************************************************************************
* Copyright (C) 2000,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXURL.h,v 1.13 2006/01/22 17:58:12 fox Exp $ *
********************************************************************************/
#ifndef FXURL_H
#define FXURL_H
namespace FX {
namespace FXURL {
/// Return host name
extern FXAPI FXString hostname();
/// Return URL of filename
extern FXAPI FXString fileToURL(const FXString& file);
/// Return filename from URL, empty if url is not a local file
extern FXAPI FXString fileFromURL(const FXString& url);
/// Decode url string
extern FXAPI FXString decode(const FXString& url);
/// Encode url string
extern FXAPI FXString encode(const FXString& url);
}
}
#endif
fox-1.6.49/include/FXVec4f.h 0000664 0001750 0001750 00000023141 12130340076 012330 0000000 0000000 /********************************************************************************
* *
* S i n g l e - P r e c i s i o n 4 - E l e m e n t V e c t o r *
* *
*********************************************************************************
* Copyright (C) 1994,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXVec4f.h,v 1.32 2006/01/22 17:58:12 fox Exp $ *
********************************************************************************/
#ifndef FXVEC4F_H
#define FXVEC4F_H
namespace FX {
class FXMat4f;
/// Single-precision 4-element vector
class FXAPI FXVec4f {
public:
FXfloat x;
FXfloat y;
FXfloat z;
FXfloat w;
public:
/// Default constructor
FXVec4f(){}
/// Initialize from another vector
FXVec4f(const FXVec4f& v){x=v.x;y=v.y;z=v.z;w=v.w;}
/// Construct with 3-vector and optional scalar
FXVec4f(const FXVec3f& v,FXfloat ww=1.0f){x=v.x;y=v.y;z=v.z;w=ww;}
/// Construct from array of floats
FXVec4f(const FXfloat v[]){x=v[0];y=v[1];z=v[2];w=v[3];}
/// Construct from components
FXVec4f(FXfloat xx,FXfloat yy,FXfloat zz,FXfloat ww=1.0f){x=xx;y=yy;z=zz;w=ww;}
/// Construct from color
FXVec4f(FXColor color);
/// Return a non-const reference to the ith element
FXfloat& operator[](FXint i){return (&x)[i];}
/// Return a const reference to the ith element
const FXfloat& operator[](FXint i) const {return (&x)[i];}
/// Assign color
FXVec4f& operator=(FXColor color);
/// Assignment
FXVec4f& operator=(const FXVec3f& v){x=v.x;y=v.y;z=v.z;w=1.0f;return *this;}
FXVec4f& operator=(const FXVec4f& v){x=v.x;y=v.y;z=v.z;w=v.w;return *this;}
/// Assignment from array of floats
FXVec4f& operator=(const FXfloat v[]){x=v[0];y=v[1];z=v[2];w=v[3];return *this;}
/// Set value from another vector
FXVec4f& set(const FXVec4f& v){x=v.x;y=v.y;z=v.z;w=v.w;return *this;}
/// Set value from array of floats
FXVec4f& set(const FXfloat v[]){x=v[0];y=v[1];z=v[2];w=v[3];return *this;}
/// Set value from components
FXVec4f& set(FXfloat xx,FXfloat yy,FXfloat zz,FXfloat ww){x=xx;y=yy;z=zz;w=ww;return *this;}
/// Assigning operators
FXVec4f& operator*=(FXfloat n){x*=n;y*=n;z*=n;w*=n;return *this;}
FXVec4f& operator/=(FXfloat n){x/=n;y/=n;z/=n;w/=n;return *this;}
FXVec4f& operator+=(const FXVec4f& v){x+=v.x;y+=v.y;z+=v.z;w+=v.w;return *this;}
FXVec4f& operator-=(const FXVec4f& v){x-=v.x;y-=v.y;z-=v.z;w-=v.w;return *this;}
/// Conversion
operator FXfloat*(){return &x;}
operator const FXfloat*() const {return &x;}
operator FXVec3f&(){return *reinterpret_cast(this);}
operator const FXVec3f&() const {return *reinterpret_cast(this);}
/// Convert to color
operator FXColor() const;
/// Unary
FXVec4f operator+() const { return *this; }
FXVec4f operator-() const { return FXVec4f(-x,-y,-z,-w); }
/// Vector and vector
FXVec4f operator+(const FXVec4f& v) const { return FXVec4f(x+v.x,y+v.y,z+v.z,w+v.w); }
FXVec4f operator-(const FXVec4f& v) const { return FXVec4f(x-v.x,y-v.y,z-v.z,w-v.w); }
/// Vector and matrix
FXVec4f operator*(const FXMat4f& m) const;
/// Scaling
friend inline FXVec4f operator*(const FXVec4f& a,FXfloat n);
friend inline FXVec4f operator*(FXfloat n,const FXVec4f& a);
friend inline FXVec4f operator/(const FXVec4f& a,FXfloat n);
friend inline FXVec4f operator/(FXfloat n,const FXVec4f& a);
/// Dot product
FXfloat operator*(const FXVec4f& v) const { return x*v.x+y*v.y+z*v.z+w*v.w; }
/// Test if zero
bool operator!() const { return x==0.0f && y==0.0f && z==0.0f && w==0.0f; }
/// Equality tests
bool operator==(const FXVec4f& v) const {return x==v.x && y==v.y && z==v.z && w==v.w; }
bool operator!=(const FXVec4f& v) const {return x!=v.x || y!=v.y || z!=v.z || w!=v.w; }
friend inline bool operator==(const FXVec4f& a,FXfloat n);
friend inline bool operator!=(const FXVec4f& a,FXfloat n);
friend inline bool operator==(FXfloat n,const FXVec4f& a);
friend inline bool operator!=(FXfloat n,const FXVec4f& a);
/// Inequality tests
bool operator<(const FXVec4f& v) const { return x(const FXVec4f& v) const { return x>v.x && y>v.y && z>v.z && w>v.w; }
bool operator>=(const FXVec4f& v) const { return x>=v.x && y>=v.y && z>=v.z && w>=v.w; }
friend inline bool operator<(const FXVec4f& a,FXfloat n);
friend inline bool operator<=(const FXVec4f& a,FXfloat n);
friend inline bool operator>(const FXVec4f& a,FXfloat n);
friend inline bool operator>=(const FXVec4f& a,FXfloat n);
friend inline bool operator<(FXfloat n,const FXVec4f& a);
friend inline bool operator<=(FXfloat n,const FXVec4f& a);
friend inline bool operator>(FXfloat n,const FXVec4f& a);
friend inline bool operator>=(FXfloat n,const FXVec4f& a);
/// Length and square of length
FXfloat length2() const { return x*x+y*y+z*z+w*w; }
FXfloat length() const { return sqrtf(length2()); }
/// Clamp values of vector between limits
FXVec4f& clamp(FXfloat lo,FXfloat hi){x=FXCLAMP(lo,x,hi);y=FXCLAMP(lo,y,hi);z=FXCLAMP(lo,z,hi);w=FXCLAMP(lo,w,hi);return *this;}
/// Lowest or highest components
friend inline FXVec4f lo(const FXVec4f& a,const FXVec4f& b);
friend inline FXVec4f hi(const FXVec4f& a,const FXVec4f& b);
/// Compute normalized plane equation ax+by+cz+d=0
friend FXAPI FXVec4f plane(const FXVec4f& vec);
friend FXAPI FXVec4f plane(const FXVec3f& vec,FXfloat dist);
friend FXAPI FXVec4f plane(const FXVec3f& vec,const FXVec3f& p);
friend FXAPI FXVec4f plane(const FXVec3f& a,const FXVec3f& b,const FXVec3f& c);
/// Signed distance normalized plane and point
FXfloat distance(const FXVec3f& p) const;
/// Return true if edge a-b crosses plane
bool crosses(const FXVec3f& a,const FXVec3f& b) const;
/// Normalize vector
friend FXAPI FXVec4f normalize(const FXVec4f& v);
/// Save to a stream
friend FXAPI FXStream& operator<<(FXStream& store,const FXVec4f& v);
/// Load from a stream
friend FXAPI FXStream& operator>>(FXStream& store,FXVec4f& v);
};
inline FXVec4f operator*(const FXVec4f& a,FXfloat n){return FXVec4f(a.x*n,a.y*n,a.z*n,a.w*n);}
inline FXVec4f operator*(FXfloat n,const FXVec4f& a){return FXVec4f(n*a.x,n*a.y,n*a.z,n*a.w);}
inline FXVec4f operator/(const FXVec4f& a,FXfloat n){return FXVec4f(a.x/n,a.y/n,a.z/n,a.w/n);}
inline FXVec4f operator/(FXfloat n,const FXVec4f& a){return FXVec4f(n/a.x,n/a.y,n/a.z,n/a.w);}
inline bool operator==(const FXVec4f& a,FXfloat n){return a.x==n && a.y==n && a.z==n && a.w==n;}
inline bool operator!=(const FXVec4f& a,FXfloat n){return a.x!=n || a.y!=n || a.z!=n || a.w!=n;}
inline bool operator==(FXfloat n,const FXVec4f& a){return n==a.x && n==a.y && n==a.z && n==a.w;}
inline bool operator!=(FXfloat n,const FXVec4f& a){return n!=a.x || n!=a.y || n!=a.z || n!=a.w;}
inline bool operator<(const FXVec4f& a,FXfloat n){return a.x(const FXVec4f& a,FXfloat n){return a.x>n && a.y>n && a.z>n && a.w>n;}
inline bool operator>=(const FXVec4f& a,FXfloat n){return a.x>=n && a.y>=n && a.z>=n && a.w>=n;}
inline bool operator<(FXfloat n,const FXVec4f& a){return n(FXfloat n,const FXVec4f& a){return n>a.x && n>a.y && n>a.z && n>a.w;}
inline bool operator>=(FXfloat n,const FXVec4f& a){return n>=a.x && n>=a.y && n>=a.z && n>=a.w;}
inline FXVec4f lo(const FXVec4f& a,const FXVec4f& b){return FXVec4f(FXMIN(a.x,b.x),FXMIN(a.y,b.y),FXMIN(a.z,b.z),FXMIN(a.w,b.w));}
inline FXVec4f hi(const FXVec4f& a,const FXVec4f& b){return FXVec4f(FXMAX(a.x,b.x),FXMAX(a.y,b.y),FXMAX(a.z,b.z),FXMAX(a.w,b.w));}
extern FXAPI FXVec4f plane(const FXVec4f& vec);
extern FXAPI FXVec4f plane(const FXVec3f& vec,FXfloat dist);
extern FXAPI FXVec4f plane(const FXVec3f& vec,const FXVec3f& p);
extern FXAPI FXVec4f plane(const FXVec3f& a,const FXVec3f& b,const FXVec3f& c);
extern FXAPI FXVec4f normalize(const FXVec4f& v);
extern FXAPI FXStream& operator<<(FXStream& store,const FXVec4f& v);
extern FXAPI FXStream& operator>>(FXStream& store,FXVec4f& v);
}
#endif
fox-1.6.49/include/FXMatrix.h 0000664 0001750 0001750 00000011406 12130340076 012626 0000000 0000000 /********************************************************************************
* *
* M a t r i x C o n t a i n e r W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXMatrix.h,v 1.19 2006/01/22 17:58:06 fox Exp $ *
********************************************************************************/
#ifndef FXMATRIX_H
#define FXMATRIX_H
#ifndef FXPACKER_H
#include "FXPacker.h"
#endif
namespace FX {
/// Matrix packing options
enum {
MATRIX_BY_ROWS = 0, /// Fixed number of rows, add columns as needed
MATRIX_BY_COLUMNS = 0x00020000 /// Fixed number of columns, adding rows as needed
};
/**
* The Matrix layout manager automatically arranges its child windows
* in rows and columns. If the matrix style is MATRIX_BY_ROWS, then
* the matrix will have the given number of rows and the number of columns
* grows as more child windows are added; if the matrix style is MATRIX_BY_COLUMNS,
* then the number of columns is fixed and the number of rows grows as more children
* are added.
* If all children in a row (column) have the LAYOUT_FILL_ROW (LAYOUT_FILL_COLUMN)
* hint set, then the row (column) will be stretchable as the matrix layout manager
* itself is resized. If more than one row (column) is stretchable, the space is
* apportioned to each stretchable row (column) proportionally.
* Within each cell of the matrix, all other layout hints are observed.
* For example, a child having LAYOUT_CENTER_Y and LAYOUT_FILL_X hints will
* be centered in the Y-direction, while being stretched in the X-direction.
* Empty cells can be obtained by simply placing a borderless FXFrame widget
* as a space-holder.
*/
class FXAPI FXMatrix : public FXPacker {
FXDECLARE(FXMatrix)
protected:
FXint num;
protected:
FXMatrix(){}
private:
FXMatrix(const FXMatrix&);
FXMatrix &operator=(const FXMatrix&);
public:
long onFocusUp(FXObject*,FXSelector,void*);
long onFocusDown(FXObject*,FXSelector,void*);
long onFocusLeft(FXObject*,FXSelector,void*);
long onFocusRight(FXObject*,FXSelector,void*);
public:
/// Construct a matrix layout manager with n rows or columns
FXMatrix(FXComposite *p,FXint n=1,FXuint opts=MATRIX_BY_ROWS,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_SPACING,FXint pr=DEFAULT_SPACING,FXint pt=DEFAULT_SPACING,FXint pb=DEFAULT_SPACING,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING);
/// Perform layout
virtual void layout();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Obtain the child placed at a certain row and column
FXWindow* childAtRowCol(FXint r,FXint c) const;
/// Return the row in which the given child is placed
FXint rowOfChild(const FXWindow* child) const;
/// Return the column in which the given child is placed
FXint colOfChild(const FXWindow* child) const;
/// Change the matrix style
void setMatrixStyle(FXuint ph);
/// Return the current matrix style
FXuint getMatrixStyle() const;
/// Change the number of rows
void setNumRows(FXint nr);
/// Return the number of rows
FXint getNumRows() const;
/// Change the number of columns
void setNumColumns(FXint nc);
/// Return the number of columns
FXint getNumColumns() const;
};
}
#endif
fox-1.6.49/include/FXMenuPane.h 0000664 0001750 0001750 00000004534 12130340076 013076 0000000 0000000 /********************************************************************************
* *
* M e n u P a n e W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXMenuPane.h,v 1.16 2006/01/22 17:58:06 fox Exp $ *
********************************************************************************/
#ifndef FXMENUPANE_H
#define FXMENUPANE_H
#ifndef FXPOPUP_H
#include "FXPopup.h"
#endif
namespace FX {
/// Popup menu pane
class FXAPI FXMenuPane : public FXPopup {
FXDECLARE(FXMenuPane)
protected:
FXMenuPane(){}
private:
FXMenuPane(const FXMenuPane&);
FXMenuPane &operator=(const FXMenuPane&);
public:
/// Construct menu pane
FXMenuPane(FXWindow* owner,FXuint opts=0);
/// Return true if popup contains this point
virtual bool contains(FXint parentx,FXint parenty) const;
};
}
#endif
fox-1.6.49/include/FXQuatf.h 0000664 0001750 0001750 00000012150 12130340076 012437 0000000 0000000 /********************************************************************************
* *
* S i n g l e - P r e c i s i o n Q u a t e r n i o n *
* *
*********************************************************************************
* Copyright (C) 1994,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXQuatf.h,v 1.17 2006/01/22 17:58:07 fox Exp $ *
********************************************************************************/
#ifndef FXQUATF_H
#define FXQUATF_H
namespace FX {
class FXMat3f;
/// Single-precision quaternion
class FXAPI FXQuatf : public FXVec4f {
public:
/// Construct
FXQuatf(){}
/// Copy constructor
FXQuatf(const FXQuatf& q):FXVec4f(q){}
/// Construct from components
FXQuatf(FXfloat xx,FXfloat yy,FXfloat zz,FXfloat ww):FXVec4f(xx,yy,zz,ww){}
/// Construct from array of floats
FXQuatf(const FXfloat v[]):FXVec4f(v){}
/// Construct from axis and angle
FXQuatf(const FXVec3f& axis,FXfloat phi=0.0f);
/// Construct from euler angles yaw (z), pitch (y), and roll (x)
FXQuatf(FXfloat roll,FXfloat pitch,FXfloat yaw);
/// Construct quaternion from two unit vectors
FXQuatf(const FXVec3f& fr,const FXVec3f& to);
/// Construct quaternion from three axes
FXQuatf(const FXVec3f& ex,const FXVec3f& ey,const FXVec3f& ez);
/// Construct quaternion from 3x3 matrix
FXQuatf(const FXMat3f& mat);
/// Adjust quaternion length
FXQuatf& adjust();
/// Set quaternion from axis and angle
void setAxisAngle(const FXVec3f& axis,FXfloat phi=0.0f);
/// Obtain axis and angle from quaternion
void getAxisAngle(FXVec3f& axis,FXfloat& phi) const;
/// Set quaternion from roll (x), pitch (y), yaw (z)
void setRollPitchYaw(FXfloat roll,FXfloat pitch,FXfloat yaw);
void getRollPitchYaw(FXfloat& roll,FXfloat& pitch,FXfloat& yaw) const;
/// Set quaternion from yaw (z), pitch (y), roll (x)
void setYawPitchRoll(FXfloat yaw,FXfloat pitch,FXfloat roll);
void getYawPitchRoll(FXfloat& yaw,FXfloat& pitch,FXfloat& roll) const;
/// Set quaternion from roll (x), yaw (z), pitch (y)
void setRollYawPitch(FXfloat roll,FXfloat yaw,FXfloat pitch);
void getRollYawPitch(FXfloat& roll,FXfloat& yaw,FXfloat& pitch) const;
/// Set quaternion from pitch (y), roll (x),yaw (z)
void setPitchRollYaw(FXfloat pitch,FXfloat roll,FXfloat yaw);
void getPitchRollYaw(FXfloat& pitch,FXfloat& roll,FXfloat& yaw) const;
/// Set quaternion from pitch (y), yaw (z), roll (x)
void setPitchYawRoll(FXfloat pitch,FXfloat yaw,FXfloat roll);
void getPitchYawRoll(FXfloat& pitch,FXfloat& yaw,FXfloat& roll) const;
/// Set quaternion from yaw (z), roll (x), pitch (y)
void setYawRollPitch(FXfloat yaw,FXfloat roll,FXfloat pitch);
void getYawRollPitch(FXfloat& yaw,FXfloat& roll,FXfloat& pitch) const;
/// Set quaternion from axes
void setAxes(const FXVec3f& ex,const FXVec3f& ey,const FXVec3f& ez);
/// Get quaternion axes
void getAxes(FXVec3f& ex,FXVec3f& ey,FXVec3f& ez) const;
/// Obtain local x axis
FXVec3f getXAxis() const;
/// Obtain local y axis
FXVec3f getYAxis() const;
/// Obtain local z axis
FXVec3f getZAxis() const;
/// Exponentiate quaternion
FXQuatf exp() const;
/// Take logarithm of quaternion
FXQuatf log() const;
/// Invert quaternion
FXQuatf invert() const;
/// Invert unit quaternion
FXQuatf unitinvert() const;
/// Conjugate quaternion
FXQuatf conj() const;
/// Construct quaternion from arc a->b on unit sphere
FXQuatf& arc(const FXVec3f& a,const FXVec3f& b);
/// Spherical lerp
FXQuatf& lerp(const FXQuatf& u,const FXQuatf& v,FXfloat f);
/// Multiply quaternions
FXQuatf operator*(const FXQuatf& q) const;
/// Rotation of a vector by a quaternion
FXVec3f operator*(const FXVec3f& v) const;
};
}
#endif
fox-1.6.49/include/FXColorSelector.h 0000664 0001750 0001750 00000015055 12130340076 014145 0000000 0000000 /********************************************************************************
* *
* C o l o r S e l e c t o r *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXColorSelector.h,v 1.30 2006/01/22 17:57:59 fox Exp $ *
********************************************************************************/
#ifndef FXCOLORSELECTOR_H
#define FXCOLORSELECTOR_H
#ifndef FXPACKER_H
#include "FXPacker.h"
#endif
namespace FX {
class FXTabBook;
class FXColorBar;
class FXColorWell;
class FXColorWheel;
class FXColorRing;
class FXColorList;
class FXList;
class FXSlider;
class FXTextField;
class FXButton;
class FXIcon;
class FXLabel;
/// Color selection widget
class FXAPI FXColorSelector : public FXPacker {
FXDECLARE(FXColorSelector)
protected:
FXTabBook *panels; // Color panes
FXColorWell *well; // Main well
FXColorList *list; // List of color names
FXColorRing *wheel; // Color ring
FXSlider *rgbaslider[4]; // RGBA sliders
FXTextField *rgbatext[4]; // RGBA text fields
FXSlider *hsvaslider[4]; // HSVA sliders
FXTextField *hsvatext[4]; // HSVA text fields
FXSlider *cmyslider[4]; // CMY sliders
FXTextField *cmytext[4]; // CMY text fields
FXColorWell *colorwells[24]; // Custom color wells
FXIcon *eyedropicon; // Icon for eye dropper
FXIcon *dialmodeicon; // Icon for dial mode
FXIcon *rgbmodeicon; // Icon for RGB mode
FXIcon *hsvmodeicon; // Icon for HSV mode
FXIcon *cmymodeicon; // Icon for CMY mode
FXIcon *txtmodeicon; // Icon for TEXT mode
FXButton *accept; // Accept button
FXButton *cancel; // Cancel button
FXfloat rgba[4]; // Accurate RGBA color
FXfloat hsva[4]; // Accurate HSVA color
protected:
static const FXchar* wellname[24]; // Well names
protected:
FXColorSelector(){}
void updateWell();
private:
FXColorSelector(const FXColorSelector&);
FXColorSelector &operator=(const FXColorSelector&);
public:
long onCmdWell(FXObject*,FXSelector,void*);
long onChgWell(FXObject*,FXSelector,void*);
long onCmdRGBSlider(FXObject*,FXSelector,void*);
long onUpdRGBSlider(FXObject*,FXSelector,void*);
long onCmdRGBText(FXObject*,FXSelector,void*);
long onUpdRGBText(FXObject*,FXSelector,void*);
long onCmdHSVSlider(FXObject*,FXSelector,void*);
long onUpdHSVSlider(FXObject*,FXSelector,void*);
long onCmdHSVText(FXObject*,FXSelector,void*);
long onUpdHSVText(FXObject*,FXSelector,void*);
long onCmdCMYSlider(FXObject*,FXSelector,void*);
long onUpdCMYSlider(FXObject*,FXSelector,void*);
long onCmdCMYText(FXObject*,FXSelector,void*);
long onUpdCMYText(FXObject*,FXSelector,void*);
long onCmdList(FXObject*,FXSelector,void*);
long onCmdCustomWell(FXObject*,FXSelector,void*);
long onChgCustomWell(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdActivePane(FXObject*,FXSelector,void*);
long onCmdAlphaSlider(FXObject*,FXSelector,void*);
long onUpdAlphaSlider(FXObject*,FXSelector,void*);
long onCmdAlphaText(FXObject*,FXSelector,void*);
long onUpdAlphaText(FXObject*,FXSelector,void*);
long onUpdAlphaLabel(FXObject*,FXSelector,void*);
long onCmdWheel(FXObject*,FXSelector,void*);
long onUpdWheel(FXObject*,FXSelector,void*);
long onCmdColorPick(FXObject*,FXSelector,void*);
public:
enum {
ID_CUSTOM_FIRST=FXPacker::ID_LAST,
ID_CUSTOM_LAST=ID_CUSTOM_FIRST+24,
ID_RGB_RED_SLIDER,
ID_RGB_GREEN_SLIDER,
ID_RGB_BLUE_SLIDER,
ID_RGB_RED_TEXT,
ID_RGB_GREEN_TEXT,
ID_RGB_BLUE_TEXT,
ID_HSV_HUE_SLIDER,
ID_HSV_SATURATION_SLIDER,
ID_HSV_VALUE_SLIDER,
ID_HSV_HUE_TEXT,
ID_HSV_SATURATION_TEXT,
ID_HSV_VALUE_TEXT,
ID_CMY_CYAN_SLIDER,
ID_CMY_MAGENTA_SLIDER,
ID_CMY_YELLOW_SLIDER,
ID_CMY_CYAN_TEXT,
ID_CMY_MAGENTA_TEXT,
ID_CMY_YELLOW_TEXT,
ID_DIAL_WHEEL,
ID_COLOR_LIST,
ID_WELL_CHANGED,
ID_ACTIVEPANE,
ID_ALPHA_SLIDER,
ID_ALPHA_TEXT,
ID_ALPHA_LABEL,
ID_COLORPICK,
ID_LAST
};
public:
/// Construct a new ColorSelector
FXColorSelector(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Create the ColorSelector
virtual void create();
/// Return a pointer to the "Accept" button
FXButton *acceptButton() const { return accept; }
/// Return a pointer to the "Cancel" button
FXButton *cancelButton() const { return cancel; }
/// Set the selected color
void setRGBA(FXColor clr);
/// Get the selected color
FXColor getRGBA() const;
/// Return true if only opaque colors allowed
FXbool isOpaqueOnly() const;
/// Change opaque only mode
void setOpaqueOnly(FXbool opaque);
/// Save to a stream
virtual void save(FXStream& store) const;
/// Load from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXColorSelector();
};
}
#endif
fox-1.6.49/include/FXSplashWindow.h 0000664 0001750 0001750 00000010110 12130340076 013773 0000000 0000000 /********************************************************************************
* *
* S p l a s h W i n d o w *
* *
*********************************************************************************
* Copyright (C) 2004,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXSplashWindow.h,v 1.10 2006/01/22 17:58:09 fox Exp $ *
********************************************************************************/
#ifndef FXSPLASHWINDOW_H
#define FXSPLASHWINDOW_H
#ifndef FXTOPWINDOW_H
#include "FXTopWindow.h"
#endif
namespace FX {
/// Splash Window options
enum {
SPLASH_SIMPLE = 0, /// Simple rectangular splash window
SPLASH_SHAPED = 0x02000000, /// Shaped splash window
SPLASH_OWNS_ICON = 0x04000000, /// Splash window will own the icon and destroy it
SPLASH_DESTROY = 0x08000000 /// Splash window will destroy itself when timer expires
};
/**
* The Splash Window is a window typically shown during startup
* of an application. It comprises a large icon, which is also
* used as the shape of the window if SPLASH_SHAPED is passed;
* with the SPLASH_SIMPLE option the window will be simply rectangular.
*/
class FXAPI FXSplashWindow : public FXTopWindow {
FXDECLARE(FXSplashWindow)
protected:
FXIcon *icon; // Really big icon
FXuint delay; // Delay before hiding
protected:
FXSplashWindow();
private:
FXSplashWindow(const FXSplashWindow&);
FXSplashWindow &operator=(const FXSplashWindow&);
public:
long onPaint(FXObject*,FXSelector,void*);
public:
/// Construct splash window
FXSplashWindow(FXApp* ap,FXIcon* ic,FXuint opts=SPLASH_SIMPLE,FXuint ms=5000);
/// Construct splash window
FXSplashWindow(FXWindow* ow,FXIcon* ic,FXuint opts=SPLASH_SIMPLE,FXuint ms=5000);
/// Create
virtual void create();
/// Detach
virtual void detach();
/// Show splash window
virtual void show();
/// Show splash window with a given placement
virtual void show(FXuint placement);
/// Hide splash window
virtual void hide();
/// Return the default width of this window
virtual FXint getDefaultWidth();
/// Return the default height of this window
virtual FXint getDefaultHeight();
/// Set the icon for the splash window
void setIcon(FXIcon* ic);
/// Get the icon for this splash window
FXIcon* getIcon() const { return icon; }
/// Set or change delay
void setDelay(FXuint ms);
/// Return delay
FXuint getDelay() const { return delay; }
/// Save label to a stream
virtual void save(FXStream& store) const;
/// Load label from a stream
virtual void load(FXStream& store);
/// Destroy splash window
virtual ~FXSplashWindow();
};
}
#endif
fox-1.6.49/include/FXColorDialog.h 0000664 0001750 0001750 00000006711 12130340076 013563 0000000 0000000 /********************************************************************************
* *
* C o l o r D i a l o g *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXColorDialog.h,v 1.20 2006/01/22 17:57:59 fox Exp $ *
********************************************************************************/
#ifndef FXCOLORDIALOG_H
#define FXCOLORDIALOG_H
#ifndef FXDIALOGBOX_H
#include "FXDialogBox.h"
#endif
namespace FX {
class FXColorSelector;
/**
* The Color dialog is a standard dialog panel used to edit colors.
* Colors can be edited via RGB (Red, Green, Blue additive color model),
* via HSV (Hue, Saturation, Value color modal), via CMY (Cyan, Magenta,
* Yellow subtractive color model), or by name.
* Commonly used colors can be dragged into a number of small color wells
* to be used repeatedly; colors dropped into the small color wells are
* automatically saved into the registry for future use.
*/
class FXAPI FXColorDialog : public FXDialogBox {
FXDECLARE(FXColorDialog)
protected:
FXColorSelector *colorbox;
protected:
FXColorDialog(){}
private:
FXColorDialog(const FXColorDialog&);
FXColorDialog &operator=(const FXColorDialog&);
public:
long onChgColor(FXObject*,FXSelector,void*);
long onCmdColor(FXObject*,FXSelector,void*);
public:
enum {
ID_COLORSELECTOR=FXDialogBox::ID_LAST,
ID_LAST
};
public:
/// Construct color dialog
FXColorDialog(FXWindow* owner,const FXString& name,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Set the color
void setRGBA(FXColor clr);
/// Get the color
FXColor getRGBA() const;
/// Return true if only opaque colors allowed
FXbool isOpaqueOnly() const;
/// Change opaque only mode
void setOpaqueOnly(FXbool forceopaque);
/// Save dialog to a stream
virtual void save(FXStream& store) const;
/// Load dialog from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXColorDialog();
};
}
#endif
fox-1.6.49/include/FXMDIClient.h 0000664 0001750 0001750 00000016204 12130340076 013133 0000000 0000000 /********************************************************************************
* *
* M u l t i p l e D o c u m e n t C l i e n t W i n d o w *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXMDIClient.h,v 1.32 2006/01/22 17:58:05 fox Exp $ *
********************************************************************************/
#ifndef FXMDICLIENT_H
#define FXMDICLIENT_H
#ifndef FXCOMPOSITE_H
#include "FXComposite.h"
#endif
namespace FX {
class FXMDIChild;
/**
* The MDI client window manages a number of MDI child windows in a multiple-document
* interface (MDI) application. MDI child windows usually receive messages from the GUI controls
* by delegation via the MDI client. This is accomplished by making the MDI client window
* the target for most GUI controls. The MDI client filters out messages intented for itself,
* and delegates the remaining messages to its currently active MDI child, if any.
* If you use the auto-gray or auto-hide feature available in some GUI controls, these
* controls can be automatically grayed out or hidden when there is no active MDI child.
* When delegating messages via MDI client to MDI child windows of different types, care
* should be taken that message ID's do not overlap, so that all message ID's only map to
* the intented handlers no matter which MDI child window type is active.
* The MDI client sends a SEL_CHANGED message to its target when the active MDI child is
* switched, with the void* pointer refering to the new MDI child.
* A MDI Window selection dialog can be brought up through the ID_MDI_OVER_X messages;
* a menu button connected to the MDI client with the ID_MDI_OVER_X message will be
* automatically grayed out if there are less than X MDI child windows.
*/
class FXAPI FXMDIClient : public FXComposite {
FXDECLARE(FXMDIClient)
friend class FXMDIChild;
protected:
FXMDIChild *active; // Active child
FXint cascadex; // Cascade offset X
FXint cascadey; // Cascade offset Y
protected:
FXMDIClient();
private:
FXMDIClient(const FXMDIClient&);
FXMDIClient &operator=(const FXMDIClient&);
public:
long onCmdActivateNext(FXObject*,FXSelector,void*);
long onCmdActivatePrev(FXObject*,FXSelector,void*);
long onCmdTileHorizontal(FXObject*,FXSelector,void*);
long onCmdTileVertical(FXObject*,FXSelector,void*);
long onCmdCascade(FXObject*,FXSelector,void*);
long onUpdActivateNext(FXObject*,FXSelector,void*);
long onUpdActivatePrev(FXObject*,FXSelector,void*);
long onUpdTileVertical(FXObject*,FXSelector,void*);
long onUpdTileHorizontal(FXObject*,FXSelector,void*);
long onUpdCascade(FXObject*,FXSelector,void*);
long onUpdClose(FXObject*,FXSelector,void*);
long onUpdMenuClose(FXObject*,FXSelector,void*);
long onUpdRestore(FXObject*,FXSelector,void*);
long onUpdMenuRestore(FXObject*,FXSelector,void*);
long onUpdMinimize(FXObject*,FXSelector,void*);
long onUpdMenuMinimize(FXObject*,FXSelector,void*);
long onUpdMaximize(FXObject*,FXSelector,void*);
long onUpdMenuWindow(FXObject*,FXSelector,void*);
long onCmdWindowSelect(FXObject*,FXSelector,void*);
long onUpdWindowSelect(FXObject*,FXSelector,void*);
long onCmdOthersWindows(FXObject*,FXSelector,void*);
long onUpdOthersWindows(FXObject*,FXSelector,void*);
long onUpdAnyWindows(FXObject*,FXSelector,void*);
virtual long onDefault(FXObject*,FXSelector,void*);
public:
enum {
ID_MDI_ANY=65400,
ID_MDI_1, // Select MDI child 1
ID_MDI_2,
ID_MDI_3,
ID_MDI_4,
ID_MDI_5,
ID_MDI_6,
ID_MDI_7,
ID_MDI_8,
ID_MDI_9,
ID_MDI_10,
ID_MDI_OVER_1, // Sensitize MDI menu when 1 or more children
ID_MDI_OVER_2,
ID_MDI_OVER_3,
ID_MDI_OVER_4,
ID_MDI_OVER_5,
ID_MDI_OVER_6,
ID_MDI_OVER_7,
ID_MDI_OVER_8,
ID_MDI_OVER_9,
ID_MDI_OVER_10,
ID_LAST
};
public:
/// Construct MDI Client window
FXMDIClient(FXComposite* p,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Perform layout
virtual void layout();
/**
* Pass message to all MDI windows, stopping when one of
* the MDI windows fails to handle the message.
*/
long forallWindows(FXObject* sender,FXSelector sel,void* ptr);
/**
* Pass message once to all MDI windows with the same document,
* stopping when one of the MDI windows fails to handle the message.
*/
long forallDocuments(FXObject* sender,FXSelector sel,void* ptr);
/**
* Pass message to all MDI Child windows whose target is document,
* stopping when one of the MDI windows fails to handle the message.
*/
long forallDocWindows(FXObject* document,FXObject* sender,FXSelector sel,void* ptr);
/// Set active MDI Child
virtual FXbool setActiveChild(FXMDIChild* child=NULL,FXbool notify=TRUE);
/// Get current active child; may be NULL!
FXMDIChild* getActiveChild() const { return active; }
/// Cascade windows
virtual void cascade(FXbool notify=FALSE);
/// Layout horizontally
virtual void horizontal(FXbool notify=FALSE);
/// Layout vertically
virtual void vertical(FXbool notify=FALSE);
/// Change cascade offset X
void setCascadeX(FXint off){ cascadex=off; }
/// Change cascade offset Y
void setCascadeY(FXint off){ cascadey=off; }
/// Get cascade offset X
FXint getCascadeX() const { return cascadex; }
/// Get cascade offset Y
FXint getCascadeY() const { return cascadey; }
/// Save object to a stream
virtual void save(FXStream& store) const;
/// Load object from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXMDIClient();
};
}
#endif
fox-1.6.49/include/FXMenuCaption.h 0000664 0001750 0001750 00000013362 12130340076 013607 0000000 0000000 /********************************************************************************
* *
* M e n u C a p t i o n W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXMenuCaption.h,v 1.33 2006/01/22 17:58:06 fox Exp $ *
********************************************************************************/
#ifndef FXMENUCAPTION_H
#define FXMENUCAPTION_H
#ifndef FXWINDOW_H
#include "FXWindow.h"
#endif
namespace FX {
/// Menu Caption options
enum {
MENU_AUTOGRAY = 0x00008000, /// Automatically gray out when not updated
MENU_AUTOHIDE = 0x00010000 /// Automatically hide button when not updated
};
class FXIcon;
class FXFont;
/**
* The menu caption is a widget which can be used as a caption
* above a number of menu commands in a menu.
*/
class FXAPI FXMenuCaption : public FXWindow {
FXDECLARE(FXMenuCaption)
protected:
FXString label;
FXString help;
FXString tip;
FXIcon *icon;
FXFont *font;
FXint hotoff;
FXHotKey hotkey;
FXColor textColor;
FXColor selbackColor;
FXColor seltextColor;
FXColor hiliteColor;
FXColor shadowColor;
protected:
FXMenuCaption();
private:
FXMenuCaption(const FXMenuCaption&);
FXMenuCaption &operator=(const FXMenuCaption&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onUpdate(FXObject*,FXSelector,void*);
long onCmdGetStringValue(FXObject*,FXSelector,void*);
long onCmdSetStringValue(FXObject*,FXSelector,void*);
long onCmdSetIconValue(FXObject*,FXSelector,void*);
long onCmdGetIconValue(FXObject*,FXSelector,void*);
long onCmdSetHelp(FXObject*,FXSelector,void*);
long onCmdGetHelp(FXObject*,FXSelector,void*);
long onCmdSetTip(FXObject*,FXSelector,void*);
long onCmdGetTip(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
public:
/// Construct a menu caption
FXMenuCaption(FXComposite* p,const FXString& text,FXIcon* ic=NULL,FXuint opts=0);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Enable the menu
virtual void enable();
/// Disable the menu
virtual void disable();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Set the text for this menu
void setText(const FXString& text);
/// Get the text for this menu
FXString getText() const { return label; }
/// Set the icon for this menu
void setIcon(FXIcon* ic);
/// Get the icon for this menu
FXIcon* getIcon() const { return icon; }
/// Set the text font
void setFont(FXFont* fnt);
/// Return the text font
FXFont* getFont() const { return font; }
/// Set menu caption style
void setMenuStyle(FXuint style);
/// Get menu caption style
FXuint getMenuStyle() const;
/// Return the current text color
void setTextColor(FXColor clr);
/// Get the current text color
FXColor getTextColor() const { return textColor; }
/// Return the selection background color
void setSelBackColor(FXColor clr);
/// Return the selection background color
FXColor getSelBackColor() const { return selbackColor; }
/// Return the selection text color
void setSelTextColor(FXColor clr);
/// Return the selection text color
FXColor getSelTextColor() const { return seltextColor; }
/// Change highlight color
void setHiliteColor(FXColor clr);
/// Get highlight color
FXColor getHiliteColor() const { return hiliteColor; }
/// Change shadow color
void setShadowColor(FXColor clr);
/// Get shadow color
FXColor getShadowColor() const { return shadowColor; }
/// Set the status line help text for this menu
void setHelpText(const FXString& text);
/// Get the status line help text for this menu
const FXString& getHelpText() const { return help; }
/// Set the tool tip message for this menu
void setTipText(const FXString& text){ tip=text; }
/// Get the tool tip message for this menu
const FXString& getTipText() const { return tip; }
/// Save menu to a stream
virtual void save(FXStream& store) const;
/// Load menu from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXMenuCaption();
};
}
#endif
fox-1.6.49/include/FXDirSelector.h 0000664 0001750 0001750 00000013032 12130340076 013576 0000000 0000000 /********************************************************************************
* *
* D i r e c t o r y S e l e c t i o n W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2000,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXDirSelector.h,v 1.21 2006/01/22 17:58:00 fox Exp $ *
********************************************************************************/
#ifndef FXDIRSELECTOR_H
#define FXDIRSELECTOR_H
#ifndef FXPACKER_H
#include "FXPacker.h"
#endif
namespace FX {
class FXDirList;
class FXTextField;
class FXButton;
/**
* The Directory Selector widget is the reusable mega-widget component which
* is the core of the Directory Dialog. The function of the directory selector widget
* is very similar to the file selector widget, except that the directory selector widget
* displays a tree-structured view of the file system, and thereby makes up and down
* navigation through the file system significantly easier.
*/
class FXAPI FXDirSelector : public FXPacker {
FXDECLARE(FXDirSelector)
protected:
FXDirList *dirbox; // Directory list widget
FXTextField *dirname; // Directory name entry field
FXButton *accept; // Accept button
FXButton *cancel; // Cancel button
FXIcon *updiricon; // Up directory icon
FXIcon *homeicon; // Go home icon
FXIcon *workicon; // Go home icon
FXIcon *markicon; // Book mark icon
FXIcon *clearicon; // Book clear icon
FXIcon *newicon; // New directory icon
FXIcon *deleteicon; // Delete file icon
FXIcon *moveicon; // Rename file icon
FXIcon *copyicon; // Copy file icon
FXIcon *linkicon; // Link file icon
FXRecentFiles mrufiles; // Recently visited places
protected:
FXDirSelector(){}
private:
FXDirSelector(const FXDirSelector&);
FXDirSelector &operator=(const FXDirSelector&);
public:
long onCmdName(FXObject*,FXSelector,void*);
long onCmdOpened(FXObject*,FXSelector,void*);
long onCmdHome(FXObject*,FXSelector,void*);
long onCmdWork(FXObject*,FXSelector,void*);
long onCmdDirectoryUp(FXObject*,FXSelector,void*);
long onPopupMenu(FXObject*,FXSelector,void*);
long onCmdBookmark(FXObject*,FXSelector,void*);
long onCmdVisit(FXObject*,FXSelector,void*);
long onCmdNew(FXObject*,FXSelector,void*);
long onUpdNew(FXObject*,FXSelector,void*);
long onCmdMove(FXObject*,FXSelector,void*);
long onCmdCopy(FXObject*,FXSelector,void*);
long onCmdLink(FXObject*,FXSelector,void*);
long onCmdDelete(FXObject*,FXSelector,void*);
long onUpdSelected(FXObject*,FXSelector,void*);
public:
enum {
ID_DIRNAME=FXPacker::ID_LAST,
ID_DIRLIST,
ID_HOME,
ID_WORK,
ID_DIRECTORY_UP,
ID_BOOKMARK,
ID_VISIT,
ID_NEW,
ID_DELETE,
ID_MOVE,
ID_COPY,
ID_LINK,
ID_LAST
};
public:
/// Constructor
FXDirSelector(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Return a pointer to the "Accept" button
FXButton *acceptButton() const { return accept; }
/// Return a pointer to the "Cancel" button
FXButton *cancelButton() const { return cancel; }
/// Change directory
void setDirectory(const FXString& path);
/// Return directory
FXString getDirectory() const;
/// Return TRUE if showing files as well as directories
FXbool showFiles() const;
/// Show or hide normal files
void showFiles(FXbool showing);
/// Return TRUE if showing hidden directories
FXbool showHiddenFiles() const;
/// Show or hide hidden directories
void showHiddenFiles(FXbool showing);
/// Return wildcard matching mode
FXuint getMatchMode() const;
/// Change wildcard matching mode
void setMatchMode(FXuint mode);
/// Change Directory List style
void setDirBoxStyle(FXuint style);
/// Return Directory List style
FXuint getDirBoxStyle() const;
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXDirSelector();
};
}
#endif
fox-1.6.49/include/FXColorWell.h 0000664 0001750 0001750 00000015372 12130340076 013272 0000000 0000000 /********************************************************************************
* *
* C o l o r W e l l W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXColorWell.h,v 1.35 2006/01/22 17:57:59 fox Exp $ *
********************************************************************************/
#ifndef FXCOLORWELL_H
#define FXCOLORWELL_H
#ifndef FXFRAME_H
#include "FXFrame.h"
#endif
namespace FX {
// Color Well Styles
enum {
COLORWELL_OPAQUEONLY = 0x00008000, /// Colors must be opaque
COLORWELL_SOURCEONLY = 0x00010000, /// ColorWell is never a target
COLORWELL_NORMAL = JUSTIFY_NORMAL
};
/**
* A color well is a widget which controls color settings.
* Colors may be dragged and dropped from one color well to another.
* A double-click inside a color well will bring up the standard
* color dialog panel to edit the color well's color.
* Colors may be also pasted by name using middle-mouse click into/out of
* color wells from/to other selection-capable applications; for example,
* you can highlight the word `red' and paste it into a color well.
* While the color value is being changed, the color well sends a SEL_CHANGED
* to its target; at the end of the change, it sends a SEL_COMMAND.
* The message data represents the current color value, of the type FXColor.
*/
class FXAPI FXColorWell : public FXFrame {
FXDECLARE(FXColorWell)
protected:
FXColor wellColor[2]; // Pixel value of RGBA over black and white
FXColor rgba; // Color with RGB and Alpha
FXString tip; // Tooltip value
FXString help; // Help value
protected:
FXColorWell();
static FXColor rgbaoverblack(FXColor clr);
static FXColor rgbaoverwhite(FXColor clr);
private:
FXColorWell(const FXColorWell&);
FXColorWell &operator=(const FXColorWell&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onMiddleBtnPress(FXObject*,FXSelector,void*);
long onMiddleBtnRelease(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onUngrabbed(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onBeginDrag(FXObject*,FXSelector,void*);
long onEndDrag(FXObject*,FXSelector,void*);
long onDragged(FXObject*,FXSelector,void*);
long onFocusIn(FXObject*,FXSelector,void*);
long onFocusOut(FXObject*,FXSelector,void*);
long onDNDEnter(FXObject*,FXSelector,void*);
long onDNDLeave(FXObject*,FXSelector,void*);
long onDNDMotion(FXObject*,FXSelector,void*);
long onDNDDrop(FXObject*,FXSelector,void*);
long onDNDRequest(FXObject*,FXSelector,void*);
long onSelectionLost(FXObject*,FXSelector,void*);
long onSelectionGained(FXObject*,FXSelector,void*);
long onSelectionRequest(FXObject*,FXSelector,void*);
long onClicked(FXObject*,FXSelector,void*);
long onDoubleClicked(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetIntValue(FXObject*,FXSelector,void*);
long onCmdGetIntValue(FXObject*,FXSelector,void*);
long onCmdColorWell(FXObject*,FXSelector,void*);
long onChgColorWell(FXObject*,FXSelector,void*);
long onCmdSetHelp(FXObject*,FXSelector,void*);
long onCmdGetHelp(FXObject*,FXSelector,void*);
long onCmdSetTip(FXObject*,FXSelector,void*);
long onCmdGetTip(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
public:
enum {
ID_COLORDIALOG=FXFrame::ID_LAST,
ID_LAST
};
public:
/// Construct color well with initial color clr
FXColorWell(FXComposite* p,FXColor clr=0,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=COLORWELL_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Returns true because a color well can receive focus
virtual bool canFocus() const;
/// Move the focus to this window
virtual void setFocus();
/// Remove the focus from this window
virtual void killFocus();
/// Set color
void setRGBA(FXColor clr,FXbool notify=FALSE);
/// Get color
FXColor getRGBA() const { return rgba; }
/// Set status line help text for this color well
void setHelpText(const FXString& text){ help=text; }
/// Get status line help text for this color well
const FXString& getHelpText() const { return help; }
/// Set tool tip message for this color well
void setTipText(const FXString& text){ tip=text; }
/// Get tool tip message for this color well
const FXString& getTipText() const { return tip; }
/// Return true if only opaque colors allowed
FXbool isOpaqueOnly() const;
/// Change opaque only mode
void setOpaqueOnly(FXbool opaque);
/// Save color well to a stream
virtual void save(FXStream& store) const;
/// Load color well from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXColorWell();
};
}
#endif
fox-1.6.49/include/FXXBMIcon.h 0000664 0001750 0001750 00000007701 12130340076 012624 0000000 0000000 /********************************************************************************
* *
* X B M I c o n O b j e c t *
* *
*********************************************************************************
* Copyright (C) 2003,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXXBMIcon.h,v 1.11 2006/01/22 17:58:12 fox Exp $ *
********************************************************************************/
#ifndef FXXBMICON_H
#define FXXBMICON_H
#ifndef FXICON_H
#include "FXIcon.h"
#endif
namespace FX {
/// X Bitmap icon
class FXAPI FXXBMIcon : public FXIcon {
FXDECLARE(FXXBMIcon)
protected:
FXXBMIcon(){}
private:
FXXBMIcon(const FXXBMIcon&);
FXXBMIcon &operator=(const FXXBMIcon&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct icon from memory stream formatted in X Bitmap format
FXXBMIcon(FXApp* a,const FXuchar *pixels=NULL,const FXuchar *mask=NULL,FXColor clr=FXRGB(192,192,192),FXuint opts=0,FXint w=1,FXint h=1);
/// Save pixels into stream in X Bitmap format
virtual bool savePixels(FXStream& store) const;
/// Load pixels from stream in X Bitmap format
virtual bool loadPixels(FXStream& store);
/// Destroy icon
virtual ~FXXBMIcon();
};
#ifndef FXLOADXBM
#define FXLOADXBM
/**
* Check if stream contains a XBM, return TRUE if so.
*/
extern FXAPI bool fxcheckXBM(FXStream& store);
/**
* Load an XBM (X Bitmap) from pixel array and mask array.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadXBM(FXColor*& data,const FXuchar *pix,const FXuchar *msk,FXint width,FXint height);
/**
* Load an XBM (X Bitmap) file from a stream.
* Upon successful return, the pixel array and size, and hot-spot are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadXBM(FXStream& store,FXColor*& data,FXint& width,FXint& height,FXint& hotx,FXint& hoty);
/**
* Save an XBM (X Bitmap) file to a stream; if the parameters hotx and hoty are set
* to -1, no hotspot location is saved.
*/
extern FXAPI bool fxsaveXBM(FXStream& store,const FXColor *data,FXint width,FXint height,FXint hotx=-1,FXint hoty=-1);
/**
* Save a PostScript file to a stream; format the picture to the maximal
* size that fits within the given margins of the indicated paper size.
*/
extern FXAPI bool fxsavePS(FXStream& store,const FXColor *data,FXint width,FXint height,FXint paperw=612,FXint paperh=792,FXint margin=35,bool color=true);
#endif
}
#endif
fox-1.6.49/include/FXSeparator.h 0000664 0001750 0001750 00000010346 12130340076 013324 0000000 0000000 /********************************************************************************
* *
* S e p a r a t o r W i d g e t s *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXSeparator.h,v 1.18 2006/01/22 17:58:09 fox Exp $ *
********************************************************************************/
#ifndef FXSEPARATOR_H
#define FXSEPARATOR_H
#ifndef FXFRAME_H
#include "FXFrame.h"
#endif
namespace FX {
/// Separator Options
enum {
SEPARATOR_NONE = 0, /// Nothing visible
SEPARATOR_GROOVE = 0x00008000, /// Etched-in looking groove
SEPARATOR_RIDGE = 0x00010000, /// Embossed looking ridge
SEPARATOR_LINE = 0x00020000 /// Simple line
};
/**
* A Separator widget is used to draw a horizontal or vertical divider between
* groups of controls. It is purely decorative. The separator may be drawn
* in various styles as determined by the SEPARATOR_NONE, SEPARATOR_GROOVE,
* SEPARATOR_RIDGE, and SEPARATOR_LINE options. Since its derived from Frame,
* it can also have the frame's border styles.
*/
class FXAPI FXSeparator : public FXFrame {
FXDECLARE(FXSeparator)
protected:
FXSeparator(){}
private:
FXSeparator(const FXSeparator&);
FXSeparator &operator=(const FXSeparator&);
public:
long onPaint(FXObject*,FXSelector,void*);
public:
/// Constructor
FXSeparator(FXComposite* p,FXuint opts=SEPARATOR_GROOVE|LAYOUT_FILL_X,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=0,FXint pr=0,FXint pt=0,FXint pb=0);
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Change separator style
void setSeparatorStyle(FXuint style);
/// Get separator style
FXuint getSeparatorStyle() const;
};
/// Horizontal separator widget
class FXAPI FXHorizontalSeparator : public FXSeparator {
FXDECLARE(FXHorizontalSeparator)
protected:
FXHorizontalSeparator(){}
private:
FXHorizontalSeparator(const FXHorizontalSeparator&);
FXHorizontalSeparator &operator=(const FXHorizontalSeparator&);
public:
/// Constructor
FXHorizontalSeparator(FXComposite* p,FXuint opts=SEPARATOR_GROOVE|LAYOUT_FILL_X,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=1,FXint pr=1,FXint pt=0,FXint pb=0);
};
/// Vertical separator widget
class FXAPI FXVerticalSeparator : public FXSeparator {
FXDECLARE(FXVerticalSeparator)
protected:
FXVerticalSeparator(){}
private:
FXVerticalSeparator(const FXVerticalSeparator&);
FXVerticalSeparator &operator=(const FXVerticalSeparator&);
public:
/// Constructor
FXVerticalSeparator(FXComposite* p,FXuint opts=SEPARATOR_GROOVE|LAYOUT_FILL_Y,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=0,FXint pr=0,FXint pt=1,FXint pb=1);
};
}
#endif
fox-1.6.49/include/FXTable.h 0000664 0001750 0001750 00000110032 12130340076 012404 0000000 0000000 /********************************************************************************
* *
* T a b l e W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1999,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXTable.h,v 1.166.2.1 2006/06/07 15:51:04 fox Exp $ *
********************************************************************************/
#ifndef FXTABLE_H
#define FXTABLE_H
#ifndef FXSCROLLAREA_H
#include "FXScrollArea.h"
#endif
namespace FX {
class FXIcon;
class FXFont;
class FXTable;
class FXHeader;
class FXButton;
/// Default cell margin
enum { DEFAULT_MARGIN = 2 };
/// Table options
enum {
TABLE_COL_SIZABLE = 0x00100000, /// Columns are resizable
TABLE_ROW_SIZABLE = 0x00200000, /// Rows are resizable
TABLE_NO_COLSELECT = 0x00400000, /// Disallow column selections
TABLE_NO_ROWSELECT = 0x00800000, /// Disallow row selections
TABLE_READONLY = 0x01000000, /// Table is NOT editable
TABLE_COL_RENUMBER = 0x02000000, /// Renumber columns
TABLE_ROW_RENUMBER = 0x04000000 /// Renumber rows
};
/// Position in table
struct FXTablePos {
FXint row;
FXint col;
};
/// Range of table cells
struct FXTableRange {
FXTablePos fm;
FXTablePos to;
};
/// Item in table
class FXAPI FXTableItem : public FXObject {
FXDECLARE(FXTableItem)
friend class FXTable;
protected:
FXString label;
FXIcon *icon;
void *data;
FXuint state;
private:
FXTableItem(const FXTableItem&);
FXTableItem& operator=(const FXTableItem&);
protected:
FXTableItem():icon(NULL),data(NULL),state(0){}
FXint textWidth(const FXTable* table) const;
FXint textHeight(const FXTable* table) const;
virtual void draw(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const;
virtual void drawBorders(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const;
virtual void drawContent(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const;
virtual void drawPattern(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const;
virtual void drawBackground(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const;
public:
enum{
SELECTED = 0x00000001, /// Selected
FOCUS = 0x00000002, /// Focus
DISABLED = 0x00000004, /// Disabled
DRAGGABLE = 0x00000008, /// Draggable
RESERVED1 = 0x00000010, /// Reserved
RESERVED2 = 0x00000020, /// Reserved
ICONOWNED = 0x00000040, /// Icon owned by table item
RIGHT = 0x00002000, /// Align on right (default)
LEFT = 0x00004000, /// Align on left
CENTER_X = 0, /// Aling centered horizontally
TOP = 0x00008000, /// Align on top
BOTTOM = 0x00010000, /// Align on bottom
CENTER_Y = 0, /// Aling centered vertically (default)
BEFORE = 0x00020000, /// Icon before the text
AFTER = 0x00040000, /// Icon after the text
ABOVE = 0x00080000, /// Icon above the text
BELOW = 0x00100000, /// Icon below the text
LBORDER = 0x00200000, /// Draw left border
RBORDER = 0x00400000, /// Draw right border
TBORDER = 0x00800000, /// Draw top border
BBORDER = 0x01000000 /// Draw bottom border
};
public:
/// Construct new table item
FXTableItem(const FXString& text,FXIcon* ic=NULL,void* ptr=NULL):label(text),icon(ic),data(ptr),state(RIGHT|CENTER_Y){}
/// Change item's text label
virtual void setText(const FXString& txt);
/// Return item's text label
virtual FXString getText() const { return label; }
/// Change item's icon, deleting the old icon if it was owned
virtual void setIcon(FXIcon* icn,FXbool owned=FALSE);
/// Return item's icon
virtual FXIcon* getIcon() const { return icon; }
/// Change item's user data
void setData(void* ptr){ data=ptr; }
/// Get item's user data
void* getData() const { return data; }
/// Make item draw as focused
virtual void setFocus(FXbool focus);
/// Return true if item has focus
FXbool hasFocus() const { return (state&FOCUS)!=0; }
/// Select item
virtual void setSelected(FXbool selected);
/// Return true if this item is selected
FXbool isSelected() const { return (state&SELECTED)!=0; }
/// Enable or disable item
virtual void setEnabled(FXbool enabled);
/// Return true if this item is enabled
FXbool isEnabled() const { return (state&DISABLED)==0; }
/// Make item draggable
virtual void setDraggable(FXbool draggable);
/// Return true if this item is draggable
FXbool isDraggable() const { return (state&DRAGGABLE)!=0; }
/// Change item content justification
virtual void setJustify(FXuint justify=RIGHT|CENTER_Y);
/// Return item content justification
FXuint getJustify() const { return state&(RIGHT|LEFT|TOP|BOTTOM); }
/// Change item icon position
virtual void setIconPosition(FXuint mode);
/// Return item icon position
FXuint getIconPosition() const { return state&(BEFORE|AFTER|ABOVE|BELOW); }
/// Change item borders
virtual void setBorders(FXuint borders=0);
/// Return item borders
FXuint getBorders() const { return state&(LBORDER|RBORDER|TBORDER|BBORDER); }
/// Change item background stipple
virtual void setStipple(FXStipplePattern pattern);
/// Return item background stipple
FXStipplePattern getStipple() const;
/// Create input control for editing this item
virtual FXWindow *getControlFor(FXTable* table);
/// Set value from input control
virtual void setFromControl(FXWindow *control);
/// Return width of item
virtual FXint getWidth(const FXTable* table) const;
/// Return height of item
virtual FXint getHeight(const FXTable* table) const;
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Destroy server-side resources
virtual void destroy();
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
/// Destroy item and free icon if owned
virtual ~FXTableItem();
};
/// Combobox Item
class FXAPI FXComboTableItem : public FXTableItem {
FXDECLARE(FXComboTableItem)
protected:
FXString selections;
private:
FXComboTableItem(const FXComboTableItem&);
FXComboTableItem& operator=(const FXComboTableItem&);
protected:
FXComboTableItem(){}
public:
/// Construct new table item
FXComboTableItem(const FXString& text,FXIcon* ic=NULL,void* ptr=NULL);
/// Create input control for editing this item
virtual FXWindow *getControlFor(FXTable* table);
/// Set value from input control
virtual void setFromControl(FXWindow *control);
/// Set selections as newline-separated strings
void setSelections(const FXString& strings);
/// Return selections
const FXString& getSelections() const { return selections; }
};
/**
* The Table widget displays a table of items, each with a text and optional
* icon. A column Header control provide captions for each column, and a row
* Header control provides captions for each row. Columns are resizable by
* means of the column Header control if the TABLE_COL_SIZABLE option is passed.
* Likewise, rows in the table are resizable if the TABLE_ROW_SIZABLE option is
* specified. An entire row (column) can be selected by clicking on the a button
* in the row (column) Header control. Passing TABLE_NO_COLSELECT disables column
* selection, and passing TABLE_NO_ROWSELECT disables column selection.
* When TABLE_COL_RENUMBER is specified, columns are automatically renumbered when
* columns are added or removed. Similarly, TABLE_ROW_RENUMBER will cause row numbers
* to be recalculated automatically when rows are added or removed.
* To disable editing of cells in the table, the TABLE_READONLY can be specified.
* Cells in the table may or may not have items in them. When populating a cell
* for the first time, an item will be automatically created if necessary. Thus,
* a cell in the table takes no space unless it has actual contents.
* Moreover, a contiguous, rectangular region of cells in the table may refer to
* one single item; in that case, the item will be stretched to cover all the
* cells in the region, and no grid lines will be drawn interior to the spanning
* item.
* The Table widget issues SEL_SELECTED or SEL_DESELECTED when cells are selected
* or deselected, respectively. The table position affected is passed along as the
* 3rd parameter of these messages.
* Whenever the current (focus) item is changed, a SEL_CHANGED message is sent with
* the new table position as a parameter.
* When items are added to the table, a SEL_INSERTED message is sent, with the table
* range of the newly added cells as the parameter in the message.
* When items are removed from the table, a SEL_DELETED message is sent prior to the
* removal of the items, and the table range of the removed cells is passed as a parameter.
* A SEL_REPLACED message is sent when the contents of a cell are changed, either through
* editing or by other means; the parameter is the range of affected cells. This message
* is sent prior to the change.
* SEL_CLICKED, SEL_DOUBLECLICKED, and SEL_TRIPLECLICKED messages are sent when a cell
* is clicked, double-clicked, or triple-clicked, respectively.
* A SEL_COMMAND is sent when an enabled item is clicked inside the table.
*/
class FXAPI FXTable : public FXScrollArea {
FXDECLARE(FXTable)
protected:
FXHeader *colHeader; // Column header
FXHeader *rowHeader; // Row header
FXButton *cornerButton; // Corner button
FXTableItem **cells; // Cells
FXWindow *editor; // Editor widget
FXFont *font; // Font
FXint nrows; // Number of rows
FXint ncols; // Number of columns
FXint visiblerows; // Visible rows
FXint visiblecols; // Visible columns
FXint margintop; // Margin top
FXint marginbottom; // Margin bottom
FXint marginleft; // Margin left
FXint marginright; // Margin right
FXColor textColor; // Normal text color
FXColor baseColor; // Base color
FXColor hiliteColor; // Highlight color
FXColor shadowColor; // Shadow color
FXColor borderColor; // Border color
FXColor selbackColor; // Select background color
FXColor seltextColor; // Select text color
FXColor gridColor; // Grid line color
FXColor stippleColor; // Stipple color
FXColor cellBorderColor; // Cell border color
FXint cellBorderWidth; // Cell border width
FXColor cellBackColor[2][2]; // Row/Column even/odd background color
FXint defColWidth; // Default column width [if uniform columns]
FXint defRowHeight; // Default row height [if uniform rows]
FXTablePos current; // Current position
FXTablePos anchor; // Anchor position
FXTableRange input; // Input cell
FXTableRange selection; // Range of selected cells
FXString clipped; // Clipped text
FXbool hgrid; // Horizontal grid lines shown
FXbool vgrid; // Vertical grid lines shown
FXuchar mode; // Mode widget is in
FXint grabx; // Grab point x
FXint graby; // Grab point y
FXint rowcol; // Row or column being resized
FXString help;
public:
static FXDragType csvType;
static const FXchar csvTypeName[];
protected:
FXTable();
FXint startRow(FXint row,FXint col) const;
FXint startCol(FXint row,FXint col) const;
FXint endRow(FXint row,FXint col) const;
FXint endCol(FXint row,FXint col) const;
void spanningRange(FXint& sr,FXint& er,FXint& sc,FXint& ec,FXint anchrow,FXint anchcol,FXint currow,FXint curcol);
virtual void moveContents(FXint x,FXint y);
virtual void drawCell(FXDC& dc,FXint sr,FXint er,FXint sc,FXint ec);
virtual void drawRange(FXDC& dc,FXint rlo,FXint rhi,FXint clo,FXint chi);
virtual void drawHGrid(FXDC& dc,FXint rlo,FXint rhi,FXint clo,FXint chi);
virtual void drawVGrid(FXDC& dc,FXint rlo,FXint rhi,FXint clo,FXint chi);
virtual void drawContents(FXDC& dc,FXint x,FXint y,FXint w,FXint h);
virtual FXTableItem* createItem(const FXString& text,FXIcon* icon,void* ptr);
virtual FXWindow *getControlForItem(FXint r,FXint c);
virtual void setItemFromControl(FXint r,FXint c,FXWindow *control);
virtual void updateColumnNumbers(FXint lo,FXint hi);
virtual void updateRowNumbers(FXint lo,FXint hi);
protected:
enum {
MOUSE_NONE,
MOUSE_SCROLL,
MOUSE_DRAG,
MOUSE_SELECT
};
private:
FXTable(const FXTable&);
FXTable& operator=(const FXTable&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onFocusIn(FXObject*,FXSelector,void*);
long onFocusOut(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onRightBtnPress(FXObject*,FXSelector,void*);
long onRightBtnRelease(FXObject*,FXSelector,void*);
long onUngrabbed(FXObject*,FXSelector,void*);
long onSelectionLost(FXObject*,FXSelector,void*);
long onSelectionGained(FXObject*,FXSelector,void*);
long onSelectionRequest(FXObject*,FXSelector,void* ptr);
long onClipboardLost(FXObject*,FXSelector,void*);
long onClipboardGained(FXObject*,FXSelector,void*);
long onClipboardRequest(FXObject*,FXSelector,void*);
long onAutoScroll(FXObject*,FXSelector,void*);
long onCommand(FXObject*,FXSelector,void*);
long onClicked(FXObject*,FXSelector,void*);
long onDoubleClicked(FXObject*,FXSelector,void*);
long onTripleClicked(FXObject*,FXSelector,void*);
long onCmdToggleEditable(FXObject*,FXSelector,void*);
long onUpdToggleEditable(FXObject*,FXSelector,void*);
// Visual characteristics
long onCmdHorzGrid(FXObject*,FXSelector,void*);
long onUpdHorzGrid(FXObject*,FXSelector,void*);
long onCmdVertGrid(FXObject*,FXSelector,void*);
long onUpdVertGrid(FXObject*,FXSelector,void*);
// Row/Column manipulations
long onCmdDeleteColumn(FXObject*,FXSelector,void*);
long onUpdDeleteColumn(FXObject*,FXSelector,void*);
long onCmdDeleteRow(FXObject*,FXSelector,void*);
long onUpdDeleteRow(FXObject*,FXSelector,void*);
long onCmdInsertColumn(FXObject*,FXSelector,void*);
long onUpdInsertColumn(FXObject*,FXSelector,void*);
long onCmdInsertRow(FXObject*,FXSelector,void*);
long onUpdInsertRow(FXObject*,FXSelector,void*);
// Movement
long onCmdMoveRight(FXObject*,FXSelector,void*);
long onCmdMoveLeft(FXObject*,FXSelector,void*);
long onCmdMoveUp(FXObject*,FXSelector,void*);
long onCmdMoveDown(FXObject*,FXSelector,void*);
long onCmdMoveHome(FXObject*,FXSelector,void*);
long onCmdMoveEnd(FXObject*,FXSelector,void*);
long onCmdMoveTop(FXObject*,FXSelector,void*);
long onCmdMoveBottom(FXObject*,FXSelector,void*);
long onCmdMovePageDown(FXObject*,FXSelector,void*);
long onCmdMovePageUp(FXObject*,FXSelector,void*);
// Mark and extend
long onCmdMark(FXObject*,FXSelector,void*);
long onCmdExtend(FXObject*,FXSelector,void*);
// Changing Selection
long onUpdSelectCell(FXObject*,FXSelector,void*);
long onCmdSelectCell(FXObject*,FXSelector,void*);
long onUpdSelectRow(FXObject*,FXSelector,void*);
long onCmdSelectRow(FXObject*,FXSelector,void*);
long onUpdSelectColumn(FXObject*,FXSelector,void*);
long onCmdSelectColumn(FXObject*,FXSelector,void*);
long onCmdSelectRowIndex(FXObject*,FXSelector,void*);
long onCmdSelectColumnIndex(FXObject*,FXSelector,void*);
long onUpdSelectAll(FXObject*,FXSelector,void*);
long onCmdSelectAll(FXObject*,FXSelector,void*);
long onUpdDeselectAll(FXObject*,FXSelector,void*);
long onCmdDeselectAll(FXObject*,FXSelector,void*);
// Manipulation Selection
long onCmdCutSel(FXObject*,FXSelector,void*);
long onCmdCopySel(FXObject*,FXSelector,void*);
long onCmdDeleteSel(FXObject*,FXSelector,void*);
long onCmdPasteSel(FXObject*,FXSelector,void*);
long onUpdHaveSelection(FXObject*,FXSelector,void*);
// Edit control
long onCmdStartInput(FXObject*,FXSelector,void*);
long onUpdStartInput(FXObject*,FXSelector,void*);
long onCmdAcceptInput(FXObject*,FXSelector,void*);
long onUpdAcceptInput(FXObject*,FXSelector,void*);
long onCmdCancelInput(FXObject*,FXSelector,void*);
public:
enum {
ID_HORZ_GRID=FXScrollArea::ID_LAST,
ID_VERT_GRID,
ID_TOGGLE_EDITABLE,
ID_DELETE_COLUMN,
ID_DELETE_ROW,
ID_INSERT_COLUMN,
ID_INSERT_ROW,
ID_SELECT_COLUMN_INDEX,
ID_SELECT_ROW_INDEX,
ID_SELECT_COLUMN,
ID_SELECT_ROW,
ID_SELECT_CELL,
ID_SELECT_ALL,
ID_DESELECT_ALL,
ID_MOVE_LEFT,
ID_MOVE_RIGHT,
ID_MOVE_UP,
ID_MOVE_DOWN,
ID_MOVE_HOME,
ID_MOVE_END,
ID_MOVE_TOP,
ID_MOVE_BOTTOM,
ID_MOVE_PAGEDOWN,
ID_MOVE_PAGEUP,
ID_START_INPUT,
ID_CANCEL_INPUT,
ID_ACCEPT_INPUT,
ID_MARK,
ID_EXTEND,
ID_CUT_SEL,
ID_COPY_SEL,
ID_PASTE_SEL,
ID_DELETE_SEL,
ID_LAST
};
public:
/**
* Construct a new table.
* The table is initially empty, and reports a default size based on
* the scroll areas's scrollbar placement policy.
*/
FXTable(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_MARGIN,FXint pr=DEFAULT_MARGIN,FXint pt=DEFAULT_MARGIN,FXint pb=DEFAULT_MARGIN);
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Computes content width
virtual FXint getContentWidth();
/// Computes content height
virtual FXint getContentHeight();
/// Create the server-side resources
virtual void create();
/// Detach the server-side resources
virtual void detach();
/// Perform layout
virtual void layout();
/// Mark this window's layout as dirty
virtual void recalc();
/// Table widget can receive focus
virtual bool canFocus() const;
/// Move the focus to this window
virtual void setFocus();
/// Remove the focus from this window
virtual void killFocus();
/// Notification that focus moved to new child
virtual void changeFocus(FXWindow *child);
/// Return button in the top/left corner
FXButton* getCornerButton() const { return cornerButton; }
/// Return column header control
FXHeader* getColumnHeader() const { return colHeader; }
/// Return row header control
FXHeader* getRowHeader() const { return rowHeader; }
/// Change visible rows
void setVisibleRows(FXint nvrows);
/// return number of visible rows
FXint getVisibleRows() const { return visiblerows; }
/// Change visible columns
void setVisibleColumns(FXint nvcols);
/// Return number of visible columns
FXint getVisibleColumns() const { return visiblecols; }
/// Return TRUE if table is editable
FXbool isEditable() const;
/// Set editable flag
void setEditable(FXbool edit=TRUE);
/// Show or hide horizontal grid
void showHorzGrid(FXbool on=TRUE);
/// Is horizontal grid shown
FXbool isHorzGridShown() const { return hgrid; }
/// Show or hide vertical grid
void showVertGrid(FXbool on=TRUE);
/// Is vertical grid shown
FXbool isVertGridShown() const { return vgrid; }
/// Get number of rows
FXint getNumRows() const { return nrows; }
/// Get number of columns
FXint getNumColumns() const { return ncols; }
/// Change top cell margin
void setMarginTop(FXint pt);
/// Return top cell margin
FXint getMarginTop() const { return margintop; }
/// Change bottom cell margin
void setMarginBottom(FXint pb);
/// Return bottom cell margin
FXint getMarginBottom() const { return marginbottom; }
/// Change left cell margin
void setMarginLeft(FXint pl);
/// Return left cell margin
FXint getMarginLeft() const { return marginleft; }
/// Change right cell margin
void setMarginRight(FXint pr);
/// Return right cell margin
FXint getMarginRight() const { return marginright; }
/**
* Start input mode for the cell at the given position.
* An input control is created which is used to edit the cell;
* it is filled by the original item's contents if the cell contained
* an item. You can enter input mode also by sending the table an
* ID_START_INPUT message.
*/
virtual void startInput(FXint row,FXint col);
/**
* Cancel input mode. The input control is immediately deleted
* and the cell will retain its old value. You can also cancel
* input mode by sending the table an ID_CANCEL_INPUT message.
*/
virtual void cancelInput();
/**
* End input mode and accept the new value from the control.
* The item in the cell will be set to the value from the control,
* and the control will be deleted. If TRUE is passed, a SEL_REPLACED
* callback will be generated to signify to the target that this call
* has a new value. You can also accept the input by sending the table
* an ID_ACCEPT_INPUT message.
*/
virtual void acceptInput(FXbool notify=FALSE);
/**
* Determine column containing x.
* Returns -1 if x left of first column, and ncols if x right of last column;
* otherwise, returns column in table containing x.
*/
FXint colAtX(FXint x) const;
/**
* Determine row containing y.
* Returns -1 if y above first row, and nrows if y below last row;
* otherwise, returns row in table containing y.
*/
FXint rowAtY(FXint y) const;
/// Return the item at the given index
FXTableItem *getItem(FXint row,FXint col) const;
/// Replace the item with a [possibly subclassed] item
void setItem(FXint row,FXint col,FXTableItem* item,FXbool notify=FALSE);
/// Set the table size to nr rows and nc columns; all existing items will be removed
virtual void setTableSize(FXint nr,FXint nc,FXbool notify=FALSE);
/// Insert new row
virtual void insertRows(FXint row,FXint nr=1,FXbool notify=FALSE);
/// Insert new column
virtual void insertColumns(FXint col,FXint nc=1,FXbool notify=FALSE);
/// Remove rows of cells
virtual void removeRows(FXint row,FXint nr=1,FXbool notify=FALSE);
/// Remove column of cells
virtual void removeColumns(FXint col,FXint nc=1,FXbool notify=FALSE);
/// Extract item from table
virtual FXTableItem* extractItem(FXint row,FXint col,FXbool notify=FALSE);
/// Clear single cell
virtual void removeItem(FXint row,FXint col,FXbool notify=FALSE);
/// Clear all cells in the given range
virtual void removeRange(FXint startrow,FXint endrow,FXint startcol,FXint endcol,FXbool notify=FALSE);
/// Remove all items from table
virtual void clearItems(FXbool notify=FALSE);
/// Scroll to make cell at r,c fully visible
virtual void makePositionVisible(FXint r,FXint c);
/// Return TRUE if item partially visible
FXbool isItemVisible(FXint r,FXint c) const;
/**
* Change column header height mode to fixed or variable.
* In variable height mode, the column header will size to
* fit the contents in it. In fixed mode, the size is
* explicitly set using setColumnHeaderHeight().
*/
void setColumnHeaderMode(FXuint hint=LAYOUT_FIX_HEIGHT);
/// Return column header height mode
FXuint getColumnHeaderMode() const;
/**
* Change row header width mode to fixed or variable.
* In variable width mode, the row header will size to
* fit the contents in it. In fixed mode, the size is
* explicitly set using setRowHeaderWidth().
*/
void setRowHeaderMode(FXuint hint=LAYOUT_FIX_WIDTH);
/// Return row header width mode
FXuint getRowHeaderMode() const;
/// Set column header font
void setColumnHeaderFont(FXFont* fnt);
/// Return column header font
FXFont* getColumnHeaderFont() const;
/// Set row header font
void setRowHeaderFont(FXFont* fnt);
/// Return row header font
FXFont* getRowHeaderFont() const;
/// Change column header height
void setColumnHeaderHeight(FXint h);
/// Return column header height
FXint getColumnHeaderHeight() const;
/// Change row header width
void setRowHeaderWidth(FXint w);
/// Return row header width
FXint getRowHeaderWidth() const;
/// Get X coordinate of column
FXint getColumnX(FXint col) const;
/// Get Y coordinate of row
FXint getRowY(FXint row) const;
/// Change column width
virtual void setColumnWidth(FXint col,FXint cwidth);
/// Get column width
FXint getColumnWidth(FXint col) const;
/// Change row height
virtual void setRowHeight(FXint row,FXint rheight);
/// Get row height
FXint getRowHeight(FXint row) const;
/// Change default column width
void setDefColumnWidth(FXint cwidth);
/// Get default column width
FXint getDefColumnWidth() const { return defColWidth; }
/// Change default row height
void setDefRowHeight(FXint rheight);
/// Get default row height
FXint getDefRowHeight() const { return defRowHeight; }
/// Return minimum row height
FXint getMinRowHeight(FXint r) const;
/// Return minimum column width
FXint getMinColumnWidth(FXint c) const;
/// Fit row heights to contents
void fitRowsToContents(FXint row,FXint nr=1);
/// Fit column widths to contents
void fitColumnsToContents(FXint col,FXint nc=1);
/// Change column header text
void setColumnText(FXint index,const FXString& text);
/// Return text of column header at index
FXString getColumnText(FXint index) const;
/// Change row header text
void setRowText(FXint index,const FXString& text);
/// Return text of row header at index
FXString getRowText(FXint index) const;
/// Change column header icon
void setColumnIcon(FXint index,FXIcon* icon);
/// Return icon of column header at index
FXIcon* getColumnIcon(FXint index) const;
/// Change row header icon
void setRowIcon(FXint index,FXIcon* icon);
/// Return icon of row header at index
FXIcon* getRowIcon(FXint index) const;
/// Change column header icon position, e.g. FXHeaderItem::BEFORE, etc.
void setColumnIconPosition(FXint index,FXuint mode);
/// Return icon position of column header at index
FXuint getColumnIconPosition(FXint index) const;
/// Change row header icon position, e.g. FXHeaderItem::BEFORE, etc.
void setRowIconPosition(FXint index,FXuint mode);
/// Return icon position of row header at index
FXuint getRowIconPosition(FXint index) const;
/// Change column header justify, e.g. FXHeaderItem::RIGHT, etc.
void setColumnJustify(FXint index,FXuint justify);
/// Return justify of column header at index
FXuint getColumnJustify(FXint index) const;
/// Change row header justify, e.g. FXHeaderItem::RIGHT, etc.
void setRowJustify(FXint index,FXuint justify);
/// Return justify of row header at index
FXuint getRowJustify(FXint index) const;
/// Modify cell text
void setItemText(FXint r,FXint c,const FXString& text,FXbool notify=FALSE);
/// Return cell text
FXString getItemText(FXint r,FXint c) const;
/// Modify cell icon, deleting the old icon if it was owned
void setItemIcon(FXint r,FXint c,FXIcon* icon,FXbool owned=FALSE,FXbool notify=FALSE);
/// Return cell icon
FXIcon* getItemIcon(FXint r,FXint c) const;
/// Modify cell user-data
void setItemData(FXint r,FXint c,void* ptr);
void* getItemData(FXint r,FXint c) const;
/**
* Extract cells from given range as text, each column separated by a string cs,
* and each row separated by a string rs.
*/
void extractText(FXchar*& text,FXint& size,FXint startrow,FXint endrow,FXint startcol,FXint endcol,const FXchar* cs="\t",const FXchar* rs="\n") const;
void extractText(FXString& text,FXint startrow,FXint endrow,FXint startcol,FXint endcol,const FXchar* cs="\t",const FXchar* rs="\n") const;
/**
* Overlay text over given cell range; the text is interpreted as
* a number of columns separated by a character from the set cs, and
* a number of rows separated by a character from the set rs.
* Cells outside the given cell range are unaffected.
*/
void overlayText(FXint startrow,FXint endrow,FXint startcol,FXint endcol,const FXchar* text,FXint size,const FXchar* cs="\t,",const FXchar* rs="\n",FXbool notify=FALSE);
void overlayText(FXint startrow,FXint endrow,FXint startcol,FXint endcol,const FXString& text,const FXchar* cs="\t,",const FXchar* rs="\n",FXbool notify=FALSE);
/**
* Determine the number of rows and columns in a block of text
* where columns are separated by characters from the set cs, and rows
* are separated by characters from the set rs.
*/
void countText(FXint& nr,FXint& nc,const FXchar* text,FXint size,const FXchar* cs="\t,",const FXchar* rs="\n") const;
void countText(FXint& nr,FXint& nc,const FXString& text,const FXchar* cs="\t,",const FXchar* rs="\n") const;
/// Return TRUE if its a spanning cell
FXbool isItemSpanning(FXint r,FXint c) const;
/// Repaint cells between grid lines sr,er and grid lines sc,ec
void updateRange(FXint sr,FXint er,FXint sc,FXint ec) const;
/// Repaint cell at r,c
void updateItem(FXint r,FXint c) const;
/// Enable item
virtual FXbool enableItem(FXint r,FXint c);
/// Disable item
virtual FXbool disableItem(FXint r,FXint c);
/// Is item enabled
FXbool isItemEnabled(FXint r,FXint c) const;
/**
* Change item justification. Horizontal justification is controlled by passing
* FXTableItem::RIGHT, FXTableItem::LEFT, or FXTableItem::CENTER_X.
* Vertical justification is controlled by FXTableItem::TOP, FXTableItem::BOTTOM,
* or FXTableItem::CENTER_Y.
* The default is a combination of FXTableItem::RIGHT and FXTableItem::CENTER_Y.
*/
void setItemJustify(FXint r,FXint c,FXuint justify);
/// Return item justification
FXuint getItemJustify(FXint r,FXint c) const;
/**
* Change relative position of icon and text of item.
* Passing FXTableItem::BEFORE or FXTableItem::AFTER places the icon
* before or after the text, and passing FXTableItem::ABOVE or
* FXTableItem::BELOW places it above or below the text, respectively.
* The default is 0 which places the text on top of the icon.
*/
void setItemIconPosition(FXint r,FXint c,FXuint mode);
/// Return relative icon and text position
FXuint getItemIconPosition(FXint r,FXint c) const;
/**
* Change item borders style. Borders on each side of the item can be turned
* controlled individually using FXTableItem::LBORDER, FXTableItem::RBORDER,
* FXTableItem::TBORDER and FXTableItem::BBORDER.
*/
void setItemBorders(FXint r,FXint c,FXuint borders);
/// Return item border style
FXuint getItemBorders(FXint r,FXint c) const;
/// Change item background stipple style
void setItemStipple(FXint r,FXint c,FXStipplePattern pat);
/// return item background stipple style
FXStipplePattern getItemStipple(FXint r,FXint c) const;
/// Change current item
virtual void setCurrentItem(FXint r,FXint c,FXbool notify=FALSE);
/// Get row number of current item
FXint getCurrentRow() const { return current.row; }
/// Get column number of current item
FXint getCurrentColumn() const { return current.col; }
/// Is item current
FXbool isItemCurrent(FXint r,FXint c) const;
/// Change anchor item
void setAnchorItem(FXint r,FXint c);
/// Get row number of anchor item
FXint getAnchorRow() const { return anchor.row; }
/// Get column number of anchor item
FXint getAnchorColumn() const { return anchor.col; }
/// Get selection start row; returns -1 if no selection
FXint getSelStartRow() const { return selection.fm.row; }
/// Get selection start column; returns -1 if no selection
FXint getSelStartColumn() const { return selection.fm.col; }
/// Get selection end row; returns -1 if no selection
FXint getSelEndRow() const { return selection.to.row; }
/// Get selection end column; returns -1 if no selection
FXint getSelEndColumn() const { return selection.to.col; }
/// Is cell selected
FXbool isItemSelected(FXint r,FXint c) const;
/// Is row of cells selected
FXbool isRowSelected(FXint r) const;
/// Is column selected
FXbool isColumnSelected(FXint c) const;
/// Is anything selected
FXbool isAnythingSelected() const;
/// Select a row
virtual FXbool selectRow(FXint row,FXbool notify=FALSE);
/// Select a column
virtual FXbool selectColumn(FXint col,FXbool notify=FALSE);
/// Select range
virtual FXbool selectRange(FXint startrow,FXint endrow,FXint startcol,FXint endcol,FXbool notify=FALSE);
/// Extend selection
virtual FXbool extendSelection(FXint r,FXint c,FXbool notify=FALSE);
/// Kill selection
virtual FXbool killSelection(FXbool notify=FALSE);
/// Change font
void setFont(FXFont* fnt);
/// Return current font
FXFont* getFont() const { return font; }
/// Obtain colors of various parts
FXColor getTextColor() const { return textColor; }
FXColor getBaseColor() const { return baseColor; }
FXColor getHiliteColor() const { return hiliteColor; }
FXColor getShadowColor() const { return shadowColor; }
FXColor getBorderColor() const { return borderColor; }
FXColor getSelBackColor() const { return selbackColor; }
FXColor getSelTextColor() const { return seltextColor; }
FXColor getGridColor() const { return gridColor; }
FXColor getStippleColor() const { return stippleColor; }
FXColor getCellBorderColor() const { return cellBorderColor; }
/// Change colors of various parts
void setTextColor(FXColor clr);
void setBaseColor(FXColor clr);
void setHiliteColor(FXColor clr);
void setShadowColor(FXColor clr);
void setBorderColor(FXColor clr);
void setSelBackColor(FXColor clr);
void setSelTextColor(FXColor clr);
void setGridColor(FXColor clr);
void setStippleColor(FXColor clr);
void setCellBorderColor(FXColor clr);
/// Change cell background color for even/odd rows/columns
void setCellColor(FXint r,FXint c,FXColor clr);
/// Obtain cell background color for even/odd rows/columns
FXColor getCellColor(FXint r,FXint c) const;
/// Change cell border width
void setCellBorderWidth(FXint borderwidth);
/// Return cell border width
FXint getCellBorderWidth() const { return cellBorderWidth; }
/// Change table style
void setTableStyle(FXuint style);
/// Return table style
FXuint getTableStyle() const;
/// Set column renumbering
void setColumnRenumbering(FXbool flag);
/// Get column renumbering
FXbool getColumnRenumbering() const;
/// Set row renumbering
void setRowRenumbering(FXbool flag);
/// Get row renumbering
FXbool getRowRenumbering() const;
/// Change help text
void setHelpText(const FXString& text){ help=text; }
const FXString& getHelpText() const { return help; }
/// Serialize
virtual void save(FXStream& store) const;
virtual void load(FXStream& store);
virtual ~FXTable();
};
}
#endif
fox-1.6.49/include/FXMDIButton.h 0000664 0001750 0001750 00000012157 12130340076 013173 0000000 0000000 /********************************************************************************
* *
* M u l t i p l e D o c u m e n t B u t t o n *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXMDIButton.h,v 1.16 2006/01/22 17:58:05 fox Exp $ *
********************************************************************************/
#ifndef FXMDIBUTTON_H
#define FXMDIBUTTON_H
#ifndef FXBUTTON_H
#include "FXButton.h"
#endif
namespace FX {
class FXIcon;
/// MDI Delete button
class FXAPI FXMDIDeleteButton : public FXButton {
FXDECLARE(FXMDIDeleteButton)
protected:
FXMDIDeleteButton(){}
private:
FXMDIDeleteButton(const FXMDIDeleteButton&);
FXMDIDeleteButton &operator=(const FXMDIDeleteButton&);
public:
long onPaint(FXObject*,FXSelector,void*);
public:
/// Constructor
FXMDIDeleteButton(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=FRAME_RAISED,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
virtual FXint getDefaultWidth();
virtual FXint getDefaultHeight();
};
/// MDI Restore button
class FXAPI FXMDIRestoreButton : public FXButton {
FXDECLARE(FXMDIRestoreButton)
protected:
FXMDIRestoreButton(){}
private:
FXMDIRestoreButton(const FXMDIRestoreButton&);
FXMDIRestoreButton &operator=(const FXMDIRestoreButton&);
public:
long onPaint(FXObject*,FXSelector,void*);
public:
/// Constructor
FXMDIRestoreButton(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=FRAME_RAISED,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
virtual FXint getDefaultWidth();
virtual FXint getDefaultHeight();
};
/// MDI Maximize button
class FXAPI FXMDIMaximizeButton : public FXButton {
FXDECLARE(FXMDIMaximizeButton)
protected:
FXMDIMaximizeButton(){}
private:
FXMDIMaximizeButton(const FXMDIMaximizeButton&);
FXMDIMaximizeButton &operator=(const FXMDIMaximizeButton&);
public:
long onPaint(FXObject*,FXSelector,void*);
public:
/// Constructor
FXMDIMaximizeButton(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=FRAME_RAISED,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
virtual FXint getDefaultWidth();
virtual FXint getDefaultHeight();
};
/// MDI Minimize button
class FXAPI FXMDIMinimizeButton : public FXButton {
FXDECLARE(FXMDIMinimizeButton)
protected:
FXMDIMinimizeButton(){}
private:
FXMDIMinimizeButton(const FXMDIMinimizeButton&);
FXMDIMinimizeButton &operator=(const FXMDIMinimizeButton&);
public:
long onPaint(FXObject*,FXSelector,void*);
public:
/// Constructor
FXMDIMinimizeButton(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=FRAME_RAISED,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
virtual FXint getDefaultWidth();
virtual FXint getDefaultHeight();
};
/// MDI Window button
class FXAPI FXMDIWindowButton : public FXMenuButton {
FXDECLARE(FXMDIWindowButton)
protected:
FXMDIWindowButton(){}
private:
FXMDIWindowButton(const FXMDIWindowButton&);
FXMDIWindowButton &operator=(const FXMDIWindowButton&);
public:
long onPaint(FXObject*,FXSelector,void*);
public:
/// Constructor
FXMDIWindowButton(FXComposite* p,FXPopup* pup,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
virtual FXint getDefaultWidth();
virtual FXint getDefaultHeight();
};
/// MDI Window Menu
class FXAPI FXMDIMenu : public FXMenuPane {
FXDECLARE(FXMDIMenu)
private:
FXIcon *closeicon;
FXIcon *maximizeicon;
FXIcon *minimizeicon;
FXIcon *restoreicon;
protected:
FXMDIMenu(){}
private:
FXMDIMenu(const FXMDIMenu&);
FXMDIMenu &operator=(const FXMDIMenu&);
public:
/// Construct MDI menu
FXMDIMenu(FXWindow *owner,FXObject* tgt=NULL);
/// Destructor
virtual ~FXMDIMenu();
};
}
#endif
fox-1.6.49/include/FXFileSelector.h 0000664 0001750 0001750 00000024403 12130340076 013743 0000000 0000000 /********************************************************************************
* *
* F i l e S e l e c t i o n W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXFileSelector.h,v 1.61 2006/01/23 15:51:05 fox Exp $ *
********************************************************************************/
#ifndef FXFILESELECTOR_H
#define FXFILESELECTOR_H
#ifndef FXPACKER_H
#include "FXPacker.h"
#endif
namespace FX {
class FXFileList;
class FXTextField;
class FXComboBox;
class FXDirBox;
class FXButton;
class FXMenuButton;
class FXIcon;
class FXMenuPane;
class FXCheckButton;
class FXMatrix;
class FXHorizontalFrame;
/// File selection modes
enum {
SELECTFILE_ANY, /// A single file, existing or not (to save to)
SELECTFILE_EXISTING, /// An existing file (to load)
SELECTFILE_MULTIPLE, /// Multiple existing files
SELECTFILE_MULTIPLE_ALL, /// Multiple existing files or directories, but not '.' and '..'
SELECTFILE_DIRECTORY /// Existing directory, including '.' or '..'
};
/// File selection widget
class FXAPI FXFileSelector : public FXPacker {
FXDECLARE(FXFileSelector)
protected:
FXFileList *filebox; // File list widget
FXTextField *filename; // File name entry field
FXComboBox *filefilter; // Combobox for pattern list
FXMenuPane *bookmarkmenu; // Menu for bookmarks
FXHorizontalFrame *navbuttons; // Navigation buttons
FXHorizontalFrame *fileboxframe; // Frame around file list
FXMatrix *entryblock; // Entry block
FXCheckButton *readonly; // Open file as read only
FXDirBox *dirbox; // Directory hierarchy list
FXButton *accept; // Accept button
FXButton *cancel; // Cancel button
FXIcon *updiricon; // Up directory icon
FXIcon *listicon; // List mode icon
FXIcon *detailicon; // Detail mode icon
FXIcon *iconsicon; // Icon mode icon
FXIcon *homeicon; // Go home icon
FXIcon *workicon; // Go home icon
FXIcon *shownicon; // Files shown icon
FXIcon *hiddenicon; // Files hidden icon
FXIcon *markicon; // Book mark icon
FXIcon *clearicon; // Book clear icon
FXIcon *newicon; // New directory icon
FXIcon *deleteicon; // Delete file icon
FXIcon *moveicon; // Rename file icon
FXIcon *copyicon; // Copy file icon
FXIcon *linkicon; // Link file icon
FXRecentFiles bookmarks; // Bookmarked places
FXuint selectmode; // Select mode
FXbool navigable; // May navigate
protected:
FXFileSelector(){}
FXString *getSelectedFiles() const;
FXString *getSelectedFilesOnly() const;
private:
FXFileSelector(const FXFileSelector&);
FXFileSelector &operator=(const FXFileSelector&);
public:
long onCmdAccept(FXObject*,FXSelector,void*);
long onCmdFilter(FXObject*,FXSelector,void*);
long onCmdItemDblClicked(FXObject*,FXSelector,void*);
long onCmdItemSelected(FXObject*,FXSelector,void*);
long onCmdItemDeselected(FXObject*,FXSelector,void*);
long onCmdDirectoryUp(FXObject*,FXSelector,void*);
long onUpdDirectoryUp(FXObject*,FXSelector,void*);
long onCmdDirTree(FXObject*,FXSelector,void*);
long onCmdHome(FXObject*,FXSelector,void*);
long onCmdWork(FXObject*,FXSelector,void*);
long onCmdBookmark(FXObject*,FXSelector,void*);
long onCmdVisit(FXObject*,FXSelector,void*);
long onCmdNew(FXObject*,FXSelector,void*);
long onUpdNew(FXObject*,FXSelector,void*);
long onCmdMove(FXObject*,FXSelector,void*);
long onCmdCopy(FXObject*,FXSelector,void*);
long onCmdLink(FXObject*,FXSelector,void*);
long onCmdDelete(FXObject*,FXSelector,void*);
long onUpdSelected(FXObject*,FXSelector,void*);
long onPopupMenu(FXObject*,FXSelector,void*);
long onCmdImageSize(FXObject*,FXSelector,void*);
long onUpdImageSize(FXObject*,FXSelector,void*);
long onUpdNavigable(FXObject*,FXSelector,void*);
public:
enum {
ID_FILEFILTER=FXPacker::ID_LAST,
ID_ACCEPT,
ID_FILELIST,
ID_DIRECTORY_UP,
ID_DIRTREE,
ID_NORMAL_SIZE,
ID_MEDIUM_SIZE,
ID_GIANT_SIZE,
ID_HOME,
ID_WORK,
ID_BOOKMARK,
ID_BOOKMENU,
ID_VISIT,
ID_NEW,
ID_DELETE,
ID_MOVE,
ID_COPY,
ID_LINK,
ID_LAST
};
public:
/// Constructor
FXFileSelector(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Return a pointer to the "Accept" button
FXButton *acceptButton() const { return accept; }
/// Return a pointer to the "Cancel" button
FXButton *cancelButton() const { return cancel; }
/// Change file name
void setFilename(const FXString& path);
/// Return file name, if any
FXString getFilename() const;
/**
* Return array of strings containing the selected file names, terminated
* by an empty string. This string array must be freed using delete [].
* If no files were selected, a NULL is returned.
*/
FXString* getFilenames() const;
/// Change file pattern
void setPattern(const FXString& ptrn);
/// Return file pattern
FXString getPattern() const;
/**
* Change the list of file patterns shown in the file dialog.
* Each pattern comprises an optional name, followed by a pattern in
* parentheses. The patterns are separated by newlines.
* For example,
*
* "*\n*.cpp,*.cc\n*.hpp,*.hh,*.h"
*
* and
*
* "All Files (*)\nC++ Sources (*.cpp,*.cc)\nC++ Headers (*.hpp,*.hh,*.h)"
*
* will set the same three patterns, but the former shows no pattern names.
*/
void setPatternList(const FXString& patterns);
/// Return list of patterns
FXString getPatternList() const;
/**
* After setting the list of patterns, this call will
* initially select pattern n as the active one.
*/
void setCurrentPattern(FXint n);
/// Return current pattern number
FXint getCurrentPattern() const;
/// Get pattern text for given pattern number
FXString getPatternText(FXint patno) const;
/// Change pattern text for pattern number
void setPatternText(FXint patno,const FXString& text);
/// Return number of patterns
FXint getNumPatterns() const;
/// Allow pattern entry
void allowPatternEntry(FXbool allow);
/// Return TRUE if pattern entry is allowed
FXbool allowPatternEntry() const;
/**
* Given filename pattern of the form "GIF Format (*.gif)",
* returns the pattern only, i.e. "*.gif" in this case.
* If the parentheses are not found then returns the entire
* input pattern.
*/
static FXString patternFromText(const FXString& pattern);
/**
* Given a pattern of the form "*.gif,*.GIF", return
* the first extension of the pattern, i.e. "gif" in this
* example. Returns empty string if it doesn't work out.
*/
static FXString extensionFromPattern(const FXString& pattern);
/// Change directory
void setDirectory(const FXString& path);
/// Return directory
FXString getDirectory() const;
/// Set the inter-item spacing (in pixels)
void setItemSpace(FXint s);
/// Return the inter-item spacing (in pixels)
FXint getItemSpace() const;
/// Change file list style
void setFileBoxStyle(FXuint style);
/// Return file list style
FXuint getFileBoxStyle() const;
/// Change file selection mode
void setSelectMode(FXuint mode);
/// Return file selection mode
FXuint getSelectMode() const { return selectmode; }
/// Change wildcard matching mode
void setMatchMode(FXuint mode);
/// Return wildcard matching mode
FXuint getMatchMode() const;
/// Return TRUE if showing hidden files
FXbool showHiddenFiles() const;
/// Show or hide hidden files
void showHiddenFiles(FXbool showing);
/// Return TRUE if image preview on
FXbool showImages() const;
/// Show or hide preview images
void showImages(FXbool showing);
/// Return images preview size
FXint getImageSize() const;
/// Change images preview size
void setImageSize(FXint size);
/// Show readonly button
void showReadOnly(FXbool show);
/// Return TRUE if readonly is shown
FXbool shownReadOnly() const;
/// Set initial state of readonly button
void setReadOnly(FXbool state);
/// Get readonly state
FXbool getReadOnly() const;
/// Allow or disallow navigation
void allowNavigation(FXbool flag){ navigable=flag; }
/// Is navigation allowed?
FXbool allowNavigation() const { return navigable; }
/// Save object to a stream
virtual void save(FXStream& store) const;
/// Load object from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXFileSelector();
};
}
#endif
fox-1.6.49/include/FXHash.h 0000664 0001750 0001750 00000006332 12130340076 012247 0000000 0000000 /********************************************************************************
* *
* H a s h T a b l e C l a s s *
* *
*********************************************************************************
* Copyright (C) 2003,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXHash.h,v 1.12 2006/01/22 17:58:04 fox Exp $ *
********************************************************************************/
#ifndef FXHASH_H
#define FXHASH_H
namespace FX {
/**
* A hash table for associating pointers to pointers.
*/
class FXAPI FXHash {
private:
struct FXEntry {
void* key;
void* value;
};
private:
FXEntry *table; // Hash table
FXuint total; // Table size
FXuint used; // Number of used entries
FXuint free; // Number of free entries
private:
FXHash(const FXHash&);
FXHash &operator=(const FXHash&);
public:
/// Construct empty hash table
FXHash();
/// Resize the table to the given size.
void size(FXuint m);
/// Return the size of the table
FXint size() const { return total; }
/// Return number of items in table
FXuint no() const { return used; }
/// Insert key into the table
void* insert(void* key,void* value);
/// Replace key in table
void* replace(void* key,void* value);
/// Remove key from the table
void* remove(void* key);
/// Return value of key
void* find(void* key) const;
/// Return true if slot is empty
bool empty(FXint pos) const { return (table[pos].key==NULL)||(table[pos].key==(void*)-1L); }
/// Return key at position pos
void* key(FXint pos) const { return table[pos].key; }
/// Return data pointer at position pos
void* value(FXint pos) const { return table[pos].value; }
/// Clear hash table
void clear();
/// Destructor
virtual ~FXHash();
};
}
#endif
fox-1.6.49/include/FX88592Codec.h 0000644 0001750 0001750 00000001104 11637250333 013016 0000000 0000000 #ifndef FX88592CODEC_H
#define FX88592CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// ISO-8859-2 Codec
class FXAPI FX88592Codec : public FXTextCodec {
FXDECLARE(FX88592Codec)
public:
FX88592Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FX88592Codec(){}
};
}
#endif
fox-1.6.49/include/FXDocument.h 0000664 0001750 0001750 00000006343 12130340076 013144 0000000 0000000 /********************************************************************************
* *
* D o c u m e n t O b j e c t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXDocument.h,v 1.16 2006/01/22 17:58:01 fox Exp $ *
********************************************************************************/
#ifndef FXDOCUMENT_H
#define FXDOCUMENT_H
#ifndef FXOBJECT_H
#include "FXObject.h"
#endif
namespace FX {
// Forward
class FXWindow;
/// Abstract base class for documents
class FXAPI FXDocument : public FXObject {
FXDECLARE(FXDocument)
private:
FXString title; // Title to appear above windows
FXString filename; // File name to save to
FXbool modified; // Document has been modified
public:
long onUpdTitle(FXObject*,FXSelector,void*);
long onUpdFilename(FXObject*,FXSelector,void*);
public:
enum {
ID_TITLE=10000, // Don't interfere with viewer's message id's
ID_FILENAME,
ID_LAST
};
public:
/// Constructor
FXDocument();
/// Return true if document is modified
FXbool isModified() const { return modified; }
/// Set its modified state
void setModified(FXbool mdfy=TRUE){ modified=mdfy; }
/// Set document title
void setTitle(const FXString& name);
/// Get document title
const FXString& getTitle() const { return title; }
/// Set document filename
void setFilename(const FXString& path);
/// Get document filename
const FXString& getFilename() const { return filename; }
/// Save document to a stream
virtual void save(FXStream& store) const;
/// Load document from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXDocument();
};
}
#endif
fox-1.6.49/include/FXVec2d.h 0000664 0001750 0001750 00000017223 12130340076 012330 0000000 0000000 /********************************************************************************
* *
* D o u b l e - P r e c i s i o n 2 - E l e m e n t V e c t o r *
* *
*********************************************************************************
* Copyright (C) 1994,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXVec2d.h,v 1.21 2006/01/22 17:58:12 fox Exp $ *
********************************************************************************/
#ifndef FXVEC2D_H
#define FXVEC2D_H
namespace FX {
class FXMat3d;
/// Double-precision 2-element vector
class FXAPI FXVec2d {
public:
FXdouble x;
FXdouble y;
public:
/// Default constructor
FXVec2d(){}
/// Initialize from another vector
FXVec2d(const FXVec2d& v){x=v.x;y=v.y;}
/// Initialize from array of floats
FXVec2d(const FXdouble v[]){x=v[0];y=v[1];}
/// Initialize from components
FXVec2d(FXdouble xx,FXdouble yy){x=xx;y=yy;}
/// Return a non-const reference to the ith element
FXdouble& operator[](FXint i){return (&x)[i];}
/// Return a const reference to the ith element
const FXdouble& operator[](FXint i) const {return (&x)[i];}
/// Assignment
FXVec2d& operator=(const FXVec2d& v){x=v.x;y=v.y;return *this;}
/// Assignment from array of floats
FXVec2d& operator=(const FXdouble v[]){x=v[0];y=v[1];return *this;}
/// Set value from another vector
FXVec2d& set(const FXVec2d& v){x=v.x;y=v.y;return *this;}
/// Set value from array of floats
FXVec2d& set(const FXdouble v[]){x=v[0];y=v[1];return *this;}
/// Set value from components
FXVec2d& set(FXdouble xx,FXdouble yy){x=xx;y=yy;return *this;}
/// Assigning operators
FXVec2d& operator*=(FXdouble n){x*=n;y*=n;return *this;}
FXVec2d& operator/=(FXdouble n){x/=n;y/=n;return *this;}
FXVec2d& operator+=(const FXVec2d& v){x+=v.x;y+=v.y;return *this;}
FXVec2d& operator-=(const FXVec2d& v){x-=v.x;y-=v.y;return *this;}
/// Conversions
operator FXdouble*(){return &x;}
operator const FXdouble*() const {return &x;}
/// Unary
FXVec2d operator+() const { return *this; }
FXVec2d operator-() const { return FXVec2d(-x,-y); }
/// Vector and vector
FXVec2d operator+(const FXVec2d& v) const { return FXVec2d(x+v.x,y+v.y); }
FXVec2d operator-(const FXVec2d& v) const { return FXVec2d(x-v.x,y-v.y); }
/// Vector and matrix
FXVec2d operator*(const FXMat3d& m) const;
/// Scaling
friend inline FXVec2d operator*(const FXVec2d& a,FXdouble n);
friend inline FXVec2d operator*(FXdouble n,const FXVec2d& a);
friend inline FXVec2d operator/(const FXVec2d& a,FXdouble n);
friend inline FXVec2d operator/(FXdouble n,const FXVec2d& a);
/// Dot product
FXdouble operator*(const FXVec2d& v) const { return x*v.x+y*v.y; }
/// Test if zero
bool operator!() const { return x==0.0 && y==0.0;}
/// Equality tests
bool operator==(const FXVec2d& v) const { return x==v.x && y==v.y; }
bool operator!=(const FXVec2d& v) const { return x!=v.x || y!=v.y; }
friend inline bool operator==(const FXVec2d& a,FXdouble n);
friend inline bool operator!=(const FXVec2d& a,FXdouble n);
friend inline bool operator==(FXdouble n,const FXVec2d& a);
friend inline bool operator!=(FXdouble n,const FXVec2d& a);
/// Inequality tests
bool operator<(const FXVec2d& v) const { return x(const FXVec2d& v) const { return x>v.x && y>v.y; }
bool operator>=(const FXVec2d& v) const { return x>=v.x && y>=v.y; }
friend inline bool operator<(const FXVec2d& a,FXdouble n);
friend inline bool operator<=(const FXVec2d& a,FXdouble n);
friend inline bool operator>(const FXVec2d& a,FXdouble n);
friend inline bool operator>=(const FXVec2d& a,FXdouble n);
friend inline bool operator<(FXdouble n,const FXVec2d& a);
friend inline bool operator<=(FXdouble n,const FXVec2d& a);
friend inline bool operator>(FXdouble n,const FXVec2d& a);
friend inline bool operator>=(FXdouble n,const FXVec2d& a);
/// Length and square of length
FXdouble length2() const { return x*x+y*y; }
FXdouble length() const { return sqrt(length2()); }
/// Clamp values of vector between limits
FXVec2d& clamp(FXdouble lo,FXdouble hi){x=FXCLAMP(lo,x,hi);y=FXCLAMP(lo,y,hi);return *this;}
/// Lowest or highest components
friend inline FXVec2d lo(const FXVec2d& a,const FXVec2d& b);
friend inline FXVec2d hi(const FXVec2d& a,const FXVec2d& b);
/// Normalize vector
friend FXAPI FXVec2d normalize(const FXVec2d& v);
/// Save vector to a stream
friend FXAPI FXStream& operator<<(FXStream& store,const FXVec2d& v);
/// Load vector from a stream
friend FXAPI FXStream& operator>>(FXStream& store,FXVec2d& v);
};
inline FXVec2d operator*(const FXVec2d& a,FXdouble n){return FXVec2d(a.x*n,a.y*n);}
inline FXVec2d operator*(FXdouble n,const FXVec2d& a){return FXVec2d(n*a.x,n*a.y);}
inline FXVec2d operator/(const FXVec2d& a,FXdouble n){return FXVec2d(a.x/n,a.y/n);}
inline FXVec2d operator/(FXdouble n,const FXVec2d& a){return FXVec2d(n/a.x,n/a.y);}
inline bool operator==(const FXVec2d& a,FXdouble n){return a.x==n && a.y==n;}
inline bool operator!=(const FXVec2d& a,FXdouble n){return a.x!=n || a.y!=n;}
inline bool operator==(FXdouble n,const FXVec2d& a){return n==a.x && n==a.y;}
inline bool operator!=(FXdouble n,const FXVec2d& a){return n!=a.x || n!=a.y;}
inline bool operator<(const FXVec2d& a,FXdouble n){return a.x(const FXVec2d& a,FXdouble n){return a.x>n && a.y>n;}
inline bool operator>=(const FXVec2d& a,FXdouble n){return a.x>=n && a.y>=n;}
inline bool operator<(FXdouble n,const FXVec2d& a){return n(FXdouble n,const FXVec2d& a){return n>a.x && n>a.y;}
inline bool operator>=(FXdouble n,const FXVec2d& a){return n>=a.x && n>=a.y;}
inline FXVec2d lo(const FXVec2d& a,const FXVec2d& b){return FXVec2d(FXMIN(a.x,b.x),FXMIN(a.y,b.y));}
inline FXVec2d hi(const FXVec2d& a,const FXVec2d& b){return FXVec2d(FXMAX(a.x,b.x),FXMAX(a.y,b.y));}
extern FXAPI FXVec2d normalize(const FXVec2d& v);
extern FXAPI FXStream& operator<<(FXStream& store,const FXVec2d& v);
extern FXAPI FXStream& operator>>(FXStream& store,FXVec2d& v);
}
#endif
fox-1.6.49/include/FXShell.h 0000664 0001750 0001750 00000006062 12130340076 012433 0000000 0000000 /********************************************************************************
* *
* S h e l l W i n d o w W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXShell.h,v 1.31 2006/01/22 17:58:09 fox Exp $ *
********************************************************************************/
#ifndef FXSHELL_H
#define FXSHELL_H
#ifndef FXCOMPOSITE_H
#include "FXComposite.h"
#endif
namespace FX {
/**
* The Shell widget is used as the base class for top level windows, i.e.
* windows which are direct children of the root window.
*/
class FXAPI FXShell : public FXComposite {
FXDECLARE(FXShell)
protected:
FXShell(){}
FXShell(FXApp* a,FXuint opts,FXint x,FXint y,FXint w,FXint h);
FXShell(FXWindow* own,FXuint opts,FXint x,FXint y,FXint w,FXint h);
private:
FXShell(const FXShell&);
FXShell &operator=(const FXShell&);
public:
long onLayout(FXObject*,FXSelector,void*);
long onConfigure(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onFocusNext(FXObject*,FXSelector,void*);
long onFocusPrev(FXObject*,FXSelector,void*);
public:
enum {
ID_LAYOUT=FXComposite::ID_LAST,
ID_LAST
};
public:
/// Create server-side resources
virtual void create();
/// Mark this window's layout as dirty
virtual void recalc();
/// Move the focus to this window
virtual void setFocus();
/// Remove the focus from this window
virtual void killFocus();
/// Destroy shell
virtual ~FXShell();
};
}
#endif
fox-1.6.49/include/FXTGAIcon.h 0000664 0001750 0001750 00000006173 12130340076 012613 0000000 0000000 /********************************************************************************
* *
* T A R G A I c o n O b j e c t *
* *
*********************************************************************************
* Copyright (C) 2001,2006 by Janusz Ganczarski. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXTGAIcon.h,v 1.18 2006/01/22 17:58:10 fox Exp $ *
********************************************************************************/
#ifndef FXTGAICON_H
#define FXTGAICON_H
#ifndef FXICON_H
#include "FXIcon.h"
#endif
namespace FX {
/// TARGA image format icon
class FXAPI FXTGAIcon : public FXIcon {
FXDECLARE(FXTGAIcon)
protected:
FXTGAIcon(){}
private:
FXTGAIcon(const FXTGAIcon&);
FXTGAIcon &operator=(const FXTGAIcon&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct icon from memory stream formatted in TARGA format
FXTGAIcon(FXApp* a,const void *pix=NULL,FXColor clr=FXRGB(192,192,192),FXuint opts=0,FXint w=1,FXint h=1);
/// Save pixels into stream in TARGA format
virtual bool savePixels(FXStream& store) const;
/// Load pixels from stream in TARGA format
virtual bool loadPixels(FXStream& store);
/// Destroy icon
virtual ~FXTGAIcon();
};
/**
* Check if stream contains a TARGA, return TRUE if so.
*/
extern FXAPI bool fxcheckTGA(FXStream& store);
/**
* Load an TARGA file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadTGA(FXStream& store,FXColor*& data,FXint& width,FXint& height);
/**
* Save an TARGA file to a stream.
*/
extern FXAPI bool fxsaveTGA(FXStream& store,const FXColor *data,FXint width,FXint height);
}
#endif
fox-1.6.49/include/FXCP864Codec.h 0000644 0001750 0001750 00000001077 11637250333 013074 0000000 0000000 #ifndef FXCP864CODEC_H
#define FXCP864CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// CP864 Codec
class FXAPI FXCP864Codec : public FXTextCodec {
FXDECLARE(FXCP864Codec)
public:
FXCP864Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FXCP864Codec(){}
};
}
#endif
fox-1.6.49/include/FXGradientBar.h 0000664 0001750 0001750 00000027560 12130340076 013554 0000000 0000000 /********************************************************************************
* *
* G r a d i e n t B a r W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2002,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXGradientBar.h,v 1.52 2006/01/22 17:58:04 fox Exp $ *
********************************************************************************/
#ifndef FXGRADIENTBAR_H
#define FXGRADIENTBAR_H
#ifndef FXFRAME_H
#include "FXFrame.h"
#endif
namespace FX {
/// Gradient bar orientation
enum {
GRADIENTBAR_HORIZONTAL = 0, /// Gradient bar shown horizontally
GRADIENTBAR_VERTICAL = 0x00008000, /// Gradient bar shown vertically
GRADIENTBAR_NO_CONTROLS = 0, /// No controls shown
GRADIENTBAR_CONTROLS_TOP = 0x00010000, /// Controls on top
GRADIENTBAR_CONTROLS_BOTTOM = 0x00020000, /// Controls on bottom
GRADIENTBAR_CONTROLS_LEFT = GRADIENTBAR_CONTROLS_TOP, /// Controls on left
GRADIENTBAR_CONTROLS_RIGHT = GRADIENTBAR_CONTROLS_BOTTOM /// Controls on right
};
/// Blend modes
enum {
GRADIENT_BLEND_LINEAR, /// Linear blend
GRADIENT_BLEND_POWER, /// Power law blend
GRADIENT_BLEND_SINE, /// Sine blend
GRADIENT_BLEND_INCREASING, /// Quadratic increasing blend
GRADIENT_BLEND_DECREASING /// Quadratic decreasing blend
};
// Gradient segment
struct FXGradient {
FXdouble lower; /// Lower value
FXdouble middle; /// Middle value
FXdouble upper; /// Upper value
FXColor lowerColor; /// Lower color
FXColor upperColor; /// Upper color
FXuchar blend; /// Blend method
};
class FXImage;
/**
* The gradient bar is a control that is used to edit color gradient,
* such as used in texture mapping and shape filling.
*/
class FXAPI FXGradientBar : public FXFrame {
FXDECLARE(FXGradientBar)
protected:
FXImage *bar; // Image containing colors
FXGradient *seg; // Segments
FXint nsegs; // Number of segments
FXint sellower; // Lower selected segment
FXint selupper; // Upper selected segment
FXint dropped; // Dropped segment
FXint current; // Current segment
FXint anchor; // Anchor segment
FXint grip; // Grip being dragged, if any
FXint where; // Where dropped in segment
FXString tip; // Tooltip value
FXString help; // Help value
FXColor selectColor; // Select color
FXint offset; // Offset
protected:
FXGradientBar();
void updatebar();
FXdouble getValue(FXint x,FXint y) const;
FXint getSegmentLowerPos(FXint sg) const;
FXint getSegmentUpperPos(FXint sg) const;
FXint getSegmentMiddlePos(FXint sg) const;
void drawUpArrow(FXDCWindow& dc,FXint x,FXint y,FXColor clr);
void drawDnArrow(FXDCWindow& dc,FXint x,FXint y,FXColor clr);
void drawRtArrow(FXDCWindow& dc,FXint x,FXint y,FXColor clr);
void drawLtArrow(FXDCWindow& dc,FXint x,FXint y,FXColor clr);
void drawBottomArrows(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawTopArrows(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawLeftArrows(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawRightArrows(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
static FXdouble blendlinear(FXdouble middle,FXdouble pos);
static FXdouble blendpower(FXdouble middle,FXdouble pos);
static FXdouble blendsine(FXdouble middle,FXdouble pos);
static FXdouble blendincreasing(FXdouble middle,FXdouble pos);
static FXdouble blenddecreasing(FXdouble middle,FXdouble pos);
private:
FXGradientBar(const FXGradientBar&);
FXGradientBar &operator=(const FXGradientBar&);
public:
enum {
GRIP_NONE,
GRIP_LOWER,
GRIP_SEG_LOWER,
GRIP_MIDDLE,
GRIP_SEG_UPPER,
GRIP_UPPER
};
public:
long onPaint(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onDNDEnter(FXObject*,FXSelector,void*);
long onDNDLeave(FXObject*,FXSelector,void*);
long onDNDMotion(FXObject*,FXSelector,void*);
long onDNDDrop(FXObject*,FXSelector,void*);
long onCmdBlending(FXObject*,FXSelector,void*);
long onUpdBlending(FXObject*,FXSelector,void*);
long onUpdSegColor(FXObject*,FXSelector,void*);
long onCmdSegColor(FXObject*,FXSelector,void*);
long onUpdRecenter(FXObject*,FXSelector,void*);
long onCmdRecenter(FXObject*,FXSelector,void*);
long onUpdSplit(FXObject*,FXSelector,void*);
long onCmdSplit(FXObject*,FXSelector,void*);
long onUpdMerge(FXObject*,FXSelector,void*);
long onCmdMerge(FXObject*,FXSelector,void*);
long onUpdUniform(FXObject*,FXSelector,void*);
long onCmdUniform(FXObject*,FXSelector,void*);
long onCmdSetHelp(FXObject*,FXSelector,void*);
long onCmdGetHelp(FXObject*,FXSelector,void*);
long onCmdSetTip(FXObject*,FXSelector,void*);
long onCmdGetTip(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
public:
enum{
ID_LOWER_COLOR=FXFrame::ID_LAST,
ID_UPPER_COLOR,
ID_BLEND_LINEAR,
ID_BLEND_POWER,
ID_BLEND_SINE,
ID_BLEND_INCREASING,
ID_BLEND_DECREASING,
ID_RECENTER,
ID_SPLIT,
ID_MERGE,
ID_UNIFORM,
ID_LAST
};
public:
/// Construct a gradient bar
FXGradientBar(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=FRAME_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Create server-side resources
virtual void create();
/// Perform layout
virtual void layout();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/**
* Obtain segment containing location x, y.
* Returns -1 if no matching segment was found.
*/
FXint getSegment(FXint x,FXint y) const;
/**
* Get the grip in segment sg which is closest to location (x, y),
* one of GRIP_LOWER, GRIP_SEG_LOWER, GRIP_MIDDLE, GRIP_SEG_UPPER,
* GRIP_UPPER or GRIP_NONE.
*/
FXint getGrip(FXint sg,FXint x,FXint y) const;
/// Return the number of segments
FXint getNumSegments() const { return nsegs; }
/**
* Replace the current gradient segments.
* The gradient bar makes a copy of the input segments array.
*/
void setGradients(const FXGradient *segments,FXint nsegments);
/**
* Return a copy of the gradient segments.
* The array of segments is allocated using FXMALLOC and should be freed
* by the caller using FXFREE.
*/
void getGradients(FXGradient*& segments,FXint& nsegments) const;
/// Change current segment
void setCurrentSegment(FXint index,FXbool notify=FALSE);
/// Return current segment, or -1 if there is no current segment
FXint getCurrentSegment() const { return current; }
/// Change anchor segment
void setAnchorSegment(FXint index);
/// Return anchor segment, or -1 if there is no anchor segment
FXint getAnchorSegment() const { return anchor; }
/// Select segment(s)
FXbool selectSegments(FXint fm,FXint to,FXbool notify=FALSE);
/// Deselect all segments
FXbool deselectSegments(FXbool notify);
/// Returns TRUE if the specified segment is selected
FXbool isSegmentSelected(FXint s) const;
/// Set lower color of a segment
void setSegmentLowerColor(FXint s,FXColor clr,FXbool notify=FALSE);
/// Set upper color of a segment
void setSegmentUpperColor(FXint s,FXColor clr,FXbool notify=FALSE);
/// Get lower color of a segment
FXColor getSegmentLowerColor(FXint s) const;
/// Get upper color of a segment
FXColor getSegmentUpperColor(FXint s) const;
/// Move lower point of segment sg
void moveSegmentLower(FXint sg,FXdouble val,FXbool notify=FALSE);
/// Move middle point of segment sg
void moveSegmentMiddle(FXint sg,FXdouble val,FXbool notify=FALSE);
/// Move upper point of segment sg
void moveSegmentUpper(FXint sg,FXdouble val,FXbool notify=FALSE);
/// Move segments sglo to sghi to new position val
void moveSegments(FXint sglo,FXint sghi,FXdouble val,FXbool notify=FALSE);
/// Get lower value of segment sg
FXdouble getSegmentLower(FXint sg) const;
/// Get middle value of segment sg
FXdouble getSegmentMiddle(FXint sg) const;
/// Get upper value of segment sg
FXdouble getSegmentUpper(FXint sg) const;
/**
* Get gradient ramp.
* The ramp argument should be an array of size nramp, which will be
* filled with the appropriate color values.
*/
void gradient(FXColor *ramp,FXint nramp);
/**
* Get blend mode of segment, one of GRADIENT_BLEND_LINEAR,
* GRADIENT_BLEND_POWER, GRADIENT_BLEND_SINE, GRADIENT_BLEND_INCREASING,
* or GRADIENT_BLEND_DECREASING.
*/
FXuint getSegmentBlend(FXint s) const;
/// Split segment at the midpoint
void splitSegments(FXint sglo,FXint sghi,FXbool notify=FALSE);
/// Merge segments
void mergeSegments(FXint sglo,FXint sghi,FXbool notify=FALSE);
/// Make segments uniformly distributed
void uniformSegments(FXint sglo,FXint sghi,FXbool notify=FALSE);
/// Change blend mode of segment
void blendSegments(FXint sglo,FXint sghi,FXuint blend=GRADIENT_BLEND_LINEAR,FXbool notify=FALSE);
/// Get the gradient bar style
FXuint getBarStyle() const;
/// Change the gradient bar style
void setBarStyle(FXuint style);
/// Set color
void setSelectColor(FXColor clr);
/// Get color
FXColor getSelectColor() const { return selectColor; }
/// Set status line help text for this gradient bar
void setHelpText(const FXString& text){ help=text; }
/// Get status line help text for this gradient bar
const FXString& getHelpText() const { return help; }
/// Set tool tip message for this gradient bar
void setTipText(const FXString& text){ tip=text; }
/// Get tool tip message for this gradient bar
const FXString& getTipText() const { return tip; }
/// Save gradient bar to a stream
virtual void save(FXStream& store) const;
/// Load gradient bar from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXGradientBar();
};
}
#endif
fox-1.6.49/include/FXCP860Codec.h 0000644 0001750 0001750 00000001077 11637250333 013070 0000000 0000000 #ifndef FXCP860CODEC_H
#define FXCP860CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// CP860 Codec
class FXAPI FXCP860Codec : public FXTextCodec {
FXDECLARE(FXCP860Codec)
public:
FXCP860Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FXCP860Codec(){}
};
}
#endif
fox-1.6.49/include/FXGIFImage.h 0000664 0001750 0001750 00000006346 12130340076 012741 0000000 0000000 /********************************************************************************
* *
* G I F I m a g e O b j e c t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXGIFImage.h,v 1.23 2006/01/22 17:58:02 fox Exp $ *
********************************************************************************/
#ifndef FXGIFIMAGE_H
#define FXGIFIMAGE_H
#ifndef FXIMAGE_H
#include "FXImage.h"
#endif
namespace FX {
/// GIF Image class
class FXAPI FXGIFImage : public FXImage {
FXDECLARE(FXGIFImage)
protected:
FXGIFImage(){}
private:
FXGIFImage(const FXGIFImage&);
FXGIFImage &operator=(const FXGIFImage&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct an image from memory stream formatted as CompuServe GIF format
FXGIFImage(FXApp* a,const void *pix=NULL,FXuint opts=0,FXint w=1,FXint h=1);
/// Save pixels into stream in [un]GIF format
virtual bool savePixels(FXStream& store) const;
/// Load pixels from stream in CompuServe GIF format
virtual bool loadPixels(FXStream& store);
/// Destroy
virtual ~FXGIFImage();
};
#ifndef FXLOADGIF
#define FXLOADGIF
/**
* Check if stream contains a GIF, return TRUE if so.
*/
extern FXAPI bool fxcheckGIF(FXStream& store);
/**
* Load an GIF (Graphics Interchange Format) file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadGIF(FXStream& store,FXColor*& data,FXint& width,FXint& height);
/**
* Save an GIF (Graphics Interchange Format) file to a stream.
*/
extern FXAPI bool fxsaveGIF(FXStream& store,const FXColor *data,FXint width,FXint height,bool fast=true);
#endif
}
#endif
fox-1.6.49/include/FXIconList.h 0000664 0001750 0001750 00000053251 12130340076 013112 0000000 0000000 /********************************************************************************
* *
* I c o n L i s t W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1999,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXIconList.h,v 1.95.2.4 2006/11/17 16:02:31 fox Exp $ *
********************************************************************************/
#ifndef FXICONLIST_H
#define FXICONLIST_H
#ifndef FXSCROLLAREA_H
#include "FXScrollArea.h"
#endif
namespace FX {
/// Icon list styles
enum {
ICONLIST_EXTENDEDSELECT = 0, /// Extended selection mode
ICONLIST_SINGLESELECT = 0x00100000, /// At most one selected item
ICONLIST_BROWSESELECT = 0x00200000, /// Always exactly one selected item
ICONLIST_MULTIPLESELECT = 0x00300000, /// Multiple selection mode
ICONLIST_AUTOSIZE = 0x00400000, /// Automatically size item spacing
ICONLIST_DETAILED = 0, /// List mode
ICONLIST_MINI_ICONS = 0x00800000, /// Mini Icon mode
ICONLIST_BIG_ICONS = 0x01000000, /// Big Icon mode
ICONLIST_ROWS = 0, /// Row-wise mode
ICONLIST_COLUMNS = 0x02000000, /// Column-wise mode
ICONLIST_NORMAL = ICONLIST_EXTENDEDSELECT
};
class FXIcon;
class FXHeader;
class FXFont;
class FXIconList;
class FXFileList;
/// Icon item
class FXAPI FXIconItem : public FXObject {
FXDECLARE(FXIconItem)
friend class FXIconList;
friend class FXFileList;
protected:
FXString label;
FXIcon *bigIcon;
FXIcon *miniIcon;
void *data;
FXuint state;
private:
FXIconItem(const FXIconItem&);
FXIconItem& operator=(const FXIconItem&);
protected:
FXIconItem():bigIcon(NULL),miniIcon(NULL),data(NULL),state(0){}
virtual void draw(const FXIconList* list,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const;
virtual FXint hitItem(const FXIconList* list,FXint rx,FXint ry,FXint rw=1,FXint rh=1) const;
protected:
virtual void drawBigIcon(const FXIconList* list,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const;
virtual void drawMiniIcon(const FXIconList* list,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const;
virtual void drawDetails(const FXIconList* list,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const;
public:
enum {
SELECTED = 1, /// Selected
FOCUS = 2, /// Focus
DISABLED = 4, /// Disabled
DRAGGABLE = 8, /// Draggable
BIGICONOWNED = 16, /// Big icon owned by item
MINIICONOWNED = 32 /// Mini icon owned by item
};
public:
/// Construct new item with given text, icons, and user-data
FXIconItem(const FXString& text,FXIcon* bi=NULL,FXIcon* mi=NULL,void* ptr=NULL):label(text),bigIcon(bi),miniIcon(mi),data(ptr),state(0){}
/// Change item's text label
virtual void setText(const FXString& txt);
/// Return item's text label
const FXString& getText() const { return label; }
/// Change item's big icon, deleting the old icon if it was owned
virtual void setBigIcon(FXIcon* icn,FXbool owned=FALSE);
/// Return item's big icon
FXIcon* getBigIcon() const { return bigIcon; }
/// Change item's mini icon, deleting the old icon if it was owned
virtual void setMiniIcon(FXIcon* icn,FXbool owned=FALSE);
/// Return item's mini icon
FXIcon* getMiniIcon() const { return miniIcon; }
/// Change item's user data
void setData(void* ptr){ data=ptr; }
/// Get item's user data
void* getData() const { return data; }
/// Make item draw as focused
virtual void setFocus(FXbool focus);
/// Return true if item has focus
FXbool hasFocus() const { return (state&FOCUS)!=0; }
/// Select item
virtual void setSelected(FXbool selected);
/// Return true if this item is selected
FXbool isSelected() const { return (state&SELECTED)!=0; }
/// Enable or disable item
virtual void setEnabled(FXbool enabled);
/// Return true if this item is enabled
FXbool isEnabled() const { return (state&DISABLED)==0; }
/// Make item draggable
virtual void setDraggable(FXbool draggable);
/// Return true if this item is draggable
FXbool isDraggable() const { return (state&DRAGGABLE)!=0; }
/// Return width of item as drawn in list
virtual FXint getWidth(const FXIconList* list) const;
/// Return height of item as drawn in list
virtual FXint getHeight(const FXIconList* list) const;
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Destroy server-side resources
virtual void destroy();
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
/// Destroy item and free icons if owned
virtual ~FXIconItem();
};
/// Icon item collate function
typedef FXint (*FXIconListSortFunc)(const FXIconItem*,const FXIconItem*);
/// List of FXIconItem's
typedef FXObjectListOf FXIconItemList;
/**
* A Icon List Widget displays a list of items, each with a text and
* optional icon. Icon List can display its items in essentially three
* different ways; in big-icon mode, the bigger of the two icons is used
* for each item, and the text is placed underneath the icon. In mini-
* icon mode, the icons are listed in rows and columns, with the smaller
* icon preceding the text. Finally, in detail mode the icons are listed
* in a single column, and all fields of the text are shown under a
* header control with one button for each subfield.
* When an item's selected state changes, the icon list sends
* a SEL_SELECTED or SEL_DESELECTED message. A change of the current
* item is signified by the SEL_CHANGED message.
* The icon list sends SEL_COMMAND messages when the user clicks on an item,
* and SEL_CLICKED, SEL_DOUBLECLICKED, and SEL_TRIPLECLICKED when the user
* clicks once, twice, or thrice, respectively.
* When items are added, replaced, or removed, the icon list sends messages
* of the type SEL_INSERTED, SEL_REPLACED, or SEL_DELETED.
* In each of these cases, the index to the item, if any, is passed in the
* 3rd argument of the message.
*/
class FXAPI FXIconList : public FXScrollArea {
FXDECLARE(FXIconList)
protected:
FXHeader *header; // Header control
FXIconItemList items; // Item list
FXint nrows; // Number of rows
FXint ncols; // Number of columns
FXint anchor; // Anchor item
FXint current; // Current item
FXint extent; // Extent item
FXint cursor; // Cursor item
FXint viewable; // Visible item
FXFont *font; // Font
FXIconListSortFunc sortfunc; // Item sort function
FXColor textColor; // Text color
FXColor selbackColor; // Selected back color
FXColor seltextColor; // Selected text color
FXint itemWidth; // Item width
FXint itemHeight; // Item height
FXint itemSpace; // Space for item label
FXint anchorx; // Rectangular selection
FXint anchory;
FXint currentx;
FXint currenty;
FXint grabx; // Grab point x
FXint graby; // Grab point y
FXString lookup; // Lookup string
FXString help; // Help text
FXbool state; // State of item
protected:
FXIconList();
void recompute();
void getrowscols(FXint& nr,FXint& nc,FXint w,FXint h) const;
void drawLasso(FXint x0,FXint y0,FXint x1,FXint y1);
void lassoChanged(FXint ox,FXint oy,FXint ow,FXint oh,FXint nx,FXint ny,FXint nw,FXint nh,FXbool notify);
virtual void moveContents(FXint x,FXint y);
virtual FXIconItem *createItem(const FXString& text,FXIcon *big,FXIcon* mini,void* ptr);
static FXint compareSection(const FXchar *p,const FXchar* q,FXint s);
static FXint compareSectionCase(const FXchar *p,const FXchar* q,FXint s);
private:
FXIconList(const FXIconList&);
FXIconList &operator=(const FXIconList&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onEnter(FXObject*,FXSelector,void*);
long onLeave(FXObject*,FXSelector,void*);
long onUngrabbed(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onRightBtnPress(FXObject*,FXSelector,void*);
long onRightBtnRelease(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
long onTipTimer(FXObject*,FXSelector,void*);
long onCmdSelectAll(FXObject*,FXSelector,void*);
long onCmdDeselectAll(FXObject*,FXSelector,void*);
long onCmdSelectInverse(FXObject*,FXSelector,void*);
long onCmdArrangeByRows(FXObject*,FXSelector,void*);
long onUpdArrangeByRows(FXObject*,FXSelector,void*);
long onCmdArrangeByColumns(FXObject*,FXSelector,void*);
long onUpdArrangeByColumns(FXObject*,FXSelector,void*);
long onCmdShowDetails(FXObject*,FXSelector,void*);
long onUpdShowDetails(FXObject*,FXSelector,void*);
long onCmdShowBigIcons(FXObject*,FXSelector,void*);
long onUpdShowBigIcons(FXObject*,FXSelector,void*);
long onCmdShowMiniIcons(FXObject*,FXSelector,void*);
long onUpdShowMiniIcons(FXObject*,FXSelector,void*);
long onHeaderChanged(FXObject*,FXSelector,void*);
long onHeaderResize(FXObject*,FXSelector,void*);
long onFocusIn(FXObject*,FXSelector,void*);
long onFocusOut(FXObject*,FXSelector,void*);
long onClicked(FXObject*,FXSelector,void*);
long onDoubleClicked(FXObject*,FXSelector,void*);
long onTripleClicked(FXObject*,FXSelector,void*);
long onCommand(FXObject*,FXSelector,void*);
long onAutoScroll(FXObject*,FXSelector,void*);
long onLookupTimer(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdGetIntValue(FXObject*,FXSelector,void*);
long onCmdSetIntValue(FXObject*,FXSelector,void*);
public:
static FXint ascending(const FXIconItem* a,const FXIconItem* b);
static FXint descending(const FXIconItem* a,const FXIconItem* b);
static FXint ascendingCase(const FXIconItem* a,const FXIconItem* b);
static FXint descendingCase(const FXIconItem* a,const FXIconItem* b);
public:
enum {
ID_SHOW_DETAILS=FXScrollArea::ID_LAST,
ID_SHOW_MINI_ICONS,
ID_SHOW_BIG_ICONS,
ID_ARRANGE_BY_ROWS,
ID_ARRANGE_BY_COLUMNS,
ID_HEADER_CHANGE,
ID_LOOKUPTIMER,
ID_SELECT_ALL,
ID_DESELECT_ALL,
ID_SELECT_INVERSE,
ID_LAST
};
public:
/// Construct icon list with no items in it initially
FXIconList(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=ICONLIST_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Recalculate layout
virtual void recalc();
/// Perform layout
virtual void layout();
/// Compute and return content width
virtual FXint getContentWidth();
/// Return content height
virtual FXint getContentHeight();
/// Icon list can receive focus
virtual bool canFocus() const;
/// Move the focus to this window
virtual void setFocus();
/// Remove the focus from this window
virtual void killFocus();
/// Return viewport size
virtual FXint getViewportHeight();
/// Resize this window to the specified width and height
virtual void resize(FXint w,FXint h);
/// Move and resize this window in the parent's coordinates
virtual void position(FXint x,FXint y,FXint w,FXint h);
/// Return number of items
FXint getNumItems() const { return items.no(); }
/// Return number of rows
FXint getNumRows() const { return nrows; }
/// Return number of columns
FXint getNumCols() const { return ncols; }
/// Return header control
FXHeader* getHeader() const { return header; }
/// Set headers from array of strings
void setHeaders(const FXchar** strings,FXint size=1);
/// Set headers from newline separated strings
void setHeaders(const FXString& strings,FXint size=1);
/// Append header with given text and optional icon
void appendHeader(const FXString& text,FXIcon *icon=NULL,FXint size=1);
/// Remove header at index
void removeHeader(FXint index);
/// Change text of header at index
void setHeaderText(FXint index,const FXString& text);
/// Return text of header at index
FXString getHeaderText(FXint index) const;
/// Change icon of header at index
void setHeaderIcon(FXint index,FXIcon *icon);
/// Return icon of header at index
FXIcon* getHeaderIcon(FXint index) const;
/// Change size of header at index
void setHeaderSize(FXint index,FXint size);
/// Return width of header at index
FXint getHeaderSize(FXint index) const;
/// Return number of headers
FXint getNumHeaders() const;
/// Return the item at the given index
FXIconItem *getItem(FXint index) const;
/// Replace the item with a [possibly subclassed] item
FXint setItem(FXint index,FXIconItem* item,FXbool notify=FALSE);
/// Replace items text, icons, and user-data pointer
FXint setItem(FXint index,const FXString& text,FXIcon *big=NULL,FXIcon* mini=NULL,void* ptr=NULL,FXbool notify=FALSE);
/// Fill list by appending items from array of strings
FXint fillItems(const FXchar** strings,FXIcon *big=NULL,FXIcon* mini=NULL,void* ptr=NULL,FXbool notify=FALSE);
/// Fill list by appending items from newline separated strings
FXint fillItems(const FXString& strings,FXIcon *big=NULL,FXIcon* mini=NULL,void* ptr=NULL,FXbool notify=FALSE);
/// Insert a new [possibly subclassed] item at the give index
FXint insertItem(FXint index,FXIconItem* item,FXbool notify=FALSE);
/// Insert item at index with given text, icons, and user-data pointer
FXint insertItem(FXint index,const FXString& text,FXIcon *big=NULL,FXIcon* mini=NULL,void* ptr=NULL,FXbool notify=FALSE);
/// Append a [possibly subclassed] item to the end of the list
FXint appendItem(FXIconItem* item,FXbool notify=FALSE);
/// Append new item with given text and optional icons, and user-data pointer
FXint appendItem(const FXString& text,FXIcon *big=NULL,FXIcon* mini=NULL,void* ptr=NULL,FXbool notify=FALSE);
/// Prepend a [possibly subclassed] item to the end of the list
FXint prependItem(FXIconItem* item,FXbool notify=FALSE);
/// Prepend new item with given text and optional icons, and user-data pointer
FXint prependItem(const FXString& text,FXIcon *big=NULL,FXIcon* mini=NULL,void* ptr=NULL,FXbool notify=FALSE);
/// Move item from oldindex to newindex
FXint moveItem(FXint newindex,FXint oldindex,FXbool notify=FALSE);
/// Extract item from list
FXIconItem* extractItem(FXint index,FXbool notify=FALSE);
/// Remove item from list
void removeItem(FXint index,FXbool notify=FALSE);
/// Remove all items from list
void clearItems(FXbool notify=FALSE);
/// Return item width
FXint getItemWidth() const { return itemWidth; }
/// Return item height
FXint getItemHeight() const { return itemHeight; }
/// Return index of item at x,y, or -1 if none
virtual FXint getItemAt(FXint x,FXint y) const;
/**
* Search items by name, beginning from item start. If the start
* item is -1 the search will start at the first item in the list.
* Flags may be SEARCH_FORWARD or SEARCH_BACKWARD to control the
* search direction; this can be combined with SEARCH_NOWRAP or SEARCH_WRAP
* to control whether the search wraps at the start or end of the list.
* The option SEARCH_IGNORECASE causes a case-insensitive match. Finally,
* passing SEARCH_PREFIX causes searching for a prefix of the item name.
* Return -1 if no matching item is found.
*/
FXint findItem(const FXString& text,FXint start=-1,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const;
/**
* Search items by associated user data, beginning from item start. If the
* start item is -1 the search will start at the first item in the list.
* Flags may be SEARCH_FORWARD or SEARCH_BACKWARD to control the
* search direction; this can be combined with SEARCH_NOWRAP or SEARCH_WRAP
* to control whether the search wraps at the start or end of the list.
*/
FXint findItemByData(const void *ptr,FXint start=-1,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const;
/// Scroll to make item at index visible
virtual void makeItemVisible(FXint index);
/// Change item text
void setItemText(FXint index,const FXString& text);
/// Return item text
FXString getItemText(FXint index) const;
/// Change item big icon
void setItemBigIcon(FXint index,FXIcon* icon,FXbool owned=FALSE);
/// Return big icon of item at index
FXIcon* getItemBigIcon(FXint index) const;
/// Change item mini icon
void setItemMiniIcon(FXint index,FXIcon* icon,FXbool owned=FALSE);
/// Return mini icon of item at index
FXIcon* getItemMiniIcon(FXint index) const;
/// Change item user-data pointer
void setItemData(FXint index,void* ptr);
/// Return item user-data pointer
void* getItemData(FXint index) const;
/// Return TRUE if item at index is selected
FXbool isItemSelected(FXint index) const;
/// Return TRUE if item at index is current
FXbool isItemCurrent(FXint index) const;
/// Return TRUE if item at index is visible
FXbool isItemVisible(FXint index) const;
/// Return TRUE if item at index is enabled
FXbool isItemEnabled(FXint index) const;
/// Return item hit code: 0 outside, 1 icon, 2 text
FXint hitItem(FXint index,FXint x,FXint y,FXint ww=1,FXint hh=1) const;
/// Repaint item at index
void updateItem(FXint index) const;
/// Enable item at index
virtual FXbool enableItem(FXint index);
/// Disable item at index
virtual FXbool disableItem(FXint index);
/// Select item at index
virtual FXbool selectItem(FXint index,FXbool notify=FALSE);
/// Deselect item at index
virtual FXbool deselectItem(FXint index,FXbool notify=FALSE);
/// Toggle item at index
virtual FXbool toggleItem(FXint index,FXbool notify=FALSE);
/// Select items in rectangle
virtual FXbool selectInRectangle(FXint x,FXint y,FXint w,FXint h,FXbool notify=FALSE);
/// Extend selection from anchor index to index
virtual FXbool extendSelection(FXint index,FXbool notify=FALSE);
/// Deselect all items
virtual FXbool killSelection(FXbool notify=FALSE);
/// Change current item index
virtual void setCurrentItem(FXint index,FXbool notify=FALSE);
/// Return current item index, or -1 if none
FXint getCurrentItem() const { return current; }
/// Change anchor item index
void setAnchorItem(FXint index);
/// Return anchor item index, or -1 if none
FXint getAnchorItem() const { return anchor; }
/// Return index of item under cursor, or -1 if none
FXint getCursorItem() const { return cursor; }
/// Sort items
void sortItems();
/// Return sort function
FXIconListSortFunc getSortFunc() const { return sortfunc; }
/// Change sort function
void setSortFunc(FXIconListSortFunc func){ sortfunc=func; }
/// Change text font
void setFont(FXFont* fnt);
/// Return text font
FXFont* getFont() const { return font; }
/// Return normal text color
FXColor getTextColor() const { return textColor; }
/// Change normal text color
void setTextColor(FXColor clr);
/// Return selected text background
FXColor getSelBackColor() const { return selbackColor; }
/// Change selected text background
void setSelBackColor(FXColor clr);
/// Return selected text color
FXColor getSelTextColor() const { return seltextColor; }
/// Change selected text color
void setSelTextColor(FXColor clr);
/// Change maximum item space for each item
void setItemSpace(FXint s);
/// Return maximum item space
FXint getItemSpace() const { return itemSpace; }
/// Get the current icon list style
FXuint getListStyle() const;
/// Set the current icon list style.
void setListStyle(FXuint style);
/// Set the status line help text for this widget
void setHelpText(const FXString& text);
/// Get the status line help text for this widget
const FXString& getHelpText() const { return help; }
/// Save list to a stream
virtual void save(FXStream& store) const;
/// Load list from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXIconList();
};
}
#endif
fox-1.6.49/include/FXDockBar.h 0000664 0001750 0001750 00000017503 12130340076 012673 0000000 0000000 /********************************************************************************
* *
* D o c k B a r W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2004,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXDockBar.h,v 1.24 2006/01/22 17:58:00 fox Exp $ *
********************************************************************************/
#ifndef FXDOCKBAR_H
#define FXDOCKBAR_H
#ifndef FXPACKER_H
#include "FXPacker.h"
#endif
namespace FX {
class FXDockSite;
/**
* A dock bar widget can be docked inside a dock site widget, or floated
* around freely. Users can move, undock, and dock the dock bar widget
* by means of a handle such as a tool bar grip. When docking, the dock
* bar sends a SEL_DOCKED message to its target; when undocking, it sends
* a SEL_FLOATED message. In either case the dock site involved is passed
* in the void* pointer argument of the message.
*/
class FXAPI FXDockBar : public FXPacker {
FXDECLARE(FXDockBar)
protected:
FXComposite *drydock; // Parent when docked
FXComposite *wetdock; // Parent when floating
FXint gripx; // Grip offset x
FXint gripy; // Grip offset y
FXuchar allowed; // Where we're allowed to dock
protected:
FXDockBar();
private:
FXDockBar(const FXDockBar&);
FXDockBar &operator=(const FXDockBar&);
public:
long onCmdUndock(FXObject*,FXSelector,void*);
long onUpdUndock(FXObject*,FXSelector,void*);
long onCmdDockTop(FXObject*,FXSelector,void*);
long onUpdDockTop(FXObject*,FXSelector,void*);
long onCmdDockBottom(FXObject*,FXSelector,void*);
long onUpdDockBottom(FXObject*,FXSelector,void*);
long onCmdDockLeft(FXObject*,FXSelector,void*);
long onUpdDockLeft(FXObject*,FXSelector,void*);
long onCmdDockRight(FXObject*,FXSelector,void*);
long onUpdDockRight(FXObject*,FXSelector,void*);
long onUpdDockFlip(FXObject*,FXSelector,void*);
long onBeginDragGrip(FXObject*,FXSelector,void*);
long onEndDragGrip(FXObject*,FXSelector,void*);
long onDraggedGrip(FXObject*,FXSelector,void*);
long onPopupMenu(FXObject*,FXSelector,void*);
long onDockTimer(FXObject*,FXSelector,void*);
public:
enum {
ID_DOCK_FLOAT=FXPacker::ID_LAST, /// Undock the dock bar
ID_DOCK_TOP, /// Dock on the top
ID_DOCK_BOTTOM, /// Dock on the bottom
ID_DOCK_LEFT, /// Dock on the left
ID_DOCK_RIGHT, /// Dock on the right
ID_DOCK_FLIP, /// Flip orientation
ID_TOOLBARGRIP, /// Tool bar grip
ID_TIMER,
ID_LAST
};
public:
enum {
ALLOW_NOWHERE=0, /// Don't allow docking anywhere
ALLOW_TOP=1, /// Docking at the top only
ALLOW_BOTTOM=2, /// Docking at the bottom only
ALLOW_LEFT=4, /// Docking at the left only
ALLOW_RIGHT=8, /// Docking at the right only
ALLOW_HORIZONTAL=ALLOW_TOP|ALLOW_BOTTOM, /// Docking at the top and bottom
ALLOW_VERTICAL=ALLOW_LEFT|ALLOW_RIGHT, /// Docking at the left and right
ALLOW_EVERYWHERE=ALLOW_HORIZONTAL|ALLOW_VERTICAL /// Docking can be everywhere
};
public:
/**
* Construct a floatable dock bar, with a default parent p and an
* alternate parent q. To allow docking and dragging the default parent
* p must be of type FXDockSite, and the alternate parent q must be of
* type FXToolBarShell.
* Normally, the dock bar is docked under a window p of type FXDockSite.
* When floated, the toolbar can be docked under window q, which is
* usually an kind of FXToolBarShell window.
*/
FXDockBar(FXComposite* p,FXComposite* q,FXuint opts=LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=3,FXint pr=3,FXint pt=2,FXint pb=2,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING);
/**
* Construct a non-floatable dock bar.
* The dock bar can not be undocked.
*/
FXDockBar(FXComposite* p,FXuint opts,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=2,FXint pr=3,FXint pt=3,FXint pb=2,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING);
/// Return true if docked
FXbool isDocked() const;
/**
* Check if the dock bar would dock or undock if at locaton barx, bary.
*/
FXbool insideDock(FXDockSite* docksite,FXint barx,FXint bary);
/**
* Set parent when docked.
* If it was docked, reparent under the new docking window.
*/
void setDryDock(FXComposite* dry);
/**
* Set parent when floating.
* If it was undocked, then reparent under the new floating window.
*/
void setWetDock(FXComposite* wet);
/// Return parent when docked
FXComposite* getDryDock() const { return drydock; }
/// Return parent when floating
FXComposite* getWetDock() const { return wetdock; }
/// Search for dock against given side of main window
FXDockSite* findDockAtSide(FXuint side=LAYOUT_SIDE_TOP);
/// Search for dock close to coordinates rootx, rooty
FXDockSite* findDockNear(FXint rootx,FXint rooty);
/**
* Dock the bar against the given side, after some other widget.
* However, if after is -1, it will be docked as the innermost bar just before
* the work-area, while if after is 0, if will be docked as the outermost bar.
*/
virtual void dock(FXDockSite* docksite,FXWindow* before=NULL,FXbool notify=FALSE);
/**
* Dock the bar against the given side, near the given position relative
* to the toolbar dock's origin.
*/
virtual void dock(FXDockSite* docksite,FXint localx,FXint localy,FXbool notify);
/**
* Undock or float the bar.
* The initial position of the wet dock is a few pixels
* below and to the right of the original docked position.
*/
virtual void undock(FXint rootx,FXint rooty,FXbool notify=FALSE);
/**
* Change set of sides (a combination of ALLOW_TOP, ALLOW_LEFT, etc.),
* where docking is allowed. The default is to allow docking on all sides.
*/
void allowedSides(FXuchar allow){ allowed=allow; }
/**
* Return set of sides where docking is allowed
*/
FXuchar allowedSides() const { return allowed; }
/// Save toolbar to a stream
virtual void save(FXStream& store) const;
/// Load toolbar from a stream
virtual void load(FXStream& store);
/// Destroy
virtual ~FXDockBar();
};
}
#endif
fox-1.6.49/include/FXGLShape.h 0000664 0001750 0001750 00000013506 12130340076 012650 0000000 0000000 /********************************************************************************
* *
* O p e n G L S h a p e O b j e c t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXGLShape.h,v 1.25 2006/01/22 17:58:03 fox Exp $ *
********************************************************************************/
#ifndef FXGLSHAPE_H
#define FXGLSHAPE_H
#ifndef FXGLOBJECT_H
#include "FXGLObject.h"
#endif
namespace FX {
class FXGLViewer;
class FXGLObject;
// Shape drawing options
enum {
SURFACE_SINGLESIDED = 0, // Single-sided [both sides same]
SURFACE_DUALSIDED = 0x00000001, // Dual-sided surface
SHADING_NONE = 0, // No light source
SHADING_SMOOTH = 0x00000002, // Smooth shaded
SHADING_FLAT = 0x00000004, // Flag shaded
FACECULLING_OFF = 0, // No face culling
FACECULLING_ON = 0x00000008, // Cull backward facing surfaces
STYLE_SURFACE = 0x00000010, // Draw filled surfaces
STYLE_WIREFRAME = 0x00000020, // Draw wire frame
STYLE_POINTS = 0x00000040, // Draw as points
STYLE_BOUNDBOX = 0x00000080 // Draw bounding box
};
/// OpenGL Shape Object
class FXAPI FXGLShape : public FXGLObject {
FXDECLARE_ABSTRACT(FXGLShape)
protected:
FXVec3f position; // Middle of the Bounding Box
FXMaterial material[2]; // Front and back material properties
FXRangef range; // Range box
FXuint options; // Drawing options
FXString tip;
protected:
FXGLShape();
virtual void drawshape(FXGLViewer*){} // To be overloaded by derived class
void drawbox();
void drawhandles();
public:
long onDNDDrop(FXObject*,FXSelector,void*);
long onDNDMotion(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
long onCmdShadeOff(FXObject*,FXSelector,void*);
long onUpdShadeOff(FXObject*,FXSelector,void*);
long onCmdShadeOn(FXObject*,FXSelector,void*);
long onUpdShadeOn(FXObject*,FXSelector,void*);
long onCmdShadeSmooth(FXObject*,FXSelector,void*);
long onUpdShadeSmooth(FXObject*,FXSelector,void*);
long onCmdFrontMaterial(FXObject*,FXSelector,void*);
long onUpdFrontMaterial(FXObject*,FXSelector,void*);
long onCmdBackMaterial(FXObject*,FXSelector,void*);
long onUpdBackMaterial(FXObject*,FXSelector,void*);
long onCmdDrawingStyle(FXObject*,FXSelector,void*);
long onUpdDrawingStyle(FXObject*,FXSelector,void*);
public:
enum {
ID_SHADEOFF=FXGLObject::ID_LAST,
ID_SHADEON,
ID_SHADESMOOTH,
ID_TOGGLE_SIDED,
ID_TOGGLE_CULLING,
ID_STYLE_POINTS,
ID_STYLE_WIREFRAME,
ID_STYLE_SURFACE,
ID_STYLE_BOUNDINGBOX,
ID_FRONT_MATERIAL,
ID_BACK_MATERIAL,
ID_LAST
};
public:
/// Construct with specified origin and options
FXGLShape(FXfloat x,FXfloat y,FXfloat z,FXuint opts);
/// Construct with specified origin, options and front and back materials
FXGLShape(FXfloat x,FXfloat y,FXfloat z,FXuint opts,const FXMaterial& front,const FXMaterial& back);
/// Copy constructor
FXGLShape(const FXGLShape& orig);
/// Called by the viewer to get bounds for this object
virtual void bounds(FXRangef& box);
/// Draw this object in a viewer
virtual void draw(FXGLViewer* viewer);
/// Draw this object for hit-testing purposes
virtual void hit(FXGLViewer* viewer);
/// Copy this object
virtual FXGLObject* copy();
/// Return true if this object can be dragged around
virtual FXbool canDrag() const;
/// Return true if this object can be deleted from the scene
virtual FXbool canDelete() const;
/// Drag this object from one position to another
virtual FXbool drag(FXGLViewer* viewer,FXint fx,FXint fy,FXint tx,FXint ty);
/// Set the tool tip message for this object
void setTipText(const FXString& text){ tip=text; }
/// Get the tool tip message for this object
const FXString& getTipText() const { return tip; }
/// Set the material for specified side (where side = 0 or 1)
void setMaterial(FXint side,const FXMaterial &mtl);
/// Get the material for specified side (where side = 0 or 1)
void getMaterial(FXint side,FXMaterial &mtl) const;
/// Save shape to a stream
virtual void save(FXStream& store) const;
/// Load shape from a stream
virtual void load(FXStream& store);
};
}
#endif
fox-1.6.49/include/FXDataTarget.h 0000664 0001750 0001750 00000023034 12130340076 013402 0000000 0000000 /********************************************************************************
* *
* D a t a T a r g e t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXDataTarget.h,v 1.25 2006/01/22 17:58:00 fox Exp $ *
********************************************************************************/
#ifndef FXDATATARGET_H
#define FXDATATARGET_H
#ifndef FXOBJECT_H
#include "FXObject.h"
#endif
namespace FX {
/**
* A Data Target allows a valuator widget such as a Slider or Text Field
* to be directly connected with a variable in the program.
* Whenever the valuator control changes, the variable connected through
* the data target is automatically updated; conversely, whenever the program
* changes a variable, all the connected valuator widgets will be updated
* to reflect this new value on the display.
* Data Targets also allow connecting Radio Buttons, Menu Commands, and so on
* to a variable. In this case, the new value of the connected variable is computed
* by subtracting ID_OPTION from the message ID.
*/
class FXAPI FXDataTarget : public FXObject {
FXDECLARE(FXDataTarget)
protected:
FXObject *target; // Target object
void *data; // Associated data
FXSelector message; // Message ID
FXuint type; // Type of data
private:
FXDataTarget(const FXDataTarget&);
FXDataTarget& operator=(const FXDataTarget&);
public:
long onCmdValue(FXObject*,FXSelector,void*);
long onUpdValue(FXObject*,FXSelector,void*);
long onCmdOption(FXObject*,FXSelector,void*);
long onUpdOption(FXObject*,FXSelector,void*);
public:
enum {
DT_VOID=0,
DT_CHAR,
DT_UCHAR,
DT_SHORT,
DT_USHORT,
DT_INT,
DT_UINT,
DT_LONG,
DT_ULONG,
DT_FLOAT,
DT_DOUBLE,
DT_STRING,
DT_LAST
};
public:
enum {
ID_VALUE=1, /// Will cause the FXDataTarget to ask sender for value
ID_OPTION=ID_VALUE+10001, /// ID_OPTION+i will set the value to i where -10000<=i<=10000
ID_LAST=ID_OPTION+10000
};
public:
/// Associate with nothing
FXDataTarget():target(NULL),data(NULL),message(0),type(DT_VOID){}
/// Associate with nothing
FXDataTarget(FXObject* tgt,FXSelector sel):target(tgt),data(NULL),message(sel),type(DT_VOID){}
/// Associate with character variable
FXDataTarget(FXchar& value,FXObject* tgt=NULL,FXSelector sel=0):target(tgt),data(&value),message(sel),type(DT_CHAR){}
/// Associate with unsigned character variable
FXDataTarget(FXuchar& value,FXObject* tgt=NULL,FXSelector sel=0):target(tgt),data(&value),message(sel),type(DT_UCHAR){}
/// Associate with signed short variable
FXDataTarget(FXshort& value,FXObject* tgt=NULL,FXSelector sel=0):target(tgt),data(&value),message(sel),type(DT_SHORT){}
/// Associate with unsigned short variable
FXDataTarget(FXushort& value,FXObject* tgt=NULL,FXSelector sel=0):target(tgt),data(&value),message(sel),type(DT_USHORT){}
/// Associate with int variable
FXDataTarget(FXint& value,FXObject* tgt=NULL,FXSelector sel=0):target(tgt),data(&value),message(sel),type(DT_INT){}
/// Associate with unsigned int variable
FXDataTarget(FXuint& value,FXObject* tgt=NULL,FXSelector sel=0):target(tgt),data(&value),message(sel),type(DT_UINT){}
/// Associate with long variable
FXDataTarget(FXlong& value,FXObject* tgt=NULL,FXSelector sel=0):target(tgt),data(&value),message(sel),type(DT_LONG){}
/// Associate with unsigned long variable
FXDataTarget(FXulong& value,FXObject* tgt=NULL,FXSelector sel=0):target(tgt),data(&value),message(sel),type(DT_ULONG){}
/// Associate with float variable
FXDataTarget(FXfloat& value,FXObject* tgt=NULL,FXSelector sel=0):target(tgt),data(&value),message(sel),type(DT_FLOAT){}
/// Associate with double variable
FXDataTarget(FXdouble& value,FXObject* tgt=NULL,FXSelector sel=0):target(tgt),data(&value),message(sel),type(DT_DOUBLE){}
/// Associate with string variable
FXDataTarget(FXString& value,FXObject* tgt=NULL,FXSelector sel=0):target(tgt),data(&value),message(sel),type(DT_STRING){}
/// Set the message target object for this data target
void setTarget(FXObject *t){ target=t; }
/// Get the message target object for this data target, if any
FXObject* getTarget() const { return target; }
/// Set the message identifier for this data target
void setSelector(FXSelector sel){ message=sel; }
/// Get the message identifier for this data target
FXSelector getSelector() const { return message; }
/// Return type of data its connected to
FXuint getType() const { return type; }
/// Return pointer to data its connected to
void* getData() const { return data; }
/// Associate with nothing
void connect(){ data=NULL; type=DT_VOID; }
/// Associate with character variable
void connect(FXchar& value){ data=&value; type=DT_CHAR; }
/// Associate with unsigned character variable
void connect(FXuchar& value){ data=&value; type=DT_UCHAR; }
/// Associate with signed short variable
void connect(FXshort& value){ data=&value; type=DT_SHORT; }
/// Associate with unsigned short variable
void connect(FXushort& value){ data=&value; type=DT_USHORT; }
/// Associate with int variable
void connect(FXint& value){ data=&value; type=DT_INT; }
/// Associate with unsigned int variable
void connect(FXuint& value){ data=&value; type=DT_UINT; }
/// Associate with long variable
void connect(FXlong& value){ data=&value; type=DT_LONG; }
/// Associate with unsigned long variable
void connect(FXulong& value){ data=&value; type=DT_ULONG; }
/// Associate with float variable
void connect(FXfloat& value){ data=&value; type=DT_FLOAT; }
/// Associate with double variable
void connect(FXdouble& value){ data=&value; type=DT_DOUBLE; }
/// Associate with string variable
void connect(FXString& value){ data=&value; type=DT_STRING; }
/// Associate with nothing; also set target and message
void connect(FXObject* tgt,FXSelector sel){ target=tgt; data=NULL; message=sel; type=DT_VOID; }
/// Associate with character variable; also set target and message
void connect(FXchar& value,FXObject* tgt,FXSelector sel){ target=tgt; data=&value; message=sel; type=DT_CHAR; }
/// Associate with unsigned character variable; also set target and message
void connect(FXuchar& value,FXObject* tgt,FXSelector sel){ target=tgt; data=&value; message=sel; type=DT_UCHAR; }
/// Associate with signed short variable; also set target and message
void connect(FXshort& value,FXObject* tgt,FXSelector sel){ target=tgt; data=&value; message=sel; type=DT_SHORT; }
/// Associate with unsigned short variable; also set target and message
void connect(FXushort& value,FXObject* tgt,FXSelector sel){ target=tgt; data=&value; message=sel; type=DT_USHORT; }
/// Associate with int variable; also set target and message
void connect(FXint& value,FXObject* tgt,FXSelector sel){ target=tgt; data=&value; message=sel; type=DT_INT; }
/// Associate with unsigned int variable; also set target and message
void connect(FXuint& value,FXObject* tgt,FXSelector sel){ target=tgt; data=&value; message=sel; type=DT_UINT; }
/// Associate with long variable; also set target and message
void connect(FXlong& value,FXObject* tgt,FXSelector sel){ target=tgt; data=&value; message=sel; type=DT_LONG; }
/// Associate with unsigned long variable; also set target and message
void connect(FXulong& value,FXObject* tgt,FXSelector sel){ target=tgt; data=&value; message=sel; type=DT_ULONG; }
/// Associate with float variable; also set target and message
void connect(FXfloat& value,FXObject* tgt,FXSelector sel){ target=tgt; data=&value; message=sel; type=DT_FLOAT; }
/// Associate with double variable; also set target and message
void connect(FXdouble& value,FXObject* tgt,FXSelector sel){ target=tgt; data=&value; message=sel; type=DT_DOUBLE; }
/// Associate with string variable; also set target and message
void connect(FXString& value,FXObject* tgt,FXSelector sel){ target=tgt; data=&value; message=sel; type=DT_STRING; }
/// Destroy
virtual ~FXDataTarget();
};
}
#endif
fox-1.6.49/include/FXXPMImage.h 0000664 0001750 0001750 00000006670 12130340076 013000 0000000 0000000 /********************************************************************************
* *
* X P M I m a g e O b j e c t *
* *
*********************************************************************************
* Copyright (C) 2000,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXXPMImage.h,v 1.21 2006/01/22 17:58:13 fox Exp $ *
********************************************************************************/
#ifndef FXXPMIMAGE_H
#define FXXPMIMAGE_H
#ifndef FXIMAGE_H
#include "FXImage.h"
#endif
namespace FX {
/// X Pixmap image
class FXAPI FXXPMImage : public FXImage {
FXDECLARE(FXXPMImage)
protected:
FXXPMImage(){}
private:
FXXPMImage(const FXXPMImage&);
FXXPMImage &operator=(const FXXPMImage&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct image from compiled-in X Pixmap format
FXXPMImage(FXApp* a,const FXchar **pix=NULL,FXuint opts=0,FXint w=1,FXint h=1);
/// Save pixels into stream in X Pixmap format
virtual bool savePixels(FXStream& store) const;
/// Load pixels from stream in X Pixmap format
virtual bool loadPixels(FXStream& store);
/// Destroy icon
virtual ~FXXPMImage();
};
#ifndef FXLOADXPM
#define FXLOADXPM
/**
* Check if stream contains a XPM, return TRUE if so.
*/
extern FXAPI bool fxcheckXPM(FXStream& store);
/**
* Load an XPM (X Pixmap) from array of strings.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadXPM(const FXchar **pix,FXColor*& data,FXint& width,FXint& height);
/**
* Load an XPM (X Pixmap) file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadXPM(FXStream& store,FXColor*& data,FXint& width,FXint& height);
/**
* Save an XPM (X Pixmap) file to a stream.
*/
extern FXAPI bool fxsaveXPM(FXStream& store,const FXColor *data,FXint width,FXint height,bool fast=true);
#endif
}
#endif
fox-1.6.49/include/FXMat4f.h 0000664 0001750 0001750 00000013727 12130340076 012345 0000000 0000000 /********************************************************************************
* *
* S i n g l e - P r e c i s i o n 4 x 4 M a t r i x *
* *
*********************************************************************************
* Copyright (C) 1994,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXMat4f.h,v 1.9 2006/01/22 17:58:06 fox Exp $ *
********************************************************************************/
#ifndef FXMAT4F_H
#define FXMAT4F_H
namespace FX {
/// Single-precision 4x4 matrix
class FXAPI FXMat4f {
protected:
FXVec4f m[4];
public:
/// Constructors
FXMat4f(){}
FXMat4f(FXfloat w);
FXMat4f(FXfloat a00,FXfloat a01,FXfloat a02,FXfloat a03,
FXfloat a10,FXfloat a11,FXfloat a12,FXfloat a13,
FXfloat a20,FXfloat a21,FXfloat a22,FXfloat a23,
FXfloat a30,FXfloat a31,FXfloat a32,FXfloat a33);
FXMat4f(const FXVec4f& a,const FXVec4f& b,const FXVec4f& c,const FXVec4f& d);
FXMat4f(const FXMat4f& other);
/// Assignment
FXMat4f& operator=(const FXMat4f& other);
FXMat4f& operator=(FXfloat w);
/// Set value from another matrix
FXMat4f& set(const FXMat4f& other);
/// Set value from scalar
FXMat4f& set(FXfloat w);
/// Set value from components
FXMat4f& set(FXfloat a00,FXfloat a01,FXfloat a02,FXfloat a03,
FXfloat a10,FXfloat a11,FXfloat a12,FXfloat a13,
FXfloat a20,FXfloat a21,FXfloat a22,FXfloat a23,
FXfloat a30,FXfloat a31,FXfloat a32,FXfloat a33);
/// Set value from four vectors
FXMat4f& set(const FXVec4f& a,const FXVec4f& b,const FXVec4f& c,const FXVec4f& d);
/// Assignment operators
FXMat4f& operator+=(const FXMat4f& w);
FXMat4f& operator-=(const FXMat4f& w);
FXMat4f& operator*=(FXfloat w);
FXMat4f& operator*=(const FXMat4f& w);
FXMat4f& operator/=(FXfloat w);
/// Indexing
FXVec4f& operator[](FXint i){return m[i];}
const FXVec4f& operator[](FXint i) const {return m[i];}
/// Conversion
operator FXfloat*(){return m[0];}
operator const FXfloat*() const {return m[0];}
/// Unary minus
FXMat4f operator-() const;
/// Matrix and matrix
FXMat4f operator+(const FXMat4f& w) const;
FXMat4f operator-(const FXMat4f& w) const;
FXMat4f operator*(const FXMat4f& w) const;
/// Other operators
friend FXAPI FXMat4f operator*(FXfloat x,const FXMat4f& a);
friend FXAPI FXMat4f operator*(const FXMat4f& a,FXfloat x);
friend FXAPI FXMat4f operator/(const FXMat4f& a,FXfloat x);
friend FXAPI FXMat4f operator/(FXfloat x,const FXMat4f& a);
/// Multiply matrix and vector
FXVec4f operator*(const FXVec4f& v) const;
FXVec3f operator*(const FXVec3f& v) const;
/// Set identity matrix
FXMat4f& eye();
/// Orthographic projection
FXMat4f& ortho(FXfloat left,FXfloat right,FXfloat bottom,FXfloat top,FXfloat hither,FXfloat yon);
/// Perspective projection
FXMat4f& frustum(FXfloat left,FXfloat right,FXfloat bottom,FXfloat top,FXfloat hither,FXfloat yon);
/// Multiply by left-hand matrix
FXMat4f& left();
/// Multiply by rotation about unit-quaternion
FXMat4f& rot(const FXQuatf& q);
/// Multiply by rotation c,s about axis
FXMat4f& rot(const FXVec3f& v,FXfloat c,FXfloat s);
/// Multiply by rotation of phi about axis
FXMat4f& rot(const FXVec3f& v,FXfloat phi);
/// Multiply by x-rotation
FXMat4f& xrot(FXfloat c,FXfloat s);
FXMat4f& xrot(FXfloat phi);
/// Multiply by y-rotation
FXMat4f& yrot(FXfloat c,FXfloat s);
FXMat4f& yrot(FXfloat phi);
/// Multiply by z-rotation
FXMat4f& zrot(FXfloat c,FXfloat s);
FXMat4f& zrot(FXfloat phi);
/// Look at
FXMat4f& look(const FXVec3f& eye,const FXVec3f& cntr,const FXVec3f& vup);
/// Multiply by translation
FXMat4f& trans(FXfloat tx,FXfloat ty,FXfloat tz);
FXMat4f& trans(const FXVec3f& v);
/// Multiply by scaling
FXMat4f& scale(FXfloat sx,FXfloat sy,FXfloat sz);
FXMat4f& scale(FXfloat s);
FXMat4f& scale(const FXVec3f& v);
/// Determinant
FXfloat det() const;
/// Transpose
FXMat4f transpose() const;
/// Invert
FXMat4f invert() const;
/// Save to a stream
friend FXAPI FXStream& operator<<(FXStream& store,const FXMat4f& m);
/// Load from a stream
friend FXAPI FXStream& operator>>(FXStream& store,FXMat4f& m);
};
extern FXAPI FXMat4f operator*(FXfloat x,const FXMat4f& a);
extern FXAPI FXMat4f operator*(const FXMat4f& a,FXfloat x);
extern FXAPI FXMat4f operator/(const FXMat4f& a,FXfloat x);
extern FXAPI FXMat4f operator/(FXfloat x,const FXMat4f& a);
extern FXAPI FXStream& operator<<(FXStream& store,const FXMat4f& m);
extern FXAPI FXStream& operator>>(FXStream& store,FXMat4f& m);
}
#endif
fox-1.6.49/include/FXCP869Codec.h 0000644 0001750 0001750 00000001077 11637250333 013101 0000000 0000000 #ifndef FXCP869CODEC_H
#define FXCP869CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// CP869 Codec
class FXAPI FXCP869Codec : public FXTextCodec {
FXDECLARE(FXCP869Codec)
public:
FXCP869Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FXCP869Codec(){}
};
}
#endif
fox-1.6.49/include/FXToolBarShell.h 0000664 0001750 0001750 00000010631 12130340076 013713 0000000 0000000 /********************************************************************************
* *
* T o o l B a r S h e l l W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2000,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXToolBarShell.h,v 1.8 2006/01/22 17:58:11 fox Exp $ *
********************************************************************************/
#ifndef FXTOOLBARSHELL_H
#define FXTOOLBARSHELL_H
#ifndef FXTOPWINDOW_H
#include "FXTopWindow.h"
#endif
namespace FX {
/**
* A Tool bar shell is a widget floating around over the Main Window.
* It typically contains an undocked tool bar.
*/
class FXAPI FXToolBarShell : public FXTopWindow {
FXDECLARE(FXToolBarShell)
protected:
FXColor baseColor;
FXColor hiliteColor;
FXColor shadowColor;
FXColor borderColor;
FXint border;
protected:
FXToolBarShell(){}
void drawBorderRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawRidgeRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawGrooveRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawDoubleRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawDoubleSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawFrame(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
private:
FXToolBarShell(const FXToolBarShell&);
FXToolBarShell &operator=(const FXToolBarShell&);
public:
long onPaint(FXObject*,FXSelector,void*);
public:
/// Construct a toolbar shell
FXToolBarShell(FXWindow* owner,FXuint opts=FRAME_RAISED|FRAME_THICK,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint hs=4,FXint vs=4);
/// Create server-side resources
virtual void create();
/// Perform layout
virtual void layout();
/// Return the default width of this window
virtual FXint getDefaultWidth();
/// Return the default height of this window
virtual FXint getDefaultHeight();
/// Change frame style
void setFrameStyle(FXuint style);
/// Get current frame style
FXuint getFrameStyle() const;
/// Get border width
FXint getBorderWidth() const { return border; }
/// Change highlight color
void setHiliteColor(FXColor clr);
/// Get highlight color
FXColor getHiliteColor() const { return hiliteColor; }
/// Change shadow color
void setShadowColor(FXColor clr);
/// Get shadow color
FXColor getShadowColor() const { return shadowColor; }
/// Change border color
void setBorderColor(FXColor clr);
/// Get border color
FXColor getBorderColor() const { return borderColor; }
/// Change base gui color
void setBaseColor(FXColor clr);
/// Get base gui color
FXColor getBaseColor() const { return baseColor; }
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
};
}
#endif
fox-1.6.49/include/FXPacker.h 0000664 0001750 0001750 00000015233 12130340076 012571 0000000 0000000 /********************************************************************************
* *
* P a c k e r C o n t a i n e r W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXPacker.h,v 1.21 2006/01/22 17:58:07 fox Exp $ *
********************************************************************************/
#ifndef FXPACKER_H
#define FXPACKER_H
#ifndef FXCOMPOSITE_H
#include "FXComposite.h"
#endif
namespace FX {
/// Default spacing
enum { DEFAULT_SPACING = 4 };
/**
* Packer is a layout manager which automatically places child windows
* inside its area against the left, right, top, or bottom side.
* Each time a child is placed, the remaining space is decreased by the
* amount of space taken by the child window.
* The side against which a child is placed is determined by the LAYOUT_SIDE_TOP,
* LAYOUT_SIDE_BOTTOM, LAYOUT_SIDE_LEFT, and LAYOUT_SIDE_RIGHT hints given by
* the child window. Other layout hints from the child are observed as far as
* sensible. So for example, a child placed against the right edge can still
* have LAYOUT_FILL_Y or LAYOUT_TOP, and so on.
* The last child may have both LAYOUT_FILL_X and LAYOUT_FILL_Y, in which
* case it will be placed to take all remaining space.
*/
class FXAPI FXPacker : public FXComposite {
FXDECLARE(FXPacker)
protected:
FXColor baseColor; // Base color
FXColor hiliteColor; // Highlight color
FXColor shadowColor; // Shadow color
FXColor borderColor; // Border color
FXint padtop; // Top margin
FXint padbottom; // Bottom margin
FXint padleft; // Left margin
FXint padright; // Right margin
FXint hspacing; // Horizontal child spacing
FXint vspacing; // Vertical child spacing
FXint border; // Border width
protected:
FXPacker();
void drawBorderRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawRidgeRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawGrooveRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawDoubleRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawDoubleSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawFocusRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawFrame(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
private:
FXPacker(const FXPacker&);
FXPacker &operator=(const FXPacker&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onFocusUp(FXObject*,FXSelector,void*);
long onFocusDown(FXObject*,FXSelector,void*);
long onFocusLeft(FXObject*,FXSelector,void*);
long onFocusRight(FXObject*,FXSelector,void*);
public:
/// Construct packer layout manager
FXPacker(FXComposite *p,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_SPACING,FXint pr=DEFAULT_SPACING,FXint pt=DEFAULT_SPACING,FXint pb=DEFAULT_SPACING,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING);
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Perform layout
virtual void layout();
/// Change frame style
void setFrameStyle(FXuint style);
/// Get current frame style
FXuint getFrameStyle() const;
/// Change packing hints
void setPackingHints(FXuint ph);
/// Return packing hints
FXuint getPackingHints() const;
/// Get border width
FXint getBorderWidth() const { return border; }
/// Change top padding
void setPadTop(FXint pt);
/// Get top interior padding
FXint getPadTop() const { return padtop; }
/// Change bottom padding
void setPadBottom(FXint pb);
/// Get bottom interior padding
FXint getPadBottom() const { return padbottom; }
/// Change left padding
void setPadLeft(FXint pl);
/// Get left interior padding
FXint getPadLeft() const { return padleft; }
/// Change right padding
void setPadRight(FXint pr);
/// Get right interior padding
FXint getPadRight() const { return padright; }
/// Change highlight color
void setHiliteColor(FXColor clr);
/// Get highlight color
FXColor getHiliteColor() const { return hiliteColor; }
/// Change shadow color
void setShadowColor(FXColor clr);
/// Get shadow color
FXColor getShadowColor() const { return shadowColor; }
/// Change border color
void setBorderColor(FXColor clr);
/// Get border color
FXColor getBorderColor() const { return borderColor; }
/// Change base gui color
void setBaseColor(FXColor clr);
/// Get base gui color
FXColor getBaseColor() const { return baseColor; }
/// Change horizontal inter-child spacing
void setHSpacing(FXint hs);
/// Return current horizontal inter-child spacing
FXint getHSpacing() const { return hspacing; }
/// Change vertical inter-child spacing
void setVSpacing(FXint vs);
/// Return current vertical inter-child spacing
FXint getVSpacing() const { return vspacing; }
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
};
}
#endif
fox-1.6.49/include/FXPoint.h 0000664 0001750 0001750 00000010237 12130340076 012454 0000000 0000000 /********************************************************************************
* *
* P o i n t C l a s s *
* *
*********************************************************************************
* Copyright (C) 1994,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXPoint.h,v 1.13 2006/01/22 17:58:07 fox Exp $ *
********************************************************************************/
#ifndef FXPOINT_H
#define FXPOINT_H
#ifndef FXSIZE_H
#include "FXSize.h"
#endif
namespace FX {
/// Point
class FXAPI FXPoint {
public:
FXshort x;
FXshort y;
public:
/// Constructors
FXPoint(){ }
FXPoint(const FXSize& s):x(s.w),y(s.h){ }
FXPoint(const FXPoint& p):x(p.x),y(p.y){ }
FXPoint(FXshort xx,FXshort yy):x(xx),y(yy){ }
/// Test if zero
bool operator!() const { return x==0 && y==0; }
/// Equality
bool operator==(const FXPoint& p) const { return x==p.x && y==p.y; }
bool operator!=(const FXPoint& p) const { return x!=p.x || y!=p.y; }
/// Assignment
FXPoint& operator=(const FXPoint& p){ x=p.x; y=p.y; return *this; }
/// Set value from another point
FXPoint& set(const FXPoint& p){ x=p.x; y=p.y; return *this; }
/// Set value from components
FXPoint& set(FXshort xx,FXshort yy){ x=xx; y=yy; return *this; }
/// Assignment operators
FXPoint& operator+=(const FXPoint& p){ x+=p.x; y+=p.y; return *this; }
FXPoint& operator-=(const FXPoint& p){ x-=p.x; y-=p.y; return *this; }
FXPoint& operator*=(FXshort c){ x*=c; y*=c; return *this; }
FXPoint& operator/=(FXshort c){ x/=c; y/=c; return *this; }
/// Negation
FXPoint operator-(){ return FXPoint(-x,-y); }
/// Addition operators
FXPoint operator+(const FXPoint& p) const { return FXPoint(x+p.x,y+p.y); }
FXPoint operator-(const FXPoint& p) const { return FXPoint(x-p.x,y-p.y); }
/// Scale operators
friend inline FXPoint operator*(const FXPoint& p,FXshort c);
friend inline FXPoint operator*(FXshort c,const FXPoint& p);
friend inline FXPoint operator/(const FXPoint& p,FXshort c);
friend inline FXPoint operator/(FXshort c,const FXPoint& p);
/// Save object to a stream
friend FXAPI FXStream& operator<<(FXStream& store,const FXPoint& p);
/// Load object from a stream
friend FXAPI FXStream& operator>>(FXStream& store,FXPoint& p);
};
inline FXPoint operator*(const FXPoint& p,FXshort c){ return FXPoint(p.x*c,p.y*c); }
inline FXPoint operator*(FXshort c,const FXPoint& p){ return FXPoint(c*p.x,c*p.y); }
inline FXPoint operator/(const FXPoint& p,FXshort c){ return FXPoint(p.x/c,p.y/c); }
inline FXPoint operator/(FXshort c,const FXPoint& p){ return FXPoint(c/p.x,c/p.y); }
extern FXAPI FXStream& operator<<(FXStream& store,const FXPoint& p);
extern FXAPI FXStream& operator>>(FXStream& store,FXPoint& p);
}
#endif
fox-1.6.49/include/FXLabel.h 0000664 0001750 0001750 00000015402 12130340076 012401 0000000 0000000 /********************************************************************************
* *
* L a b e l W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXLabel.h,v 1.31 2006/03/01 02:13:21 fox Exp $ *
********************************************************************************/
#ifndef FXLABEL_H
#define FXLABEL_H
#ifndef FXFRAME_H
#include "FXFrame.h"
#endif
namespace FX {
/// Relationship options for icon-labels
enum {
ICON_UNDER_TEXT = 0, /// Icon appears under text
ICON_AFTER_TEXT = 0x00080000, /// Icon appears after text (to its right)
ICON_BEFORE_TEXT = 0x00100000, /// Icon appears before text (to its left)
ICON_ABOVE_TEXT = 0x00200000, /// Icon appears above text
ICON_BELOW_TEXT = 0x00400000, /// Icon appears below text
TEXT_OVER_ICON = ICON_UNDER_TEXT, /// Same as ICON_UNDER_TEXT
TEXT_AFTER_ICON = ICON_BEFORE_TEXT, /// Same as ICON_BEFORE_TEXT
TEXT_BEFORE_ICON = ICON_AFTER_TEXT, /// Same as ICON_AFTER_TEXT
TEXT_ABOVE_ICON = ICON_BELOW_TEXT, /// Same as ICON_BELOW_TEXT
TEXT_BELOW_ICON = ICON_ABOVE_TEXT /// Same as ICON_ABOVE_TEXT
};
/// Normal way to show label
enum {
LABEL_NORMAL = JUSTIFY_NORMAL|ICON_BEFORE_TEXT
};
class FXIcon;
class FXFont;
/**
* A label widget can be used to place a text and/or icon for
* explanation purposes. The text label may have an optional tooltip
* and/or help string. Icon and label are placed relative to the widget
* using the justfication options, and relative to each other as determined
* by the icon relationship options. A large number of arrangements is
* possible.
*/
class FXAPI FXLabel : public FXFrame {
FXDECLARE(FXLabel)
protected:
FXString label; // Text on the label
FXIcon* icon; // Icon on the label
FXFont* font; // Label font
FXHotKey hotkey; // Hotkey
FXint hotoff; // Offset in string
FXColor textColor; // Text color
FXString tip; // Tooltip
FXString help; // Help message
protected:
FXLabel();
FXint labelHeight(const FXString& text) const;
FXint labelWidth(const FXString& text) const;
void drawLabel(FXDCWindow& dc,const FXString& text,FXint hot,FXint tx,FXint ty,FXint tw,FXint th);
void just_x(FXint& tx,FXint& ix,FXint tw,FXint iw);
void just_y(FXint& ty,FXint& iy,FXint th,FXint ih);
private:
FXLabel(const FXLabel&);
FXLabel &operator=(const FXLabel&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onHotKeyPress(FXObject*,FXSelector,void*);
long onHotKeyRelease(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetStringValue(FXObject*,FXSelector,void*);
long onCmdGetStringValue(FXObject*,FXSelector,void*);
long onCmdSetIconValue(FXObject*,FXSelector,void*);
long onCmdGetIconValue(FXObject*,FXSelector,void*);
long onCmdSetHelp(FXObject*,FXSelector,void*);
long onCmdGetHelp(FXObject*,FXSelector,void*);
long onCmdSetTip(FXObject*,FXSelector,void*);
long onCmdGetTip(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
public:
/// Construct label with given text and icon
FXLabel(FXComposite* p,const FXString& text,FXIcon* ic=0,FXuint opts=LABEL_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Enable the window
virtual void enable();
/// Disable the window
virtual void disable();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Set the text for this label
void setText(const FXString& text);
/// Get the text for this label
FXString getText() const { return label; }
/// Set the icon for this label
void setIcon(FXIcon* ic);
/// Get the icon for this label
FXIcon* getIcon() const { return icon; }
/// Set the text font
void setFont(FXFont *fnt);
/// Get the text font
FXFont* getFont() const { return font; }
/// Get the current text color
FXColor getTextColor() const { return textColor; }
/// Set the current text color
void setTextColor(FXColor clr);
/// Set the current text-justification mode.
void setJustify(FXuint mode);
/// Get the current text-justification mode.
FXuint getJustify() const;
/// Set the current icon position
void setIconPosition(FXuint mode);
/// Get the current icon position
FXuint getIconPosition() const;
/// Set the status line help text for this label
void setHelpText(const FXString& text){ help=text; }
/// Get the status line help text for this label
const FXString& getHelpText() const { return help; }
/// Set the tool tip message for this label
void setTipText(const FXString& text){ tip=text; }
/// Get the tool tip message for this label
const FXString& getTipText() const { return tip; }
/// Save label to a stream
virtual void save(FXStream& store) const;
/// Load label from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXLabel();
};
}
#endif
fox-1.6.49/include/FXMat3d.h 0000664 0001750 0001750 00000012245 12130340076 012334 0000000 0000000 /********************************************************************************
* *
* D o u b l e - P r e c i s i o n 3 x 3 M a t r i x *
* *
*********************************************************************************
* Copyright (C) 2003,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXMat3d.h,v 1.12 2006/01/22 17:58:05 fox Exp $ *
********************************************************************************/
#ifndef FXMAT3D_H
#define FXMAT3D_H
namespace FX {
class FXQuatd;
/// Double-precision 3x3 matrix
class FXAPI FXMat3d {
protected:
FXVec3d m[3];
public:
/// Default constructor
FXMat3d(){}
/// Initialize matrix from another matrix
FXMat3d(const FXMat3d& other);
/// Initialize matrix from scalar
FXMat3d(FXdouble w);
/// Initialize matrix from components
FXMat3d(FXdouble a00,FXdouble a01,FXdouble a02,
FXdouble a10,FXdouble a11,FXdouble a12,
FXdouble a20,FXdouble a21,FXdouble a22);
/// Initialize matrix from three vectors
FXMat3d(const FXVec3d& a,const FXVec3d& b,const FXVec3d& c);
/// Initialize matrix from quaternion
FXMat3d(const FXQuatd& quat);
/// Assignment
FXMat3d& operator=(const FXMat3d& other);
FXMat3d& operator=(FXdouble w);
/// Set value from another matrix
FXMat3d& set(const FXMat3d& other);
/// Set value from scalar
FXMat3d& set(FXdouble w);
/// Set value from components
FXMat3d& set(FXdouble a00,FXdouble a01,FXdouble a02,
FXdouble a10,FXdouble a11,FXdouble a12,
FXdouble a20,FXdouble a21,FXdouble a22);
/// Set value from three vectors
FXMat3d& set(const FXVec3d& a,const FXVec3d& b,const FXVec3d& c);
/// Set value from quaternion
FXMat3d& set(const FXQuatd& quat);
/// Assignment operators
FXMat3d& operator+=(const FXMat3d& w);
FXMat3d& operator-=(const FXMat3d& w);
FXMat3d& operator*=(FXdouble w);
FXMat3d& operator*=(const FXMat3d& w);
FXMat3d& operator/=(FXdouble w);
/// Indexing
FXVec3d& operator[](FXint i){return m[i];}
const FXVec3d& operator[](FXint i) const {return m[i];}
/// Conversion
operator FXdouble*(){return m[0];}
operator const FXdouble*() const {return m[0];}
/// Unary minus
FXMat3d operator-() const;
/// Matrix and matrix
FXMat3d operator+(const FXMat3d& w) const;
FXMat3d operator-(const FXMat3d& w) const;
FXMat3d operator*(const FXMat3d& w) const;
/// Multiply matrix and vector
FXVec3d operator*(const FXVec3d& v) const;
FXVec2d operator*(const FXVec2d& v) const;
/// Matrix and scalar
friend FXAPI FXMat3d operator*(FXdouble x,const FXMat3d& a);
friend FXAPI FXMat3d operator*(const FXMat3d& a,FXdouble x);
friend FXAPI FXMat3d operator/(const FXMat3d& a,FXdouble x);
friend FXAPI FXMat3d operator/(FXdouble x,const FXMat3d& a);
/// Set identity matrix
FXMat3d& eye();
/// Multiply by rotation of phi
FXMat3d& rot(FXdouble c,FXdouble s);
FXMat3d& rot(FXdouble phi);
/// Multiply by translation
FXMat3d& trans(FXdouble tx,FXdouble ty);
/// Multiply by scaling
FXMat3d& scale(FXdouble sx,FXdouble sy);
FXMat3d& scale(FXdouble s);
/// Determinant
FXdouble det() const;
/// Transpose
FXMat3d transpose() const;
/// Invert
FXMat3d invert() const;
/// Save to a stream
friend FXAPI FXStream& operator<<(FXStream& store,const FXMat3d& m);
/// Load from a stream
friend FXAPI FXStream& operator>>(FXStream& store,FXMat3d& m);
};
extern FXAPI FXMat3d operator*(FXdouble x,const FXMat3d& a);
extern FXAPI FXMat3d operator*(const FXMat3d& a,FXdouble x);
extern FXAPI FXMat3d operator/(const FXMat3d& a,FXdouble x);
extern FXAPI FXMat3d operator/(FXdouble x,const FXMat3d& a);
extern FXAPI FXStream& operator<<(FXStream& store,const FXMat3d& m);
extern FXAPI FXStream& operator>>(FXStream& store,FXMat3d& m);
}
#endif
fox-1.6.49/include/FXColorBar.h 0000664 0001750 0001750 00000011665 12130340076 013074 0000000 0000000 /********************************************************************************
* *
* C o l o r B a r W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2001,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXColorBar.h,v 1.20 2006/01/22 17:57:59 fox Exp $ *
********************************************************************************/
#ifndef FXCOLORBAR_H
#define FXCOLORBAR_H
#ifndef FXFRAME_H
#include "FXFrame.h"
#endif
namespace FX {
/// Color bar orientation
enum {
COLORBAR_HORIZONTAL = 0, /// Color bar shown horizontally
COLORBAR_VERTICAL = 0x00008000 /// Color bar shown vertically
};
class FXImage;
/**
* A Color Bar is a widget which controls the brightness (value) of a
* color by means of the hue, saturation, value specification system.
* It is most useful when used together with the Color Wheel which controls
* the hue and saturation.
* The options COLORBAR_HORIZONTAL and COLORBAR_VERTICAL control the orientation
* of the bar.
*/
class FXAPI FXColorBar : public FXFrame {
FXDECLARE(FXColorBar)
protected:
FXImage *bar; // Intensity bar
FXfloat hsv[3]; // Hue, saturation, value
FXString tip; // Tooltip value
FXString help; // Help value
protected:
FXColorBar();
void updatebar();
private:
FXColorBar(const FXColorBar&);
FXColorBar &operator=(const FXColorBar&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onCmdSetHelp(FXObject*,FXSelector,void*);
long onCmdGetHelp(FXObject*,FXSelector,void*);
long onCmdSetTip(FXObject*,FXSelector,void*);
long onCmdGetTip(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
public:
/// Construct color bar
FXColorBar(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=FRAME_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Perform layout
virtual void layout();
/// Change hue
void setHue(FXfloat h);
/// Return hue
FXfloat getHue() const { return hsv[0]; }
/// Change saturation
void setSat(FXfloat s);
/// Return saturation
FXfloat getSat() const { return hsv[1]; }
/// Change value
void setVal(FXfloat v);
/// Return value
FXfloat getVal() const { return hsv[2]; }
/// Change the color bar style
FXuint getBarStyle() const;
/// Get the color bar style
void setBarStyle(FXuint style);
/// Set status line help text for this color bar
void setHelpText(const FXString& text){ help=text; }
/// Get status line help text for this color bar
const FXString& getHelpText() const { return help; }
/// Set tool tip message for this color bar
void setTipText(const FXString& text){ tip=text; }
/// Get tool tip message for this color bar
const FXString& getTipText() const { return tip; }
/// Save color bar to a stream
virtual void save(FXStream& store) const;
/// Load color bar from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXColorBar();
};
}
#endif
fox-1.6.49/include/FXCP1251Codec.h 0000644 0001750 0001750 00000001106 11637250333 013134 0000000 0000000 #ifndef FXCP1251CODEC_H
#define FXCP1251CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// CP1251 Codec
class FXAPI FXCP1251Codec : public FXTextCodec {
FXDECLARE(FXCP1251Codec)
public:
FXCP1251Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FXCP1251Codec(){}
};
}
#endif
fox-1.6.49/include/FXDragCorner.h 0000664 0001750 0001750 00000006542 12130340076 013415 0000000 0000000 /********************************************************************************
* *
* D r a g C o r n e r W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXDragCorner.h,v 1.15 2006/01/22 17:58:01 fox Exp $ *
********************************************************************************/
#ifndef FXDRAGCORNER_H
#define FXDRAGCORNER_H
#ifndef FXWINDOW_H
#include "FXWindow.h"
#endif
namespace FX {
/**
* A drag corner widget may be placed in the bottom right corner
* so as to allow the window to be resized more easily.
*/
class FXAPI FXDragCorner : public FXWindow {
FXDECLARE(FXDragCorner)
protected:
FXColor hiliteColor;
FXColor shadowColor;
FXint oldw;
FXint oldh;
FXint xoff;
FXint yoff;
FXbool ewmh;
protected:
FXDragCorner();
private:
FXDragCorner(const FXDragCorner&);
FXDragCorner &operator=(const FXDragCorner&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
public:
/// Construct a drag corner
FXDragCorner(FXComposite* p);
/// Get default width
virtual FXint getDefaultWidth();
/// Get default height
virtual FXint getDefaultHeight();
/// Create all of the server-side resources for this window
virtual void create();
/// Change highlight color
void setHiliteColor(FXColor clr);
/// Return current highlight color
FXColor getHiliteColor() const { return hiliteColor; }
/// Change shadow color
void setShadowColor(FXColor clr);
/// Return current shadow color
FXColor getShadowColor() const { return shadowColor; }
/// Save drag corner to a stream
virtual void save(FXStream& store) const;
/// Load drag corner from a stream
virtual void load(FXStream& store);
};
}
#endif
fox-1.6.49/include/FXMainWindow.h 0000664 0001750 0001750 00000005667 12130340076 013452 0000000 0000000 /********************************************************************************
* *
* M a i n W i n d o w W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXMainWindow.h,v 1.21 2006/01/22 17:58:05 fox Exp $ *
********************************************************************************/
#ifndef FXMAINWINDOW_H
#define FXMAINWINDOW_H
#ifndef FXTOPWINDOW_H
#include "FXTopWindow.h"
#endif
namespace FX {
/**
* The Main Window is usually the central window of an application. Applications
* may have any number of main windows.
* When a MainWindow is closed, it sends a SEL_CLOSE message to its target; the target
* should return 0 if there is no objection against proceeding with the close, and
* return 1 otherwise.
* After the SEL_CLOSE message has been sent and no objection was raised, the main
* window will delete itself.
*/
class FXAPI FXMainWindow : public FXTopWindow {
FXDECLARE(FXMainWindow)
protected:
FXMainWindow(){}
private:
FXMainWindow(const FXMainWindow&);
FXMainWindow &operator=(const FXMainWindow&);
public:
/// Construct a main window
FXMainWindow(FXApp* a,const FXString& name,FXIcon *ic=NULL,FXIcon *mi=NULL,FXuint opts=DECOR_ALL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=0,FXint pr=0,FXint pt=0,FXint pb=0,FXint hs=0,FXint vs=0);
/// Create server-side resources
virtual void create();
/// Destructor
virtual ~FXMainWindow();
};
}
#endif
fox-1.6.49/include/FXGUISignal.h 0000664 0001750 0001750 00000011171 12130340076 013143 0000000 0000000 /********************************************************************************
* *
* S i g n a l G U I T h r e a d *
* *
*********************************************************************************
* Copyright (C) 2005,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXGUISignal.h,v 1.6.2.1 2006/05/24 12:08:45 fox Exp $ *
********************************************************************************/
#ifndef FXGUISIGNAL_H
#define FXGUISIGNAL_H
#ifndef FXOBJECT_H
#include "FXObject.h"
#endif
namespace FX {
class FXApp;
/**
* An FXGUISignal manages a waitable object which is used to awaken the
* main user-interface thread from a worker thread. When a FXGUISignal is
* constructed, it automatically calls addInput() function to register itself
* as the message handler for the SEL_IO_READ message from FXApp. Likewise,
* when FXGUISignal is destroyed, it calls removeInput() to remove itself as
* the message handler for the SEL_IO_READ message from FXApp.
* When a worker thread calls the signal() API, the waitable object managed by
* FXGUISignal is set to the signaled state, after which the worker thread
* continues execution immediately.
* Meanwhile, the main user-interface thread is awakened because one of its
* inputs has become signaled. It invokes the onSignal handler of FXGUISignal,
* which clears the waitable object's state and subsequently dispatches to the
* target of FXGUISignal through the SEL_IO_READ message.
* Thus, the SEL_IO_READ handler in FXGUISignal is executed in the context of
* the user-interface thread, allowing any user-interaction without blocking
* a worker thread.
* In a typical scenario, a worker thread updates some common data structure,
* then notifies the main user-interface thread (via the FXGUISignal) to update
* the user interface and perform some appropriate action.
*/
class FXAPI FXGUISignal : public FXObject {
FXDECLARE(FXGUISignal)
private:
FXApp *app; // Application
protected:
FXObject *target; // Target object
void *data; // User data
FXSelector message; // Message id
private:
#ifndef WIN32
FXInputHandle fd[2];
#else
FXInputHandle event;
#endif
protected:
FXGUISignal();
private:
FXGUISignal(const FXGUISignal&);
FXGUISignal& operator=(const FXGUISignal&);
public:
enum{
ID_IO_READ=0,
ID_LAST
};
public:
long onSignal(FXObject*,FXSelector,void*);
public:
/// Constructor
FXGUISignal(FXApp* a,FXObject* tgt=NULL,FXSelector sel=0,void* ptr=NULL);
/// Get application
FXApp* getApp() const { return app; }
/// Set the message target object
void setTarget(FXObject *t){ target=t; }
/// Get the message target object, if any
FXObject* getTarget() const { return target; }
/// Set the message identifier
void setSelector(FXSelector sel){ message=sel; }
/// Get the message identifier
FXSelector getSelector() const { return message; }
/// Set user data pointer
void setData(void *ptr){ data=ptr; }
/// Get user data pointer
void* getData() const { return data; }
/**
* Signal the event; this API may be called by the worker thread
* to send a message to the user-interface thread.
*/
void signal();
/// Destructor
virtual ~FXGUISignal();
};
}
#endif
fox-1.6.49/include/FXTopWindow.h 0000664 0001750 0001750 00000026214 12130340076 013317 0000000 0000000 /********************************************************************************
* *
* T o p - L e v e l W i n d o w W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXTopWindow.h,v 1.62 2006/01/22 17:58:11 fox Exp $ *
********************************************************************************/
#ifndef FXTOPWINDOW_H
#define FXTOPWINDOW_H
#ifndef FXSHELL_H
#include "FXShell.h"
#endif
namespace FX {
/// Title and border decorations
enum {
DECOR_NONE = 0, /// Borderless window
DECOR_TITLE = 0x00020000, /// Window title
DECOR_MINIMIZE = 0x00040000, /// Minimize button
DECOR_MAXIMIZE = 0x00080000, /// Maximize button
DECOR_CLOSE = 0x00100000, /// Close button
DECOR_BORDER = 0x00200000, /// Border
DECOR_SHRINKABLE = 0x00400000, /// Window can become smaller
DECOR_STRETCHABLE = 0x00800000, /// Window can become larger
DECOR_RESIZE = DECOR_SHRINKABLE|DECOR_STRETCHABLE, /// Resize handles
DECOR_MENU = 0x01000000, /// Window menu
DECOR_ALL = (DECOR_TITLE|DECOR_MINIMIZE|DECOR_MAXIMIZE|DECOR_CLOSE|DECOR_BORDER|DECOR_SHRINKABLE|DECOR_STRETCHABLE|DECOR_MENU)
};
/// Initial window placement
enum {
PLACEMENT_DEFAULT, /// Place it at the default size and location
PLACEMENT_VISIBLE, /// Place window to be fully visible
PLACEMENT_CURSOR, /// Place it under the cursor position
PLACEMENT_OWNER, /// Place it centered on its owner
PLACEMENT_SCREEN, /// Place it centered on the screen
PLACEMENT_MAXIMIZED /// Place it maximized to the screen size
};
class FXToolBar;
class FXIcon;
/**
* Abstract base class for all top-level windows.
* TopWindows are usually managed by a Window Manager under X11 and
* therefore borders and window-menus and other decorations like resize-
* handles are subject to the Window Manager's interpretation of the
* decoration hints.
* When a TopWindow is closed, it sends a SEL_CLOSE message to its
* target. The target should return 0 in response to this message if
* there is no objection to proceed with the closing of the window, and
* return 1 otherwise. After the SEL_CLOSE message has been sent and
* no objection was raised, the window will delete itself.
* When the session is closed, the window will send a SEL_SESSION_NOTIFY
* message to its target, allowing the application to write any unsaved
* data to the disk. If the target returns 0, then the system will proceed
* to close the session. Subsequently a SEL_SESSION_CLOSED will be received
* which causes the window to be closed with prejudice by calling the
* function close(FALSE).
* When receiving a SEL_UPDATE, the target can update the title string
* of the window, so that the title of the window reflects the name
* of the document, for example.
* For convenience, TopWindow provides the same layout behavior as
* the Packer widget, as well as docking and undocking of toolbars.
* TopWindows can be owned by other windows, or be free-floating.
* Owned TopWindows will usually remain stacked on top of the owner
* windows. The lifetime of an owned window should not exceed that of
* the owner.
*/
class FXAPI FXTopWindow : public FXShell {
FXDECLARE_ABSTRACT(FXTopWindow)
protected:
FXString title; // Window title
FXIcon *icon; // Window icon (big)
FXIcon *miniIcon; // Window icon (small)
FXint padtop; // Top margin
FXint padbottom; // Bottom margin
FXint padleft; // Left margin
FXint padright; // Right margin
FXint hspacing; // Horizontal child spacing
FXint vspacing; // Vertical child spacing
protected:
FXTopWindow();
void settitle();
void seticons();
void setdecorations();
FXTopWindow(FXApp* ap,const FXString& name,FXIcon *ic,FXIcon *mi,FXuint opts,FXint x,FXint y,FXint w,FXint h,FXint pl,FXint pr,FXint pt,FXint pb,FXint hs,FXint vs);
FXTopWindow(FXWindow* ow,const FXString& name,FXIcon *ic,FXIcon *mi,FXuint opts,FXint x,FXint y,FXint w,FXint h,FXint pl,FXint pr,FXint pt,FXint pb,FXint hs,FXint vs);
private:
FXTopWindow(const FXTopWindow&);
FXTopWindow& operator=(const FXTopWindow&);
#ifdef WIN32
virtual const char* GetClass() const;
#endif
public:
long onFocusUp(FXObject*,FXSelector,void*);
long onFocusDown(FXObject*,FXSelector,void*);
long onFocusLeft(FXObject*,FXSelector,void*);
long onFocusRight(FXObject*,FXSelector,void*);
long onSessionNotify(FXObject*,FXSelector,void*);
long onSessionClosed(FXObject*,FXSelector,void*);
long onCmdMaximize(FXObject*,FXSelector,void*);
long onCmdMinimize(FXObject*,FXSelector,void*);
long onCmdRestore(FXObject*,FXSelector,void*);
long onCmdClose(FXObject*,FXSelector,void*);
long onCmdSetStringValue(FXObject*,FXSelector,void*);
long onCmdGetStringValue(FXObject*,FXSelector,void*);
long onCmdSetIconValue(FXObject*,FXSelector,void*);
long onCmdGetIconValue(FXObject*,FXSelector,void*);
public:
enum {
ID_MAXIMIZE=FXShell::ID_LAST, /// Maximize the window
ID_MINIMIZE, /// Minimize the window
ID_RESTORE, /// Restore the window
ID_CLOSE, /// Close the window
ID_QUERY_DOCK, /// Toolbar asks to dock
ID_LAST
};
public:
/// Create server-side resources
virtual void create();
/// Detach the server-side resources for this window
virtual void detach();
/// Destroy the server-side resources for this window
virtual void destroy();
/// Perform layout
virtual void layout();
/// Move the focus to this window
virtual void setFocus();
/// Remove the focus from this window
virtual void killFocus();
/// Show this window
virtual void show();
/// Hide this window
virtual void hide();
/// Show this window with given placement
virtual void show(FXuint placement);
/// Position the window based on placement
void place(FXuint placement);
/// Return the default width of this window
virtual FXint getDefaultWidth();
/// Return the default height of this window
virtual FXint getDefaultHeight();
/// Obtain border sizes added to our window by the window manager
FXbool getWMBorders(FXint& left,FXint& right,FXint& top,FXint& bottom);
/// Raise this window to the top of the stacking order
virtual void raise();
/// Move this window to the specified position in the parent's coordinates
virtual void move(FXint x,FXint y);
/// Resize this window to the specified width and height
virtual void resize(FXint w,FXint h);
/// Move and resize this window in the parent's coordinates
virtual void position(FXint x,FXint y,FXint w,FXint h);
/// Maximize window, return TRUE if maximized
virtual FXbool maximize(FXbool notify=FALSE);
/// Minimize or iconify window, return TRUE if minimized
virtual FXbool minimize(FXbool notify=FALSE);
/// Restore window to normal, return TRUE if restored
virtual FXbool restore(FXbool notify=FALSE);
/**
* Close the window, return TRUE if actually closed. If notify=TRUE, the target
* will receive a SEL_CLOSE message to determine if it is OK to close the window.
* If the target ignores the SEL_CLOSE message or returns 0, the window will
* be closed, and subsequently deleted. When the last main window has been
* closed, the application will receive an ID_QUIT message and will be closed.
*/
virtual FXbool close(FXbool notify=FALSE);
/// Return TRUE if maximized
FXbool isMaximized() const;
/// Return TRUE if minimized
FXbool isMinimized() const;
/// Change window title
void setTitle(const FXString& name);
/// Return window title
FXString getTitle() const { return title; }
/// Change top padding
void setPadTop(FXint pt);
/// Get top interior padding
FXint getPadTop() const { return padtop; }
/// Change bottom padding
void setPadBottom(FXint pb);
/// Get bottom interior padding
FXint getPadBottom() const { return padbottom; }
/// Change left padding
void setPadLeft(FXint pl);
/// Get left interior padding
FXint getPadLeft() const { return padleft; }
/// Change right padding
void setPadRight(FXint pr);
/// Get right interior padding
FXint getPadRight() const { return padright; }
/// Return horizontal spacing between children
FXint getHSpacing() const { return hspacing; }
/// Return vertical spacing between children
FXint getVSpacing() const { return vspacing; }
/// Change horizontal spacing between children
void setHSpacing(FXint hs);
/// Change vertical spacing between children
void setVSpacing(FXint vs);
/// Change packing hints for children
void setPackingHints(FXuint ph);
/// Return packing hints for children
FXuint getPackingHints() const;
/// Change title and border decorations
void setDecorations(FXuint decorations);
/// Return current title and border decorations
FXuint getDecorations() const;
/// Return window icon
FXIcon* getIcon() const { return icon; }
/// Change window icon
void setIcon(FXIcon* ic);
/// Return window mini (title) icon
FXIcon* getMiniIcon() const { return miniIcon; }
/// Change window mini (title) icon
void setMiniIcon(FXIcon *ic);
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXTopWindow();
};
}
#endif
fox-1.6.49/include/FXAccelTable.h 0000664 0001750 0001750 00000011452 12130340076 013342 0000000 0000000 /********************************************************************************
* *
* A c c e l e r a t o r T a b l e C l a s s *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXAccelTable.h,v 1.27 2006/01/22 17:57:58 fox Exp $ *
********************************************************************************/
#ifndef FXACCELTABLE_H
#define FXACCELTABLE_H
#ifndef FXOBJECT_H
#include "FXObject.h"
#endif
namespace FX {
/**
* The accelerator table sends a message to a specific
* target object when the indicated key and modifier combination
* is pressed.
*/
class FXAPI FXAccelTable : public FXObject {
FXDECLARE(FXAccelTable)
protected:
struct FXAccelKey {
FXObject *target; // Target object of message
FXSelector messagedn; // Message being sent
FXSelector messageup; // Message being sent
FXHotKey code; // Keysym and modifier mask to match
};
private:
FXAccelKey *key; // Accelerator table
FXuint max; // Largest table index
FXuint num; // Number of entries
private:
void resize(FXuint m);
private:
FXAccelTable(const FXAccelTable&);
FXAccelTable &operator=(const FXAccelTable&);
public:
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
public:
/// Construct empty accelerator table
FXAccelTable();
/// Add an accelerator into the table
void addAccel(FXHotKey hotkey,FXObject* target=NULL,FXSelector seldn=0,FXSelector selup=0);
/// Remove an accelerator from the table
void removeAccel(FXHotKey hotkey);
/// Return true if accelerator specified
bool hasAccel(FXHotKey hotkey) const;
/// Return target object of the given accelerator
FXObject* targetOfAccel(FXHotKey hotkey) const;
/**
* Parse accelerator from string, yielding modifier and
* key code. For example, parseAccel("Ctl+Shift+X")
* yields MKUINT(KEY_X,CONTROLMASK|SHIFTMASK).
*/
friend FXAPI FXHotKey parseAccel(const FXString& string);
/**
* Unparse hot key comprising modifier and key code back
* into a string suitable for parsing with fxparseHotKey.
*/
friend FXAPI FXString unparseAccel(FXHotKey key);
/**
* Parse hot key from string, yielding modifier and
* key code. For example, parseHotKey(""Salt && &Pepper!"")
* yields MKUINT(KEY_p,ALTMASK).
*/
friend FXAPI FXHotKey parseHotKey(const FXString& string);
/**
* Obtain hot key offset in string, or -1 if not found.
* For example, findHotKey("Salt && &Pepper!") yields 7.
* Note that this is the byte-offset, not the character
* index!
*/
friend FXAPI FXint findHotKey(const FXString& string);
/**
* Strip hot key combination from the string.
* For example, stripHotKey("Salt && &Pepper") should
* yield "Salt & Pepper".
*/
friend FXAPI FXString stripHotKey(const FXString& string);
/// Save table to a stream
virtual void save(FXStream& store) const;
/// Load table from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXAccelTable();
};
extern FXAPI FXHotKey parseAccel(const FXString& string);
extern FXAPI FXString unparseAccel(FXHotKey key);
extern FXAPI FXHotKey parseHotKey(const FXString& string);
extern FXAPI FXint findHotKey(const FXString& string);
extern FXAPI FXString stripHotKey(const FXString& string);
}
#endif
fox-1.6.49/include/FXChoiceBox.h 0000664 0001750 0001750 00000012735 12130340076 013233 0000000 0000000 /********************************************************************************
* *
* C h o i c e B o x *
* *
*********************************************************************************
* Copyright (C) 2004,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXChoiceBox.h,v 1.8 2006/01/22 17:57:59 fox Exp $ *
********************************************************************************/
#ifndef FXCHOICEBOX_H
#define FXCHOICEBOX_H
#ifndef FXDIALOGBOX_H
#include "FXDialogBox.h"
#endif
namespace FX {
class FXList;
/**
* The Choice Box provides a dialog panel to select one item out of a list
* of choices. The choices are provided as a list of text strings.
* When the dialog closes, the index of the selected choice is returned,
* while a -1 is returned if the dialog was canceled,
*/
class FXAPI FXChoiceBox : public FXDialogBox {
FXDECLARE(FXChoiceBox)
protected:
FXList *list;
protected:
FXChoiceBox(){}
private:
FXChoiceBox(const FXChoiceBox&);
FXChoiceBox &operator=(const FXChoiceBox&);
void initialize(const FXString& text,FXIcon* icon);
public:
long onCmdClicked(FXObject*,FXSelector,void*);
long onCmdCancel(FXObject*,FXSelector,void*);
public:
enum{
ID_CLICKED=FXDialogBox::ID_LAST,
ID_LAST
};
public:
/// Construct choice box with given caption, icon, message text, and with choices from array of strings
FXChoiceBox(FXWindow* owner,const FXString& caption,const FXString& text,FXIcon* icon,const FXchar** choices,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Construct choice box with given caption, icon, message text, and with choices from newline separated strings
FXChoiceBox(FXWindow* owner,const FXString& caption,const FXString& text,FXIcon* icon,const FXString& choices,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Construct free floating choice box with given caption, icon, message text, and with choices from array of strings
FXChoiceBox(FXApp* app,const FXString& caption,const FXString& text,FXIcon* icon,const FXchar** choices,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Construct free floating choice box with given caption, icon, message text, and with choices from newline separated strings
FXChoiceBox(FXApp* app,const FXString& caption,const FXString& text,FXIcon* icon,const FXString& choices,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/**
* Show a modal choice dialog.
* Prompt the user using a dialog with given caption, icon,
* message text, and with choices from newline array of strings.
* The return value is -1 if cancelled, or the given choice.
*/
static FXint ask(FXWindow* owner,FXuint opts,const FXString& caption,const FXString& text,FXIcon* icon,const FXchar** choices);
/**
* Show a modal choice dialog.
* Prompt the user using a dialog with given caption, icon,
* message text, and with choices from newline separated strings.
* The return value is -1 if cancelled, or the given choice
*/
static FXint ask(FXWindow* owner,FXuint opts,const FXString& caption,const FXString& text,FXIcon* icon,const FXString& choices);
/**
* Show modal choice message, in free floating window.
* Prompt the user using a dialog with given caption, icon,
* message text, and with choices from newline array of strings.
* The return value is -1 if cancelled, or the given choice
*/
static FXint ask(FXApp* app,FXuint opts,const FXString& caption,const FXString& text,FXIcon* icon,const FXchar** choices);
/**
* Show modal choice message, in free floating window.
* Prompt the user using a dialog with given caption, icon,
* message text, and with choices from newline separated strings.
* The return value is -1 if cancelled, or the given choice
*/
static FXint ask(FXApp* app,FXuint opts,const FXString& caption,const FXString& text,FXIcon* icon,const FXString& choices);
/// Save choice box to a stream
virtual void save(FXStream& store) const;
/// Load choice box from a stream
virtual void load(FXStream& store);
/// Destroy choice box
virtual ~FXChoiceBox();
};
}
#endif
fox-1.6.49/include/FXImageView.h 0000664 0001750 0001750 00000010135 12130340076 013235 0000000 0000000 /********************************************************************************
* *
* I m a g e V i e w W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2000,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXImageView.h,v 1.16 2006/01/22 17:58:05 fox Exp $ *
********************************************************************************/
#ifndef FXIMAGEVIEW_H
#define FXIMAGEVIEW_H
#ifndef FXSCROLLAREA_H
#include "FXScrollArea.h"
#endif
namespace FX {
class FXImage;
/// Image alignment styles
enum {
IMAGEVIEW_NORMAL = 0, /// Normal mode is centered
IMAGEVIEW_CENTER_X = 0, /// Centered horizontally
IMAGEVIEW_LEFT = 0x00100000, /// Left-aligned
IMAGEVIEW_RIGHT = 0x00200000, /// Right-aligned
IMAGEVIEW_CENTER_Y = 0, /// Centered vertically
IMAGEVIEW_TOP = 0x00400000, /// Top-aligned
IMAGEVIEW_BOTTOM = 0x00800000 /// Bottom-aligned
};
/**
* The Image View widget display a scrollable view of an image.
*/
class FXAPI FXImageView : public FXScrollArea {
FXDECLARE(FXImageView)
protected:
FXImage *image; // Image to view
FXint grabx; // Grab point x
FXint graby; // Grab point y
protected:
FXImageView();
private:
FXImageView(const FXImageView&);
FXImageView &operator=(const FXImageView&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onRightBtnPress(FXObject*,FXSelector,void*);
long onRightBtnRelease(FXObject*,FXSelector,void*);
public:
enum {
ID_XYZ=FXScrollArea::ID_LAST,
ID_LAST
};
public:
/// Construct a scroll window
FXImageView(FXComposite* p,FXImage* img=NULL,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Perform layout
virtual void layout();
/// Image view widget can receive focus
virtual bool canFocus() const;
/// Return the width of the contents
virtual FXint getContentWidth();
/// Return the height of the contents
virtual FXint getContentHeight();
/// Change image
void setImage(FXImage* img);
/// Return image
FXImage* getImage() const { return image; }
/// Set the current alignment.
void setAlignment(FXuint mode);
/// Get the current alignment.
FXuint getAlignment() const;
/// Save list to a stream
virtual void save(FXStream& store) const;
/// Load list from a stream
virtual void load(FXStream& store);
/// Destroy
virtual ~FXImageView();
};
}
#endif
fox-1.6.49/include/FXDC.h 0000664 0001750 0001750 00000035124 12130340076 011653 0000000 0000000 /********************************************************************************
* *
* D e v i c e C o n t e x t B a s e C l a s s *
* *
*********************************************************************************
* Copyright (C) 1999,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXDC.h,v 1.37 2006/01/22 17:58:00 fox Exp $ *
********************************************************************************/
#ifndef FXDC_H
#define FXDC_H
namespace FX {
/// Drawing (BITBLT) functions
enum FXFunction {
BLT_CLR, /// D := 0
BLT_SRC_AND_DST, /// D := S & D
BLT_SRC_AND_NOT_DST, /// D := S & ~D
BLT_SRC, /// D := S
BLT_NOT_SRC_AND_DST, /// D := ~S & D
BLT_DST, /// D := D
BLT_SRC_XOR_DST, /// D := S ^ D
BLT_SRC_OR_DST, /// D := S | D
BLT_NOT_SRC_AND_NOT_DST, /// D := ~S & ~D == D := ~(S | D)
BLT_NOT_SRC_XOR_DST, /// D := ~S ^ D
BLT_NOT_DST, /// D := ~D
BLT_SRC_OR_NOT_DST, /// D := S | ~D
BLT_NOT_SRC, /// D := ~S
BLT_NOT_SRC_OR_DST, /// D := ~S | D
BLT_NOT_SRC_OR_NOT_DST, /// D := ~S | ~D == ~(S & D)
BLT_SET /// D := 1
};
/// Line Styles
enum FXLineStyle {
LINE_SOLID, /// Solid lines
LINE_ONOFF_DASH, /// On-off dashed lines
LINE_DOUBLE_DASH /// Double dashed lines
};
/// Line Cap Styles
enum FXCapStyle {
CAP_NOT_LAST, /// Don't include last end cap
CAP_BUTT, /// Butting line end caps
CAP_ROUND, /// Round line end caps
CAP_PROJECTING /// Projecting line end caps
};
/// Line Join Styles
enum FXJoinStyle {
JOIN_MITER, /// Mitered or pointy joints
JOIN_ROUND, /// Round line joints
JOIN_BEVEL /// Beveled or flat joints
};
/// Fill Styles
enum FXFillStyle {
FILL_SOLID, /// Fill with solid color
FILL_TILED, /// Fill with tiled bitmap
FILL_STIPPLED, /// Fill where stipple mask is 1
FILL_OPAQUESTIPPLED /// Fill with foreground where mask is 1, background otherwise
};
/// Fill Rules
enum FXFillRule {
RULE_EVEN_ODD, /// Even odd polygon filling
RULE_WINDING /// Winding rule polygon filling
};
/// Stipple/dither patterns
enum FXStipplePattern {
STIPPLE_0 = 0,
STIPPLE_NONE = 0,
STIPPLE_BLACK = 0, /// All ones
STIPPLE_1 = 1,
STIPPLE_2 = 2,
STIPPLE_3 = 3,
STIPPLE_4 = 4,
STIPPLE_5 = 5,
STIPPLE_6 = 6,
STIPPLE_7 = 7,
STIPPLE_8 = 8,
STIPPLE_GRAY = 8, /// 50% gray
STIPPLE_9 = 9,
STIPPLE_10 = 10,
STIPPLE_11 = 11,
STIPPLE_12 = 12,
STIPPLE_13 = 13,
STIPPLE_14 = 14,
STIPPLE_15 = 15,
STIPPLE_16 = 16,
STIPPLE_WHITE = 16, /// All zeroes
STIPPLE_HORZ = 17, /// Horizontal hatch pattern
STIPPLE_VERT = 18, /// Vertical hatch pattern
STIPPLE_CROSS = 19, /// Cross-hatch pattern
STIPPLE_DIAG = 20, /// Diagonal // hatch pattern
STIPPLE_REVDIAG = 21, /// Reverse diagonal \\ hatch pattern
STIPPLE_CROSSDIAG = 22 /// Cross-diagonal hatch pattern
};
/// Line segment
struct FXSegment {
FXshort x1,y1,x2,y2;
};
/// Arc
struct FXArc {
FXshort x,y,w,h,a,b;
};
class FXApp;
class FXImage;
class FXBitmap;
class FXIcon;
class FXFont;
class FXDrawable;
class FXRegion;
/**
* Abstract Device Context
*
* A Device Context is used to maintain the state of the graphics drawing system.
* Defining your drawing code in terms of the Abstract Device Context allows the
* drawing commands to be rendered on different types of surfaces, such as windows
* and images (FXDCWindow), or on paper (FXDCPrint).
* WYSYWYG may be obtained by using the same identical drawing code in your
* application regardless of the actual device surface being utilized.
*/
class FXAPI FXDC {
friend class FXFont;
private:
FXApp *app; // Application
protected:
void *ctx; // Context handle
FXFont *font; // Drawing font
FXStipplePattern pattern; // Stipple pattern
FXBitmap *stipple; // Stipple bitmap
FXImage *tile; // Tile image
FXBitmap *mask; // Mask bitmap
FXRectangle clip; // Clip rectangle
FXColor fg; // Foreground color
FXColor bg; // Background color
FXuint width; // Line width
FXCapStyle cap; // Line cap style
FXJoinStyle join; // Line join style
FXLineStyle style; // Line style
FXFillStyle fill; // Fill style
FXFillRule rule; // Fill rule
FXFunction rop; // RasterOp
FXchar dashpat[32]; // Line dash pattern data
FXuint dashlen; // Line dash pattern length
FXuint dashoff; // Line dash pattern offset
FXint tx; // Tile dx
FXint ty; // Tile dy
FXint cx; // Clip x
FXint cy; // Clip y
private:
FXDC();
FXDC(const FXDC&);
FXDC &operator=(const FXDC&);
public:
/// Construct dummy DC
FXDC(FXApp* a);
/// Get application
FXApp* getApp() const { return app; }
/// Get context handle
void* context() const { return ctx; }
/// Read back pixel
virtual FXColor readPixel(FXint x,FXint y);
/// Draw points
virtual void drawPoint(FXint x,FXint y);
virtual void drawPoints(const FXPoint* points,FXuint npoints);
virtual void drawPointsRel(const FXPoint* points,FXuint npoints);
/// Draw lines
virtual void drawLine(FXint x1,FXint y1,FXint x2,FXint y2);
virtual void drawLines(const FXPoint* points,FXuint npoints);
virtual void drawLinesRel(const FXPoint* points,FXuint npoints);
virtual void drawLineSegments(const FXSegment* segments,FXuint nsegments);
/// Draw rectangles
virtual void drawRectangle(FXint x,FXint y,FXint w,FXint h);
virtual void drawRectangles(const FXRectangle* rectangles,FXuint nrectangles);
/// Draw rounded rectangle with ellipse with ew and ellips height eh
virtual void drawRoundRectangle(FXint x,FXint y,FXint w,FXint h,FXint ew,FXint eh);
/**
* Draw arcs.
* The argument ang1 specifies the start of the arc relative to the
* three-o'clock position from the center, in units of degrees*64.
* The argument ang2 specifies the path and extent of the arc relative
* to the start of the arc, in units of degrees*64.
* The arguments x,y,w,h specify the bounding rectangle.
*/
virtual void drawArc(FXint x,FXint y,FXint w,FXint h,FXint ang1,FXint ang2);
virtual void drawArcs(const FXArc* arcs,FXuint narcs);
/// Draw ellipse
virtual void drawEllipse(FXint x,FXint y,FXint w,FXint h);
/// Filled rectangles
virtual void fillRectangle(FXint x,FXint y,FXint w,FXint h);
virtual void fillRectangles(const FXRectangle* rectangles,FXuint nrectangles);
/// Filled rounded rectangle with ellipse with ew and ellips height eh
virtual void fillRoundRectangle(FXint x,FXint y,FXint w,FXint h,FXint ew,FXint eh);
/// Fill chord
virtual void fillChord(FXint x,FXint y,FXint w,FXint h,FXint ang1,FXint ang2);
virtual void fillChords(const FXArc* chords,FXuint nchords);
/// Fill arcs
virtual void fillArc(FXint x,FXint y,FXint w,FXint h,FXint ang1,FXint ang2);
virtual void fillArcs(const FXArc* arcs,FXuint narcs);
/// Fill ellipse
virtual void fillEllipse(FXint x,FXint y,FXint w,FXint h);
/// Filled polygon
virtual void fillPolygon(const FXPoint* points,FXuint npoints);
virtual void fillConcavePolygon(const FXPoint* points,FXuint npoints);
virtual void fillComplexPolygon(const FXPoint* points,FXuint npoints);
/// Filled polygon with relative points
virtual void fillPolygonRel(const FXPoint* points,FXuint npoints);
virtual void fillConcavePolygonRel(const FXPoint* points,FXuint npoints);
virtual void fillComplexPolygonRel(const FXPoint* points,FXuint npoints);
/// Draw hashed box
virtual void drawHashBox(FXint x,FXint y,FXint w,FXint h,FXint b=1);
/// Draw focus rectangle
virtual void drawFocusRectangle(FXint x,FXint y,FXint w,FXint h);
/// Draw area from source
virtual void drawArea(const FXDrawable* source,FXint sx,FXint sy,FXint sw,FXint sh,FXint dx,FXint dy);
/// Draw area stretched area from source
virtual void drawArea(const FXDrawable* source,FXint sx,FXint sy,FXint sw,FXint sh,FXint dx,FXint dy,FXint dw,FXint dh);
/// Draw image
virtual void drawImage(const FXImage* image,FXint dx,FXint dy);
/// Draw bitmap
virtual void drawBitmap(const FXBitmap* bitmap,FXint dx,FXint dy);
/// Draw icon
virtual void drawIcon(const FXIcon* icon,FXint dx,FXint dy);
virtual void drawIconShaded(const FXIcon* icon,FXint dx,FXint dy);
virtual void drawIconSunken(const FXIcon* icon,FXint dx,FXint dy);
/// Draw string with base line starting at x, y
virtual void drawText(FXint x,FXint y,const FXString& string);
virtual void drawText(FXint x,FXint y,const FXchar* string,FXuint length);
/// Draw text starting at x, y over filled background
virtual void drawImageText(FXint x,FXint y,const FXString& string);
virtual void drawImageText(FXint x,FXint y,const FXchar* string,FXuint length);
/// Set foreground drawing color
virtual void setForeground(FXColor clr);
/// Get foreground drawing color
FXColor getForeground() const { return fg; }
/// Set background drawing color
virtual void setBackground(FXColor clr);
/// Get background drawing color
FXColor getBackground() const { return bg; }
/**
* Set dash pattern and dash offset.
* A dash pattern of [1 2 3 4] is a repeating pattern of 1 foreground pixel,
* 2 background pixels, 3 foreground pixels, and 4 background pixels.
* The offset is where in the pattern the system will start counting.
* The maximum length of the dash pattern is 32.
*/
virtual void setDashes(FXuint dashoffset,const FXchar *dashpattern,FXuint dashlength);
/// Get dash pattern
const FXchar* getDashPattern() const { return dashpat; }
/// Get dash offset
FXuint getDashOffset() const { return dashoff; }
/// Get dash length
FXuint getDashLength() const { return dashlen; }
/// Set line width:- 0 means thinnest/fastest possible
virtual void setLineWidth(FXuint linewidth=0);
/// Get line width
FXuint getLineWidth() const { return width; }
/// Set line cap style
virtual void setLineCap(FXCapStyle capstyle=CAP_BUTT);
/// Get line cap style
FXCapStyle getLineCap() const { return cap; }
/// Set line join style
virtual void setLineJoin(FXJoinStyle joinstyle=JOIN_MITER);
/// Get line join style
FXJoinStyle getLineJoin() const { return join; }
/// Set line style
virtual void setLineStyle(FXLineStyle linestyle=LINE_SOLID);
/// Get line style
FXLineStyle getLineStyle() const { return style; }
/// Set fill style
virtual void setFillStyle(FXFillStyle fillstyle=FILL_SOLID);
/// Get fill style
FXFillStyle getFillStyle() const { return fill; }
/// Set fill rule
virtual void setFillRule(FXFillRule fillrule=RULE_EVEN_ODD);
/// Get fill rule
FXFillRule getFillRule() const { return rule; }
/// Set rasterop function
virtual void setFunction(FXFunction func=BLT_SRC);
/// Get rasterop function
FXFunction getFunction() const { return rop; }
/// Set the tile image
virtual void setTile(FXImage* image,FXint dx=0,FXint dy=0);
/// Get the tile image
FXImage *getTile() const { return tile; }
/// Set the stipple pattern
virtual void setStipple(FXBitmap *bitmap,FXint dx=0,FXint dy=0);
/// Get stipple bitmap
FXBitmap *getStippleBitmap() const { return stipple; }
/// Set the stipple pattern
virtual void setStipple(FXStipplePattern pat,FXint dx=0,FXint dy=0);
/// Get pattern
FXStipplePattern getStipplePattern() const { return pattern; }
/// Set clip region
virtual void setClipRegion(const FXRegion& region);
/// Set clip rectangle
virtual void setClipRectangle(FXint x,FXint y,FXint w,FXint h);
/// Change clip rectangle
virtual void setClipRectangle(const FXRectangle& rectangle);
/// Return clip rectangle
const FXRectangle& getClipRectangle() const { return clip; }
/// Return clip x
FXint getClipX() const { return clip.x; }
/// Return clip y
FXint getClipY() const { return clip.y; }
/// Return clip width
FXint getClipWidth() const { return clip.w; }
/// Return clip height
FXint getClipHeight() const { return clip.h; }
/// Clear clipping
virtual void clearClipRectangle();
/// Set clip mask
virtual void setClipMask(FXBitmap* bitmap,FXint dx=0,FXint dy=0);
/// Clear clip mask
virtual void clearClipMask();
/// Set font to draw text with
virtual void setFont(FXFont *fnt);
/// Get text font
FXFont* getFont() const { return font; }
/// Clip against child windows
virtual void clipChildren(FXbool yes);
/// Destructor
virtual ~FXDC();
};
}
#endif
fox-1.6.49/include/FXCP1254Codec.h 0000644 0001750 0001750 00000001106 11637250333 013137 0000000 0000000 #ifndef FXCP1254CODEC_H
#define FXCP1254CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// CP1254 Codec
class FXAPI FXCP1254Codec : public FXTextCodec {
FXDECLARE(FXCP1254Codec)
public:
FXCP1254Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FXCP1254Codec(){}
};
}
#endif
fox-1.6.49/include/FXDir.h 0000664 0001750 0001750 00000007630 12130340076 012104 0000000 0000000 /********************************************************************************
* *
* D i r e c t o r y E n u m e r a t o r *
* *
*********************************************************************************
* Copyright (C) 2005,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXDir.h,v 1.24 2006/01/22 17:58:00 fox Exp $ *
********************************************************************************/
#ifndef FXDIR_H
#define FXDIR_H
namespace FX {
/// Directory enumerator
class FXAPI FXDir {
private:
FXuval space[256];
private:
FXDir(const FXDir&);
FXDir &operator=(const FXDir&);
public:
/// Options for listing files
enum {
MatchAll = 0, /// Matching files and directories
NoFiles = 1, /// Don't list any files
NoDirs = 2, /// Don't list any directories
AllFiles = 4, /// List all files
AllDirs = 8, /// List all directories
HiddenFiles = 16, /// List hidden files also
HiddenDirs = 32, /// List hidden directories also
NoParent = 64, /// Don't include '..' in the listing
CaseFold = 128 /// Matching is case-insensitive
};
public:
/// Construct directory enumerator
FXDir();
/// Construct directory enumerator open on path
FXDir(const FXString& path);
/// Open directory to path, return true if ok.
virtual bool open(const FXString& path);
/// Returns true if the directory is open
virtual bool isOpen() const;
/// Go to next one
virtual bool next();
/// Return current file name
virtual FXString name() const;
/// Close directory
virtual void close();
/// Create directory
static bool create(const FXString& path,FXuint mode=FXIO::OwnerFull|FXIO::GroupFull|FXIO::OtherFull);
/// Remove directory
static bool remove(const FXString& path);
/// Rename or move srcpath to dstpath
static bool rename(const FXString& srcpath,const FXString& dstpath);
/**
* List files in a given directory.
* Returns the number of files in the string-array list which matched the
* pattern or satisfied the flag conditions.
*/
static FXint listFiles(FXString*& filelist,const FXString& path,const FXString& pattern="*",FXuint flags=FXDir::MatchAll);
/**
* List drives, i.e. roots of directory trees.
* Return the number of drives in the string array.
*/
static FXint listDrives(FXString*& drivelist);
/// Destructor
virtual ~FXDir();
};
}
#endif
fox-1.6.49/include/FXFileStream.h 0000664 0001750 0001750 00000014502 12130340076 013415 0000000 0000000 /********************************************************************************
* *
* F i l e S t r e a m C l a s s *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXFileStream.h,v 1.15 2006/01/22 17:58:01 fox Exp $ *
********************************************************************************/
#ifndef FXFILESTREAM_H
#define FXFILESTREAM_H
#ifndef FXSTREAM_H
#include "FXStream.h"
#endif
namespace FX {
/// File Store Definition
class FXAPI FXFileStream : public FXStream {
protected:
FXFile file;
protected:
virtual FXuval writeBuffer(FXuval count);
virtual FXuval readBuffer(FXuval count);
public:
/// Create file store
FXFileStream(const FXObject* cont=NULL);
/**
* Open binary data file stream; allocate a buffer of the given size
* for the file I/O; the buffer must be at least 16 bytes.
*/
bool open(const FXString& filename,FXStreamDirection save_or_load,FXuval size=8192);
/// Close file store
virtual bool close();
/// Get position
FXlong position() const { return FXStream::position(); }
/// Move to position
virtual bool position(FXlong offset,FXWhence whence=FXFromStart);
/// Save single items to stream
FXFileStream& operator<<(const FXuchar& v){ FXStream::operator<<(v); return *this; }
FXFileStream& operator<<(const FXchar& v){ FXStream::operator<<(v); return *this; }
FXFileStream& operator<<(const FXushort& v){ FXStream::operator<<(v); return *this; }
FXFileStream& operator<<(const FXshort& v){ FXStream::operator<<(v); return *this; }
FXFileStream& operator<<(const FXuint& v){ FXStream::operator<<(v); return *this; }
FXFileStream& operator<<(const FXint& v){ FXStream::operator<<(v); return *this; }
FXFileStream& operator<<(const FXfloat& v){ FXStream::operator<<(v); return *this; }
FXFileStream& operator<<(const FXdouble& v){ FXStream::operator<<(v); return *this; }
FXFileStream& operator<<(const FXlong& v){ FXStream::operator<<(v); return *this; }
FXFileStream& operator<<(const FXulong& v){ FXStream::operator<<(v); return *this; }
/// Save arrays of items to stream
FXFileStream& save(const FXuchar* p,FXuval n){ FXStream::save(p,n); return *this; }
FXFileStream& save(const FXchar* p,FXuval n){ FXStream::save(p,n); return *this; }
FXFileStream& save(const FXushort* p,FXuval n){ FXStream::save(p,n); return *this; }
FXFileStream& save(const FXshort* p,FXuval n){ FXStream::save(p,n); return *this; }
FXFileStream& save(const FXuint* p,FXuval n){ FXStream::save(p,n); return *this; }
FXFileStream& save(const FXint* p,FXuval n){ FXStream::save(p,n); return *this; }
FXFileStream& save(const FXfloat* p,FXuval n){ FXStream::save(p,n); return *this; }
FXFileStream& save(const FXdouble* p,FXuval n){ FXStream::save(p,n); return *this; }
FXFileStream& save(const FXlong* p,FXuval n){ FXStream::save(p,n); return *this; }
FXFileStream& save(const FXulong* p,FXuval n){ FXStream::save(p,n); return *this; }
/// Load single items from stream
FXFileStream& operator>>(FXuchar& v){ FXStream::operator>>(v); return *this; }
FXFileStream& operator>>(FXchar& v){ FXStream::operator>>(v); return *this; }
FXFileStream& operator>>(FXushort& v){ FXStream::operator>>(v); return *this; }
FXFileStream& operator>>(FXshort& v){ FXStream::operator>>(v); return *this; }
FXFileStream& operator>>(FXuint& v){ FXStream::operator>>(v); return *this; }
FXFileStream& operator>>(FXint& v){ FXStream::operator>>(v); return *this; }
FXFileStream& operator>>(FXfloat& v){ FXStream::operator>>(v); return *this; }
FXFileStream& operator>>(FXdouble& v){ FXStream::operator>>(v); return *this; }
FXFileStream& operator>>(FXlong& v){ FXStream::operator>>(v); return *this; }
FXFileStream& operator>>(FXulong& v){ FXStream::operator>>(v); return *this; }
/// Load arrays of items from stream
FXFileStream& load(FXuchar* p,FXuval n){ FXStream::load(p,n); return *this; }
FXFileStream& load(FXchar* p,FXuval n){ FXStream::load(p,n); return *this; }
FXFileStream& load(FXushort* p,FXuval n){ FXStream::load(p,n); return *this; }
FXFileStream& load(FXshort* p,FXuval n){ FXStream::load(p,n); return *this; }
FXFileStream& load(FXuint* p,FXuval n){ FXStream::load(p,n); return *this; }
FXFileStream& load(FXint* p,FXuval n){ FXStream::load(p,n); return *this; }
FXFileStream& load(FXfloat* p,FXuval n){ FXStream::load(p,n); return *this; }
FXFileStream& load(FXdouble* p,FXuval n){ FXStream::load(p,n); return *this; }
FXFileStream& load(FXlong* p,FXuval n){ FXStream::load(p,n); return *this; }
FXFileStream& load(FXulong* p,FXuval n){ FXStream::load(p,n); return *this; }
/// Save object
FXFileStream& saveObject(const FXObject* v){ FXStream::saveObject(v); return *this; }
/// Load object
FXFileStream& loadObject(FXObject*& v){ FXStream::loadObject(v); return *this; }
/// Destructor
virtual ~FXFileStream();
};
}
#endif
fox-1.6.49/include/FXVec2f.h 0000664 0001750 0001750 00000017143 12130340076 012333 0000000 0000000 /********************************************************************************
* *
* S i n g l e - P r e c i s i o n 2 - E l e m e n t V e c t o r *
* *
*********************************************************************************
* Copyright (C) 1994,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXVec2f.h,v 1.21 2006/01/22 17:58:12 fox Exp $ *
********************************************************************************/
#ifndef FXVEC2F_H
#define FXVEC2F_H
namespace FX {
class FXMat3f;
/// Single-precision 2-element vector
class FXAPI FXVec2f {
public:
FXfloat x;
FXfloat y;
public:
/// Default constructor
FXVec2f(){}
/// Initialize from another vector
FXVec2f(const FXVec2f& v){x=v.x;y=v.y;}
/// Initialize from array of floats
FXVec2f(const FXfloat v[]){x=v[0];y=v[1];}
/// Initialize from components
FXVec2f(FXfloat xx,FXfloat yy){x=xx;y=yy;}
/// Return a non-const reference to the ith element
FXfloat& operator[](FXint i){return (&x)[i];}
/// Return a const reference to the ith element
const FXfloat& operator[](FXint i) const {return (&x)[i];}
/// Assignment
FXVec2f& operator=(const FXVec2f& v){x=v.x;y=v.y;return *this;}
/// Assignment from array of floats
FXVec2f& operator=(const FXfloat v[]){x=v[0];y=v[1];return *this;}
/// Set value from another vector
FXVec2f& set(const FXVec2f& v){x=v.x;y=v.y;return *this;}
/// Set value from array of floats
FXVec2f& set(const FXfloat v[]){x=v[0];y=v[1];return *this;}
/// Set value from components
FXVec2f& set(FXfloat xx,FXfloat yy){x=xx;y=yy;return *this;}
/// Assigning operators
FXVec2f& operator*=(FXfloat n){x*=n;y*=n;return *this;}
FXVec2f& operator/=(FXfloat n){x/=n;y/=n;return *this;}
FXVec2f& operator+=(const FXVec2f& v){x+=v.x;y+=v.y;return *this;}
FXVec2f& operator-=(const FXVec2f& v){x-=v.x;y-=v.y;return *this;}
/// Conversions
operator FXfloat*(){return &x;}
operator const FXfloat*() const {return &x;}
/// Unary
FXVec2f operator+() const { return *this; }
FXVec2f operator-() const { return FXVec2f(-x,-y); }
/// Vector and vector
FXVec2f operator+(const FXVec2f& v) const { return FXVec2f(x+v.x,y+v.y); }
FXVec2f operator-(const FXVec2f& v) const { return FXVec2f(x-v.x,y-v.y); }
/// Vector and matrix
FXVec2f operator*(const FXMat3f& m) const;
/// Scaling
friend inline FXVec2f operator*(const FXVec2f& a,FXfloat n);
friend inline FXVec2f operator*(FXfloat n,const FXVec2f& a);
friend inline FXVec2f operator/(const FXVec2f& a,FXfloat n);
friend inline FXVec2f operator/(FXfloat n,const FXVec2f& a);
/// Dot product
FXfloat operator*(const FXVec2f& v) const { return x*v.x+y*v.y; }
/// Test if zero
bool operator!() const { return x==0.0f && y==0.0f; }
/// Equality tests
bool operator==(const FXVec2f& v) const { return x==v.x && y==v.y; }
bool operator!=(const FXVec2f& v) const { return x!=v.x || y!=v.y; }
friend inline bool operator==(const FXVec2f& a,FXfloat n);
friend inline bool operator!=(const FXVec2f& a,FXfloat n);
friend inline bool operator==(FXfloat n,const FXVec2f& a);
friend inline bool operator!=(FXfloat n,const FXVec2f& a);
/// Inequality tests
bool operator<(const FXVec2f& v) const { return x(const FXVec2f& v) const { return x>v.x && y>v.y; }
bool operator>=(const FXVec2f& v) const { return x>=v.x && y>=v.y; }
friend inline bool operator<(const FXVec2f& a,FXfloat n);
friend inline bool operator<=(const FXVec2f& a,FXfloat n);
friend inline bool operator>(const FXVec2f& a,FXfloat n);
friend inline bool operator>=(const FXVec2f& a,FXfloat n);
friend inline bool operator<(FXfloat n,const FXVec2f& a);
friend inline bool operator<=(FXfloat n,const FXVec2f& a);
friend inline bool operator>(FXfloat n,const FXVec2f& a);
friend inline bool operator>=(FXfloat n,const FXVec2f& a);
/// Length and square of length
FXfloat length2() const { return x*x+y*y; }
FXfloat length() const { return sqrtf(length2()); }
/// Clamp values of vector between limits
FXVec2f& clamp(FXfloat lo,FXfloat hi){x=FXCLAMP(lo,x,hi);y=FXCLAMP(lo,y,hi);return *this;}
/// Lowest or highest components
friend inline FXVec2f lo(const FXVec2f& a,const FXVec2f& b);
friend inline FXVec2f hi(const FXVec2f& a,const FXVec2f& b);
/// Normalize vector
friend FXAPI FXVec2f normalize(const FXVec2f& v);
/// Save vector to a stream
friend FXAPI FXStream& operator<<(FXStream& store,const FXVec2f& v);
/// Load vector from a stream
friend FXAPI FXStream& operator>>(FXStream& store,FXVec2f& v);
};
inline FXVec2f operator*(const FXVec2f& a,FXfloat n){return FXVec2f(a.x*n,a.y*n);}
inline FXVec2f operator*(FXfloat n,const FXVec2f& a){return FXVec2f(n*a.x,n*a.y);}
inline FXVec2f operator/(const FXVec2f& a,FXfloat n){return FXVec2f(a.x/n,a.y/n);}
inline FXVec2f operator/(FXfloat n,const FXVec2f& a){return FXVec2f(n/a.x,n/a.y);}
inline bool operator==(const FXVec2f& a,FXfloat n){return a.x==n && a.y==n;}
inline bool operator!=(const FXVec2f& a,FXfloat n){return a.x!=n || a.y!=n;}
inline bool operator==(FXfloat n,const FXVec2f& a){return n==a.x && n==a.y;}
inline bool operator!=(FXfloat n,const FXVec2f& a){return n!=a.x || n!=a.y;}
inline bool operator<(const FXVec2f& a,FXfloat n){return a.x(const FXVec2f& a,FXfloat n){return a.x>n && a.y>n;}
inline bool operator>=(const FXVec2f& a,FXfloat n){return a.x>=n && a.y>=n;}
inline bool operator<(FXfloat n,const FXVec2f& a){return n(FXfloat n,const FXVec2f& a){return n>a.x && n>a.y;}
inline bool operator>=(FXfloat n,const FXVec2f& a){return n>=a.x && n>=a.y;}
inline FXVec2f lo(const FXVec2f& a,const FXVec2f& b){return FXVec2f(FXMIN(a.x,b.x),FXMIN(a.y,b.y));}
inline FXVec2f hi(const FXVec2f& a,const FXVec2f& b){return FXVec2f(FXMAX(a.x,b.x),FXMAX(a.y,b.y));}
extern FXAPI FXVec2f normalize(const FXVec2f& v);
extern FXAPI FXStream& operator<<(FXStream& store,const FXVec2f& v);
extern FXAPI FXStream& operator>>(FXStream& store,FXVec2f& v);
}
#endif
fox-1.6.49/include/FXHeader.h 0000664 0001750 0001750 00000033674 12130340076 012565 0000000 0000000 /********************************************************************************
* *
* H e a d e r W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXHeader.h,v 1.70.2.2 2006/11/17 16:02:31 fox Exp $ *
********************************************************************************/
#ifndef FXHEADER_H
#define FXHEADER_H
#ifndef FXFRAME_H
#include "FXFrame.h"
#endif
namespace FX {
class FXIcon;
class FXFont;
class FXHeader;
/// Header style options
enum {
HEADER_BUTTON = 0x00008000, /// Button style can be clicked
HEADER_HORIZONTAL = 0, /// Horizontal header control (default)
HEADER_VERTICAL = 0x00010000, /// Vertical header control
HEADER_TRACKING = 0x00020000, /// Tracks continuously while moving
HEADER_RESIZE = 0x00040000, /// Allow resizing sections
HEADER_NORMAL = HEADER_HORIZONTAL|FRAME_NORMAL
};
/// Header item
class FXAPI FXHeaderItem : public FXObject {
FXDECLARE(FXHeaderItem)
friend class FXHeader;
protected:
FXString label; // Text of item
FXIcon *icon; // Icon of item
void *data; // Item user data pointer
FXint size; // Item size
FXint pos; // Item position
FXuint state; // Item state flags
private:
FXHeaderItem(const FXHeaderItem&);
FXHeaderItem& operator=(const FXHeaderItem&);
protected:
FXHeaderItem(){}
virtual void draw(const FXHeader* header,FXDC& dc,FXint x,FXint y,FXint w,FXint h);
public:
enum{
ARROW_NONE = 0, /// No arrow
ARROW_UP = 1, /// Arrow pointing up
ARROW_DOWN = 2, /// Arrow pointing down
PRESSED = 4, /// Pressed down
RIGHT = 8, /// Align on right
LEFT = 16, /// Align on left
CENTER_X = 0, /// Aling centered horizontally (default)
TOP = 32, /// Align on top
BOTTOM = 64, /// Align on bottom
CENTER_Y = 0, /// Aling centered vertically (default)
BEFORE = 128, /// Icon before the text
AFTER = 256, /// Icon after the text
ABOVE = 512, /// Icon above the text
BELOW = 1024 /// Icon below the text
};
public:
/// Construct new item with given text, icon, size, and user-data
FXHeaderItem(const FXString& text,FXIcon* ic=NULL,FXint s=0,void* ptr=NULL):label(text),icon(ic),data(ptr),size(s),pos(0),state(LEFT|BEFORE){}
/// Change item's text label
virtual void setText(const FXString& txt);
/// Return item's text label
const FXString& getText() const { return label; }
/// Change item's icon
virtual void setIcon(FXIcon* icn);
/// Return item's icon
FXIcon* getIcon() const { return icon; }
/// Change item's user data
void setData(void* ptr){ data=ptr; }
/// Get item's user data
void* getData() const { return data; }
/// Change size
void setSize(FXint s){ size=s; }
/// Obtain current size
FXint getSize() const { return size; }
/// Change position
void setPos(FXint p){ pos=p; }
/// Obtain current position
FXint getPos() const { return pos; }
/// Change sort direction (FALSE, TRUE, MAYBE)
void setArrowDir(FXbool dir=MAYBE);
/// Return sort direction (FALSE, TRUE, MAYBE)
FXbool getArrowDir() const;
/// Change content justification
void setJustify(FXuint justify=LEFT|CENTER_Y);
/// Return content justification
FXuint getJustify() const { return state&(RIGHT|LEFT|TOP|BOTTOM); }
/// Change icon position
void setIconPosition(FXuint mode=BEFORE);
/// Return icon position
FXuint getIconPosition() const { return state&(BEFORE|AFTER|ABOVE|BELOW); }
/// Change state to pressed
void setPressed(FXbool pressed);
/// Return pressed state
FXbool isPressed() const { return (state&PRESSED)!=0; }
/// Return the item's content width in the header
virtual FXint getWidth(const FXHeader* header) const;
/// Return the item's content height in the header
virtual FXint getHeight(const FXHeader* header) const;
/// Create server-side resources
virtual void create();
/// Detach from server-side resources
virtual void detach();
/// Destroy server-side resources
virtual void destroy();
/// Stream serialization
virtual void save(FXStream& store) const;
virtual void load(FXStream& store);
/// Destructor
virtual ~FXHeaderItem(){}
};
/// List of FXHeaderItem's
typedef FXObjectListOf FXHeaderItemList;
/**
* Header control may be placed over a table or list to provide a resizable
* captions above a number of columns.
* Each caption comprises a label and an optional icon; in addition, an arrow
* may be shown to indicate whether the items in that column are sorted, and
* if so, whether they are sorted in increasing or decreasing order.
* Each caption can be interactively resized. During the resizing, if the
* HEADER_TRACKING was specified, the header control sends a SEL_CHANGED message
* to its target, with the message data set to the caption number being resized,
* of the type FXint.
* If the HEADER_TRACKING was not specified the SEL_CHANGED message is sent at
* the end of the resizing operation.
* Clicking on a caption causes a message of type SEL_COMMAND to be sent to the
* target, with the message data set to the caption number being clicked.
* A single click on a split causes a message of type SEL_CLICKED to be sent to the
* target; a typical response to this message would be to adjust the size of
* the split to fit the contents displayed underneath it.
* The contents may be scrolled by calling setPosition().
*/
class FXAPI FXHeader : public FXFrame {
FXDECLARE(FXHeader)
protected:
FXHeaderItemList items; // Item list
FXColor textColor; // Text color
FXFont *font; // Text font
FXString help; // Help text
FXint pos; // Scroll position
FXint active; // Active button
FXint activepos; // Position of active item
FXint activesize; // Size of active item
FXint offset; // Offset where split grabbed
protected:
FXHeader();
void drawSplit(FXint pos);
virtual FXHeaderItem *createItem(const FXString& text,FXIcon* icon,FXint size,void* ptr);
private:
FXHeader(const FXHeader&);
FXHeader &operator=(const FXHeader&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onUngrabbed(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onTipTimer(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
public:
/// Construct new header control
FXHeader(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=HEADER_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Perform layout
virtual void layout();
/// Return number of items
FXint getNumItems() const { return items.no(); }
/// Return total size of all items
FXint getTotalSize() const;
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Set the current position
void setPosition(FXint pos);
/// Return the current position
FXint getPosition() const { return pos; }
/**
* Return item-index given coordinate offset, or -1 if coordinate
* is before first item in header, or nitems if coordinate is after
* last item in header.
*/
FXint getItemAt(FXint coord) const;
/// Return item at given index
FXHeaderItem *getItem(FXint index) const;
/// Replace the item with a [possibly subclassed] item
FXint setItem(FXint index,FXHeaderItem* item,FXbool notify=FALSE);
/// Replace items text, icon, and user-data pointer
FXint setItem(FXint index,const FXString& text,FXIcon *icon=NULL,FXint size=0,void* ptr=NULL,FXbool notify=FALSE);
/// Fill header by appending items from array of strings
FXint fillItems(const FXchar** strings,FXIcon *icon=NULL,FXint size=0,void* ptr=NULL,FXbool notify=FALSE);
/// Fill header by appending items from newline separated strings
FXint fillItems(const FXString& strings,FXIcon *icon=NULL,FXint size=0,void* ptr=NULL,FXbool notify=FALSE);
/// Insert a new [possibly subclassed] item at the give index
FXint insertItem(FXint index,FXHeaderItem* item,FXbool notify=FALSE);
/// Insert item at index with given text, icon, and user-data pointer
FXint insertItem(FXint index,const FXString& text,FXIcon *icon=NULL,FXint size=0,void* ptr=NULL,FXbool notify=FALSE);
/// Append a [possibly subclassed] item to the list
FXint appendItem(FXHeaderItem* item,FXbool notify=FALSE);
/// Append new item with given text and optional icon, and user-data pointer
FXint appendItem(const FXString& text,FXIcon *icon=NULL,FXint size=0,void* ptr=NULL,FXbool notify=FALSE);
/// Prepend a [possibly subclassed] item to the list
FXint prependItem(FXHeaderItem* item,FXbool notify=FALSE);
/// Prepend new item with given text and optional icon, and user-data pointer
FXint prependItem(const FXString& text,FXIcon *icon=NULL,FXint size=0,void* ptr=NULL,FXbool notify=FALSE);
/// Extract item from list
FXHeaderItem* extractItem(FXint index,FXbool notify=FALSE);
/// Remove item at index
void removeItem(FXint index,FXbool notify=FALSE);
/// Remove all items
void clearItems(FXbool notify=FALSE);
/// Change text label for item at index
void setItemText(FXint index,const FXString& text);
/// Get text of item at index
FXString getItemText(FXint index) const;
/// Change icon of item at index
void setItemIcon(FXint index,FXIcon* icon);
/// Return icon of item at index
FXIcon* getItemIcon(FXint index) const;
/// Change size of item at index
void setItemSize(FXint index,FXint size);
/// Return size of item at index
FXint getItemSize(FXint index) const;
/// Compute offset from the left side of item at index
FXint getItemOffset(FXint index) const;
/// Change data of item at index
void setItemData(FXint index,void* ptr);
/// Return data of item at index
void* getItemData(FXint index) const;
/// Change sort direction (FALSE, TRUE, MAYBE)
void setArrowDir(FXint index,FXbool dir=MAYBE);
/// Return sort direction (FALSE, TRUE, MAYBE)
FXbool getArrowDir(FXint index) const;
/**
* Change item justification. Horizontal justification is controlled by passing
* FXHeaderItem::RIGHT, FXHeaderItem::LEFT, or FXHeaderItem::CENTER_X.
* Vertical justification is controlled by FXHeaderItem::TOP, FXHeaderItem::BOTTOM,
* or FXHeaderItem::CENTER_Y.
* The default is a combination of FXHeaderItem::LEFT and FXHeaderItem::CENTER_Y.
*/
void setItemJustify(FXint index,FXuint justify);
/// Return item justification
FXuint getItemJustify(FXint index) const;
/**
* Change relative position of icon and text of item.
* Passing FXHeaderItem::BEFORE or FXHeaderItem::AFTER places the icon
* before or after the text, and passing FXHeaderItem::ABOVE or
* FXHeaderItem::BELOW places it above or below the text, respectively.
* The default of FXHeaderItem::BEFORE places the icon in front of the text.
*/
void setItemIconPosition(FXint index,FXuint mode);
/// Return relative icon and text position
FXuint getItemIconPosition(FXint index) const;
/// Changed button item's pressed state
void setItemPressed(FXint index,FXbool pressed=TRUE);
/// Return TRUE if button item is pressed in
FXbool isItemPressed(FXint index) const;
/// Scroll to make given item visible
void makeItemVisible(FXint index);
/// Repaint header at index
void updateItem(FXint index) const;
/// Change text font
void setFont(FXFont* fnt);
/// return text font
FXFont* getFont() const { return font; }
/// Return text color
FXColor getTextColor() const { return textColor; }
/// Change text color
void setTextColor(FXColor clr);
/// Set header style options
void setHeaderStyle(FXuint style);
/// Get header style options
FXuint getHeaderStyle() const;
/// Set the status line help text for this header
void setHelpText(const FXString& text);
/// Get the status line help text for this header
const FXString& getHelpText() const { return help; }
/// Save header to a stream
virtual void save(FXStream& store) const;
/// Load header from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXHeader();
};
}
#endif
fox-1.6.49/include/FXCP863Codec.h 0000644 0001750 0001750 00000001077 11637250333 013073 0000000 0000000 #ifndef FXCP863CODEC_H
#define FXCP863CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// CP863 Codec
class FXAPI FXCP863Codec : public FXTextCodec {
FXDECLARE(FXCP863Codec)
public:
FXCP863Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FXCP863Codec(){}
};
}
#endif
fox-1.6.49/include/FXStream.h 0000664 0001750 0001750 00000024403 12130340076 012616 0000000 0000000 /********************************************************************************
* *
* P e r s i s t e n t S t o r a g e S t r e a m C l a s s e s *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXStream.h,v 1.42 2006/01/22 17:58:10 fox Exp $ *
********************************************************************************/
#ifndef FXSTREAM_H
#define FXSTREAM_H
namespace FX {
/// Stream data flow direction
enum FXStreamDirection {
FXStreamDead=0, /// Unopened stream
FXStreamSave=1, /// Saving stuff to stream
FXStreamLoad=2 /// Loading stuff from stream
};
/// Stream status codes
enum FXStreamStatus {
FXStreamOK=0, /// OK
FXStreamEnd=1, /// Try read past end of stream
FXStreamFull=2, /// Filled up stream buffer or disk full
FXStreamNoWrite=3, /// Unable to open for write
FXStreamNoRead=4, /// Unable to open for read
FXStreamFormat=5, /// Stream format error
FXStreamUnknown=6, /// Trying to read unknown class
FXStreamAlloc=7, /// Alloc failed
FXStreamFailure=8 /// General failure
};
/// Stream seeking
enum FXWhence {
FXFromStart=0, /// Seek from start position
FXFromCurrent=1, /// Seek from current position
FXFromEnd=2 /// Seek from end position
};
/**
* A stream is a way to serialize data and objects into a byte stream.
* Each item of data that is saved or loaded from the stream may be byte-swapped,
* thus allowing little-endian machines to read data produced on big endian ones
* and vice-versa.
* Data is serialized exactly as-is. There are no tags or other markers
* inserted into the stream; thus, the stream may be used to save or load arbitrary
* binary data.
* Objects derived from FXObjects may be serialized also; whenever a reference to an
* object is serialized, a table is consulted to determine if the same object has
* been encountered previously; if not, the object is added to the table and then
* its contents are serialized. If the object has been encountered before, only a
* reference to the object is serialized.
* When loading back a serialized object, new instances are constructed using
* the default constructor, and subsequently the object's contents are loaded.
* A special container object may be passed in which is placed in the table
* as if it had been encountered before; this will cause only references to this
* object to be saved. The container object is typically the top-level document
* object which manages all objects contained by it. Additional objects may be
* added using addObject(); these will not be actually saved or loaded.
*/
class FXAPI FXStream {
protected:
FXHash hash; // Hash table
const FXObject *parent; // Parent object
FXuchar *begptr; // Begin of buffer
FXuchar *endptr; // End of buffer
FXuchar *wrptr; // Write pointer
FXuchar *rdptr; // Read pointer
FXlong pos; // Position
FXStreamDirection dir; // Direction of current transfer
FXStreamStatus code; // Status code
FXuint seq; // Sequence number
bool owns; // Stream owns buffer
bool swap; // Swap bytes on readin
protected:
/**
* Write at least count bytes from the buffer;
* returns number of bytes available to be written.
*/
virtual FXuval writeBuffer(FXuval count);
/**
* Read at least count bytes into the buffer;
* returns number of bytes available to be read.
*/
virtual FXuval readBuffer(FXuval count);
public:
/**
* Construct stream with given container object. The container object
* is an object that will itself not be saved to or loaded from the stream,
* but which may be referenced by other objects. These references will be
* properly saved and restored.
*/
FXStream(const FXObject* cont=NULL);
/**
* Open stream for reading (FXStreamLoad) or for writing (FXStreamSave).
* An initial buffer size may be given, which must be at least 16 bytes.
* If data is not NULL, it is expected to point to an external data buffer
* of length size; otherwise stream will use an internally managed buffer.
*/
bool open(FXStreamDirection save_or_load,FXuval size=8192,FXuchar* data=NULL);
/// Flush buffer
virtual bool flush();
/// Close; return true if OK
virtual bool close();
/// Get available buffer space
FXuval getSpace() const;
/// Set available buffer space
void setSpace(FXuval sp);
/// Get status code
FXStreamStatus status() const { return code; }
/// Return true if at end of file or error
bool eof() const { return code!=FXStreamOK; }
/// Set status code
void setError(FXStreamStatus err);
/// Obtain stream direction
FXStreamDirection direction() const { return dir; }
/// Get parent object
const FXObject* container() const { return parent; }
/// Get position
FXlong position() const { return pos; }
/// Move to position relative to head, tail, or current location
virtual bool position(FXlong offset,FXWhence whence=FXFromStart);
/**
* Change swap bytes flag.
*/
void swapBytes(bool s){ swap=s; }
/**
* Get state of the swap bytes flag.
*/
bool swapBytes() const { return swap; }
/**
* Set stream to big endian mode if true. Byte swapping will
* be enabled if the machine native byte order is not equal to
* the desired byte order.
*/
void setBigEndian(bool big);
/**
* Return true if big endian mode.
*/
bool isBigEndian() const;
/// Save single items to stream
FXStream& operator<<(const FXuchar& v);
FXStream& operator<<(const FXchar& v){ return *this << reinterpret_cast(v); }
FXStream& operator<<(const FXushort& v);
FXStream& operator<<(const FXshort& v){ return *this << reinterpret_cast(v); }
FXStream& operator<<(const FXuint& v);
FXStream& operator<<(const FXint& v){ return *this << reinterpret_cast(v); }
FXStream& operator<<(const FXfloat& v){ return *this << reinterpret_cast(v); }
FXStream& operator<<(const FXdouble& v);
FXStream& operator<<(const FXlong& v){ return *this << reinterpret_cast(v); }
FXStream& operator<<(const FXulong& v){ return *this << reinterpret_cast(v); }
/// Save arrays of items to stream
FXStream& save(const FXuchar* p,FXuval n);
FXStream& save(const FXchar* p,FXuval n){ return save(reinterpret_cast(p),n); }
FXStream& save(const FXushort* p,FXuval n);
FXStream& save(const FXshort* p,FXuval n){ return save(reinterpret_cast(p),n); }
FXStream& save(const FXuint* p,FXuval n);
FXStream& save(const FXint* p,FXuval n){ return save(reinterpret_cast(p),n); }
FXStream& save(const FXfloat* p,FXuval n){ return save(reinterpret_cast(p),n); }
FXStream& save(const FXdouble* p,FXuval n);
FXStream& save(const FXlong* p,FXuval n){ return save(reinterpret_cast(p),n); }
FXStream& save(const FXulong* p,FXuval n){ return save(reinterpret_cast(p),n); }
/// Load single items from stream
FXStream& operator>>(FXuchar& v);
FXStream& operator>>(FXchar& v){ return *this >> reinterpret_cast(v); }
FXStream& operator>>(FXushort& v);
FXStream& operator>>(FXshort& v){ return *this >> reinterpret_cast(v); }
FXStream& operator>>(FXuint& v);
FXStream& operator>>(FXint& v){ return *this >> reinterpret_cast(v); }
FXStream& operator>>(FXfloat& v){ return *this >> reinterpret_cast(v); }
FXStream& operator>>(FXdouble& v);
FXStream& operator>>(FXlong& v){ return *this >> reinterpret_cast(v); }
FXStream& operator>>(FXulong& v){ return *this >> reinterpret_cast(v); }
/// Load arrays of items from stream
FXStream& load(FXuchar* p,FXuval n);
FXStream& load(FXchar* p,FXuval n){ return load(reinterpret_cast(p),n); }
FXStream& load(FXushort* p,FXuval n);
FXStream& load(FXshort* p,FXuval n){ return load(reinterpret_cast(p),n); }
FXStream& load(FXuint* p,FXuval n);
FXStream& load(FXint* p,FXuval n){ return load(reinterpret_cast(p),n); }
FXStream& load(FXfloat* p,FXuval n){ return load(reinterpret_cast(p),n); }
FXStream& load(FXdouble* p,FXuval n);
FXStream& load(FXlong* p,FXuval n){ return load(reinterpret_cast(p),n); }
FXStream& load(FXulong* p,FXuval n){ return load(reinterpret_cast(p),n); }
/// Save object
FXStream& saveObject(const FXObject* v);
/// Load object
FXStream& loadObject(FXObject*& v);
/// Add object without saving or loading
FXStream& addObject(const FXObject* v);
/// Destructor
virtual ~FXStream();
};
}
#endif
fox-1.6.49/include/FXImageFrame.h 0000664 0001750 0001750 00000006473 12130340076 013367 0000000 0000000 /********************************************************************************
* *
* I m a g e F r a m e W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2001,2006 by H. J. Daniel III. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXImageFrame.h,v 1.8 2006/01/22 17:58:05 fox Exp $ *
********************************************************************************/
#ifndef FXIMAGEFRAME_H
#define FXIMAGEFRAME_H
#ifndef FXFRAME_H
#include "FXFrame.h"
#endif
namespace FX {
/**
* The image frame is a simple frame widget displaying
* an image; the image is not owned by the image frame so
* it must be explicitly deleted elsewhere.
*/
class FXAPI FXImageFrame : public FXFrame {
FXDECLARE(FXImageFrame)
protected:
FXImage* image; // The image being displayed
protected:
FXImageFrame();
private:
FXImageFrame(const FXImageFrame&);
FXImageFrame &operator=(const FXImageFrame&);
public:
long onPaint(FXObject*,FXSelector,void* ptr);
public:
/// Construct image frame and pass it an image
FXImageFrame(FXComposite* p,FXImage *img,FXuint opts=FRAME_SUNKEN|FRAME_THICK,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=0,FXint pr=0,FXint pt=0,FXint pb=0);
/// Create window
virtual void create();
/// Get default width
virtual FXint getDefaultWidth();
/// Get default height
virtual FXint getDefaultHeight();
/// Change the image being displayed
void setImage(FXImage* img);
/// Return the current image
FXImage* getImage() const { return image; }
/// Set the current justification mode.
void setJustify(FXuint mode);
/// Get the current justification mode.
FXuint getJustify() const;
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
/// Destroy the widget, but do not destroy the image
virtual ~FXImageFrame();
};
}
#endif
fox-1.6.49/include/FXRGBIcon.h 0000664 0001750 0001750 00000006222 12130340076 012605 0000000 0000000 /********************************************************************************
* *
* I R I S R G B I c o n O b j e c t *
* *
*********************************************************************************
* Copyright (C) 2002,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXRGBIcon.h,v 1.14 2006/01/22 17:58:07 fox Exp $ *
********************************************************************************/
#ifndef FXRGBICON_H
#define FXRGBICON_H
#ifndef FXICON_H
#include "FXIcon.h"
#endif
namespace FX {
/// IRIS RGB icon
class FXAPI FXRGBIcon : public FXIcon {
FXDECLARE(FXRGBIcon)
protected:
FXRGBIcon(){}
private:
FXRGBIcon(const FXRGBIcon&);
FXRGBIcon &operator=(const FXRGBIcon&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct icon from memory stream formatted in IRIS-RGB format
FXRGBIcon(FXApp* a,const void *pix=NULL,FXColor clr=FXRGB(192,192,192),FXuint opts=0,FXint w=1,FXint h=1);
/// Save pixels into stream in IRIS-RGB format
virtual bool savePixels(FXStream& store) const;
/// Load pixels from stream in IRIS-RGB format
virtual bool loadPixels(FXStream& store);
/// Destroy icon
virtual ~FXRGBIcon();
};
/**
* Check if stream contains a RGB, return TRUE if so.
*/
extern FXAPI bool fxcheckRGB(FXStream& store);
/**
* Load an RGB (SGI IRIS RGB) file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadRGB(FXStream& store,FXColor*& data,FXint& width,FXint& height);
/**
* Save an RGB (SGI IRIS RGB) file to a stream.
*/
extern FXAPI bool fxsaveRGB(FXStream& store,const FXColor *data,FXint width,FXint height);
}
#endif
fox-1.6.49/include/FXMat3f.h 0000664 0001750 0001750 00000012173 12130340076 012336 0000000 0000000 /********************************************************************************
* *
* S i n g l e - P r e c i s i o n 3 x 3 M a t r i x *
* *
*********************************************************************************
* Copyright (C) 2003,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXMat3f.h,v 1.13 2006/01/22 17:58:05 fox Exp $ *
********************************************************************************/
#ifndef FXMAT3F_H
#define FXMAT3F_H
namespace FX {
class FXQuatf;
/// Single-precision 3x3 matrix
class FXAPI FXMat3f {
protected:
FXVec3f m[3];
public:
/// Default constructor
FXMat3f(){}
/// Initialize matrix from another matrix
FXMat3f(const FXMat3f& other);
/// Initialize matrix from scalar
FXMat3f(FXfloat w);
/// Initialize matrix from components
FXMat3f(FXfloat a00,FXfloat a01,FXfloat a02,
FXfloat a10,FXfloat a11,FXfloat a12,
FXfloat a20,FXfloat a21,FXfloat a22);
/// Initialize matrix from three vectors
FXMat3f(const FXVec3f& a,const FXVec3f& b,const FXVec3f& c);
/// Initialize matrix from quaternion
FXMat3f(const FXQuatf& quat);
/// Assignment
FXMat3f& operator=(const FXMat3f& other);
FXMat3f& operator=(FXfloat w);
/// Set value from another matrix
FXMat3f& set(const FXMat3f& other);
/// Set value from scalar
FXMat3f& set(FXfloat w);
/// Set value from components
FXMat3f& set(FXfloat a00,FXfloat a01,FXfloat a02,
FXfloat a10,FXfloat a11,FXfloat a12,
FXfloat a20,FXfloat a21,FXfloat a22);
/// Set value from three vectors
FXMat3f& set(const FXVec3f& a,const FXVec3f& b,const FXVec3f& c);
/// Set value from quaternion
FXMat3f& set(const FXQuatf& quat);
/// Assignment operators
FXMat3f& operator+=(const FXMat3f& w);
FXMat3f& operator-=(const FXMat3f& w);
FXMat3f& operator*=(FXfloat w);
FXMat3f& operator*=(const FXMat3f& w);
FXMat3f& operator/=(FXfloat w);
/// Indexing
FXVec3f& operator[](FXint i){return m[i];}
const FXVec3f& operator[](FXint i) const {return m[i];}
/// Conversion
operator FXfloat*(){return m[0];}
operator const FXfloat*() const {return m[0];}
/// Unary minus
FXMat3f operator-() const;
/// Matrix and matrix
FXMat3f operator+(const FXMat3f& w) const;
FXMat3f operator-(const FXMat3f& w) const;
FXMat3f operator*(const FXMat3f& w) const;
/// Multiply matrix and vector
FXVec3f operator*(const FXVec3f& v) const;
FXVec2f operator*(const FXVec2f& v) const;
/// Matrix and scalar
friend FXAPI FXMat3f operator*(FXfloat x,const FXMat3f& a);
friend FXAPI FXMat3f operator*(const FXMat3f& a,FXfloat x);
friend FXAPI FXMat3f operator/(const FXMat3f& a,FXfloat x);
friend FXAPI FXMat3f operator/(FXfloat x,const FXMat3f& a);
/// Set identity matrix
FXMat3f& eye();
/// Multiply by rotation of phi
FXMat3f& rot(FXfloat c,FXfloat s);
FXMat3f& rot(FXfloat phi);
/// Multiply by translation
FXMat3f& trans(FXfloat tx,FXfloat ty);
/// Multiply by scaling
FXMat3f& scale(FXfloat sx,FXfloat sy);
FXMat3f& scale(FXfloat s);
/// Determinant
FXfloat det() const;
/// Transpose
FXMat3f transpose() const;
/// Invert
FXMat3f invert() const;
/// Save to a stream
friend FXAPI FXStream& operator<<(FXStream& store,const FXMat3f& m);
/// Load from a stream
friend FXAPI FXStream& operator>>(FXStream& store,FXMat3f& m);
};
extern FXAPI FXMat3f operator*(FXfloat x,const FXMat3f& a);
extern FXAPI FXMat3f operator*(const FXMat3f& a,FXfloat x);
extern FXAPI FXMat3f operator/(const FXMat3f& a,FXfloat x);
extern FXAPI FXMat3f operator/(FXfloat x,const FXMat3f& a);
extern FXAPI FXStream& operator<<(FXStream& store,const FXMat3f& m);
extern FXAPI FXStream& operator>>(FXStream& store,FXMat3f& m);
}
#endif
fox-1.6.49/include/FXRulerView.h 0000664 0001750 0001750 00000021031 12130340076 013301 0000000 0000000 /********************************************************************************
* *
* R u l e r V i e w W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2005,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXRulerView.h,v 1.15 2006/01/28 20:29:30 fox Exp $ *
********************************************************************************/
#ifndef FXRULERVIEW_H
#define FXRULERVIEW_H
#ifndef FXSCROLLAREA_H
#include "FXScrollArea.h"
#endif
namespace FX {
class FXRuler;
class FXFrame;
/**
* The Ruler View provides viewing of a document with rulers.
* It is intended to be subclassed in order to draw actual contents
* and provide editing behavior for the document.
* The ruler view itself simply manages the geometry of the document
* being edited, and coordinates the movement of the ruler displays
* as the document is being scrolled.
*/
class FXRulerView : public FXScrollArea {
FXDECLARE(FXRulerView)
protected:
FXRuler *hruler; // Horizontal ruler
FXRuler *vruler; // Vertical ruler
FXFrame *filler; // Corner thingy
FXColor docColor; // Color of document
FXString tip; // Tooltip text
FXString help; // Help text
protected:
FXRulerView();
virtual void moveContents(FXint x,FXint y);
virtual void drawBackground(FXDCWindow& dc);
virtual void drawContents(FXDCWindow& dc);
private:
FXRulerView(const FXRulerView&);
FXRulerView &operator=(const FXRulerView&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onCmdSetHelp(FXObject*,FXSelector,void*);
long onCmdGetHelp(FXObject*,FXSelector,void*);
long onCmdSetTip(FXObject*,FXSelector,void*);
long onCmdGetTip(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
long onDocChanged(FXObject*,FXSelector,void*);
public:
enum {
ID_HRULER=FXScrollArea::ID_LAST,
ID_VRULER,
ID_LAST
};
public:
/// Construct a rulerview window
FXRulerView(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Return viewport height
virtual FXint getViewportHeight();
/// Return viewport width
virtual FXint getViewportWidth();
/// Return content width
virtual FXint getContentWidth();
/// Return content height
virtual FXint getContentHeight();
/// Perform layout
virtual void layout();
/// Return a pointer to the horizontal ruler
FXRuler* horizontalRuler() const { return hruler; }
/// Return a pointer to the vertical ruler
FXRuler* verticalRuler() const { return vruler; }
/// Get document position X
FXint getDocumentX() const;
/// Get document position Y
FXint getDocumentY() const;
/// Set document width
void setDocumentWidth(FXint w,FXbool notify=FALSE);
/// Get document width
FXint getDocumentWidth() const;
/// Set document height
void setDocumentHeight(FXint h,FXbool notify=FALSE);
/// Get document height
FXint getDocumentHeight() const;
/// Set the current document color
void setDocumentColor(FXColor clr);
/// Get the current document color
FXColor getDocumentColor() const { return docColor; }
/// Change edge spacing around document
void setHEdgeSpacing(FXint es,FXbool notify=FALSE);
void setVEdgeSpacing(FXint es,FXbool notify=FALSE);
/// Return edge spacing
FXint getHEdgeSpacing() const;
FXint getVEdgeSpacing() const;
/// Change horizontal lower margin
void setHMarginLower(FXint marg,FXbool notify=FALSE);
/// Change horizontal upper margin
void setHMarginUpper(FXint marg,FXbool notify=FALSE);
/// Get horizontal lower margin
FXint getHMarginLower() const;
/// Get horizontal upper margin
FXint getHMarginUpper() const;
/// Change vertical lower margin
void setVMarginLower(FXint marg,FXbool notify=FALSE);
/// Change vertical upper margin
void setVMarginUpper(FXint marg,FXbool notify=FALSE);
/// Get vertical lower margin
FXint getVMarginLower() const;
/// Get vertical upper margin
FXint getVMarginUpper() const;
/// Set horizontal alignment; the default is RULER_ALIGN_NORMAL
void setHAlignment(FXuint align,FXbool notify=FALSE);
/// Return horizontal alignment
FXuint getHAlignment() const;
/// Set vertical alignment; the default is RULER_ALIGN_NORMAL
void setVAlignment(FXuint align,FXbool notify=FALSE);
/// Return vertical alignment
FXuint getVAlignment() const;
/// Set X arrow position, relative to document position
void setArrowPosX(FXint x);
/// Set X arrow position, relative to document position
void setArrowPosY(FXint y);
/// Get X arrow position in document
FXint getArrowPosX() const;
/// Get Y arrow position in document
FXint getArrowPosY() const;
/// Set the horizontal ruler font
void setHRulerFont(FXFont *fnt,FXbool notify=FALSE);
/// Get the horizontal ruler font
FXFont* getHRulerFont() const;
/// Set the vertical ruler font
void setVRulerFont(FXFont *fnt,FXbool notify=FALSE);
/// Get the vertical ruler font
FXFont* getVRulerFont() const;
/// Change document number placement
void setHNumberTicks(FXint ticks,FXbool notify=FALSE);
void setVNumberTicks(FXint ticks,FXbool notify=FALSE);
/// Return document number placement
FXint getHNumberTicks() const;
FXint getVNumberTicks() const;
/// Change document major ticks
void setHMajorTicks(FXint ticks,FXbool notify=FALSE);
void setVMajorTicks(FXint ticks,FXbool notify=FALSE);
/// Return document major ticks
FXint getHMajorTicks() const;
FXint getVMajorTicks() const;
/// Change document medium ticks
void setHMediumTicks(FXint ticks,FXbool notify=FALSE);
void setVMediumTicks(FXint ticks,FXbool notify=FALSE);
/// Return document medium ticks
FXint getHMediumTicks() const;
FXint getVMediumTicks() const;
/// Change document tiny ticks
void setHTinyTicks(FXint ticks,FXbool notify=FALSE);
void setVTinyTicks(FXint ticks,FXbool notify=FALSE);
/// Return document tiny ticks
FXint getHTinyTicks() const;
FXint getVTinyTicks() const;
/// Change pixel per tick spacing
void setHPixelPerTick(FXdouble space,FXbool notify=FALSE);
void setVPixelPerTick(FXdouble space,FXbool notify=FALSE);
/// Return pixel per tick spacing
FXdouble getHPixelPerTick() const;
FXdouble getVPixelPerTick() const;
/// Set ruler style
void setHRulerStyle(FXuint style);
void setVRulerStyle(FXuint style);
/// Get ruler style
FXuint getHRulerStyle() const;
FXuint getVRulerStyle() const;
/// Set the status line help text for the ruler view
void setHelpText(const FXString& text){ help=text; }
/// Get the status line help text for the ruler view
const FXString& getHelpText() const { return help; }
/// Set the tool tip message for the ruler view
void setTipText(const FXString& text){ tip=text; }
/// Get the tool tip message for the ruler view
const FXString& getTipText() const { return tip; }
/// Save list to a stream
virtual void save(FXStream& store) const;
/// Load list from a stream
virtual void load(FXStream& store);
/// Destroy
virtual ~FXRulerView();
};
}
#endif
fox-1.6.49/include/FX7Segment.h 0000664 0001750 0001750 00000012614 12130340076 013055 0000000 0000000 /********************************************************************************
* *
* 7 - S e g m e n t D i s p l a y W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2004,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FX7Segment.h,v 1.12 2006/03/01 02:13:21 fox Exp $ *
********************************************************************************/
#ifndef FX7SEGMENT_H
#define FX7SEGMENT_H
#ifndef FXFRAME_H
#include "FXFrame.h"
#endif
namespace FX {
/// 7 Segment styles
enum {
SEVENSEGMENT_NORMAL = 0, /// Draw segments normally
SEVENSEGMENT_SHADOW = 0x00080000 /// Draw shadow under the segments
};
/**
* Seven-segment (eg LCD/watch style) widget, useful for making
* indicators and timers. Besides numbers, the seven-segment
* display widget can also display some letters and punctuations.
*/
class FXAPI FX7Segment : public FXFrame {
FXDECLARE(FX7Segment)
protected:
FXString label; // Text being shown
FXColor textColor; // Text color
FXint thickness; // Segment thickness
FXint cellwidth; // Width of cell
FXint cellheight; // height of cell
FXString tip; // Tooltip
FXString help; // Help message
protected:
FX7Segment();
private:
FX7Segment(const FX7Segment&);
FX7Segment &operator=(const FX7Segment&);
void drawCells(FXDCWindow &dc,FXint x,FXint y,FXint cw,FXint ch);
void drawSegments(FXDCWindow &dc,FXint x,FXint y,FXint w,FXint h,FXuint segments);
public:
long onPaint(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetIntValue(FXObject*,FXSelector,void*);
long onCmdSetRealValue(FXObject*,FXSelector,void*);
long onCmdSetStringValue(FXObject*,FXSelector,void*);
long onCmdGetIntValue(FXObject*,FXSelector,void*);
long onCmdGetRealValue(FXObject*,FXSelector,void*);
long onCmdGetStringValue(FXObject*,FXSelector,void*);
long onCmdSetHelp(FXObject*,FXSelector,void*);
long onCmdGetHelp(FXObject*,FXSelector,void*);
long onCmdSetTip(FXObject*,FXSelector,void*);
long onCmdGetTip(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
public:
/// Create a seven segment display
FX7Segment(FXComposite* p,const FXString& text,FXuint opts=SEVENSEGMENT_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Set the text for this label
void setText(const FXString& text);
/// Get the text for this label
FXString getText() const { return label; }
/// Change text color
void setTextColor(FXColor clr);
/// Return text color
FXColor getTextColor() const { return textColor; }
/// Get/set cell width
void setCellWidth(FXint w);
FXint getCellWidth() const { return cellwidth; }
/// Get/set cell height
void setCellHeight(FXint h);
FXint getCellHeight() const { return cellheight; }
/// Get/set segment thickness
void setThickness(FXint t);
FXint getThickness() const { return thickness; }
/// Change 7 segment style
void set7SegmentStyle(FXuint style);
/// Get current 7 segment style
FXuint get7SegmentStyle() const;
/// Set the current text-justification mode.
void setJustify(FXuint mode);
/// Get the current text-justification mode.
FXuint getJustify() const;
/// Set the status line help text
void setHelpText(const FXString& text){ help=text; }
/// Get the status line help text
const FXString& getHelpText() const { return help; }
/// Set the tool tip message
void setTipText(const FXString& text){ tip=text; }
/// Get the tool tip message
const FXString& getTipText() const { return tip; }
/// Save to a stream
virtual void save(FXStream &store) const;
/// Load from a stream
virtual void load(FXStream &store);
};
}
#endif
fox-1.6.49/include/FXGLCanvas.h 0000664 0001750 0001750 00000010033 12130340076 013013 0000000 0000000 /********************************************************************************
* *
* G L C a n v a s W i n d o w W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXGLCanvas.h,v 1.33 2006/01/22 17:58:02 fox Exp $ *
********************************************************************************/
#ifndef FXGLCANVAS_H
#define FXGLCANVAS_H
#ifndef FXCANVAS_H
#include "FXCanvas.h"
#endif
namespace FX {
class FXGLVisual;
/// GLCanvas, an area drawn by another object
class FXAPI FXGLCanvas : public FXCanvas {
FXDECLARE(FXGLCanvas)
private:
FXGLCanvas *sgnext; // Share group next in share list
FXGLCanvas *sgprev; // Share group previous in share list
protected:
void *ctx; // GL Context
protected:
FXGLCanvas();
private:
FXGLCanvas(const FXGLCanvas&);
FXGLCanvas &operator=(const FXGLCanvas&);
#ifdef WIN32
virtual const char* GetClass() const;
#endif
public:
/**
* Construct an OpenGL-capable canvas, with its own private display list.
*/
FXGLCanvas(FXComposite* p,FXGLVisual *vis,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/**
* Construct an OpenGL-capable canvas, sharing display
* list with another GL canvas. This canvas becomes a member
* of a display list share group. All members of the display
* list share group have to have the same visual.
*/
FXGLCanvas(FXComposite* p,FXGLVisual *vis,FXGLCanvas* sharegroup,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Return TRUE if it is sharing display lists
FXbool isShared() const;
/// Create all of the server-side resources for this window
virtual void create();
/// Detach the server-side resources for this window
virtual void detach();
/// Destroy the server-side resources for this window
virtual void destroy();
/// Make OpenGL context current prior to performing OpenGL commands
virtual FXbool makeCurrent();
/// Make OpenGL context non current
virtual FXbool makeNonCurrent();
/// Return TRUE if this window's context is current
virtual FXbool isCurrent() const;
/// Return current context, if any
static void* getCurrentContext();
/// Get GL context handle
void* getContext() const { return ctx; }
/// Swap front and back buffer
virtual void swapBuffers();
/// Save object to stream
virtual void save(FXStream& store) const;
/// Load object from stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXGLCanvas();
};
}
#endif
fox-1.6.49/include/FXBMPIcon.h 0000664 0001750 0001750 00000007050 12130340076 012611 0000000 0000000 /********************************************************************************
* *
* B M P I c o n O b j e c t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXBMPIcon.h,v 1.22 2006/01/22 17:57:59 fox Exp $ *
********************************************************************************/
#ifndef FXBMPICON_H
#define FXBMPICON_H
#ifndef FXICON_H
#include "FXIcon.h"
#endif
namespace FX {
/**
* The BMP Icon class is a convenience class for working with icons in the
* Microsoft Bitmap (.bmp) graphics file format. This makes it possible to
* use resources created with Windows development tools inside FOX without
* need for graphics file format translators. The bitmap loaded handles
* 1, 4, and 8 bit paletted bitmaps, 16 and 24 bit RGB bitmaps, and
* 32 bit RGBA bitmaps.
*/
class FXAPI FXBMPIcon : public FXIcon {
FXDECLARE(FXBMPIcon)
protected:
FXBMPIcon(){}
private:
FXBMPIcon(const FXBMPIcon&);
FXBMPIcon &operator=(const FXBMPIcon&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct icon from memory stream formatted in Microsoft BMP format
FXBMPIcon(FXApp* a,const void *pix=NULL,FXColor clr=FXRGB(192,192,192),FXuint opts=0,FXint w=1,FXint h=1);
/// Save pixels into stream in Microsoft bitmap format
virtual bool savePixels(FXStream& store) const;
/// Load pixels from stream in Microsoft bitmap format
virtual bool loadPixels(FXStream& store);
/// Destroy icon
virtual ~FXBMPIcon();
};
/**
* Check if stream contains a bitmap, return TRUE if so.
*/
extern FXAPI bool fxcheckBMP(FXStream& store);
/**
* Load an BMP (Microsoft Bitmap) file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadBMP(FXStream& store,FXColor*& data,FXint& width,FXint& height);
/**
* Save an BMP (Microsoft Bitmap) file to a stream.
*/
extern FXAPI bool fxsaveBMP(FXStream& store,const FXColor *data,FXint width,FXint height);
}
#endif
fox-1.6.49/include/FXXPMIcon.h 0000664 0001750 0001750 00000006707 12130340076 012647 0000000 0000000 /********************************************************************************
* *
* X P M I c o n O b j e c t *
* *
*********************************************************************************
* Copyright (C) 2000,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXXPMIcon.h,v 1.22 2006/01/22 17:58:12 fox Exp $ *
********************************************************************************/
#ifndef FXXPMICON_H
#define FXXPMICON_H
#ifndef FXICON_H
#include "FXIcon.h"
#endif
namespace FX {
/// X Pixmap icon
class FXAPI FXXPMIcon : public FXIcon {
FXDECLARE(FXXPMIcon)
protected:
FXXPMIcon(){}
private:
FXXPMIcon(const FXXPMIcon&);
FXXPMIcon &operator=(const FXXPMIcon&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct icon from compiled-in X Pixmap format
FXXPMIcon(FXApp* a,const FXchar **pix=NULL,FXColor clr=FXRGB(192,192,192),FXuint opts=0,FXint w=1,FXint h=1);
/// Save pixels into stream in X Pixmap format
virtual bool savePixels(FXStream& store) const;
/// Load pixels from stream in X Pixmap format
virtual bool loadPixels(FXStream& store);
/// Destroy icon
virtual ~FXXPMIcon();
};
#ifndef FXLOADXPM
#define FXLOADXPM
/**
* Check if stream contains a XPM, return TRUE if so.
*/
extern FXAPI bool fxcheckXPM(FXStream& store);
/**
* Load an XPM (X Pixmap) from array of strings.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadXPM(const FXchar **pix,FXColor*& data,FXint& width,FXint& height);
/**
* Load an XPM (X Pixmap) file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadXPM(FXStream& store,FXColor*& data,FXint& width,FXint& height);
/**
* Save an XPM (X Pixmap) file to a stream.
*/
extern FXAPI bool fxsaveXPM(FXStream& store,const FXColor *data,FXint width,FXint height,bool fast=true);
#endif
}
#endif
fox-1.6.49/include/FXArrowButton.h 0000664 0001750 0001750 00000014613 12130340076 013653 0000000 0000000 /********************************************************************************
* *
* A r r o w B u t t o n W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXArrowButton.h,v 1.39 2006/01/22 17:57:58 fox Exp $ *
********************************************************************************/
#ifndef FXARROWBUTTON_H
#define FXARROWBUTTON_H
#ifndef FXFRAME_H
#include "FXFrame.h"
#endif
namespace FX {
// Arrow style options
enum {
ARROW_NONE = 0, // No arrow
ARROW_UP = 0x00080000, // Arrow points up
ARROW_DOWN = 0x00100000, // Arrow points down
ARROW_LEFT = 0x00200000, // Arrow points left
ARROW_RIGHT = 0x00400000, // Arrow points right
ARROW_AUTO = 0x00800000, // Automatically fire when hovering mouse over button
ARROW_REPEAT = 0x01000000, // Button repeats if held down
ARROW_AUTOGRAY = 0x02000000, // Automatically gray out when not updated
ARROW_AUTOHIDE = 0x04000000, // Automatically hide when not updated
ARROW_TOOLBAR = 0x08000000, // Button is toolbar-style
ARROW_NORMAL = FRAME_RAISED|FRAME_THICK|ARROW_UP
};
/**
* Button with an arrow; the arrow can point in any direction.
* When clicked, the arrow button sends a SEL_COMMAND to its target.
* When ARROW_REPEAT is passed, the arrow button sends a SEL_COMMAND
* repeatedly while the button is pressed.
* The option ARROW_AUTO together with ARROW_REPEAT makes the arrow
* button work in repeat mode simply by hovering the cursor over it.
*/
class FXAPI FXArrowButton : public FXFrame {
FXDECLARE(FXArrowButton)
protected:
FXColor arrowColor; // Arrow color
FXint arrowSize; // Arrow size
FXString tip; // Tooltip value
FXString help; // Help value
FXbool state; // State of button
FXbool fired; // Timer has fired
protected:
FXArrowButton();
private:
FXArrowButton(const FXArrowButton&);
FXArrowButton &operator=(const FXArrowButton&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onUpdate(FXObject*,FXSelector,void*);
long onEnter(FXObject*,FXSelector,void*);
long onLeave(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onUngrabbed(FXObject*,FXSelector,void*);
long onRepeat(FXObject*,FXSelector,void*);
long onAuto(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onHotKeyPress(FXObject*,FXSelector,void*);
long onHotKeyRelease(FXObject*,FXSelector,void*);
long onCmdSetHelp(FXObject*,FXSelector,void*);
long onCmdGetHelp(FXObject*,FXSelector,void*);
long onCmdSetTip(FXObject*,FXSelector,void*);
long onCmdGetTip(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
public:
enum {
ID_REPEAT=FXFrame::ID_LAST,
ID_AUTO,
ID_LAST
};
public:
/// Construct arrow button
FXArrowButton(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=ARROW_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Get default width
virtual FXint getDefaultWidth();
/// Get default height
virtual FXint getDefaultHeight();
/// Enable the button
virtual void enable();
/// Disable the button
virtual void disable();
/// Returns true because a button can receive focus
virtual bool canFocus() const;
/// Set the button state (where TRUE means the button is down)
void setState(FXbool s);
/// Get the button state (where TRUE means the button is down)
FXbool getState() const { return state; }
/// Set status line help text for this arrow button
void setHelpText(const FXString& text){ help=text; }
/// Get status line help text for this arrow button
const FXString& getHelpText() const { return help; }
/// Set tool tip message for this arrow button
void setTipText(const FXString& text){ tip=text; }
/// Get tool tip message for this arrow button
const FXString& getTipText() const { return tip; }
/// Set the arrow style flags
void setArrowStyle(FXuint style);
/// Get the arrow style flags
FXuint getArrowStyle() const;
/// Set the default arrow size
void setArrowSize(FXint size);
/// Get the default arrow size
FXint getArrowSize() const { return arrowSize; }
/// Set the current justification mode.
void setJustify(FXuint mode);
/// Get the current justification mode.
FXuint getJustify() const;
/// Get the fill color for the arrow
FXColor getArrowColor() const { return arrowColor; }
/// Set the fill color for the arrow
void setArrowColor(FXColor clr);
/// Save label to a stream
virtual void save(FXStream& store) const;
/// Load label from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXArrowButton();
};
}
#endif
fox-1.6.49/include/FXMat4d.h 0000664 0001750 0001750 00000014050 12130340076 012331 0000000 0000000 /********************************************************************************
* *
* D o u b l e - P r e c i s i o n 4 x 4 M a t r i x *
* *
*********************************************************************************
* Copyright (C) 1994,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXMat4d.h,v 1.8 2006/01/22 17:58:05 fox Exp $ *
********************************************************************************/
#ifndef FXMAT4D_H
#define FXMAT4D_H
namespace FX {
/// Double-precision 4x4 matrix
class FXAPI FXMat4d {
protected:
FXVec4d m[4];
public:
/// Constructors
FXMat4d(){}
FXMat4d(FXdouble w);
FXMat4d(FXdouble a00,FXdouble a01,FXdouble a02,FXdouble a03,
FXdouble a10,FXdouble a11,FXdouble a12,FXdouble a13,
FXdouble a20,FXdouble a21,FXdouble a22,FXdouble a23,
FXdouble a30,FXdouble a31,FXdouble a32,FXdouble a33);
FXMat4d(const FXVec4d& a,const FXVec4d& b,const FXVec4d& c,const FXVec4d& d);
FXMat4d(const FXMat4d& other);
/// Assignment
FXMat4d& operator=(const FXMat4d& other);
FXMat4d& operator=(FXdouble w);
/// Set value from another matrix
FXMat4d& set(const FXMat4d& other);
/// Set value from scalar
FXMat4d& set(FXdouble w);
/// Set value from components
FXMat4d& set(FXdouble a00,FXdouble a01,FXdouble a02,FXdouble a03,
FXdouble a10,FXdouble a11,FXdouble a12,FXdouble a13,
FXdouble a20,FXdouble a21,FXdouble a22,FXdouble a23,
FXdouble a30,FXdouble a31,FXdouble a32,FXdouble a33);
/// Set value from four vectors
FXMat4d& set(const FXVec4d& a,const FXVec4d& b,const FXVec4d& c,const FXVec4d& d);
/// Assignment operators
FXMat4d& operator+=(const FXMat4d& w);
FXMat4d& operator-=(const FXMat4d& w);
FXMat4d& operator*=(FXdouble w);
FXMat4d& operator*=(const FXMat4d& w);
FXMat4d& operator/=(FXdouble w);
/// Indexing
FXVec4d& operator[](FXint i){return m[i];}
const FXVec4d& operator[](FXint i) const {return m[i];}
/// Conversion
operator FXdouble*(){return m[0];}
operator const FXdouble*() const {return m[0];}
/// Unary minus
FXMat4d operator-() const;
/// Matrix and matrix
FXMat4d operator+(const FXMat4d& w) const;
FXMat4d operator-(const FXMat4d& w) const;
FXMat4d operator*(const FXMat4d& w) const;
/// Matrix and scalar
friend FXAPI FXMat4d operator*(FXdouble x,const FXMat4d& a);
friend FXAPI FXMat4d operator*(const FXMat4d& a,FXdouble x);
friend FXAPI FXMat4d operator/(const FXMat4d& a,FXdouble x);
friend FXAPI FXMat4d operator/(FXdouble x,const FXMat4d& a);
/// Multiply matrix and vector
FXVec4d operator*(const FXVec4d& v) const;
FXVec3d operator*(const FXVec3d& v) const;
/// Set identity matrix
FXMat4d& eye();
/// Orthographic projection
FXMat4d& ortho(FXdouble left,FXdouble right,FXdouble bottom,FXdouble top,FXdouble hither,FXdouble yon);
/// Perspective projection
FXMat4d& frustum(FXdouble left,FXdouble right,FXdouble bottom,FXdouble top,FXdouble hither,FXdouble yon);
/// Multiply by left-hand matrix
FXMat4d& left();
/// Multiply by rotation about unit-quaternion
FXMat4d& rot(const FXQuatd& q);
/// Multiply by rotation c,s about axis
FXMat4d& rot(const FXVec3d& v,FXdouble c,FXdouble s);
/// Multiply by rotation of phi about axis
FXMat4d& rot(const FXVec3d& v,FXdouble phi);
/// Multiply by x-rotation
FXMat4d& xrot(FXdouble c,FXdouble s);
FXMat4d& xrot(FXdouble phi);
/// Multiply by y-rotation
FXMat4d& yrot(FXdouble c,FXdouble s);
FXMat4d& yrot(FXdouble phi);
/// Multiply by z-rotation
FXMat4d& zrot(FXdouble c,FXdouble s);
FXMat4d& zrot(FXdouble phi);
/// Look at
FXMat4d& look(const FXVec3d& eye,const FXVec3d& cntr,const FXVec3d& vup);
/// Multiply by translation
FXMat4d& trans(FXdouble tx,FXdouble ty,FXdouble tz);
FXMat4d& trans(const FXVec3d& v);
/// Multiply by scaling
FXMat4d& scale(FXdouble sx,FXdouble sy,FXdouble sz);
FXMat4d& scale(FXdouble s);
FXMat4d& scale(const FXVec3d& v);
/// Determinant
FXdouble det() const;
/// Transpose
FXMat4d transpose() const;
/// Invert
FXMat4d invert() const;
/// Save to a stream
friend FXAPI FXStream& operator<<(FXStream& store,const FXMat4d& m);
/// Load from a stream
friend FXAPI FXStream& operator>>(FXStream& store,FXMat4d& m);
};
extern FXAPI FXMat4d operator*(FXdouble x,const FXMat4d& a);
extern FXAPI FXMat4d operator*(const FXMat4d& a,FXdouble x);
extern FXAPI FXMat4d operator/(const FXMat4d& a,FXdouble x);
extern FXAPI FXMat4d operator/(FXdouble x,const FXMat4d& a);
extern FXAPI FXStream& operator<<(FXStream& store,const FXMat4d& m);
extern FXAPI FXStream& operator>>(FXStream& store,FXMat4d& m);
}
#endif
fox-1.6.49/include/FXTIFIcon.h 0000664 0001750 0001750 00000006650 12130340076 012622 0000000 0000000 /********************************************************************************
* *
* T I F F I c o n O b j e c t *
* *
*********************************************************************************
* Copyright (C) 2001,2006 Eric Gillet. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXTIFIcon.h,v 1.22 2006/01/22 17:58:10 fox Exp $ *
********************************************************************************/
#ifndef FXTIFICON_H
#define FXTIFICON_H
#ifndef FXICON_H
#include "FXIcon.h"
#endif
namespace FX {
/// TIFF Icon class
class FXAPI FXTIFIcon : public FXIcon {
FXDECLARE(FXTIFIcon)
protected:
FXushort codec;
protected:
FXTIFIcon(){}
private:
FXTIFIcon(const FXTIFIcon&);
FXTIFIcon &operator=(const FXTIFIcon&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct an icon from memory stream formatted in TIFF format
FXTIFIcon(FXApp *a,const void *pix=NULL,FXColor clr=FXRGB(192,192,192),FXuint opts=0,FXint w=1,FXint h=1);
/// True if format is supported
static const bool supported;
/// Set codec to save with
void setCodec(FXuint c){ codec=c; }
/// Get codec setting
FXuint getCodec() const { return codec; }
/// Save pixels into stream in TIFF format
virtual bool savePixels(FXStream& store) const;
/// Load pixels from stream in TIFF format
virtual bool loadPixels(FXStream& store);
/// Destroy
virtual ~FXTIFIcon();
};
/**
* Check if stream contains a TIFF, return TRUE if so.
*/
extern FXAPI bool fxcheckTIF(FXStream& store);
/**
* Load an TIFF (Tagged Image File Format) file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadTIF(FXStream& store,FXColor*& data,FXint& width,FXint& height,FXushort& codec);
/**
* Save an TIFF (Tagged Image File Format) file to a stream.
*/
extern FXAPI bool fxsaveTIF(FXStream& store,const FXColor* data,FXint width,FXint height,FXushort codec);
}
#endif
fox-1.6.49/include/FX88597Codec.h 0000644 0001750 0001750 00000001104 11637250333 013023 0000000 0000000 #ifndef FX88597CODEC_H
#define FX88597CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// ISO-8859-7 Codec
class FXAPI FX88597Codec : public FXTextCodec {
FXDECLARE(FX88597Codec)
public:
FX88597Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FX88597Codec(){}
};
}
#endif
fox-1.6.49/include/FXTabItem.h 0000664 0001750 0001750 00000010065 12130340076 012707 0000000 0000000 /********************************************************************************
* *
* T a b I t e m W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXTabItem.h,v 1.10 2006/01/22 17:58:10 fox Exp $ *
********************************************************************************/
#ifndef FXTABITEM_H
#define FXTABITEM_H
#ifndef FXLABEL_H
#include "FXLabel.h"
#endif
namespace FX {
/// Tab Item orientations which affect border
enum {
TAB_TOP = 0, // Top side tabs
TAB_LEFT = 0x00800000, // Left side tabs
TAB_RIGHT = 0x01000000, // Right side tabs
TAB_BOTTOM = 0x01800000, // Bottom side tabs
TAB_TOP_NORMAL = JUSTIFY_NORMAL|ICON_BEFORE_TEXT|TAB_TOP|FRAME_RAISED|FRAME_THICK,
TAB_BOTTOM_NORMAL= JUSTIFY_NORMAL|ICON_BEFORE_TEXT|TAB_BOTTOM|FRAME_RAISED|FRAME_THICK,
TAB_LEFT_NORMAL = JUSTIFY_LEFT|JUSTIFY_CENTER_Y|ICON_BEFORE_TEXT|TAB_LEFT|FRAME_RAISED|FRAME_THICK,
TAB_RIGHT_NORMAL = JUSTIFY_LEFT|JUSTIFY_CENTER_Y|ICON_BEFORE_TEXT|TAB_RIGHT|FRAME_RAISED|FRAME_THICK
};
class FXTabBar;
/**
* A tab item is placed in a tab bar or tab book.
* When selected, the tab item sends a message to its
* parent, and causes itself to become the active tab,
* and raised slightly above the other tabs.
* In the tab book, activating a tab item also causes
* the corresponding panel to be raised to the top.
*/
class FXAPI FXTabItem : public FXLabel {
FXDECLARE(FXTabItem)
protected:
FXTabItem(){}
private:
FXTabItem(const FXTabItem&);
FXTabItem& operator=(const FXTabItem&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onFocusIn(FXObject*,FXSelector,void*);
long onFocusOut(FXObject*,FXSelector,void*);
long onUngrabbed(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onHotKeyPress(FXObject*,FXSelector,void*);
long onHotKeyRelease(FXObject*,FXSelector,void*);
public:
/// Construct a tab item
FXTabItem(FXTabBar* p,const FXString& text,FXIcon* ic=0,FXuint opts=TAB_TOP_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Returns true because a tab item can receive focus
virtual bool canFocus() const;
/// Return current tab item orientation
FXuint getTabOrientation() const;
/// Change tab item orientation
void setTabOrientation(FXuint style);
};
}
#endif
fox-1.6.49/include/FXIO.h 0000664 0001750 0001750 00000014372 12130340076 011676 0000000 0000000 /********************************************************************************
* *
* I / O D e v i c e C l a s s *
* *
*********************************************************************************
* Copyright (C) 2005,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXIO.h,v 1.8 2006/01/22 17:58:04 fox Exp $ *
********************************************************************************/
#ifndef FXIO_H
#define FXIO_H
namespace FX {
/**
* FXIO manipulates a handle to an abstract i/o device.
* The various subclasses of FXIO perform i/o on files, sockets,
* pipes, and possibly other devices.
*/
class FXAPI FXIO {
protected:
FXInputHandle device; // Device (file/pipe/socket/whatever)
FXuint access; // Access being performed
private:
FXIO(const FXIO&);
FXIO &operator=(const FXIO&);
public:
/// File modes
enum {
/// Permissions
OtherRead = 0x00004, /// Others have read permission
OtherWrite = 0x00002, /// Others have write permisson
OtherExec = 0x00001, /// Others have execute permission
OtherReadWrite = 0x00006, /// Others have read and write permission
OtherFull = 0x00007, /// Others have full access
GroupRead = 0x00020, /// Group has read permission
GroupWrite = 0x00010, /// Group has write permission
GroupExec = 0x00008, /// Group has execute permission
GroupReadWrite = 0x00030, /// Group has read and write permission
GroupFull = 0x00038, /// Group has full access
OwnerRead = 0x00100, /// Owner has read permission
OwnerWrite = 0x00080, /// Owner has write permission
OwnerExec = 0x00040, /// Owner has execute permission
OwnerReadWrite = 0x00180, /// Owner has read and write permission
OwnerFull = 0x001C0, /// Owner has full access
/// Other flags
Hidden = 0x00200, /// Hidden file
Directory = 0x00400, /// Is directory
File = 0x00800, /// Is regular file
SymLink = 0x01000, /// Is symbolic link
/// Special mode bits
SetUser = 0x02000, /// Set user id
SetGroup = 0x04000, /// Set group id
Sticky = 0x08000, /// Sticky bit
/// Device special files
Character = 0x10000, /// Character device
Block = 0x20000, /// Block device
Socket = 0x40000, /// Socket device
Fifo = 0x80000 /// Fifo device
};
/// Access modes
enum {
/// Basic access options
NoAccess = 0, /// No access
ReadOnly = 1, /// Open for reading
WriteOnly = 2, /// Open for writing
ReadWrite = 3, /// Open for read and write
Append = 4, /// Open for append
Truncate = 8, /// Truncate to zero when writing
Create = 16, /// Create if it doesn't exist
Exclusive = 32, /// Fail if trying to create a file which already exists
NonBlocking = 64, /// Non-blocking i/o
/// Convenience access options
Reading = ReadOnly, /// Normal options for reading
Writing = ReadWrite|Create|Truncate /// Normal options for writing
};
/// Positioning modes
enum {
Begin = 0, /// Position from the begin (default)
Current = 1, /// Position relative to current position
End = 2 /// Position from the end
};
public:
/// Construct
FXIO();
/// Open device with access mode and handle
virtual bool open(FXInputHandle handle,FXuint mode);
/// Return true if open
virtual bool isOpen() const;
/// Return access mode
FXuint mode() const { return access; }
/// Return handle
FXInputHandle handle() const { return device; }
/// Attach existing device handle
virtual void attach(FXInputHandle handle,FXuint mode);
/// Detach device handle
virtual void detach();
/// Get current file position
virtual FXlong position() const;
/// Change file position, returning new position from start
virtual FXlong position(FXlong offset,FXuint from=FXIO::Begin);
/// Read block of bytes, returning number of bytes read
virtual FXival readBlock(void* data,FXival count);
/// Write block of bytes, returning number of bytes written
virtual FXival writeBlock(const void* data,FXival count);
/// Truncate file
virtual FXlong truncate(FXlong size);
/// Flush to disk
virtual bool flush();
/// Test if we're at the end
virtual bool eof();
/// Return size of i/o device
virtual FXlong size();
/// Close handle
virtual bool close();
/// Destroy and close
virtual ~FXIO();
};
}
#endif
fox-1.6.49/include/FXDict.h 0000664 0001750 0001750 00000012363 12130340076 012250 0000000 0000000 /********************************************************************************
* *
* S t r i n g D i c t i o n a r y C l a s s *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXDict.h,v 1.26 2006/01/22 17:58:00 fox Exp $ *
********************************************************************************/
#ifndef FXDICT_H
#define FXDICT_H
#ifndef FXOBJECT_H
#include "FXObject.h"
#endif
namespace FX {
/**
* The dictionary class maintains a fast-access hash table of entities
* indexed by a character string.
* It is typically used to map strings to pointers; however, overloading
* the createData() and deleteData() members allows any type of data to
* be indexed by strings.
*/
class FXAPI FXDict : public FXObject {
FXDECLARE(FXDict)
protected:
struct FXDictEntry {
FXchar *key; // Key string
void *data; // Data
FXint hash; // Hash value of key
bool mark; // Entry is marked
};
protected:
FXDictEntry *dict; // Dictionary
FXint total; // Dictionary size
FXint number; // Number of entries
protected:
static FXint hash(const FXchar* str);
protected:
/**
* Overload this function in a derived class to return the
* data pointer given an input pointer; the default implementation
* just returns the input pointer.
*/
virtual void *createData(const void*);
/**
* Overload this function in a derived class to delete the pointer
* previously returned by createData(); the default implementation
* does nothing.
*/
virtual void deleteData(void*);
public:
/**
* Construct an empty dictionary.
*/
FXDict();
/// Copy constructor; does bit-copy of void pointer data.
FXDict(const FXDict& orig);
/// Assignment operator
FXDict& operator=(const FXDict& orig);
/**
* Resize the table to the given size.
*/
void size(FXint m);
/**
* Return the size of the table, including the empty slots.
*/
FXint size() const { return total; }
/**
* Return the total number of entries in the table.
*/
FXint no() const { return number; }
/**
* Insert a new entry into the table given key and mark.
* If there is already an entry with that key, leave it unchanged,
* otherwise insert the new entry.
*/
void* insert(const FXchar* ky,const void* ptr,bool mrk=false);
/**
* Replace data at key, if the entry's mark is less than
* or equal to the given mark. If there was no existing entry,
* a new entry is inserted with the given mark.
*/
void* replace(const FXchar* ky,const void* ptr,bool mrk=false);
/**
* Remove data given key.
*/
void* remove(const FXchar* ky);
/**
* Find data pointer given key.
*/
void* find(const FXchar* ky) const;
/**
* Return true if slot is empty.
*/
bool empty(FXint pos) const { return dict[pos].hash<0; }
/**
* Return key at position pos.
*/
const FXchar* key(FXuint pos) const { return dict[pos].key; }
/**
* return data pointer at position pos.
*/
void* data(FXuint pos) const { return dict[pos].data; }
/**
* Return mark flag of entry at position pos.
*/
bool mark(FXuint pos) const { return dict[pos].mark; }
/**
* Return position of first filled slot, or >= total
*/
FXint first() const;
/**
* Return position of last filled slot or -1
*/
FXint last() const;
/**
* Return position of next filled slot in hash table
* or a value greater than or equal to total if no filled
* slot was found
*/
FXint next(FXint pos) const;
/**
* Return position of previous filled slot in hash table
* or a -1 if no filled slot was found
*/
FXint prev(FXint pos) const;
/// Clear all entries
void clear();
/// Destructor
virtual ~FXDict();
};
}
#endif
fox-1.6.49/include/FXExtentf.h 0000664 0001750 0001750 00000011365 12130340076 013003 0000000 0000000 /********************************************************************************
* *
* S i n g l e - P r e c i s i o n E x t e n t C l a s s *
* *
*********************************************************************************
* Copyright (C) 2004,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXExtentf.h,v 1.8.2.1 2006/07/25 01:35:36 fox Exp $ *
********************************************************************************/
#ifndef FXEXTENTF_H
#define FXEXTENTF_H
namespace FX {
/// Extent
class FXAPI FXExtentf {
public:
FXVec2f lower;
FXVec2f upper;
public:
/// Default constructor
FXExtentf(){}
/// Copy constructor
FXExtentf(const FXExtentf& ext):lower(ext.lower),upper(ext.upper){}
/// Initialize from two vectors
FXExtentf(const FXVec2f& lo,const FXVec2f& hi):lower(lo),upper(hi){}
/// Initialize from six numbers
FXExtentf(FXfloat xlo,FXfloat xhi,FXfloat ylo,FXfloat yhi):lower(xlo,ylo),upper(xhi,yhi){}
/// Assignment
FXExtentf& operator=(const FXExtentf& ext){ lower=ext.lower; upper=ext.upper; return *this; }
/// Indexing with 0..1
FXVec2f& operator[](FXint i){ return (&lower)[i]; }
/// Indexing with 0..1
const FXVec2f& operator[](FXint i) const { return (&lower)[i]; }
/// Comparison
bool operator==(const FXExtentf& ext) const { return lower==ext.lower && upper==ext.upper;}
bool operator!=(const FXExtentf& ext) const { return lower!=ext.lower || upper!=ext.upper;}
/// Width of box
FXfloat width() const { return upper.x-lower.x; }
/// Height of box
FXfloat height() const { return upper.y-lower.y; }
/// Longest side
FXfloat longest() const;
/// shortest side
FXfloat shortest() const;
/// Length of diagonal
FXfloat diameter() const;
/// Get radius of box
FXfloat radius() const;
/// Compute diagonal
FXVec2f diagonal() const;
/// Get center of box
FXVec2f center() const;
/// Test if empty
bool empty() const;
/// Test if box contains point x,y
bool contains(FXfloat x,FXfloat y) const;
/// Test if box contains point p
bool contains(const FXVec2f& p) const;
/// Test if box properly contains another box
bool contains(const FXExtentf& ext) const;
/// Include point
FXExtentf& include(FXfloat x,FXfloat y);
/// Include point
FXExtentf& include(const FXVec2f& v);
/// Include given range into extent
FXExtentf& include(const FXExtentf& ext);
/// Test if bounds overlap
friend FXAPI bool overlap(const FXExtentf& a,const FXExtentf& b);
/// Get corner number 0..3
FXVec2f corner(FXint c) const { return FXVec2f((&lower)[c&1].x, (&lower)[(c>>1)&1].y); }
/// Union of two boxes
friend FXAPI FXExtentf unite(const FXExtentf& a,const FXExtentf& b);
/// Intersection of two boxes
friend FXAPI FXExtentf intersect(const FXExtentf& a,const FXExtentf& b);
/// Save object to a stream
friend FXAPI FXStream& operator<<(FXStream& store,const FXExtentf& ext);
/// Load object from a stream
friend FXAPI FXStream& operator>>(FXStream& store,FXExtentf& ext);
};
extern FXAPI bool overlap(const FXExtentf& a,const FXExtentf& b);
extern FXAPI FXExtentf unite(const FXExtentf& a,const FXExtentf& b);
extern FXAPI FXExtentf intersect(const FXExtentf& a,const FXExtentf& b);
extern FXAPI FXStream& operator<<(FXStream& store,const FXExtentf& ext);
extern FXAPI FXStream& operator>>(FXStream& store,FXExtentf& ext);
}
#endif
fox-1.6.49/include/FXFont.h 0000664 0001750 0001750 00000036663 12130340076 012304 0000000 0000000 /********************************************************************************
* *
* F o n t O b j e c t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXFont.h,v 1.66 2006/01/22 17:58:02 fox Exp $ *
********************************************************************************/
#ifndef FXFONT_H
#define FXFONT_H
#ifndef FXID_H
#include "FXId.h"
#endif
namespace FX {
/// Font character set encoding
enum FXFontEncoding {
FONTENCODING_DEFAULT, /// Don't care character encoding
FONTENCODING_ISO_8859_1 = 1, /// West European (Latin1)
FONTENCODING_ISO_8859_2 = 2, /// Central and East European (Latin2)
FONTENCODING_ISO_8859_3 = 3, /// Esperanto (Latin3)
FONTENCODING_ISO_8859_4 = 4,
FONTENCODING_ISO_8859_5 = 5, /// Cyrillic (almost obsolete)
FONTENCODING_ISO_8859_6 = 6, /// Arabic
FONTENCODING_ISO_8859_7 = 7, /// Greek
FONTENCODING_ISO_8859_8 = 8, /// Hebrew
FONTENCODING_ISO_8859_9 = 9, /// Turkish (Latin5)
FONTENCODING_ISO_8859_10 = 10,
FONTENCODING_ISO_8859_11 = 11, /// Thai
FONTENCODING_ISO_8859_13 = 13, /// Baltic
FONTENCODING_ISO_8859_14 = 14,
FONTENCODING_ISO_8859_15 = 15,
FONTENCODING_ISO_8859_16 = 16,
FONTENCODING_KOI8 = 17,
FONTENCODING_KOI8_R = 18, /// Russian
FONTENCODING_KOI8_U = 19, /// Ukrainian
FONTENCODING_KOI8_UNIFIED = 20,
FONTENCODING_CP437 = 437, /// IBM-PC code page
FONTENCODING_CP850 = 850, /// IBMPC Multilingual
FONTENCODING_CP851 = 851, /// IBM-PC Greek
FONTENCODING_CP852 = 852, /// IBM-PC Latin2
FONTENCODING_CP855 = 855, /// IBM-PC Cyrillic
FONTENCODING_CP856 = 856, /// IBM-PC Hebrew
FONTENCODING_CP857 = 857, /// IBM-PC Turkish
FONTENCODING_CP860 = 860, /// IBM-PC Portugese
FONTENCODING_CP861 = 861, /// IBM-PC Iceland
FONTENCODING_CP862 = 862, /// IBM-PC Israel
FONTENCODING_CP863 = 863, /// IBM-PC Canadian/French
FONTENCODING_CP864 = 864, /// IBM-PC Arabic
FONTENCODING_CP865 = 865, /// IBM-PC Nordic
FONTENCODING_CP866 = 866, /// IBM-PC Cyrillic #2
FONTENCODING_CP869 = 869, /// IBM-PC Greek #2
FONTENCODING_CP870 = 870, /// Latin-2 Multilingual
FONTENCODING_CP1250 = 1250, /// Windows Central European
FONTENCODING_CP1251 = 1251, /// Windows Russian
FONTENCODING_CP1252 = 1252, /// Windows Latin1
FONTENCODING_CP1253 = 1253, /// Windows Greek
FONTENCODING_CP1254 = 1254, /// Windows Turkish
FONTENCODING_CP1255 = 1255, /// Windows Hebrew
FONTENCODING_CP1256 = 1256, /// Windows Arabic
FONTENCODING_CP1257 = 1257, /// Windows Baltic
FONTENCODING_CP1258 = 1258, /// Windows Vietnam
FONTENCODING_CP874 = 874, /// Windows Thai
FONTENCODING_UNICODE = 9999,
FONTENCODING_LATIN1 = FONTENCODING_ISO_8859_1, /// Latin 1 (West European)
FONTENCODING_LATIN2 = FONTENCODING_ISO_8859_2, /// Latin 2 (East European)
FONTENCODING_LATIN3 = FONTENCODING_ISO_8859_3, /// Latin 3 (South European)
FONTENCODING_LATIN4 = FONTENCODING_ISO_8859_4, /// Latin 4 (North European)
FONTENCODING_LATIN5 = FONTENCODING_ISO_8859_9, /// Latin 5 (Turkish)
FONTENCODING_LATIN6 = FONTENCODING_ISO_8859_10, /// Latin 6 (Nordic)
FONTENCODING_LATIN7 = FONTENCODING_ISO_8859_13, /// Latin 7 (Baltic Rim)
FONTENCODING_LATIN8 = FONTENCODING_ISO_8859_14, /// Latin 8 (Celtic)
FONTENCODING_LATIN9 = FONTENCODING_ISO_8859_15, /// Latin 9 AKA Latin 0
FONTENCODING_LATIN10 = FONTENCODING_ISO_8859_16, /// Latin 10
FONTENCODING_USASCII = FONTENCODING_ISO_8859_1, /// Latin 1
FONTENCODING_WESTEUROPE = FONTENCODING_ISO_8859_1, /// Latin 1 (West European)
FONTENCODING_EASTEUROPE = FONTENCODING_ISO_8859_2, /// Latin 2 (East European)
FONTENCODING_SOUTHEUROPE = FONTENCODING_ISO_8859_3, /// Latin 3 (South European)
FONTENCODING_NORTHEUROPE = FONTENCODING_ISO_8859_4, /// Latin 4 (North European)
FONTENCODING_CYRILLIC = FONTENCODING_ISO_8859_5, /// Cyrillic
FONTENCODING_RUSSIAN = FONTENCODING_KOI8, /// Cyrillic
FONTENCODING_ARABIC = FONTENCODING_ISO_8859_6, /// Arabic
FONTENCODING_GREEK = FONTENCODING_ISO_8859_7, /// Greek
FONTENCODING_HEBREW = FONTENCODING_ISO_8859_8, /// Hebrew
FONTENCODING_TURKISH = FONTENCODING_ISO_8859_9, /// Latin 5 (Turkish)
FONTENCODING_NORDIC = FONTENCODING_ISO_8859_10, /// Latin 6 (Nordic)
FONTENCODING_THAI = FONTENCODING_ISO_8859_11, /// Thai
FONTENCODING_BALTIC = FONTENCODING_ISO_8859_13, /// Latin 7 (Baltic Rim)
FONTENCODING_CELTIC = FONTENCODING_ISO_8859_14 /// Latin 8 (Celtic)
};
/// Font style
struct FXFontDesc {
FXchar face[116]; /// Face name
FXushort size; /// Size in deci-points
FXushort weight; /// Weight [light, normal, bold, ...]
FXushort slant; /// Slant [normal, italic, oblique, ...]
FXushort setwidth; /// Set width [normal, condensed, expanded, ...]
FXushort encoding; /// Encoding of character set
FXushort flags; /// Flags
};
class FXDC;
class FXDCWindow;
/// Font class
class FXAPI FXFont : public FXId {
friend class FXDCWindow;
FXDECLARE(FXFont)
protected:
FXString wantedName; // Desired font font name
FXString actualName; // Matched font font name
FXushort wantedSize; // Font size (points*10)
FXushort actualSize; // Actual size that was matched
FXushort wantedWeight; // Font weight
FXushort actualWeight; // Font weight
FXushort wantedSlant; // Font slant
FXushort actualSlant; // Font slant
FXushort wantedSetwidth; // Relative setwidth
FXushort actualSetwidth; // Relative setwidth
FXushort wantedEncoding; // Character set encoding
FXushort actualEncoding; // Character set encoding
FXushort hints; // Matching hint flags
FXushort flags; // Actual flags
FXshort angle; // Angle
void *font; // Info about the font
private:
#ifdef WIN32
FXID dc;
#endif
protected:
FXFont();
void* match(const FXString& wantfamily,const FXString& wantforge,FXuint wantsize,FXuint wantweight,FXuint wantslant,FXuint wantsetwidth,FXuint wantencoding,FXuint wanthints,FXint res);
private:
FXFont(const FXFont&);
FXFont &operator=(const FXFont&);
public:
/// Font pitch hints
enum {
Fixed = 1, /// Fixed pitch, mono-spaced
Variable = 2 /// Variable pitch, proportional spacing
};
/// Font style hints
enum {
Decorative = 4, /// Fancy fonts
Modern = 8, /// Monospace typewriter font
Roman = 16, /// Variable width times-like font, serif
Script = 32, /// Script or cursive
Swiss = 64, /// Helvetica/swiss type font, sans-serif
System = 128, /// System font
X11 = 256, /// Raw X11 font string
Scalable = 512, /// Scalable fonts
Polymorphic = 1024, /// Polymorphic fonts, e.g. parametric weight, slant, etc.
Rotatable = 2048 /// Rotatable fonts
};
/// Font slant options
enum {
ReverseOblique = 1, /// Reversed oblique
ReverseItalic = 2, /// Reversed italic
Straight = 5, /// Straight, not slanted
Italic = 8, /// Italics
Oblique = 9 /// Oblique slant
};
/// Font weight options
enum {
Thin = 10, /// Thin
ExtraLight = 20, /// Extra light
Light = 30, /// Light
Normal = 40, /// Normal or regular weight
Medium = 50, /// Medium bold face
DemiBold = 60, /// Demi bold face
Bold = 70, /// Bold face
ExtraBold = 80, /// Extra
Black = 90 /// Black
};
/// Condensed or expanded options
enum {
UltraCondensed = 50, /// Ultra condensed printing
ExtraCondensed = 63, /// Extra condensed
Condensed = 75, /// Condensed
SemiCondensed = 87, /// Semi-condensed
NonExpanded = 100, /// Regular printing
SemiExpanded = 113, /// Semi expanded
Expanded = 125, /// Expanded
ExtraExpanded = 150, /// Extra expanded
UltraExpanded = 200 /// Ultra expanded
};
public:
/**
* Construct a font with given font description of the form:
*
* fontname [ "[" foundry "]" ] ["," size ["," weight ["," slant ["," setwidth ["," encoding ["," hints]]]]]]
*
* For example:
*
* "helvetica [bitstream],120,bold,italic,normal,iso8859-1,0"
*
* Typically, at least the font name, and size must be given for
* normal font matching. As a special case, raw X11 fonts can also be
* passed, for example:
*
* "9x15bold"
*
* Note: use of the raw X11 fonts is stronly discouraged.
*/
FXFont(FXApp* a,const FXString& string);
/**
* Construct a font with given name, size in points, weight, slant, character set
* encoding, setwidth, and hints.
* The font name may be comprised of a family name and optional foundry name enclosed in
* square brackets, for example, "helvetica [bitstream]".
*/
FXFont(FXApp* a,const FXString& face,FXuint size,FXuint weight=FXFont::Normal,FXuint slant=FXFont::Straight,FXuint encoding=FONTENCODING_DEFAULT,FXuint setwidth=FXFont::NonExpanded,FXuint h=0);
/// Construct font from font description
FXFont(FXApp* a,const FXFontDesc& fontdesc);
/// Create the font
virtual void create();
/// Detach the font
virtual void detach();
/// Destroy the font
virtual void destroy();
/// Return family part of name
FXString getFamily() const;
/// Return foundry part of name
FXString getFoundry() const;
/// Get font family name
const FXString& getName() const { return wantedName; }
/// Get actual family name
const FXString& getActualName() const { return actualName; }
/// Get size in deci-points
FXuint getSize() const { return wantedSize; }
/// Get actual size in deci-points
FXuint getActualSize() const { return actualSize; }
/// Get font weight
FXuint getWeight() const { return wantedWeight; }
/// Get actual font weight
FXuint getActualWeight() const { return actualWeight; }
/// Get slant
FXuint getSlant() const { return wantedSlant; }
/// Get actual slant
FXuint getActualSlant() const { return actualSlant; }
/// Get character set encoding
FXuint getEncoding() const { return wantedEncoding; }
/// Get actual encoding
FXuint getActualEncoding() const { return actualEncoding; }
/// Get setwidth
FXuint getSetWidth() const { return wantedSetwidth; }
/// Get actual setwidth
FXuint getActualSetWidth() const { return actualSetwidth; }
/// Get hints
FXuint getHints() const { return hints; }
/// Get flags
FXuint getFlags() const { return flags; }
/// Get font description
void getFontDesc(FXFontDesc& fontdesc) const;
/// Change font description
virtual void setFontDesc(const FXFontDesc& fontdesc);
/// Return angle
FXint getAngle() const { return angle; }
/// Set to new angle, in degrees*64 relative to positive x axis
virtual void setAngle(FXint ang);
/**
* Return the font description as a string suitable for
* parsing with setFont(), see above.
*/
FXString getFont() const;
/**
* Change the font to the specified font description string.
*/
virtual void setFont(const FXString& string);
/// Find out if the font is monotype or proportional
virtual FXbool isFontMono() const;
/// See if font has glyph for ch
virtual FXbool hasChar(FXwchar ch) const;
/// Get first character glyph in font
virtual FXwchar getMinChar() const;
/// Get last character glyph in font
virtual FXwchar getMaxChar() const;
/// Left bearing
virtual FXint leftBearing(FXwchar ch) const;
/// Right bearing
virtual FXint rightBearing(FXwchar ch) const;
/// Width of widest character in font
virtual FXint getFontWidth() const;
/// Height of highest character in font
virtual FXint getFontHeight() const;
/// Ascent from baseline
virtual FXint getFontAscent() const;
/// Descent from baseline
virtual FXint getFontDescent() const;
/// Get font leading [that is lead-ing as in Pb!]
virtual FXint getFontLeading() const;
/// Get font line spacing
virtual FXint getFontSpacing() const;
/// Calculate width of single wide character in this font
virtual FXint getCharWidth(const FXwchar ch) const;
/// Calculate width of given text in this font
virtual FXint getTextWidth(const FXString& string) const;
/// Calculate width of given text in this font
virtual FXint getTextWidth(const FXchar* string,FXuint length) const;
/// Calculate height of given text in this font
virtual FXint getTextHeight(const FXString& string) const;
/// Calculate height of given text in this font
virtual FXint getTextHeight(const FXchar *string,FXuint length) const;
/**
* List all fonts matching hints. If listFonts() returns TRUE then
* fonts points to a newly-allocated array of length numfonts. It
* is the caller's responsibility to free this array using FXFREE().
*/
static FXbool listFonts(FXFontDesc*& fonts,FXuint& numfonts,const FXString& face,FXuint wt=0,FXuint sl=0,FXuint sw=0,FXuint en=0,FXuint h=0);
/// Save font data into stream
virtual void save(FXStream& store) const;
/// Load font data from stream
virtual void load(FXStream& store);
/// Destroy font
virtual ~FXFont();
};
}
#endif
fox-1.6.49/include/fx.h 0000664 0001750 0001750 00000015072 12130340076 011544 0000000 0000000 /********************************************************************************
* *
* M a i n F O X I n c l u d e F i l e *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: fx.h,v 1.104 2006/01/22 17:58:13 fox Exp $ *
********************************************************************************/
#ifndef FX_H
#define FX_H
// Basic includes
#include
#include
#include
#include
#include
// FOX defines
#include "fxver.h"
#include "fxdefs.h"
#include "fxascii.h"
#include "fxunicode.h"
// FOX classes
#include "FXHash.h"
#include "FXException.h"
#include "FXThread.h"
#include "FXStream.h"
#include "FXIO.h"
#include "FXFile.h"
#include "FXPipe.h"
#include "FXSocket.h"
#include "FXFileStream.h"
#include "FXMemoryStream.h"
#include "FXString.h"
#include "FXSize.h"
#include "FXPoint.h"
#include "FXRectangle.h"
#include "FXObject.h"
#include "FXDelegator.h"
#include "FXDict.h"
#include "FXPath.h"
#include "FXSystem.h"
#include "FXStat.h"
#include "FXDir.h"
#include "FXDate.h"
#include "FXURL.h"
#include "FXStringDict.h"
#include "FXSettings.h"
#include "FXRegistry.h"
#include "FXObjectList.h"
#include "FXAccelTable.h"
#include "FXRecentFiles.h"
#include "FXApp.h"
#include "FXId.h"
#include "FXVisual.h"
#include "FXFont.h"
#include "FXCursor.h"
#include "FXGUISignal.h"
#include "FXCURCursor.h"
#include "FXGIFCursor.h"
#include "FXDrawable.h"
#include "FXBitmap.h"
#include "FXImage.h"
#include "FXIcon.h"
#include "FXGIFImage.h"
#include "FXIFFImage.h"
#include "FXBMPImage.h"
#include "FXICOImage.h"
#include "FXXBMImage.h"
#include "FXXPMImage.h"
#include "FXPCXImage.h"
#include "FXTGAImage.h"
#include "FXRGBImage.h"
#include "FXPPMImage.h"
#include "FXRASImage.h"
#include "FXGIFIcon.h"
#include "FXIFFIcon.h"
#include "FXBMPIcon.h"
#include "FXICOIcon.h"
#include "FXXBMIcon.h"
#include "FXXPMIcon.h"
#include "FXPCXIcon.h"
#include "FXTGAIcon.h"
#include "FXRGBIcon.h"
#include "FXPPMIcon.h"
#include "FXRASIcon.h"
#include "FXRegion.h"
#include "FXDC.h"
#include "FXDCWindow.h"
#include "FXDCPrint.h"
#include "FXIconSource.h"
#include "FXIconDict.h"
#include "FXFileDict.h"
#include "FXWindow.h"
#include "FXFrame.h"
#include "FXSeparator.h"
#include "FXLabel.h"
#include "FX7Segment.h"
#include "FXDial.h"
#include "FXKnob.h"
#include "FXColorBar.h"
#include "FXColorRing.h"
#include "FXColorWell.h"
#include "FXColorWheel.h"
#include "FXTextField.h"
#include "FXButton.h"
#include "FXPicker.h"
#include "FXToggleButton.h"
#include "FXTriStateButton.h"
#include "FXCheckButton.h"
#include "FXRadioButton.h"
#include "FXArrowButton.h"
#include "FXMenuButton.h"
#include "FXComposite.h"
#include "FXPacker.h"
#include "FXHorizontalFrame.h"
#include "FXVerticalFrame.h"
#include "FXSpring.h"
#include "FXMatrix.h"
#include "FXSpinner.h"
#include "FXRealSpinner.h"
#include "FXRootWindow.h"
#include "FXCanvas.h"
#include "FXGroupBox.h"
#include "FXShell.h"
#include "FXToolTip.h"
#include "FXPopup.h"
#include "FXTopWindow.h"
#include "FXDialogBox.h"
#include "FXMainWindow.h"
#include "FXMenuPane.h"
#include "FXScrollPane.h"
#include "FXMenuCaption.h"
#include "FXMenuSeparator.h"
#include "FXMenuTitle.h"
#include "FXMenuCascade.h"
#include "FXMenuCommand.h"
#include "FXMenuCheck.h"
#include "FXMenuRadio.h"
#include "FXMenuBar.h"
#include "FXOptionMenu.h"
#include "FXSwitcher.h"
#include "FXTabBar.h"
#include "FXTabBook.h"
#include "FXTabItem.h"
#include "FXScrollBar.h"
#include "FXScrollArea.h"
#include "FXScrollWindow.h"
#include "FXList.h"
#include "FXComboBox.h"
#include "FXListBox.h"
#include "FXTreeList.h"
#include "FXTreeListBox.h"
#include "FXFoldingList.h"
#include "FXBitmapView.h"
#include "FXBitmapFrame.h"
#include "FXImageView.h"
#include "FXImageFrame.h"
#include "FXTable.h"
#include "FXDragCorner.h"
#include "FXStatusBar.h"
#include "FXStatusLine.h"
#include "FXChoiceBox.h"
#include "FXMessageBox.h"
#include "FXDirList.h"
#include "FXSlider.h"
#include "FXRealSlider.h"
#include "FXSplitter.h"
#include "FX4Splitter.h"
#include "FXHeader.h"
#include "FXShutter.h"
#include "FXIconList.h"
#include "FXFileList.h"
#include "FXDirBox.h"
#include "FXDriveBox.h"
#include "FXDirSelector.h"
#include "FXDirDialog.h"
#include "FXFileSelector.h"
#include "FXFileDialog.h"
#include "FXColorSelector.h"
#include "FXColorDialog.h"
#include "FXFontSelector.h"
#include "FXFontDialog.h"
#include "FXUndoList.h"
#include "FXRex.h"
#include "FXText.h"
#include "FXDataTarget.h"
#include "FXProgressBar.h"
#include "FXReplaceDialog.h"
#include "FXRuler.h"
#include "FXRulerView.h"
#include "FXSearchDialog.h"
#include "FXInputDialog.h"
#include "FXProgressDialog.h"
#include "FXWizard.h"
#include "FXMDIButton.h"
#include "FXMDIClient.h"
#include "FXMDIChild.h"
#include "FXDocument.h"
#include "FXDockSite.h"
#include "FXDockBar.h"
#include "FXToolBar.h"
#include "FXDockHandler.h"
#include "FXDockTitle.h"
#include "FXToolBarGrip.h"
#include "FXToolBarShell.h"
#include "FXToolBarTab.h"
#include "FXPrintDialog.h"
#include "FXDebugTarget.h"
#include "FXSplashWindow.h"
#ifndef FX_NO_GLOBAL_NAMESPACE
using namespace FX;
#endif
#endif
fox-1.6.49/include/FXRealSpinner.h 0000664 0001750 0001750 00000017507 12130340076 013614 0000000 0000000 /********************************************************************************
* *
* R e a l - V a l u e d S p i n n e r W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2003,2006 by Bill Baxter. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXRealSpinner.h,v 1.16 2006/02/10 03:53:47 fox Exp $ *
********************************************************************************/
#ifndef FXREALSPINNER_H
#define FXREALSPINNER_H
#ifndef FXPACKER_H
#include "FXPacker.h"
#endif
namespace FX {
/// RealSpinner Options
enum {
REALSPIN_NORMAL = 0, /// Normal, non-cyclic
REALSPIN_CYCLIC = 0x00020000, /// Cyclic spinner
REALSPIN_NOTEXT = 0x00040000, /// No text visible
REALSPIN_NOMAX = 0x00080000, /// Spin all the way up to infinity
REALSPIN_NOMIN = 0x00100000, /// Spin all the way down to -infinity
REALSPIN_LOG = 0x00200000 /// Logarithmic rather than linear
};
class FXTextField;
class FXDial;
/// Spinner control
class FXAPI FXRealSpinner : public FXPacker {
FXDECLARE(FXRealSpinner)
protected:
FXTextField *textField; // Text field
FXArrowButton *upButton; // The up button
FXArrowButton *downButton; // The down button
FXdouble range[2]; // Reported data range
FXdouble incr; // Increment
FXdouble gran; // Granularity
FXdouble pos; // Current position
protected:
FXRealSpinner();
private:
FXRealSpinner(const FXRealSpinner&);
FXRealSpinner& operator=(const FXRealSpinner&);
public:
long onUpdIncrement(FXObject*,FXSelector,void*);
long onCmdIncrement(FXObject*,FXSelector,void*);
long onUpdDecrement(FXObject*,FXSelector,void*);
long onCmdDecrement(FXObject*,FXSelector,void*);
long onCmdEntry(FXObject*,FXSelector,void*);
long onChgEntry(FXObject*,FXSelector,void*);
long onWheelEntry(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetIntValue(FXObject*,FXSelector,void*);
long onCmdGetIntValue(FXObject*,FXSelector,void*);
long onCmdSetIntRange(FXObject*,FXSelector,void*);
long onCmdGetIntRange(FXObject*,FXSelector,void*);
long onCmdSetRealValue(FXObject*,FXSelector,void*);
long onCmdGetRealValue(FXObject*,FXSelector,void*);
long onCmdSetRealRange(FXObject*,FXSelector,void*);
long onCmdGetRealRange(FXObject*,FXSelector,void*);
long onFocusSelf(FXObject*,FXSelector,void*);
public:
enum{
ID_INCREMENT=FXPacker::ID_LAST,
ID_DECREMENT,
ID_ENTRY,
ID_LAST
};
public:
/// Construct a spinner
FXRealSpinner(FXComposite *p,FXint cols,FXObject *tgt=NULL,FXSelector sel=0,FXuint opts=REALSPIN_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Perform layout
virtual void layout();
/// Disable spinner
virtual void disable();
/// Enable spinner
virtual void enable();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Increment spinner
void increment(FXbool notify=FALSE);
/// Increment spinner by certain amount
void incrementByAmount(FXdouble amount,FXbool notify=FALSE);
/// Decrement spinner
void decrement(FXbool notify=FALSE);
/// Decrement spinner by certain amount
void decrementByAmount(FXdouble amount, FXbool notify=FALSE);
/// Return TRUE if in cyclic mode
FXbool isCyclic() const;
/// Set to cyclic mode, i.e. wrap around at maximum/minimum
void setCyclic(FXbool cyclic);
/// Return TRUE if text is visible
FXbool isTextVisible() const;
/// Set text visible flag
void setTextVisible(FXbool shown);
/// Change current value
virtual void setValue(FXdouble value,FXbool notify=FALSE);
/// Return current value
FXdouble getValue() const { return pos; }
/// Change the spinner's range
void setRange(FXdouble lo,FXdouble hi,FXbool notify=FALSE);
/// Get the spinner's current range
void getRange(FXdouble& lo,FXdouble& hi) const { lo=range[0]; hi=range[1]; }
/// Change spinner increment
void setIncrement(FXdouble increment);
/// Return spinner increment
FXdouble getIncrement() const { return incr; }
/// Change spinner granularity
void setGranularity(FXdouble gr);
/// Return spinner granularity
FXdouble getGranularity() const { return gran; }
/// Set the text font
void setFont(FXFont *fnt);
/// Get the text font
FXFont *getFont() const;
/// Set the status line help text for this spinner
void setHelpText(const FXString& text);
/// Get the status line help text for this spinner
const FXString& getHelpText() const;
/// Set the tool tip message for this spinner
void setTipText(const FXString& text);
/// Get the tool tip message for this spinner
const FXString& getTipText() const;
/// Change spinner style
void setSpinnerStyle(FXuint style);
/// Return current spinner style
FXuint getSpinnerStyle() const;
/// Allow editing of the text field
void setEditable(FXbool edit=TRUE);
/// Return TRUE if text field is editable
FXbool isEditable() const;
/// Change color of the up arrow
void setUpArrowColor(FXColor clr);
/// Return color of the up arrow
FXColor getUpArrowColor() const;
/// Change color of the down arrow
void setDownArrowColor(FXColor clr);
/// Return color of the the down arrow
FXColor getDownArrowColor() const;
/// Change text color
void setTextColor(FXColor clr);
/// Return text color
FXColor getTextColor() const;
/// Change selected background color
void setSelBackColor(FXColor clr);
/// Return selected background color
FXColor getSelBackColor() const;
/// Change selected text color
void setSelTextColor(FXColor clr);
/// Return selected text color
FXColor getSelTextColor() const;
/// Changes the cursor color
void setCursorColor(FXColor clr);
/// Return the cursor color
FXColor getCursorColor() const;
/// Change width of text field in terms of number of columns * `m'
void setNumColumns(FXint cols);
/// Return number of columns
FXint getNumColumns() const;
/// Save spinner to a stream
virtual void save(FXStream& store) const;
/// Load spinner from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXRealSpinner();
};
}
#endif
fox-1.6.49/include/FXMenuButton.h 0000664 0001750 0001750 00000017104 12130340076 013463 0000000 0000000 /********************************************************************************
* *
* M e n u B u t t o n W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXMenuButton.h,v 1.24 2006/01/22 17:58:06 fox Exp $ *
********************************************************************************/
#ifndef FXMENUBUTTON_H
#define FXMENUBUTTON_H
#ifndef FXLABEL_H
#include "FXLabel.h"
#endif
namespace FX {
class FXPopup;
// Menu button options
enum {
MENUBUTTON_AUTOGRAY = 0x00800000, /// Automatically gray out when no target
MENUBUTTON_AUTOHIDE = 0x01000000, /// Automatically hide when no target
MENUBUTTON_TOOLBAR = 0x02000000, /// Toolbar style
MENUBUTTON_DOWN = 0, /// Popup window appears below menu button
MENUBUTTON_UP = 0x04000000, /// Popup window appears above menu button
MENUBUTTON_LEFT = 0x08000000, /// Popup window to the left of the menu button
MENUBUTTON_RIGHT = MENUBUTTON_LEFT|MENUBUTTON_UP, /// Popup window to the right of the menu button
MENUBUTTON_NOARROWS = 0x10000000, /// Do not show arrows
MENUBUTTON_ATTACH_LEFT = 0, /// Popup attaches to the left side of the menu button
MENUBUTTON_ATTACH_TOP = MENUBUTTON_ATTACH_LEFT, /// Popup attaches to the top of the menu button
MENUBUTTON_ATTACH_RIGHT = 0x20000000, /// Popup attaches to the right side of the menu button
MENUBUTTON_ATTACH_BOTTOM = MENUBUTTON_ATTACH_RIGHT, /// Popup attaches to the bottom of the menu button
MENUBUTTON_ATTACH_CENTER = 0x40000000, /// Popup attaches to the center of the menu button
MENUBUTTON_ATTACH_BOTH = MENUBUTTON_ATTACH_CENTER|MENUBUTTON_ATTACH_RIGHT /// Popup attaches to both sides of the menu button
};
/**
* A menu button posts a popup menu when clicked.
* There are many ways to control the placement where the popup will appear;
* first, the popup may be placed on either of the four sides relative to the
* menu button; this is controlled by the flags MENUBUTTON_DOWN, etc.
* Next, there are several attachment modes; the popup's left/bottom edge may
* attach to the menu button's left/top edge, or the popup's right/top edge may
* attach to the menu button's right/bottom edge, or both.
* Also, the popup may apear centered relative to the menu button.
* Finally, a small offset may be specified to displace the location of the
* popup by a few pixels so as to account for borders and so on.
* Normally, the menu button shows an arrow pointing to the direction where
* the popup is set to appear; this can be turned off by passing the option
* MENUBUTTON_NOARROWS.
*/
class FXAPI FXMenuButton : public FXLabel {
FXDECLARE(FXMenuButton)
protected:
FXPopup *pane; // Pane to pop up
FXint offsetx; // Shift attachment point x
FXint offsety; // Shift attachment point y
FXbool state; // Pane was popped
protected:
FXMenuButton();
private:
FXMenuButton(const FXMenuButton&);
FXMenuButton &operator=(const FXMenuButton&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onUpdate(FXObject*,FXSelector,void*);
long onEnter(FXObject*,FXSelector,void*);
long onLeave(FXObject*,FXSelector,void*);
long onFocusIn(FXObject*,FXSelector,void*);
long onFocusOut(FXObject*,FXSelector,void*);
long onUngrabbed(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onHotKeyPress(FXObject*,FXSelector,void*);
long onHotKeyRelease(FXObject*,FXSelector,void*);
long onCmdPost(FXObject*,FXSelector,void*);
long onCmdUnpost(FXObject*,FXSelector,void*);
public:
/// Constructor
FXMenuButton(FXComposite* p,const FXString& text,FXIcon* ic=NULL,FXPopup* pup=NULL,FXuint opts=JUSTIFY_NORMAL|ICON_BEFORE_TEXT|MENUBUTTON_DOWN,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Returns true because a menu button can receive focus
virtual bool canFocus() const;
/// Remove the focus from this window
virtual void killFocus();
/// Return true if window logically contains the given point
virtual bool contains(FXint parentx,FXint parenty) const;
/// Change the popup menu
void setMenu(FXPopup *pup);
/// Return current popup menu
FXPopup* getMenu() const { return pane; }
/// Set X offset where menu pops up relative to button
void setXOffset(FXint offx){ offsetx=offx; }
/// Return current X offset
FXint getXOffset() const { return offsetx; }
/// Set Y offset where menu pops up relative to button
void setYOffset(FXint offy){ offsety=offy; }
/// Return current Y offset
FXint getYOffset() const { return offsety; }
/// Change menu button style
void setButtonStyle(FXuint style);
/// Get menu button style
FXuint getButtonStyle() const;
/// Change popup style
void setPopupStyle(FXuint style);
/// Get popup style
FXuint getPopupStyle() const;
/// Change attachment
void setAttachment(FXuint att);
/// Get attachment
FXuint getAttachment() const;
/// Save menu button to a stream
virtual void save(FXStream& store) const;
/// Load menu button from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXMenuButton();
};
}
#endif
fox-1.6.49/include/FXBZFileStream.h 0000664 0001750 0001750 00000014646 12130340076 013662 0000000 0000000 /********************************************************************************
* *
* B Z F i l e S t r e a m C l a s s e s *
* *
*********************************************************************************
* Copyright (C) 1999,2006 by Lyle Johnson. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXBZFileStream.h,v 1.5.2.1 2007/09/28 16:42:19 fox Exp $ *
********************************************************************************/
#ifdef HAVE_BZ2LIB_H
#ifndef FXBZFILESTREAM_H
#define FXBZFILESTREAM_H
#ifndef FXFILESTREAM_H
#include "FXFileStream.h"
#endif
namespace FX {
struct BZBlock;
/// BZIP2 compressed file stream
class FXAPI FXBZFileStream : public FXFileStream {
private:
BZBlock *bz;
int ac;
protected:
virtual FXuval writeBuffer(FXuval count);
virtual FXuval readBuffer(FXuval count);
public:
/// Create BZIP2 file stream
FXBZFileStream(const FXObject* cont=NULL);
/// Open file stream
bool open(const FXString& filename,FXStreamDirection save_or_load,FXuval size=8192);
/// Flush buffer
virtual bool flush();
/// Close file stream
virtual bool close();
/// Get position
FXlong position() const { return FXStream::position(); }
/// Move to position
virtual bool position(FXlong,FXWhence){ return FALSE; }
/// Save single items to stream
FXBZFileStream& operator<<(const FXuchar& v){ FXStream::operator<<(v); return *this; }
FXBZFileStream& operator<<(const FXchar& v){ FXStream::operator<<(v); return *this; }
FXBZFileStream& operator<<(const FXushort& v){ FXStream::operator<<(v); return *this; }
FXBZFileStream& operator<<(const FXshort& v){ FXStream::operator<<(v); return *this; }
FXBZFileStream& operator<<(const FXuint& v){ FXStream::operator<<(v); return *this; }
FXBZFileStream& operator<<(const FXint& v){ FXStream::operator<<(v); return *this; }
FXBZFileStream& operator<<(const FXfloat& v){ FXStream::operator<<(v); return *this; }
FXBZFileStream& operator<<(const FXdouble& v){ FXStream::operator<<(v); return *this; }
FXBZFileStream& operator<<(const FXlong& v){ FXStream::operator<<(v); return *this; }
FXBZFileStream& operator<<(const FXulong& v){ FXStream::operator<<(v); return *this; }
/// Save arrays of items to stream
FXBZFileStream& save(const FXuchar* p,FXuval n){ FXStream::save(p,n); return *this; }
FXBZFileStream& save(const FXchar* p,FXuval n){ FXStream::save(p,n); return *this; }
FXBZFileStream& save(const FXushort* p,FXuval n){ FXStream::save(p,n); return *this; }
FXBZFileStream& save(const FXshort* p,FXuval n){ FXStream::save(p,n); return *this; }
FXBZFileStream& save(const FXuint* p,FXuval n){ FXStream::save(p,n); return *this; }
FXBZFileStream& save(const FXint* p,FXuval n){ FXStream::save(p,n); return *this; }
FXBZFileStream& save(const FXfloat* p,FXuval n){ FXStream::save(p,n); return *this; }
FXBZFileStream& save(const FXdouble* p,FXuval n){ FXStream::save(p,n); return *this; }
FXBZFileStream& save(const FXlong* p,FXuval n){ FXStream::save(p,n); return *this; }
FXBZFileStream& save(const FXulong* p,FXuval n){ FXStream::save(p,n); return *this; }
/// Load single items from stream
FXBZFileStream& operator>>(FXuchar& v){ FXStream::operator>>(v); return *this; }
FXBZFileStream& operator>>(FXchar& v){ FXStream::operator>>(v); return *this; }
FXBZFileStream& operator>>(FXushort& v){ FXStream::operator>>(v); return *this; }
FXBZFileStream& operator>>(FXshort& v){ FXStream::operator>>(v); return *this; }
FXBZFileStream& operator>>(FXuint& v){ FXStream::operator>>(v); return *this; }
FXBZFileStream& operator>>(FXint& v){ FXStream::operator>>(v); return *this; }
FXBZFileStream& operator>>(FXfloat& v){ FXStream::operator>>(v); return *this; }
FXBZFileStream& operator>>(FXdouble& v){ FXStream::operator>>(v); return *this; }
FXBZFileStream& operator>>(FXlong& v){ FXStream::operator>>(v); return *this; }
FXBZFileStream& operator>>(FXulong& v){ FXStream::operator>>(v); return *this; }
/// Load arrays of items from stream
FXBZFileStream& load(FXuchar* p,FXuval n){ FXStream::load(p,n); return *this; }
FXBZFileStream& load(FXchar* p,FXuval n){ FXStream::load(p,n); return *this; }
FXBZFileStream& load(FXushort* p,FXuval n){ FXStream::load(p,n); return *this; }
FXBZFileStream& load(FXshort* p,FXuval n){ FXStream::load(p,n); return *this; }
FXBZFileStream& load(FXuint* p,FXuval n){ FXStream::load(p,n); return *this; }
FXBZFileStream& load(FXint* p,FXuval n){ FXStream::load(p,n); return *this; }
FXBZFileStream& load(FXfloat* p,FXuval n){ FXStream::load(p,n); return *this; }
FXBZFileStream& load(FXdouble* p,FXuval n){ FXStream::load(p,n); return *this; }
FXBZFileStream& load(FXlong* p,FXuval n){ FXStream::load(p,n); return *this; }
FXBZFileStream& load(FXulong* p,FXuval n){ FXStream::load(p,n); return *this; }
/// Save object
FXBZFileStream& saveObject(const FXObject* v){ FXStream::saveObject(v); return *this; }
/// Load object
FXBZFileStream& loadObject(FXObject*& v){ FXStream::loadObject(v); return *this; }
/// Clean up
virtual ~FXBZFileStream();
};
}
#endif
#endif
fox-1.6.49/include/FXProgressBar.h 0000664 0001750 0001750 00000012400 12130340076 013606 0000000 0000000 /********************************************************************************
* *
* P r o g r e s s B a r W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXProgressBar.h,v 1.22 2006/01/22 17:58:07 fox Exp $ *
********************************************************************************/
#ifndef FXPROGRESSBAR_H
#define FXPROGRESSBAR_H
#ifndef FXFRAME_H
#include "FXFrame.h"
#endif
namespace FX {
/// Progress bar styles
enum {
PROGRESSBAR_HORIZONTAL = 0, /// Horizontal display
PROGRESSBAR_VERTICAL = 0x00008000, /// Vertical display
PROGRESSBAR_PERCENTAGE = 0x00010000, /// Show percentage done
PROGRESSBAR_DIAL = 0x00020000, /// Show as a dial instead of bar
PROGRESSBAR_NORMAL = FRAME_SUNKEN|FRAME_THICK
};
/// Progress bar widget
class FXAPI FXProgressBar : public FXFrame {
FXDECLARE(FXProgressBar)
protected:
FXuint progress; // Integer percentage number
FXuint total; // Amount for completion
FXint barsize; // Bar size
FXFont* font;
FXColor barBGColor;
FXColor barColor;
FXColor textNumColor;
FXColor textAltColor;
protected:
FXProgressBar(){}
void drawInterior(FXDCWindow& dc);
private:
FXProgressBar(const FXProgressBar&);
FXProgressBar &operator=(const FXProgressBar&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetIntValue(FXObject*,FXSelector,void*);
long onCmdGetIntValue(FXObject*,FXSelector,void*);
public:
/// Construct progress bar
FXProgressBar(FXComposite* p,FXObject* target=NULL,FXSelector sel=0,FXuint opts=PROGRESSBAR_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Change the amount of progress
void setProgress(FXuint value);
/// Get current progress
FXuint getProgress() const { return progress; }
/// Set total amount of progress
void setTotal(FXuint value);
/// Return total amount of progrss
FXuint getTotal() const { return total; }
/// Increment progress by given amount
void increment(FXuint value);
/// Hide progress percentage
void hideNumber();
/// Show progress percentage
void showNumber();
/// Change progress bar width
void setBarSize(FXint size);
/// Return progress bar width
FXint getBarSize() const { return barsize; }
/// Change backgroundcolor
void setBarBGColor(FXColor clr);
/// Return background color
FXColor getBarBGColor() const { return barBGColor; }
/// Change bar color
void setBarColor(FXColor clr);
/// Return bar color
FXColor getBarColor() const { return barColor; }
/// Change text color
void setTextColor(FXColor clr);
/// Return text color
FXColor getTextColor() const { return textNumColor; }
/// Change alternate text color shown when bar under text
void setTextAltColor(FXColor clr);
/// Return alternate text color
FXColor getTextAltColor() const { return textAltColor; }
/// Set the text font
void setFont(FXFont *fnt);
/// Get the text font
FXFont* getFont() const { return font; }
/// Change progress bar style
void setBarStyle(FXuint style);
/// Return current progress bar style
FXuint getBarStyle() const;
/// Save progress bar to a stream
virtual void save(FXStream& store) const;
/// Load progress bar from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXProgressBar();
};
}
#endif
fox-1.6.49/include/FXWindow.h 0000664 0001750 0001750 00000070130 12130340076 012630 0000000 0000000 /********************************************************************************
* *
* W i n d o w O b j e c t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXWindow.h,v 1.149 2006/01/22 17:58:12 fox Exp $ *
********************************************************************************/
#ifndef FXWINDOW_H
#define FXWINDOW_H
#ifndef FXDRAWABLE_H
#include "FXDrawable.h"
#endif
namespace FX {
/// Layout hints for child widgets
enum {
LAYOUT_NORMAL = 0, /// Default layout mode
LAYOUT_SIDE_TOP = 0, /// Pack on top side (default)
LAYOUT_SIDE_BOTTOM = 0x00000001, /// Pack on bottom side
LAYOUT_SIDE_LEFT = 0x00000002, /// Pack on left side
LAYOUT_SIDE_RIGHT = LAYOUT_SIDE_LEFT|LAYOUT_SIDE_BOTTOM, /// Pack on right side
LAYOUT_FILL_COLUMN = 0x00000001, /// Matrix column is stretchable
LAYOUT_FILL_ROW = 0x00000002, /// Matrix row is stretchable
LAYOUT_LEFT = 0, /// Stick on left (default)
LAYOUT_RIGHT = 0x00000004, /// Stick on right
LAYOUT_CENTER_X = 0x00000008, /// Center horizontally
LAYOUT_FIX_X = LAYOUT_RIGHT|LAYOUT_CENTER_X, /// X fixed
LAYOUT_TOP = 0, /// Stick on top (default)
LAYOUT_BOTTOM = 0x00000010, /// Stick on bottom
LAYOUT_CENTER_Y = 0x00000020, /// Center vertically
LAYOUT_FIX_Y = LAYOUT_BOTTOM|LAYOUT_CENTER_Y, /// Y fixed
LAYOUT_DOCK_SAME = 0, /// Dock on same galley if it fits
LAYOUT_DOCK_NEXT = 0x00000040, /// Dock on next galley
LAYOUT_RESERVED_1 = 0x00000080,
LAYOUT_FIX_WIDTH = 0x00000100, /// Width fixed
LAYOUT_FIX_HEIGHT = 0x00000200, /// height fixed
LAYOUT_MIN_WIDTH = 0, /// Minimum width is the default
LAYOUT_MIN_HEIGHT = 0, /// Minimum height is the default
LAYOUT_FILL_X = 0x00000400, /// Stretch or shrink horizontally
LAYOUT_FILL_Y = 0x00000800, /// Stretch or shrink vertically
LAYOUT_FILL = LAYOUT_FILL_X|LAYOUT_FILL_Y, /// Stretch or shrink in both directions
LAYOUT_EXPLICIT = LAYOUT_FIX_X|LAYOUT_FIX_Y|LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT /// Explicit placement
};
/// Frame border appearance styles (for subclasses)
enum {
FRAME_NONE = 0, /// Default is no frame
FRAME_SUNKEN = 0x00001000, /// Sunken border
FRAME_RAISED = 0x00002000, /// Raised border
FRAME_THICK = 0x00004000, /// Thick border
FRAME_GROOVE = FRAME_THICK, /// A groove or etched-in border
FRAME_RIDGE = FRAME_THICK|FRAME_RAISED|FRAME_SUNKEN, /// A ridge or embossed border
FRAME_LINE = FRAME_RAISED|FRAME_SUNKEN, /// Simple line border
FRAME_NORMAL = FRAME_SUNKEN|FRAME_THICK /// Regular raised/thick border
};
/// Packing style (for packers)
enum {
PACK_NORMAL = 0, /// Default is each its own size
PACK_UNIFORM_HEIGHT = 0x00008000, /// Uniform height
PACK_UNIFORM_WIDTH = 0x00010000 /// Uniform width
};
class FXIcon;
class FXBitmap;
class FXCursor;
class FXRegion;
class FXComposite;
class FXAccelTable;
class FXComposeContext;
/// Base class for all windows
class FXAPI FXWindow : public FXDrawable {
FXDECLARE(FXWindow)
friend class FXApp;
private:
FXWindow *parent; // Parent Window
FXWindow *owner; // Owner Window
FXWindow *first; // First Child
FXWindow *last; // Last Child
FXWindow *next; // Next Sibling
FXWindow *prev; // Previous Sibling
FXWindow *focus; // Focus Child
FXuint wk; // Window Key
protected:
FXComposeContext *composeContext; // Compose context
FXCursor *defaultCursor; // Normal Cursor
FXCursor *dragCursor; // Cursor during drag
FXAccelTable *accelTable; // Accelerator table
FXObject *target; // Target object
FXSelector message; // Message ID
FXint xpos; // Window X Position
FXint ypos; // Window Y Position
FXColor backColor; // Window background color
FXString tag; // Help tag
FXuint flags; // Window state flags
FXuint options; // Window options
public:
static FXDragType octetType; // Raw octet stream
static FXDragType deleteType; // Delete request
static FXDragType textType; // Ascii text request
static FXDragType utf8Type; // UTF-8 text request
static FXDragType utf16Type; // UTF-16 text request
static FXDragType colorType; // Color
static FXDragType urilistType; // URI List
static const FXDragType stringType; // Clipboard text type (pre-registered)
static const FXDragType imageType; // Clipboard image type (pre-registered)
protected:
FXWindow();
FXWindow(FXApp* a,FXVisual *vis);
FXWindow(FXApp* a,FXWindow* own,FXuint opts,FXint x,FXint y,FXint w,FXint h);
static FXWindow* findDefault(FXWindow* window);
static FXWindow* findInitial(FXWindow* window);
virtual bool doesOverrideRedirect() const;
protected:
#ifdef WIN32
virtual FXID GetDC() const;
virtual int ReleaseDC(FXID) const;
virtual const char* GetClass() const;
#else
void addColormapWindows();
void remColormapWindows();
#endif
private:
FXWindow(const FXWindow&);
FXWindow& operator=(const FXWindow&);
protected:
// Window state flags
enum {
FLAG_SHOWN = 0x00000001, // Is shown
FLAG_ENABLED = 0x00000002, // Able to receive input
FLAG_UPDATE = 0x00000004, // Is subject to GUI update
FLAG_DROPTARGET = 0x00000008, // Drop target
FLAG_FOCUSED = 0x00000010, // Has focus
FLAG_DIRTY = 0x00000020, // Needs layout
FLAG_RECALC = 0x00000040, // Needs recalculation
FLAG_TIP = 0x00000080, // Show tip
FLAG_HELP = 0x00000100, // Show help
FLAG_DEFAULT = 0x00000200, // Default widget
FLAG_INITIAL = 0x00000400, // Initial widget
FLAG_SHELL = 0x00000800, // Shell window
FLAG_ACTIVE = 0x00001000, // Window is active
FLAG_PRESSED = 0x00002000, // Button has been pressed
FLAG_KEY = 0x00004000, // Keyboard key pressed
FLAG_CARET = 0x00008000, // Caret is on
FLAG_CHANGED = 0x00010000, // Window data changed
FLAG_LASSO = 0x00020000, // Lasso mode
FLAG_TRYDRAG = 0x00040000, // Tentative drag mode
FLAG_DODRAG = 0x00080000, // Doing drag mode
FLAG_SCROLLINSIDE = 0x00100000, // Scroll only when inside
FLAG_SCROLLING = 0x00200000, // Right mouse scrolling
FLAG_OWNED = 0x00400000
};
public:
// Message handlers
long onPaint(FXObject*,FXSelector,void*);
long onMap(FXObject*,FXSelector,void*);
long onUnmap(FXObject*,FXSelector,void*);
long onConfigure(FXObject*,FXSelector,void*);
long onUpdate(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onMouseWheel(FXObject*,FXSelector,void*);
long onEnter(FXObject*,FXSelector,void*);
long onLeave(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onMiddleBtnPress(FXObject*,FXSelector,void*);
long onMiddleBtnRelease(FXObject*,FXSelector,void*);
long onRightBtnPress(FXObject*,FXSelector,void*);
long onRightBtnRelease(FXObject*,FXSelector,void*);
long onBeginDrag(FXObject*,FXSelector,void*);
long onEndDrag(FXObject*,FXSelector,void*);
long onDragged(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onUngrabbed(FXObject*,FXSelector,void*);
long onDestroy(FXObject*,FXSelector,void*);
long onFocusSelf(FXObject*,FXSelector,void*);
long onFocusIn(FXObject*,FXSelector,void*);
long onFocusOut(FXObject*,FXSelector,void*);
long onSelectionLost(FXObject*,FXSelector,void*);
long onSelectionGained(FXObject*,FXSelector,void*);
long onSelectionRequest(FXObject*,FXSelector,void*);
long onClipboardLost(FXObject*,FXSelector,void*);
long onClipboardGained(FXObject*,FXSelector,void*);
long onClipboardRequest(FXObject*,FXSelector,void*);
long onDNDEnter(FXObject*,FXSelector,void*);
long onDNDLeave(FXObject*,FXSelector,void*);
long onDNDMotion(FXObject*,FXSelector,void*);
long onDNDDrop(FXObject*,FXSelector,void*);
long onDNDRequest(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
long onCmdShow(FXObject*,FXSelector,void*);
long onCmdHide(FXObject*,FXSelector,void*);
long onUpdToggleShown(FXObject*,FXSelector,void*);
long onCmdToggleShown(FXObject*,FXSelector,void*);
long onCmdRaise(FXObject*,FXSelector,void*);
long onCmdLower(FXObject*,FXSelector,void*);
long onCmdEnable(FXObject*,FXSelector,void*);
long onCmdDisable(FXObject*,FXSelector,void*);
long onUpdToggleEnabled(FXObject*,FXSelector,void*);
long onCmdToggleEnabled(FXObject*,FXSelector,void*);
long onCmdUpdate(FXObject*,FXSelector,void*);
long onUpdYes(FXObject*,FXSelector,void*);
long onCmdDelete(FXObject*,FXSelector,void*);
public:
// Message ID's common to most Windows
enum {
ID_NONE,
ID_HIDE, // ID_HIDE+FALSE
ID_SHOW, // ID_HIDE+TRUE
ID_TOGGLESHOWN,
ID_LOWER,
ID_RAISE,
ID_DELETE,
ID_DISABLE, // ID_DISABLE+FALSE
ID_ENABLE, // ID_DISABLE+TRUE
ID_TOGGLEENABLED,
ID_UNCHECK, // ID_UNCHECK+FALSE
ID_CHECK, // ID_UNCHECK+TRUE
ID_UNKNOWN, // ID_UNCHECK+MAYBE
ID_UPDATE,
ID_AUTOSCROLL,
ID_TIPTIMER,
ID_HSCROLLED,
ID_VSCROLLED,
ID_SETVALUE,
ID_SETINTVALUE,
ID_SETREALVALUE,
ID_SETSTRINGVALUE,
ID_SETICONVALUE,
ID_SETINTRANGE,
ID_SETREALRANGE,
ID_GETINTVALUE,
ID_GETREALVALUE,
ID_GETSTRINGVALUE,
ID_GETICONVALUE,
ID_GETINTRANGE,
ID_GETREALRANGE,
ID_SETHELPSTRING,
ID_GETHELPSTRING,
ID_SETTIPSTRING,
ID_GETTIPSTRING,
ID_QUERY_MENU,
ID_HOTKEY,
ID_ACCEL,
ID_UNPOST,
ID_POST,
ID_MDI_TILEHORIZONTAL,
ID_MDI_TILEVERTICAL,
ID_MDI_CASCADE,
ID_MDI_MAXIMIZE,
ID_MDI_MINIMIZE,
ID_MDI_RESTORE,
ID_MDI_CLOSE,
ID_MDI_WINDOW,
ID_MDI_MENUWINDOW,
ID_MDI_MENUMINIMIZE,
ID_MDI_MENURESTORE,
ID_MDI_MENUCLOSE,
ID_MDI_NEXT,
ID_MDI_PREV,
ID_LAST
};
public:
// Common DND type names
static const FXchar octetTypeName[];
static const FXchar deleteTypeName[];
static const FXchar textTypeName[];
static const FXchar colorTypeName[];
static const FXchar urilistTypeName[];
static const FXchar utf8TypeName[];
static const FXchar utf16TypeName[];
public:
/// Constructor
FXWindow(FXComposite* p,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Return a pointer to the parent window
FXWindow* getParent() const { return parent; }
/// Return a pointer to the owner window
FXWindow* getOwner() const { return owner; }
/// Return a pointer to the shell window
FXWindow* getShell() const;
/// Return a pointer to the root window
FXWindow* getRoot() const;
/// Return a pointer to the next (sibling) window, if any
FXWindow* getNext() const { return next; }
/// Return a pointer to the previous (sibling) window , if any
FXWindow* getPrev() const { return prev; }
/// Return a pointer to this window's first child window , if any
FXWindow* getFirst() const { return first; }
/// Return a pointer to this window's last child window, if any
FXWindow* getLast() const { return last; }
/// Return a pointer to the currently focused child window
FXWindow* getFocus() const { return focus; }
/// Change window key
void setKey(FXuint k){ wk=k; }
/// Return window key
FXuint getKey() const { return wk; }
/// Set the message target object for this window
void setTarget(FXObject *t){ target=t; }
/// Get the message target object for this window, if any
FXObject* getTarget() const { return target; }
/// Set the message identifier for this window
void setSelector(FXSelector sel){ message=sel; }
/// Get the message identifier for this window
FXSelector getSelector() const { return message; }
/// Get this window's x-coordinate, in the parent's coordinate system
FXint getX() const { return xpos; }
/// Get this window's y-coordinate, in the parent's coordinate system
FXint getY() const { return ypos; }
/// Return the default width of this window
virtual FXint getDefaultWidth();
/// Return the default height of this window
virtual FXint getDefaultHeight();
/// Return width for given height
virtual FXint getWidthForHeight(FXint givenheight);
/// Return height for given width
virtual FXint getHeightForWidth(FXint givenwidth);
/// Set this window's x-coordinate, in the parent's coordinate system
void setX(FXint x);
/// Set this window's y-coordinate, in the parent's coordinate system
void setY(FXint y);
/**
* Set the window width; and flag the widget as being in need of
* layout by its parent. This does not immediately update the server-
* side representation of the widget.
*/
void setWidth(FXint w);
/**
* Set the window height; and flag the widget as being in need of
* layout by its parent. This does not immediately update the server-
* side representation of the widget.
*/
void setHeight(FXint h);
/// Set layout hints for this window
void setLayoutHints(FXuint lout);
/// Get layout hints for this window
FXuint getLayoutHints() const;
/// Return a pointer to the accelerator table
FXAccelTable* getAccelTable() const { return accelTable; }
/// Set the accelerator table
void setAccelTable(FXAccelTable* acceltable){ accelTable=acceltable; }
/// Add a hot key
void addHotKey(FXHotKey code);
/// Remove a hot key
void remHotKey(FXHotKey code);
/// Change help tag for this widget
void setHelpTag(const FXString& text){ tag=text; }
/// Get the help tag for this widget
const FXString& getHelpTag() const { return tag; }
/// Return true if window is a shell window
bool isShell() const;
/// Return true if specified window is owned by this window
bool isOwnerOf(const FXWindow* window) const;
/// Return true if specified window is ancestor of this window
bool isChildOf(const FXWindow* window) const;
/// Return true if this window contains child in its subtree
bool containsChild(const FXWindow* child) const;
/// Return the child window at specified coordinates
FXWindow* getChildAt(FXint x,FXint y) const;
/// Return the number of child windows for this window
FXint numChildren() const;
/**
* Return the index (starting from zero) of the specified child window,
* or -1 if the window is not a child or NULL
*/
FXint indexOfChild(const FXWindow *window) const;
/**
* Return the child window at specified index,
* or NULL if the index is negative or out of range
*/
FXWindow* childAtIndex(FXint index) const;
/// Return the common ancestor of window a and window b
static FXWindow* commonAncestor(FXWindow* a,FXWindow* b);
/// Return TRUE if sibling a <= sibling b in list
static bool before(const FXWindow *a,const FXWindow* b);
/// Return TRUE if sibling a >= sibling b in list
static bool after(const FXWindow *a,const FXWindow* b);
/// Return compose context
FXComposeContext* getComposeContext() const { return composeContext; }
/// Create compose context
void createComposeContext();
/// Destroy compose context
void destroyComposeContext();
/// Set the default cursor for this window
void setDefaultCursor(FXCursor* cur);
/// Return the default cursor for this window
FXCursor* getDefaultCursor() const { return defaultCursor; }
/// Set the drag cursor for this window
void setDragCursor(FXCursor* cur);
/// Return the drag cursor for this window
FXCursor* getDragCursor() const { return dragCursor; }
/// Return the cursor position and mouse button-state
FXint getCursorPosition(FXint& x,FXint& y,FXuint& buttons) const;
/// Warp the cursor to the new position
FXint setCursorPosition(FXint x,FXint y);
/// Return true if this window is able to receive mouse and keyboard events
bool isEnabled() const;
/// Return true if the window is active
bool isActive() const;
/// Return true if this window is a control capable of receiving the focus
virtual bool canFocus() const;
/// Return true if this window has the focus
bool hasFocus() const;
/// Return true if this window is in focus chain
bool inFocusChain() const;
/// Move the focus to this window
virtual void setFocus();
/// Remove the focus from this window
virtual void killFocus();
/// Notification that focus moved to new child
virtual void changeFocus(FXWindow *child);
/**
* This changes the default window which responds to the Return
* key in a dialog. If enable is TRUE, this window becomes the default
* window; when enable is FALSE, this window will be no longer the
* default window. Finally, when enable is MAYBE, the default window
* will revert to the initial default window.
*/
virtual void setDefault(FXbool enable=TRUE);
/// Return true if this is the default window
bool isDefault() const;
/// Make this window the initial default window
void setInitial(bool enable=true);
/// Return true if this is the initial default window
bool isInitial() const;
/// Enable the window to receive mouse and keyboard events
virtual void enable();
/// Disable the window from receiving mouse and keyboard events
virtual void disable();
/// Create all of the server-side resources for this window
virtual void create();
/// Attach foreign window handle to this window
virtual void attach(FXID w);
/// Detach the server-side resources for this window
virtual void detach();
/// Destroy the server-side resources for this window
virtual void destroy();
/// Set window shape by means of region
virtual void setShape(const FXRegion& region);
/// Set window shape by means of bitmap
virtual void setShape(FXBitmap* bitmap);
/// Set window shape by means of icon
virtual void setShape(FXIcon* icon);
/// Clear window shape
virtual void clearShape();
/// Raise this window to the top of the stacking order
virtual void raise();
/// Lower this window to the bottom of the stacking order
virtual void lower();
/**
* Move the window immediately, in the parent's coordinate system.
* Update the server representation as well if the window is realized.
* Perform layout of the children when necessary.
*/
virtual void move(FXint x,FXint y);
/**
* Resize the window to the specified width and height immediately,
* updating the server representation as well, if the window was realized.
* Perform layout of the children when necessary.
*/
virtual void resize(FXint w,FXint h);
/**
* Move and resize the window immediately, in the parent's coordinate system.
* Update the server representation as well if the window is realized.
* Perform layout of the children when necessary.
*/
virtual void position(FXint x,FXint y,FXint w,FXint h);
/// Mark this window's layout as dirty for later layout
virtual void recalc();
/// Perform layout immediately
virtual void layout();
/// Generate a SEL_UPDATE message for the window and its children
void forceRefresh();
/// Reparent this window under new father before other
virtual void reparent(FXWindow* father,FXWindow *other=NULL);
/// Scroll rectangle x,y,w,h by a shift of dx,dy
void scroll(FXint x,FXint y,FXint w,FXint h,FXint dx,FXint dy) const;
/// Mark the specified rectangle to be repainted later
void update(FXint x,FXint y,FXint w,FXint h) const;
/// Mark the entire window to be repainted later
void update() const;
/// Process any outstanding repaint messages immediately, for the given rectangle
void repaint(FXint x,FXint y,FXint w,FXint h) const;
/// Process any outstanding repaint messages immediately
void repaint() const;
/**
* Grab the mouse to this window; future mouse events will be
* reported to this window even while the cursor goes outside of this window
*/
void grab();
/// Release the mouse grab
void ungrab();
/// Return true if the window has been grabbed
bool grabbed() const;
/// Grab keyboard device
void grabKeyboard();
/// Ungrab keyboard device
void ungrabKeyboard();
/// Return true if active grab is in effect
bool grabbedKeyboard() const;
/// Show this window
virtual void show();
/// Hide this window
virtual void hide();
/// Return true if the window is shown
bool shown() const;
/// Return true if the window is composite
virtual bool isComposite() const;
/// Return true if the window is under the cursor
bool underCursor() const;
/// Return true if this window owns the primary selection
bool hasSelection() const;
/// Try to acquire the primary selection, given a list of drag types
bool acquireSelection(const FXDragType *types,FXuint numtypes);
/// Release the primary selection
bool releaseSelection();
/// Return true if this window owns the clipboard
bool hasClipboard() const;
/// Try to acquire the clipboard, given a list of drag types
bool acquireClipboard(const FXDragType *types,FXuint numtypes);
/// Release the clipboard
bool releaseClipboard();
/// Enable this window to receive drops
virtual void dropEnable();
/// Disable this window from receiving drops
virtual void dropDisable();
/// Return true if this window is able to receive drops
bool isDropEnabled() const;
/// Return true if a drag operaion has been initiated from this window
bool isDragging() const;
/// Initiate a drag operation with a list of previously registered drag types
bool beginDrag(const FXDragType *types,FXuint numtypes);
/**
* When dragging, inform the drop-target of the new position and
* the drag action
*/
bool handleDrag(FXint x,FXint y,FXDragAction action=DRAG_COPY);
/**
* Terminate the drag operation with or without actually dropping the data
* Returns the action performed by the target
*/
FXDragAction endDrag(bool drop=true);
/// Return true if this window is the target of a drop
bool isDropTarget() const;
/**
* When being dragged over, indicate that no further SEL_DND_MOTION messages
* are required while the cursor is inside the given rectangle
*/
void setDragRectangle(FXint x,FXint y,FXint w,FXint h,bool wantupdates=true) const;
/**
* When being dragged over, indicate we want to receive SEL_DND_MOTION messages
* every time the cursor moves
*/
void clearDragRectangle() const;
/// When being dragged over, indicate acceptance or rejection of the dragged data
void acceptDrop(FXDragAction action=DRAG_ACCEPT) const;
/// The target accepted our drop
FXDragAction didAccept() const;
/**
* Sent by the drop target in response to SEL_DND_DROP. The drag action
* should be the same as the action the drop target reported to the drag
* source in reponse to the SEL_DND_MOTION message.
* This function notifies the drag source that its part of the drop transaction
* is finished, and that it is free to release any resources involved in the
* drag operation.
* Calling dropFinished() is advisable in cases where the drop target needs
* to perform complex processing on the data received from the drag source,
* prior to returning from the SEL_DND_DROP message handler.
*/
void dropFinished(FXDragAction action=DRAG_REJECT) const;
/// When being dragged over, inquire the drag types which are being offered
bool inquireDNDTypes(FXDNDOrigin origin,FXDragType*& types,FXuint& numtypes) const;
/// When being dragged over, return true if we are offered the given drag type
bool offeredDNDType(FXDNDOrigin origin,FXDragType type) const;
/// When being dragged over, return the drag action
FXDragAction inquireDNDAction() const;
/**
* Set DND data; the array must be allocated with FXMALLOC and ownership is
* transferred to the system
*/
bool setDNDData(FXDNDOrigin origin,FXDragType type,FXuchar* data,FXuint size) const;
/**
* Set DND data from string value.
*/
bool setDNDData(FXDNDOrigin origin,FXDragType type,const FXString& string) const;
/**
* Get DND data; the caller becomes the owner of the array and must free it
* with FXFREE
*/
bool getDNDData(FXDNDOrigin origin,FXDragType type,FXuchar*& data,FXuint& size) const;
/**
* Get DND data into string value.
*/
bool getDNDData(FXDNDOrigin origin,FXDragType type,FXString& string) const;
/// Return true if window logically contains the given point
virtual bool contains(FXint parentx,FXint parenty) const;
/// Translate coordinates from fromwindow's coordinate space to this window's coordinate space
void translateCoordinatesFrom(FXint& tox,FXint& toy,const FXWindow* fromwindow,FXint fromx,FXint fromy) const;
/// Translate coordinates from this window's coordinate space to towindow's coordinate space
void translateCoordinatesTo(FXint& tox,FXint& toy,const FXWindow* towindow,FXint fromx,FXint fromy) const;
/// Set window background color
virtual void setBackColor(FXColor clr);
/// Get background color
FXColor getBackColor() const { return backColor; }
virtual bool doesSaveUnder() const;
/**
* Translate message for localization; using the current FXTranslator,
* an attempt is made to translate the given message into the current
* language. An optional hint may be passed to break any ties in case
* more than one tranlation is possible for the given message text.
* In addition, the name of the widget is passed as context name so
* that controls in a single dialog may be grouped together.
*/
virtual const FXchar* tr(const FXchar* message,const FXchar* hint=NULL) const;
/// Save window to stream
virtual void save(FXStream& store) const;
/// Restore window from stream
virtual void load(FXStream& store);
/// Destroy window
virtual ~FXWindow();
};
}
#endif
fox-1.6.49/include/FXSearchDialog.h 0000664 0001750 0001750 00000004673 12130340076 013717 0000000 0000000 /********************************************************************************
* *
* T e x t S e a r c h D i a l o g *
* *
*********************************************************************************
* Copyright (C) 2000,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXSearchDialog.h,v 1.23 2006/01/22 17:58:09 fox Exp $ *
********************************************************************************/
#ifndef FXSEARCHDIALOG_H
#define FXSEARCHDIALOG_H
#ifndef FXREPLACEDIALOG_H
#include "FXReplaceDialog.h"
#endif
namespace FX {
/// Text search dialog
class FXAPI FXSearchDialog : public FXReplaceDialog {
FXDECLARE(FXSearchDialog)
protected:
FXSearchDialog(){}
private:
FXSearchDialog(const FXSearchDialog&);
FXSearchDialog &operator=(const FXSearchDialog&);
public:
/// Construct search dialog box
FXSearchDialog(FXWindow* owner,const FXString& caption,FXIcon* ic=NULL,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Destructor
virtual ~FXSearchDialog();
};
}
#endif
fox-1.6.49/include/FXDelegator.h 0000664 0001750 0001750 00000005650 12130340076 013274 0000000 0000000 /********************************************************************************
* *
* D e l e g a t o r T a r g e t *
* *
*********************************************************************************
* Copyright (C) 2000,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXDelegator.h,v 1.15 2006/01/22 17:58:00 fox Exp $ *
********************************************************************************/
#ifndef FXDELEGATOR_H
#define FXDELEGATOR_H
#ifndef FXOBJECT_H
#include "FXObject.h"
#endif
namespace FX {
/**
* A delegator forwards messages to a delegate object.
* Delegators are used when you need to multiplex messages
* toward any number of target objects.
* For example, many controls may be connected to FXDelegator,
* instead of directly to the document object. Changing the
* delegate in FXDelegator will then reconnect the controls with their
* new target.
*/
class FXAPI FXDelegator : public FXObject {
FXDECLARE(FXDelegator)
protected:
FXObject *delegate;
private:
FXDelegator(const FXDelegator&);
FXDelegator &operator=(const FXDelegator&);
public:
virtual long onDefault(FXObject*,FXSelector,void*);
public:
/// Construct a delegator
FXDelegator(FXObject* target=NULL):delegate(target){ }
/// Return delegate object
FXObject* getDelegate() const { return delegate; }
/// Change delegate object
void setDelegate(FXObject* target){ delegate=target; }
/// Always trash during detroy
virtual ~FXDelegator(){ delegate=(FXObject*)-1L; }
};
}
#endif
fox-1.6.49/include/FXXBMImage.h 0000664 0001750 0001750 00000007662 12130340076 012764 0000000 0000000 /********************************************************************************
* *
* X B M I m a g e O b j e c t *
* *
*********************************************************************************
* Copyright (C) 2003,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXXBMImage.h,v 1.12 2006/01/22 17:58:12 fox Exp $ *
********************************************************************************/
#ifndef FXXBMIMAGE_H
#define FXXBMIMAGE_H
#ifndef FXIMAGE_H
#include "FXImage.h"
#endif
namespace FX {
/// X Bitmap image
class FXAPI FXXBMImage : public FXImage {
FXDECLARE(FXXBMImage)
protected:
FXXBMImage(){}
private:
FXXBMImage(const FXXBMImage&);
FXXBMImage &operator=(const FXXBMImage&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct image from memory stream formatted in X Bitmap format
FXXBMImage(FXApp* a,const FXuchar *pixels=NULL,const FXuchar *mask=NULL,FXuint opts=0,FXint w=1,FXint h=1);
/// Save pixels into stream in X Bitmap format
virtual bool savePixels(FXStream& store) const;
/// Load pixels from stream in X Bitmap format
virtual bool loadPixels(FXStream& store);
/// Destroy icon
virtual ~FXXBMImage();
};
#ifndef FXLOADXBM
#define FXLOADXBM
/**
* Check if stream contains a XBM, return TRUE if so.
*/
extern FXAPI bool fxcheckXBM(FXStream& store);
/**
* Load an XBM (X Bitmap) from pixel array and mask array.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadXBM(FXColor*& data,const FXuchar *pix,const FXuchar *msk,FXint width,FXint height);
/**
* Load an XBM (X Bitmap) file from a stream.
* Upon successful return, the pixel array and size, and hot-spot are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadXBM(FXStream& store,FXColor*& data,FXint& width,FXint& height,FXint& hotx,FXint& hoty);
/**
* Save an XBM (X Bitmap) file to a stream; if the parameters hotx and hoty are set
* to -1, no hotspot location is saved.
*/
extern FXAPI bool fxsaveXBM(FXStream& store,const FXColor *data,FXint width,FXint height,FXint hotx=-1,FXint hoty=-1);
/**
* Save a PostScript file to a stream; format the picture to the maximal
* size that fits within the given margins of the indicated paper size.
*/
extern FXAPI bool fxsavePS(FXStream& store,const FXColor *data,FXint width,FXint height,FXint paperw=612,FXint paperh=792,FXint margin=35,bool color=true);
#endif
}
#endif
fox-1.6.49/include/FXBitmapFrame.h 0000664 0001750 0001750 00000007270 12130340076 013555 0000000 0000000 /********************************************************************************
* *
* B i t m a p F r a m e W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2001,2006 by H. J. Daniel III. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXBitmapFrame.h,v 1.6 2006/01/22 17:57:59 fox Exp $ *
********************************************************************************/
#ifndef FXBITMAPFRAME_H
#define FXBITMAPFRAME_H
#ifndef FXFRAME_H
#include "FXFrame.h"
#endif
namespace FX {
/**
* The bitmap frame is a simple frame widget displaying an monochrome bitmap
* image; the bitmap is not owned by the bitmap frame so it must be explicitly
* deleted elsewhere.
*/
class FXAPI FXBitmapFrame : public FXFrame {
FXDECLARE(FXBitmapFrame)
protected:
FXBitmap *bitmap; // The bitmap being displayed
FXColor onColor; // Color for on pixels
FXColor offColor; // Color for off pixels
protected:
FXBitmapFrame();
private:
FXBitmapFrame(const FXBitmapFrame&);
FXBitmapFrame &operator=(const FXBitmapFrame&);
public:
long onPaint(FXObject*,FXSelector,void* ptr);
public:
/// Construct image frame and pass it an image
FXBitmapFrame(FXComposite* p,FXBitmap *bmp,FXuint opts=FRAME_SUNKEN|FRAME_THICK,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=0,FXint pr=0,FXint pt=0,FXint pb=0);
/// Create window
virtual void create();
/// Get default width
virtual FXint getDefaultWidth();
/// Get default height
virtual FXint getDefaultHeight();
/// Change the image being displayed
void setBitmap(FXBitmap* bmp);
/// Return the current image
FXBitmap* getBitmap() const { return bitmap; }
/// Set on color
void setOnColor(FXColor clr);
/// Get on color
FXColor getOnColor() const { return onColor; }
/// Set off color
void setOffColor(FXColor clr);
/// Get off color
FXColor getOffColor() const { return offColor; }
/// Set the current justification mode.
void setJustify(FXuint mode);
/// Get the current justification mode.
FXuint getJustify() const;
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
/// Destroy the widget, but do not destroy the image
virtual ~FXBitmapFrame();
};
}
#endif
fox-1.6.49/include/FXSphered.h 0000664 0001750 0001750 00000012742 12130340076 012760 0000000 0000000 /********************************************************************************
* *
* D o u b l e - P r e c i s i o n S p h e r e C l a s s *
* *
*********************************************************************************
* Copyright (C) 2004,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXSphered.h,v 1.17 2006/01/22 17:58:09 fox Exp $ *
********************************************************************************/
#ifndef FXSPHERED_H
#define FXSPHERED_H
namespace FX {
class FXRanged;
/// Spherical bounds
class FXAPI FXSphered {
public:
FXVec3d center;
FXdouble radius;
public:
/// Default constructor
FXSphered(){}
/// Copy constructor
FXSphered(const FXSphered& sphere):center(sphere.center),radius(sphere.radius){}
/// Initialize from center and radius
FXSphered(const FXVec3d& cen,FXdouble rad=0.0):center(cen),radius(rad){}
/// Initialize from center and radius
FXSphered(FXdouble x,FXdouble y,FXdouble z,FXdouble rad=0.0):center(x,y,z),radius(rad){}
/// Initialize sphere to fully contain the given bounding box
FXSphered(const FXRanged& bounds);
/// Assignment
FXSphered& operator=(const FXSphered& sphere){ center=sphere.center; radius=sphere.radius; return *this; }
/// Set value from another sphere
FXSphered& set(const FXSphered& sphere){ center=sphere.center; radius=sphere.radius; return *this; }
/// Set value from center and radius
FXSphered& set(const FXVec3d& cen,FXdouble rad){ center=cen; radius=rad; return *this; }
/// Set value from center and radius
FXSphered& set(FXdouble x,FXdouble y,FXdouble z,FXdouble rad){ center.set(x,y,z); radius=rad; return *this; }
/// Comparison
bool operator==(const FXSphered& s) const { return center==s.center && radius==s.radius;}
bool operator!=(const FXSphered& s) const { return center!=s.center || radius!=s.radius;}
/// Diameter of sphere
FXdouble diameter() const { return radius*2.0; }
/// Test if empty
bool empty() const { return radius<0.0; }
/// Test if sphere contains point x,y,z
bool contains(FXdouble x,FXdouble y,FXdouble z) const;
/// Test if sphere contains point p
bool contains(const FXVec3d& p) const;
/// Test if sphere contains another box
bool contains(const FXRanged& box) const;
/// Test if sphere contains another sphere
bool contains(const FXSphered& sphere) const;
/// Include point
FXSphered& include(FXdouble x,FXdouble y,FXdouble z);
/// Include point
FXSphered& include(const FXVec3d& p);
/// Expand radius to include point
FXSphered& includeInRadius(FXdouble x,FXdouble y,FXdouble z);
/// Expand radius to include point
FXSphered& includeInRadius(const FXVec3d& p);
/// Include given range into this one
FXSphered& include(const FXRanged& box);
/// Expand radius to include box
FXSphered& includeInRadius(const FXRanged& box);
/// Include given sphere into this one
FXSphered& include(const FXSphered& sphere);
/// Expand radius to include sphere
FXSphered& includeInRadius(const FXSphered& sphere);
/// Intersect sphere with normalized plane ax+by+cz+w; returns -1,0,+1
FXint intersect(const FXVec4d& plane) const;
/// Intersect sphere with ray u-v
bool intersect(const FXVec3d& u,const FXVec3d& v) const;
/// Test if box overlaps with sphere
friend FXAPI bool overlap(const FXRanged& a,const FXSphered& b);
/// Test if sphere overlaps with box
friend FXAPI bool overlap(const FXSphered& a,const FXRanged& b);
/// Test if spheres overlap
friend FXAPI bool overlap(const FXSphered& a,const FXSphered& b);
/// Save object to a stream
friend FXAPI FXStream& operator<<(FXStream& store,const FXSphered& sphere);
/// Load object from a stream
friend FXAPI FXStream& operator>>(FXStream& store,FXSphered& sphere);
};
extern FXAPI bool overlap(const FXRanged& a,const FXSphered& b);
extern FXAPI bool overlap(const FXSphered& a,const FXRanged& b);
extern FXAPI bool overlap(const FXSphered& a,const FXSphered& b);
extern FXAPI FXStream& operator<<(FXStream& store,const FXSphered& sphere);
extern FXAPI FXStream& operator>>(FXStream& store,FXSphered& sphere);
}
#endif
fox-1.6.49/include/FXWizard.h 0000664 0001750 0001750 00000012041 12130340076 012616 0000000 0000000 /********************************************************************************
* *
* W i z a r d W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2002,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXWizard.h,v 1.8 2006/01/22 17:58:12 fox Exp $ *
********************************************************************************/
#ifndef FXWIZARD_H
#define FXWIZARD_H
#ifndef FXDIALOGBOX_H
#include "FXDialogBox.h"
#endif
namespace FX {
class FXImage;
class FXIcon;
class FXImageFrame;
class FXButton;
class FXSwitcher;
/**
* A Wizard widget guides the user through a number of panels
* in a predefined sequence; each step must be completed before
* moving on to the next step.
* For example, a Wizard may be used to install software components,
* and ask various questions at each step in the installation.
*/
class FXAPI FXWizard : public FXDialogBox {
FXDECLARE(FXWizard)
protected:
FXHorizontalFrame *buttons; // Button frame
FXImageFrame *sidebar; // Sidebar comprising image
FXButton *advance; // Advance to next stage
FXButton *retreat; // Retreat to last stage
FXButton *finish; // Finish panel
FXButton *cancel; // Cancel button
FXSwitcher *panels; // Sub panels
FXIcon *finishicon;
FXIcon *nexticon;
FXIcon *backicon;
protected:
FXWizard(){}
void construct();
private:
FXWizard(const FXWizard&);
FXWizard &operator=(const FXWizard&);
public:
long onUpdFinish(FXObject*,FXSelector,void*);
long onCmdNext(FXObject*,FXSelector,void*);
long onUpdNext(FXObject*,FXSelector,void*);
long onCmdBack(FXObject*,FXSelector,void*);
long onUpdBack(FXObject*,FXSelector,void*);
public:
enum {
ID_NEXT=FXDialogBox::ID_LAST,
ID_BACK,
ID_LAST
};
public:
/// Construct free-floating Wizard
FXWizard(FXApp* a,const FXString& name,FXImage *image,FXuint opts=DECOR_TITLE|DECOR_BORDER|DECOR_RESIZE,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=10,FXint pr=10,FXint pt=10,FXint pb=10,FXint hs=10,FXint vs=10);
/// Construct Wizard which will always float over the owner window
FXWizard(FXWindow* owner,const FXString& name,FXImage *image,FXuint opts=DECOR_TITLE|DECOR_BORDER|DECOR_RESIZE,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=10,FXint pr=10,FXint pt=10,FXint pb=10,FXint hs=10,FXint vs=10);
/// Return a pointer to the button frame
FXHorizontalFrame *buttonFrame() const { return buttons; }
/// Return a pointer to the "Advance" button
FXButton *advanceButton() const { return advance; }
/// Return a pointer to the "Retreat" button
FXButton *retreatButton() const { return retreat; }
/// Return a pointer to the "Finish" button
FXButton *finishButton() const { return finish; }
/// Return a pointer to the "Cancel" button
FXButton *cancelButton() const { return cancel; }
/// Return the container used as parent for the subpanels
FXSwitcher *getContainer() const { return panels; }
/// Change the image being displayed
void setImage(FXImage* img);
/// Return the current image
FXImage* getImage() const;
/// Return number of panels
FXint getNumPanels() const;
/// Bring the child window at index to the top
void setCurrentPanel(FXint index);
/// Return the index of the child window currently on top
FXint getCurrentPanel() const;
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
// Destroy
virtual ~FXWizard();
};
}
#endif
fox-1.6.49/include/FXCP866Codec.h 0000644 0001750 0001750 00000001077 11637250333 013076 0000000 0000000 #ifndef FXCP866CODEC_H
#define FXCP866CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// CP866 Codec
class FXAPI FXCP866Codec : public FXTextCodec {
FXDECLARE(FXCP866Codec)
public:
FXCP866Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FXCP866Codec(){}
};
}
#endif
fox-1.6.49/include/FXMenuCommand.h 0000664 0001750 0001750 00000007513 12130340076 013571 0000000 0000000 /********************************************************************************
* *
* M e n u C o m m a n d W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXMenuCommand.h,v 1.30 2006/01/22 17:58:06 fox Exp $ *
********************************************************************************/
#ifndef FXMENUCOMMAND_H
#define FXMENUCOMMAND_H
#ifndef FXMENUCAPTION_H
#include "FXMenuCaption.h"
#endif
namespace FX {
/**
* The menu command widget is used to invoke a command in the
* application from a menu. Menu commands may reflect
* the state of the application by graying out, or becoming hidden.
* When activated, a menu command sends a SEL_COMMAND to its target.
*/
class FXAPI FXMenuCommand : public FXMenuCaption {
FXDECLARE(FXMenuCommand)
protected:
FXString accel; // Accelerator string
FXHotKey acckey; // Accelerator key
protected:
FXMenuCommand();
private:
FXMenuCommand(const FXMenuCommand&);
FXMenuCommand &operator=(const FXMenuCommand&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onEnter(FXObject*,FXSelector,void*);
long onLeave(FXObject*,FXSelector,void*);
long onButtonPress(FXObject*,FXSelector,void*);
long onButtonRelease(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onHotKeyPress(FXObject*,FXSelector,void*);
long onHotKeyRelease(FXObject*,FXSelector,void*);
long onCmdAccel(FXObject*,FXSelector,void*);
public:
/// Construct a menu command
FXMenuCommand(FXComposite* p,const FXString& text,FXIcon* ic=NULL,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0);
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Yes it can receive the focus
virtual bool canFocus() const;
/// Move the focus to this window
virtual void setFocus();
/// Remove the focus from this window
virtual void killFocus();
/// Set accelerator text
void setAccelText(const FXString& text);
/// Return accelarator text
FXString getAccelText() const { return accel; }
/// Save menu to a stream
virtual void save(FXStream& store) const;
/// Load menu from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXMenuCommand();
};
}
#endif
fox-1.6.49/include/FXPCXIcon.h 0000664 0001750 0001750 00000006216 12130340076 012630 0000000 0000000 /********************************************************************************
* *
* P C X I c o n O b j e c t *
* *
*********************************************************************************
* Copyright (C) 2001,2006 by Janusz Ganczarski. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXPCXIcon.h,v 1.18 2006/01/22 17:58:06 fox Exp $ *
********************************************************************************/
#ifndef FXPCXICON_H
#define FXPCXICON_H
#ifndef FXICON_H
#include "FXIcon.h"
#endif
namespace FX {
/// PCX icon
class FXAPI FXPCXIcon : public FXIcon {
FXDECLARE(FXPCXIcon)
protected:
FXPCXIcon(){}
private:
FXPCXIcon(const FXPCXIcon&);
FXPCXIcon &operator=(const FXPCXIcon&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct icon from memory stream formatted in PCX file format
FXPCXIcon(FXApp* a,const void *pix=NULL,FXColor clr=FXRGB(192,192,192),FXuint opts=0,FXint w=1,FXint h=1);
/// Save pixels into stream in PCX file format
virtual bool savePixels(FXStream& store) const;
/// Load pixels from stream in PCX file format
virtual bool loadPixels(FXStream& store);
/// Destroy icon
virtual ~FXPCXIcon();
};
/**
* Check if stream contains a PCX, return TRUE if so.
*/
extern FXAPI bool fxcheckPCX(FXStream& store);
/**
* Load an PCX (PC Paintbrush) file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadPCX(FXStream& store,FXColor*& data,FXint& width,FXint& height);
/**
* Save an PCX (PC Paintbrush) file to a stream.
*/
extern FXAPI bool fxsavePCX(FXStream& store,const FXColor *data,FXint width,FXint height);
}
#endif
fox-1.6.49/include/FXToolBarGrip.h 0000664 0001750 0001750 00000007653 12130340076 013557 0000000 0000000 /********************************************************************************
* *
* T o o l B a r G r i p W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2000,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXToolBarGrip.h,v 1.20 2006/01/22 17:58:11 fox Exp $ *
********************************************************************************/
#ifndef FXTOOLBARGRIP_H
#define FXTOOLBARGRIP_H
#ifndef FXDOCKHANDLER_H
#include "FXDockHandler.h"
#endif
namespace FX {
/// Tool Bar Grip styles
enum {
TOOLBARGRIP_SINGLE = 0, /// Single bar mode for movable toolbars
TOOLBARGRIP_DOUBLE = 0x00008000 /// Double bar mode for dockable toolbars
};
/**
* A toolbar grip is used to move its container, a dock bar.
* The grip draws either a single or double bar; it is customary
* to use the single bar grip for toolbar-rearrangements only,
* and use the double-bar when the toolbar needs to be floated
* or docked.
* The toolbar grip is automatically oriented properly by the
* the toolbar widget, similar to the FXSeparator widget.
* Holding the Control Key while dragging the grip will prevent
* the toolbar from docking when it is near a dock site.
*/
class FXAPI FXToolBarGrip : public FXDockHandler {
FXDECLARE(FXToolBarGrip)
protected:
FXColor activeColor; // Color when active
protected:
FXToolBarGrip();
private:
FXToolBarGrip(const FXToolBarGrip&);
FXToolBarGrip& operator=(const FXToolBarGrip&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onEnter(FXObject*,FXSelector,void*);
long onLeave(FXObject*,FXSelector,void*);
public:
/// Construct toolbar grip
FXToolBarGrip(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=TOOLBARGRIP_SINGLE,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=0,FXint pr=0,FXint pt=0,FXint pb=0);
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// The grip can not receive the focus
virtual bool canFocus() const;
/// Change toolbar grip to double
void setDoubleBar(FXbool dbl=TRUE);
/// Return TRUE if toolbar grip is displayed as a double bar
FXbool isDoubleBar() const;
/// Set the active color
void setActiveColor(FXColor clr);
/// Get the active color
FXColor getActiveColor() const { return activeColor; }
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
};
}
#endif
fox-1.6.49/include/FX4Splitter.h 0000664 0001750 0001750 00000015731 12130340076 013261 0000000 0000000 /********************************************************************************
* *
* F o u r - W a y S p l i t t e r *
* *
*********************************************************************************
* Copyright (C) 1999,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FX4Splitter.h,v 1.30 2006/02/20 03:32:12 fox Exp $ *
********************************************************************************/
#ifndef FX4SPLITTER_H
#define FX4SPLITTER_H
#ifndef FXCOMPOSITE_H
#include "FXComposite.h"
#endif
namespace FX {
// Splitter options
enum {
FOURSPLITTER_TRACKING = 0x00008000, // Track continuously during split
FOURSPLITTER_NORMAL = 0
};
/**
* The four-way splitter is a layout manager which manages
* four children like four panes in a window.
* You can use a four-way splitter for example in a CAD program
* where you may want to maintain three orthographic views, and
* one oblique view of a model.
* The four-way splitter allows interactive repartitioning of the
* panes by means of moving the central splitter bars.
* When the four-way splitter is itself resized, each child is
* proportionally resized, maintaining the same split-percentage.
* The four-way splitter widget sends a SEL_CHANGED to its target
* during the resizing of the panes; at the end of the resize interaction,
* it sends a SEL_COMMAND to signify that the resize operation is complete.
*/
class FXAPI FX4Splitter : public FXComposite {
FXDECLARE(FX4Splitter)
private:
FXint splitx; // Current x split
FXint splity; // Current y split
FXint barsize; // Size of the splitter bar
FXint fhor; // Horizontal split fraction
FXint fver; // Vertical split fraction
FXint offx;
FXint offy;
FXuchar mode;
protected:
FX4Splitter();
FXuchar getMode(FXint x,FXint y);
void moveSplit(FXint x,FXint y);
void drawSplit(FXint x,FXint y,FXuint m);
void adjustLayout();
private:
FX4Splitter(const FX4Splitter&);
FX4Splitter &operator=(const FX4Splitter&);
public:
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onFocusUp(FXObject*,FXSelector,void*);
long onFocusDown(FXObject*,FXSelector,void*);
long onFocusLeft(FXObject*,FXSelector,void*);
long onFocusRight(FXObject*,FXSelector,void*);
long onCmdExpand(FXObject*,FXSelector,void*);
long onUpdExpand(FXObject*,FXSelector,void*);
public:
enum {
ExpandNone = 0, /// None expanded
ExpandTopLeft = 1, /// Expand top left child
ExpandTopRight = 2, /// Expand top right child
ExpandBottomLeft = 4, /// Expand bottom left child
ExpandBottomRight = 8, /// Expand bottom right child
ExpandTop = ExpandTopLeft|ExpandTopRight, /// Expand top children
ExpandBottom = ExpandBottomLeft|ExpandBottomRight, /// Expand bottom children
ExpandLeft = ExpandTopLeft|ExpandBottomLeft, /// Expand left children
ExpandRight = ExpandTopRight|ExpandBottomRight, /// Expand right children
ExpandAll = ExpandLeft|ExpandRight /// Expand all children
};
public:
enum {
ID_EXPAND_NONE=FXComposite::ID_LAST+ExpandNone,
ID_EXPAND_TOP=ID_EXPAND_NONE+ExpandTop,
ID_EXPAND_BOTTOM=ID_EXPAND_NONE+ExpandBottom,
ID_EXPAND_LEFT=ID_EXPAND_NONE+ExpandLeft,
ID_EXPAND_RIGHT=ID_EXPAND_NONE+ExpandRight,
ID_EXPAND_TOPLEFT=ID_EXPAND_NONE+ExpandTopLeft,
ID_EXPAND_TOPRIGHT=ID_EXPAND_NONE+ExpandTopRight,
ID_EXPAND_BOTTOMLEFT=ID_EXPAND_NONE+ExpandBottomLeft,
ID_EXPAND_BOTTOMRIGHT=ID_EXPAND_NONE+ExpandBottomRight,
ID_EXPAND_ALL=ID_EXPAND_NONE+ExpandAll,
ID_LAST
};
public:
/// Create 4-way splitter, initially shown as four unexpanded panes
FX4Splitter(FXComposite* p,FXuint opts=FOURSPLITTER_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Create 4-way splitter, initially shown as four unexpanded panes; notifies target about size changes
FX4Splitter(FXComposite* p,FXObject* tgt,FXSelector sel,FXuint opts=FOURSPLITTER_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Get top left child, if any
FXWindow *getTopLeft() const;
/// Get top right child, if any
FXWindow *getTopRight() const;
/// Get bottom left child, if any
FXWindow *getBottomLeft() const;
/// Get bottom right child, if any
FXWindow *getBottomRight() const;
/// Get horizontal split fraction
FXint getHSplit() const { return fhor; }
/// Get vertical split fraction
FXint getVSplit() const { return fver; }
/// Change horizontal split fraction
void setHSplit(FXint s);
/// Change vertical split fraction
void setVSplit(FXint s);
/// Perform layout
virtual void layout();
/// Get default width
virtual FXint getDefaultWidth();
/// Get default height
virtual FXint getDefaultHeight();
/// Return current splitter style
FXuint getSplitterStyle() const;
/// Change splitter style
void setSplitterStyle(FXuint style);
/// Change splitter bar width
void setBarSize(FXint bs);
/// Get splitter bar width
FXint getBarSize() const { return barsize; }
/// Change set of expanded children
void setExpanded(FXuint set=FX4Splitter::ExpandAll);
/// Get set of expanded children
FXuint getExpanded() const;
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
};
}
#endif
fox-1.6.49/include/fxver.h 0000664 0001750 0001750 00000000304 12130342444 012252 0000000 0000000 #ifndef FXVER_H
#define FXVER_H
// FOX version
#define FOX_MAJOR 1
#define FOX_MINOR 6
#define FOX_LEVEL 49
// FOX byte order
#ifndef FOX_BIGENDIAN
#define FOX_BIGENDIAN 0
#endif
#endif
fox-1.6.49/include/FXDLL.h 0000664 0001750 0001750 00000004676 12130340076 012010 0000000 0000000 /********************************************************************************
* *
* D y n a m i c L i n k L i b r a r y S u p p o r t *
* *
*********************************************************************************
* Copyright (C) 2002,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXDLL.h,v 1.8 2006/01/22 17:58:00 fox Exp $ *
********************************************************************************/
#ifndef FXDLL_H
#define FXDLL_H
namespace FX {
/**
* Open library with given name, returning handle to the
* library, or NULL if the operation failed.
*/
extern FXAPI void* fxdllOpen(const FXchar *dllname);
/**
* Close library represented by dllhandle.
*/
extern FXAPI void fxdllClose(void* dllhandle);
/**
* Return address of the symbol in the library represented by
* dllhandle, or NULL if the operation failed.
*/
extern FXAPI void* fxdllSymbol(void* dllhandle,const FXchar* dllsymbol);
/**
* Return the string error message when loading dll's.
*/
extern FXAPI FXString fxdllError();
}
#endif
fox-1.6.49/include/FXCP850Codec.h 0000644 0001750 0001750 00000001100 11637250333 013052 0000000 0000000 #ifndef FXCP850CODEC_H
#define FXCP850CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// CP8502 Codec
class FXAPI FXCP850Codec : public FXTextCodec {
FXDECLARE(FXCP850Codec)
public:
FXCP850Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FXCP850Codec(){}
};
}
#endif
fox-1.6.49/include/FXPNGImage.h 0000664 0001750 0001750 00000006353 12130340076 012756 0000000 0000000 /********************************************************************************
* *
* P N G I m a g e O b j e c t *
* *
*********************************************************************************
* Copyright (C) 1999,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXPNGImage.h,v 1.22 2006/01/22 17:58:06 fox Exp $ *
********************************************************************************/
#ifndef FXPNGIMAGE_H
#define FXPNGIMAGE_H
#ifndef FXIMAGE_H
#include "FXImage.h"
#endif
namespace FX {
/// Portable Network Graphics (PNG) Image class
class FXAPI FXPNGImage : public FXImage {
FXDECLARE(FXPNGImage)
protected:
FXPNGImage(){}
private:
FXPNGImage(const FXPNGImage&);
FXPNGImage &operator=(const FXPNGImage&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct an image from memory stream formatted in PNG format
FXPNGImage(FXApp *a,const void *pix=NULL,FXuint opts=0,FXint w=1,FXint h=1);
/// True if format is supported
static const bool supported;
/// Save pixels into stream in PNG format
virtual bool loadPixels(FXStream& store);
/// Load pixels from stream in PNG format
virtual bool savePixels(FXStream& store) const;
/// Destroy
virtual ~FXPNGImage();
};
/**
* Check if stream contains a PNG, return TRUE if so.
*/
extern FXAPI bool fxcheckPNG(FXStream& store);
/**
* Load an PNG (Portable Network Graphics) file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadPNG(FXStream& store,FXColor*& data,FXint& width,FXint& height);
/**
* Save an PNG (Portable Network Graphics) file to a stream.
*/
extern FXAPI bool fxsavePNG(FXStream& store,const FXColor* data,FXint width,FXint height);
}
#endif
fox-1.6.49/include/FXToolBar.h 0000664 0001750 0001750 00000007136 12130340076 012731 0000000 0000000 /********************************************************************************
* *
* T o o l B a r W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2004,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXToolBar.h,v 1.24 2006/01/22 17:58:11 fox Exp $ *
********************************************************************************/
#ifndef FXTOOLBAR_H
#define FXTOOLBAR_H
#ifndef FXDOCKBAR_H
#include "FXDockBar.h"
#endif
namespace FX {
class FXDockSite;
/**
* A tool bar widget can be docked in a dock site; it automatically
* adjusts its orientation based on the orientation of the dock site,
* and adjusts the layout options accordingly.
* See dock bar widget for more information on the docking behavior.
*/
class FXAPI FXToolBar : public FXDockBar {
FXDECLARE(FXToolBar)
protected:
FXToolBar(){}
private:
FXToolBar(const FXToolBar&);
FXToolBar &operator=(const FXToolBar&);
public:
long onCmdDockFlip(FXObject*,FXSelector,void*);
long onUpdDockFlip(FXObject*,FXSelector,void*);
public:
/// Construct floatable toolbar, initially docked under parent p
FXToolBar(FXComposite* p,FXComposite* q,FXuint opts=LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=3,FXint pr=3,FXint pt=2,FXint pb=2,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING);
/// Construct a non-floatable toolbar
FXToolBar(FXComposite* p,FXuint opts,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=2,FXint pr=3,FXint pt=3,FXint pb=2,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING);
/// Perform layout
virtual void layout();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Dock and optionally flip orientation of toolbar
virtual void dock(FXDockSite* docksite,FXWindow* before=NULL,FXbool notify=FALSE);
/// Dock and optionally flip orientation of toolbar
virtual void dock(FXDockSite* docksite,FXint localx,FXint localy,FXbool notify);
/// Set docking side
void setDockingSide(FXuint side=LAYOUT_SIDE_TOP);
/// Return docking side
FXuint getDockingSide() const;
};
}
#endif
fox-1.6.49/include/FXDockHandler.h 0000664 0001750 0001750 00000007220 12130340076 013537 0000000 0000000 /********************************************************************************
* *
* D o c k H a n d l e r W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2005,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXDockHandler.h,v 1.3 2006/01/22 17:58:00 fox Exp $ *
********************************************************************************/
#ifndef FXDOCKHANDLER_H
#define FXDOCKHANDLER_H
#ifndef FXFRAME_H
#include "FXFrame.h"
#endif
namespace FX {
/**
* The dock handler exists as a common base class for tool bar grip
* and dock title.
*/
class FXAPI FXDockHandler : public FXFrame {
FXDECLARE_ABSTRACT(FXDockHandler)
protected:
FXString tip; // Tool tip
FXString help; // Help string
private:
FXID xxx;
protected:
FXDockHandler();
private:
FXDockHandler(const FXDockHandler&);
FXDockHandler& operator=(const FXDockHandler&);
public:
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
long onCmdSetTip(FXObject*,FXSelector,void*);
long onCmdGetTip(FXObject*,FXSelector,void*);
long onCmdSetHelp(FXObject*,FXSelector,void*);
long onCmdGetHelp(FXObject*,FXSelector,void*);
protected:
FXDockHandler(FXComposite* p,FXObject* tgt,FXSelector sel,FXuint opts,FXint x,FXint y,FXint w,FXint h,FXint pl,FXint pr,FXint pt,FXint pb);
public:
/// The grip can receive the focus
virtual bool canFocus() const;
/// Set the status line help text for grip
void setHelpText(const FXString& text){ help=text; }
/// Get the status line help text for grip
const FXString& getHelpText() const { return help; }
/// Set the tool tip message for the grip
void setTipText(const FXString& text){ tip=text; }
/// Get the tool tip message for the grip
const FXString& getTipText() const { return tip; }
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
};
}
#endif
fox-1.6.49/include/FXRangef.h 0000664 0001750 0001750 00000013454 12130340076 012571 0000000 0000000 /********************************************************************************
* *
* S i n g l e - P r e c i s i o n R a n g e C l a s s *
* *
*********************************************************************************
* Copyright (C) 2004,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXRangef.h,v 1.16 2006/01/22 17:58:08 fox Exp $ *
********************************************************************************/
#ifndef FXRANGEF_H
#define FXRANGEF_H
namespace FX {
class FXSpheref;
/// Bounds
class FXAPI FXRangef {
public:
FXVec3f lower;
FXVec3f upper;
public:
/// Default constructor
FXRangef(){}
/// Copy constructor
FXRangef(const FXRangef& bounds):lower(bounds.lower),upper(bounds.upper){}
/// Initialize from two vectors
FXRangef(const FXVec3f& lo,const FXVec3f& hi):lower(lo),upper(hi){}
/// Initialize from six numbers
FXRangef(FXfloat xlo,FXfloat xhi,FXfloat ylo,FXfloat yhi,FXfloat zlo,FXfloat zhi):lower(xlo,ylo,zlo),upper(xhi,yhi,zhi){}
/// Initialize box to fully contain the given bounding sphere
FXRangef(const FXSpheref& sphere);
/// Assignment
FXRangef& operator=(const FXRangef& bounds){ lower=bounds.lower; upper=bounds.upper; return *this; }
/// Set value from another range
FXRangef& set(const FXRangef& bounds){ lower=bounds.lower; upper=bounds.upper; return *this; }
/// Set value from two vectors
FXRangef& set(const FXVec3f& lo,const FXVec3f& hi){ lower=lo; upper=hi; return *this; }
/// Set value from six numbers
FXRangef& set(FXfloat xlo,FXfloat xhi,FXfloat ylo,FXfloat yhi,FXfloat zlo,FXfloat zhi){ lower.set(xlo,ylo,zlo); upper.set(xhi,yhi,zhi); return *this; }
/// Indexing with 0..1
FXVec3f& operator[](FXint i){ return (&lower)[i]; }
/// Indexing with 0..1
const FXVec3f& operator[](FXint i) const { return (&lower)[i]; }
/// Comparison
bool operator==(const FXRangef& r) const { return lower==r.lower && upper==r.upper; }
bool operator!=(const FXRangef& r) const { return lower!=r.lower || upper!=r.upper; }
/// Width of box
FXfloat width() const { return upper.x-lower.x; }
/// Height of box
FXfloat height() const { return upper.y-lower.y; }
/// Depth of box
FXfloat depth() const { return upper.z-lower.z; }
/// Longest side
FXfloat longest() const;
/// shortest side
FXfloat shortest() const;
/// Length of diagonal
FXfloat diameter() const;
/// Get radius of box
FXfloat radius() const;
/// Compute diagonal
FXVec3f diagonal() const;
/// Get center of box
FXVec3f center() const;
/// Test if empty
bool empty() const;
/// Test if box contains point x,y,z
bool contains(FXfloat x,FXfloat y,FXfloat z) const;
/// Test if box contains point p
bool contains(const FXVec3f& p) const;
/// Test if box properly contains another box
bool contains(const FXRangef& bounds) const;
/// Test if box properly contains sphere
bool contains(const FXSpheref& sphere) const;
/// Include point
FXRangef& include(FXfloat x,FXfloat y,FXfloat z);
/// Include point
FXRangef& include(const FXVec3f& v);
/// Include given range into box
FXRangef& include(const FXRangef& box);
/// Include given sphere into this box
FXRangef& include(const FXSpheref& sphere);
/// Intersect box with normalized plane ax+by+cz+w; returns -1,0,+1
FXint intersect(const FXVec4f& plane) const;
/// Intersect box with ray u-v
bool intersect(const FXVec3f& u,const FXVec3f& v);
/// Test if boxes a and b overlap
friend FXAPI bool overlap(const FXRangef& a,const FXRangef& b);
/// Get corner number 0..7
FXVec3f corner(FXint c) const { return FXVec3f((&lower)[c&1].x,(&lower)[(c>>1)&1].y,(&lower)[c>>2].z); }
/// Union of two boxes
friend FXAPI FXRangef unite(const FXRangef& a,const FXRangef& b);
/// Intersection of two boxes
friend FXAPI FXRangef intersect(const FXRangef& a,const FXRangef& b);
/// Save object to a stream
friend FXAPI FXStream& operator<<(FXStream& store,const FXRangef& bounds);
/// Load object from a stream
friend FXAPI FXStream& operator>>(FXStream& store,FXRangef& bounds);
};
extern FXAPI bool overlap(const FXRangef& a,const FXRangef& b);
extern FXAPI FXRangef unite(const FXRangef& a,const FXRangef& b);
extern FXAPI FXRangef intersect(const FXRangef& a,const FXRangef& b);
extern FXAPI FXStream& operator<<(FXStream& store,const FXRangef& bounds);
extern FXAPI FXStream& operator>>(FXStream& store,FXRangef& bounds);
}
#endif
fox-1.6.49/include/FXStatusBar.h 0000664 0001750 0001750 00000006503 12130340076 013274 0000000 0000000 /********************************************************************************
* *
* S t a t u s B a r W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXStatusBar.h,v 1.7 2006/01/22 17:58:10 fox Exp $ *
********************************************************************************/
#ifndef FXSTATUSBAR_H
#define FXSTATUSBAR_H
#ifndef FXHORIZONTALFRAME_H
#include "FXHorizontalFrame.h"
#endif
namespace FX {
/// StatusBar options
enum {
STATUSBAR_WITH_DRAGCORNER = 0x00020000 /// Causes the DragCorner to be shown
};
class FXDragCorner;
class FXStatusLine;
/// Status bar
class FXAPI FXStatusBar : public FXHorizontalFrame {
FXDECLARE(FXStatusBar)
protected:
FXDragCorner *corner;
FXStatusLine *status;
protected:
FXStatusBar(){}
private:
FXStatusBar(const FXStatusBar&);
FXStatusBar& operator=(const FXStatusBar&);
public:
/// Construct status bar with or without a drag corner
FXStatusBar(FXComposite* p,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=3,FXint pr=3,FXint pt=2,FXint pb=2,FXint hs=4,FXint vs=0);
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Perform layout
virtual void layout();
/// Show or hide the drag corner
void setCornerStyle(FXbool withcorner=TRUE);
/// Return TRUE if drag corner shown
FXbool getCornerStyle() const;
/// Acess the status line widget
FXStatusLine *getStatusLine() const { return status; }
/// Access the drag corner widget
FXDragCorner *getDragCorner() const { return corner; }
/// Save status bar to a stream
virtual void save(FXStream& store) const;
/// Load status bar from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXStatusBar();
};
}
#endif
fox-1.6.49/include/FXGZFileStream.h 0000664 0001750 0001750 00000014643 12130340076 013664 0000000 0000000 /********************************************************************************
* *
* G Z F i l e S t r e a m C l a s s e s *
* *
*********************************************************************************
* Copyright (C) 2002,2006 by Sander Jansen. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXGZFileStream.h,v 1.5.2.1 2007/09/28 16:42:19 fox Exp $ *
********************************************************************************/
#ifdef HAVE_ZLIB_H
#ifndef FXGZFILESTREAM_H
#define FXGZFILESTREAM_H
#ifndef FXFILESTREAM_H
#include "FXFileStream.h"
#endif
namespace FX {
struct ZBlock;
/// GZIP compressed stream
class FXAPI FXGZFileStream : public FXFileStream {
private:
ZBlock *z;
int f;
protected:
virtual FXuval writeBuffer(FXuval count);
virtual FXuval readBuffer(FXuval count);
public:
/// Create GZIP compressed file stream
FXGZFileStream(const FXObject* cont=NULL);
/// Open file stream
bool open(const FXString& filename,FXStreamDirection save_or_load,FXuval size=8192);
/// Flush buffer
virtual bool flush();
/// Close file stream
virtual bool close();
/// Get position
FXlong position() const { return FXStream::position(); }
/// Move to position
virtual bool position(FXlong,FXWhence){ return FALSE; }
/// Save single items to stream
FXGZFileStream& operator<<(const FXuchar& v){ FXStream::operator<<(v); return *this; }
FXGZFileStream& operator<<(const FXchar& v){ FXStream::operator<<(v); return *this; }
FXGZFileStream& operator<<(const FXushort& v){ FXStream::operator<<(v); return *this; }
FXGZFileStream& operator<<(const FXshort& v){ FXStream::operator<<(v); return *this; }
FXGZFileStream& operator<<(const FXuint& v){ FXStream::operator<<(v); return *this; }
FXGZFileStream& operator<<(const FXint& v){ FXStream::operator<<(v); return *this; }
FXGZFileStream& operator<<(const FXfloat& v){ FXStream::operator<<(v); return *this; }
FXGZFileStream& operator<<(const FXdouble& v){ FXStream::operator<<(v); return *this; }
FXGZFileStream& operator<<(const FXlong& v){ FXStream::operator<<(v); return *this; }
FXGZFileStream& operator<<(const FXulong& v){ FXStream::operator<<(v); return *this; }
/// Save arrays of items to stream
FXGZFileStream& save(const FXuchar* p,FXuval n){ FXStream::save(p,n); return *this; }
FXGZFileStream& save(const FXchar* p,FXuval n){ FXStream::save(p,n); return *this; }
FXGZFileStream& save(const FXushort* p,FXuval n){ FXStream::save(p,n); return *this; }
FXGZFileStream& save(const FXshort* p,FXuval n){ FXStream::save(p,n); return *this; }
FXGZFileStream& save(const FXuint* p,FXuval n){ FXStream::save(p,n); return *this; }
FXGZFileStream& save(const FXint* p,FXuval n){ FXStream::save(p,n); return *this; }
FXGZFileStream& save(const FXfloat* p,FXuval n){ FXStream::save(p,n); return *this; }
FXGZFileStream& save(const FXdouble* p,FXuval n){ FXStream::save(p,n); return *this; }
FXGZFileStream& save(const FXlong* p,FXuval n){ FXStream::save(p,n); return *this; }
FXGZFileStream& save(const FXulong* p,FXuval n){ FXStream::save(p,n); return *this; }
/// Load single items from stream
FXGZFileStream& operator>>(FXuchar& v){ FXStream::operator>>(v); return *this; }
FXGZFileStream& operator>>(FXchar& v){ FXStream::operator>>(v); return *this; }
FXGZFileStream& operator>>(FXushort& v){ FXStream::operator>>(v); return *this; }
FXGZFileStream& operator>>(FXshort& v){ FXStream::operator>>(v); return *this; }
FXGZFileStream& operator>>(FXuint& v){ FXStream::operator>>(v); return *this; }
FXGZFileStream& operator>>(FXint& v){ FXStream::operator>>(v); return *this; }
FXGZFileStream& operator>>(FXfloat& v){ FXStream::operator>>(v); return *this; }
FXGZFileStream& operator>>(FXdouble& v){ FXStream::operator>>(v); return *this; }
FXGZFileStream& operator>>(FXlong& v){ FXStream::operator>>(v); return *this; }
FXGZFileStream& operator>>(FXulong& v){ FXStream::operator>>(v); return *this; }
/// Load arrays of items from stream
FXGZFileStream& load(FXuchar* p,FXuval n){ FXStream::load(p,n); return *this; }
FXGZFileStream& load(FXchar* p,FXuval n){ FXStream::load(p,n); return *this; }
FXGZFileStream& load(FXushort* p,FXuval n){ FXStream::load(p,n); return *this; }
FXGZFileStream& load(FXshort* p,FXuval n){ FXStream::load(p,n); return *this; }
FXGZFileStream& load(FXuint* p,FXuval n){ FXStream::load(p,n); return *this; }
FXGZFileStream& load(FXint* p,FXuval n){ FXStream::load(p,n); return *this; }
FXGZFileStream& load(FXfloat* p,FXuval n){ FXStream::load(p,n); return *this; }
FXGZFileStream& load(FXdouble* p,FXuval n){ FXStream::load(p,n); return *this; }
FXGZFileStream& load(FXlong* p,FXuval n){ FXStream::load(p,n); return *this; }
FXGZFileStream& load(FXulong* p,FXuval n){ FXStream::load(p,n); return *this; }
/// Save object
FXGZFileStream& saveObject(const FXObject* v){ FXStream::saveObject(v); return *this; }
/// Load object
FXGZFileStream& loadObject(FXObject*& v){ FXStream::loadObject(v); return *this; }
/// Clean up
virtual ~FXGZFileStream();
};
}
#endif
#endif
fox-1.6.49/include/FXDCPrint.h 0000664 0001750 0001750 00000025721 12130340076 012672 0000000 0000000 /********************************************************************************
* *
* D e v i c e C o n t e x t F o r P r i n t i n g *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXDCPrint.h,v 1.30 2006/01/22 17:58:00 fox Exp $ *
********************************************************************************/
#ifndef FXDCPRINT_H
#define FXDCPRINT_H
#ifndef FXDC_H
#include "FXDC.h"
#endif
////////////////////////////// UNDER DEVELOPMENT //////////////////////////////
namespace FX {
class FXApp;
class FXDrawable;
class FXImage;
class FXBitmap;
class FXIcon;
class FXFont;
/// Printer flags
enum FXPrintFlags {
PRINT_DEST_PAPER = 0, /// Send print to paper
PRINT_DEST_FILE = 1, /// Send print to file
PRINT_PAGES_ALL = 0, /// Print all pages
PRINT_PAGES_EVEN = 2, /// Print even pages only
PRINT_PAGES_ODD = 4, /// Print odd pages only
PRINT_PAGES_RANGE = 8, /// Print range of pages
PRINT_COLLATE_NORMAL = 0, /// Normal collate order
PRINT_COLLATE_REVERSED = 16, /// Reversed collate order
PRINT_PORTRAIT = 0, /// Portrait orientation
PRINT_LANDSCAPE = 32, /// Landscape orientation
PRINT_BLACKANDWHITE = 0, /// Black and white output
PRINT_COLOR = 64, /// Color output
PRINT_NOBOUNDS = 128 /// Must determine bounding box
};
/// Printer media size
enum FXMediaSize {
MEDIA_CUSTOM = 0, /// Custom paper size
MEDIA_USLETTER = 1, /// US Letter size
MEDIA_LEGAL = 2, /// US Legal size
MEDIA_A4 = 3, /// A4
MEDIA_ENVELOPE = 4 /// #10 Envelope
};
/// Bounding box
struct FXPSBounds {
FXdouble xmin;
FXdouble xmax;
FXdouble ymin;
FXdouble ymax;
};
/// Describes printer
struct FXAPI FXPrinter {
FXString name; /// Printer name
FXuint firstpage; /// First page that can be printed
FXuint lastpage; /// Last page that can be printed
FXuint currentpage; /// Current page to print
FXuint frompage; /// On output, this is the first page to print
FXuint topage; /// On output, last page to print
FXuint mediasize; /// Media size index
FXdouble mediawidth; /// Width of paper in points [1/72 of an inch]
FXdouble mediaheight; /// Height of paper in points
FXdouble leftmargin; /// Left margin
FXdouble rightmargin; /// Right margin
FXdouble topmargin; /// Top margin
FXdouble bottommargin; /// Bottom margin
FXuint numcopies; /// Number of copies
FXuint flags; /// Flags
};
/// Postscript Printer Device Context
class FXAPI FXDCPrint : public FXDC {
// friend class FXGLViewer; // This is TEMPORARY!!!
protected:
void *psout; // File Stream for PS output
FXFont *font;
FXuint flags;
FXint Xr,Yr;
FXdouble mediawidth; // Media width
FXdouble mediaheight; // Media height
FXPSBounds mediabb; // Media bounding box
FXPSBounds docbb; // Document bounding box
FXPSBounds pagebb; // Page bounding box
FXint pagecount; // Number of pages printed
FXint nchars; // Number of characters on a line
FXint pxmin; // min X coord in content
FXint pymin; // min Y coord in content
FXint pxmax; // max X coord in content
FXint pymax; // max Y coord in content
protected:
void bbox(FXfloat x,FXfloat y);
void tfm(FXfloat& xo,FXfloat& yo,FXfloat xi,FXfloat yi);
private:
FXDCPrint();
FXDCPrint(const FXDCPrint&);
FXDCPrint &operator=(const FXDCPrint&);
public:
/// Construct
FXDCPrint(FXApp* a);
/// Generate print job prolog
FXbool beginPrint(FXPrinter& job);
/// Generate print job epilog
FXbool endPrint();
/// Generate begin of page
FXbool beginPage(FXuint page=1);
/// Generate end of page
FXbool endPage();
FXbool setContentRange(FXint pxmin, FXint pymin, FXint pxmax, FXint pymax);
/// Draw points
virtual void drawPoint(FXint x,FXint y);
virtual void drawPoints(const FXPoint* points,FXuint npoints);
virtual void drawPointsRel(const FXPoint* points,FXuint npoints);
/// Draw lines
virtual void drawLine(FXint x1,FXint y1,FXint x2,FXint y2);
virtual void drawLines(const FXPoint* points,FXuint npoints);
virtual void drawLinesRel(const FXPoint* points,FXuint npoints);
virtual void drawLineSegments(const FXSegment* segments,FXuint nsegments);
/// Draw rectangles
virtual void drawRectangle(FXint x,FXint y,FXint w,FXint h);
virtual void drawRectangles(const FXRectangle* rectangles,FXuint nrectangles);
/// Draw rounded rectangle with ellipse with ew and ellips height eh
virtual void drawRoundRectangle(FXint x,FXint y,FXint w,FXint h,FXint ew,FXint eh);
/// Draw arcs
virtual void drawArc(FXint x,FXint y,FXint w,FXint h,FXint ang1,FXint ang2);
virtual void drawArcs(const FXArc* arcs,FXuint narcs);
/// Draw ellipse
virtual void drawEllipse(FXint x,FXint y,FXint w,FXint h);
/// Filled rectangles
virtual void fillRectangle(FXint x,FXint y,FXint w,FXint h);
virtual void fillRectangles(const FXRectangle* rectangles,FXuint nrectangles);
/// Filled rounded rectangle with ellipse with ew and ellips height eh
virtual void fillRoundRectangle(FXint x,FXint y,FXint w,FXint h,FXint ew,FXint eh);
/// Fill chord
virtual void fillChord(FXint x,FXint y,FXint w,FXint h,FXint ang1,FXint ang2);
virtual void fillChords(const FXArc* chords,FXuint nchords);
/// Draw arcs
virtual void fillArc(FXint x,FXint y,FXint w,FXint h,FXint ang1,FXint ang2);
virtual void fillArcs(const FXArc* arcs,FXuint narcs);
/// Fill ellipse
virtual void fillEllipse(FXint x,FXint y,FXint w,FXint h);
/// Filled polygon
virtual void fillPolygon(const FXPoint* points,FXuint npoints);
virtual void fillConcavePolygon(const FXPoint* points,FXuint npoints);
virtual void fillComplexPolygon(const FXPoint* points,FXuint npoints);
/// Filled polygon with relative points
virtual void fillPolygonRel(const FXPoint* points,FXuint npoints);
virtual void fillConcavePolygonRel(const FXPoint* points,FXuint npoints);
virtual void fillComplexPolygonRel(const FXPoint* points,FXuint npoints);
/// Draw hashed box
virtual void drawHashBox(FXint x,FXint y,FXint w,FXint h,FXint b=1);
/// Draw area from source
virtual void drawArea(const FXDrawable* source,FXint sx,FXint sy,FXint sw,FXint sh,FXint dx,FXint dy);
/// Draw area stretched area from source
virtual void drawArea(const FXDrawable* source,FXint sx,FXint sy,FXint sw,FXint sh,FXint dx,FXint dy,FXint dw,FXint dh);
/// Draw image
virtual void drawImage(const FXImage* image,FXint dx,FXint dy);
/// Draw bitmap
virtual void drawBitmap(const FXBitmap* bitmap,FXint dx,FXint dy);
/// Draw icon
virtual void drawIcon(const FXIcon* icon,FXint dx,FXint dy);
virtual void drawIconShaded(const FXIcon* icon,FXint dx,FXint dy);
virtual void drawIconSunken(const FXIcon* icon,FXint dx,FXint dy);
/// Draw string with base line starting at x, y
virtual void drawText(FXint x,FXint y,const FXString& string);
virtual void drawText(FXint x,FXint y,const FXchar* string,FXuint length);
/// Draw text starting at x, y over filled background
virtual void drawImageText(FXint x,FXint y,const FXString& string);
virtual void drawImageText(FXint x,FXint y,const FXchar* string,FXuint length);
/// Set foreground/background drawing color
virtual void setForeground(FXColor clr);
virtual void setBackground(FXColor clr);
/// Set dash pattern
virtual void setDashes(FXuint dashoffset,const FXchar *dashlist,FXuint n);
/// Set line width
virtual void setLineWidth(FXuint linewidth=0);
/// Set line cap style
virtual void setLineCap(FXCapStyle capstyle=CAP_BUTT);
/// Set line join style
virtual void setLineJoin(FXJoinStyle joinstyle=JOIN_MITER);
/// Set line style
virtual void setLineStyle(FXLineStyle linestyle=LINE_SOLID);
/// Set fill style
virtual void setFillStyle(FXFillStyle fillstyle=FILL_SOLID);
/// Set fill rule
virtual void setFillRule(FXFillRule fillrule=RULE_EVEN_ODD);
/// Set blit function
virtual void setFunction(FXFunction func=BLT_SRC);
/// Set the tile
virtual void setTile(FXImage* tile,FXint dx=0,FXint dy=0);
/// Set the stipple pattern
virtual void setStipple(FXBitmap *stipple,FXint dx=0,FXint dy=0);
/// Set the stipple pattern
virtual void setStipple(FXStipplePattern stipple,FXint dx=0,FXint dy=0);
/// Set clip rectangle
virtual void setClipRectangle(FXint x,FXint y,FXint w,FXint h);
/// Set clip rectangle
virtual void setClipRectangle(const FXRectangle& rectangle);
/// Clear clipping
virtual void clearClipRectangle();
/// Set clip mask
virtual void setClipMask(FXBitmap* mask,FXint dx=0,FXint dy=0);
/// Clear clip mask
virtual void clearClipMask();
/// Set font to draw text with
virtual void setFont(FXFont *fnt);
/// Clip drawing by child windows
virtual void clipChildren(FXbool yes);
/// Temporarily public; do not rely on this!!
void outhex(FXuint hex);
void outf(const char* format,...);
/// Cleanup
virtual ~FXDCPrint();
};
}
#endif
fox-1.6.49/include/FX885914Codec.h 0000644 0001750 0001750 00000001113 11637250333 013101 0000000 0000000 #ifndef FX885914CODEC_H
#define FX885914CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// ISO-8859-14 Codec
class FXAPI FX885914Codec : public FXTextCodec {
FXDECLARE(FX885914Codec)
public:
FX885914Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FX885914Codec(){}
};
}
#endif
fox-1.6.49/include/FXSlider.h 0000664 0001750 0001750 00000020514 12130340076 012604 0000000 0000000 /********************************************************************************
* *
* S l i d e r W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXSlider.h,v 1.44 2006/01/22 17:58:09 fox Exp $ *
********************************************************************************/
#ifndef FXSLIDER_H
#define FXSLIDER_H
#ifndef FXFRAME_H
#include "FXFrame.h"
#endif
namespace FX {
/// Slider Control styles
enum {
SLIDER_HORIZONTAL = 0, /// Slider shown horizontally
SLIDER_VERTICAL = 0x00008000, /// Slider shown vertically
SLIDER_ARROW_UP = 0x00010000, /// Slider has arrow head pointing up
SLIDER_ARROW_DOWN = 0x00020000, /// Slider has arrow head pointing down
SLIDER_ARROW_LEFT = SLIDER_ARROW_UP, /// Slider has arrow head pointing left
SLIDER_ARROW_RIGHT = SLIDER_ARROW_DOWN, /// Slider has arrow head pointing right
SLIDER_INSIDE_BAR = 0x00040000, /// Slider is inside the slot rather than overhanging
SLIDER_TICKS_TOP = 0x00080000, /// Ticks on the top of horizontal slider
SLIDER_TICKS_BOTTOM = 0x00100000, /// Ticks on the bottom of horizontal slider
SLIDER_TICKS_LEFT = SLIDER_TICKS_TOP, /// Ticks on the left of vertical slider
SLIDER_TICKS_RIGHT = SLIDER_TICKS_BOTTOM, /// Ticks on the right of vertical slider
SLIDER_NORMAL = SLIDER_HORIZONTAL
};
/**
* The slider widget is a valuator widget which provides simple linear value range.
* Two visual appearances are supported:- the sunken look, which is enabled with
* the SLIDER_INSIDE_BAR option and the regular look. The latter may have optional
* arrows on the slider thumb.
* While being moved, the slider sends a SEL_CHANGED message to its target;
* at the end of the interaction, a SEL_COMMAND message is sent.
* The message data represents the current slider value, of type FXint.
*/
class FXAPI FXSlider : public FXFrame {
FXDECLARE(FXSlider)
protected:
FXint range[2]; // Reported data range
FXint pos; // Reported data position
FXint incr; // Increment when auto-sliding
FXint delta; // Interval between ticks
FXint headpos; // Head position
FXint headsize; // Head size
FXint slotsize; // Slot size
FXColor slotColor; // Color of slot the head moves in
FXint dragpoint; // Where the head is grabbed
FXString help; // Help string
FXString tip; // Tip string
protected:
FXSlider();
void drawSliderHead(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawHorzTicks(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawVertTicks(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
private:
FXSlider(const FXSlider&);
FXSlider &operator=(const FXSlider&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onMouseWheel(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onMiddleBtnPress(FXObject*,FXSelector,void*);
long onMiddleBtnRelease(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onUngrabbed(FXObject*,FXSelector,void*);
long onAutoSlide(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetIntValue(FXObject*,FXSelector,void*);
long onCmdGetIntValue(FXObject*,FXSelector,void*);
long onCmdSetRealValue(FXObject*,FXSelector,void*);
long onCmdGetRealValue(FXObject*,FXSelector,void*);
long onCmdSetIntRange(FXObject*,FXSelector,void*);
long onCmdGetIntRange(FXObject*,FXSelector,void*);
long onCmdSetRealRange(FXObject*,FXSelector,void*);
long onCmdGetRealRange(FXObject*,FXSelector,void*);
long onCmdSetHelp(FXObject*,FXSelector,void*);
long onCmdGetHelp(FXObject*,FXSelector,void*);
long onCmdSetTip(FXObject*,FXSelector,void*);
long onCmdGetTip(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
public:
enum{
ID_AUTOSLIDE=FXFrame::ID_LAST,
ID_LAST
};
public:
/// Construct a slider widget
FXSlider(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=SLIDER_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=0,FXint pr=0,FXint pt=0,FXint pb=0);
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Returns true because a slider can receive focus
virtual bool canFocus() const;
/// Perform layout
virtual void layout();
/// Enable the slider
virtual void enable();
/// Disable the slider
virtual void disable();
/// Change slider value
void setValue(FXint value,FXbool notify=FALSE);
/// Return slider value
FXint getValue() const { return pos; }
/// Change the slider's range
void setRange(FXint lo,FXint hi,FXbool notify=FALSE);
/// Get the slider's current range
void getRange(FXint& lo,FXint& hi) const { lo=range[0]; hi=range[1]; }
/// Change the slider style
FXuint getSliderStyle() const;
/// Get the current slider style
void setSliderStyle(FXuint style);
/// Get the slider's head size
FXint getHeadSize() const { return headsize; }
/// Change the slider's head size
void setHeadSize(FXint hs);
/// Get the slider's current slot size
FXint getSlotSize() const { return slotsize; }
/// Change the slider's slot size
void setSlotSize(FXint bs);
/// Get the slider's auto-increment/decrement value
FXint getIncrement() const { return incr; }
/// Change the slider's auto-increment/decrement value
void setIncrement(FXint inc);
/// Change the delta between ticks
void setTickDelta(FXint dist);
/// Get delta between ticks
FXint getTickDelta() const { return delta; }
/// Change the color of the slot the slider head moves in
void setSlotColor(FXColor clr);
/// Get the current slot color
FXColor getSlotColor() const { return slotColor; }
/// Set the help text to be displayed on the status line
void setHelpText(const FXString& text){ help=text; }
/// Get the current help text
const FXString& getHelpText() const { return help; }
/// Set the tip text to be displayed in the tooltip
void setTipText(const FXString& text){ tip=text; }
/// Get the current tooltip text value
const FXString& getTipText() const { return tip; }
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
/// Destroy the slider
virtual ~FXSlider();
};
}
#endif
fox-1.6.49/include/FXPath.h 0000664 0001750 0001750 00000014773 12130340076 012270 0000000 0000000 /********************************************************************************
* *
* P a t h N a m e M a n i p u l a t i o n *
* *
*********************************************************************************
* Copyright (C) 2000,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXPath.h,v 1.11 2006/01/23 06:03:15 fox Exp $ *
********************************************************************************/
#ifndef FXPATH_H
#define FXPATH_H
namespace FX {
namespace FXPath {
/**
* Return root of absolute path; on Unix, this is just "/". On
* Windows, this is "\\" or "C:\". Returns the empty string
* if the given path is not absolute.
*/
FXString FXAPI root(const FXString& file);
/**
* Return the directory part of the path name.
* Note that directory("/bla/bla/") is "/bla/bla" and NOT "/bla".
* However, directory("/bla/bla") is "/bla" as we expect!
*/
FXString FXAPI directory(const FXString& file);
/**
* Return name and extension part of the path name.
* Note that name("/bla/bla/") is "" and NOT "bla".
* However, name("/bla/bla") is "bla" as we expect!
*/
FXString FXAPI name(const FXString& file);
/// Return file title, i.e. document name only
FXString FXAPI title(const FXString& file);
/// Return extension part of the file name
FXString FXAPI extension(const FXString& file);
/// Return file name less the extension
FXString FXAPI stripExtension(const FXString& file);
/// Return the drive letter prefixing this file name (if any).
FXString FXAPI drive(const FXString& file);
/// Perform tilde or environment variable expansion
FXString FXAPI expand(const FXString& file);
/// Contract path based on user name and environment variable
FXString FXAPI contract(const FXString& file,const FXString& user=FXString::null,const FXString& var=FXString::null);
/**
* Simplify a file path; the path will remain relative if it was relative,
* or absolute if it was absolute. Also, a trailing "/" will be preserved
* as this is important in other functions.
* For example, simplify("..//aaa/./bbb//../c/") becomes "../aaa/c/".
*/
FXString FXAPI simplify(const FXString& file);
/// Return absolute path from current directory and file name
FXString FXAPI absolute(const FXString& file);
/// Return absolute path from base directory and file name
FXString FXAPI absolute(const FXString& base,const FXString& file);
/// Return relative path of file to the current directory
FXString FXAPI relative(const FXString& file);
/// Return relative path of file to given base directory
FXString FXAPI relative(const FXString& base,const FXString& file);
/// Return path following local path separator conventions
FXString FXAPI convert(const FXString& path);
/// Return path to directory above input directory name
FXString FXAPI upLevel(const FXString& file);
/// Return true if file name is absolute
bool FXAPI isAbsolute(const FXString& file);
/// Return true if input directory is a top-level directory
bool FXAPI isTopDirectory(const FXString& file);
/// Return true if input path is a file share
bool FXAPI isShare(const FXString& file);
/// Enquote filename to make safe for shell
FXString FXAPI enquote(const FXString& file,bool forcequotes=false);
/// Dequote filename to get original again
FXString FXAPI dequote(const FXString& file);
/**
* Perform wildcard match of a filename against a wildcard pattern.
* The wildcard pattern may comprise ordinary characters or special
* matching characters, as given below:
*
* ? Any single character.
* * Zero or more of any character.
* [abc] Any character from the set {a,b,c}.
* [^abc] Any character BUT the ones from the set {a,b,c}.
* [!abc] Ditto.
* [a-zA-Z] Matches single character, which must be one of a-z or A-Z.
* [^a-zA-Z] Matches single character, which must be anything other than a-z or A-Z.
* [!a-zA-Z] Ditto.
* pat1|pat2 Match sub-pattern pat1 or pat2.
* pat1,pat2 Ditto.
* (pat1|pat2) Match sub-pattern pat1 or pat2; patterns may be nested.
* (pat1,pat2) Ditto.
*
* The special characters may be escaped to treat them as ordinary characters.
* Matching may be influenced by a number of flags:
*
* FILEMATCH_FILE_NAME No wildcard can ever match /
* FILEMATCH_NOESCAPE Backslashes don't quote special chars
* FILEMATCH_PERIOD Leading . is matched only explicitly
* FILEMATCH_LEADING_DIR Ignore /... after a match
* FILEMATCH_CASEFOLD Compare without regard to case
*/
bool FXAPI match(const FXString& pattern,const FXString& file,FXuint flags=(FILEMATCH_NOESCAPE|FILEMATCH_FILE_NAME));
/**
* Generate unique filename of the form pathnameXXX.ext, where
* pathname.ext is the original input file, and XXX is a number,
* possibly empty, that makes the file unique.
*/
FXString FXAPI unique(const FXString& file);
/**
* Search path list for this file, return full path name for first occurrence.
*/
FXString FXAPI search(const FXString& pathlist,const FXString& file);
}
}
#endif
fox-1.6.49/include/FXCP1256Codec.h 0000644 0001750 0001750 00000001106 11637250333 013141 0000000 0000000 #ifndef FXCP1256CODEC_H
#define FXCP1256CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// CP1256 Codec
class FXAPI FXCP1256Codec : public FXTextCodec {
FXDECLARE(FXCP1256Codec)
public:
FXCP1256Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FXCP1256Codec(){}
};
}
#endif
fox-1.6.49/include/FXRuler.h 0000664 0001750 0001750 00000027227 12130340076 012463 0000000 0000000 /********************************************************************************
* *
* R u l e r W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2002,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXRuler.h,v 1.36 2006/01/28 20:30:21 fox Exp $ *
********************************************************************************/
#ifndef FXRULER_H
#define FXRULER_H
#ifndef FXFRAME_H
#include "FXFrame.h"
#endif
namespace FX {
/// Ruler options
enum {
RULER_NORMAL = 0, /// Default appearance (default)
RULER_HORIZONTAL = 0, /// Ruler is horizontal (default)
RULER_VERTICAL = 0x00008000, /// Ruler is vertical
RULER_TICKS_OFF = 0, /// Tick marks off (default)
RULER_TICKS_TOP = 0x00010000, /// Ticks on the top (if horizontal)
RULER_TICKS_BOTTOM = 0x00020000, /// Ticks on the bottom (if horizontal)
RULER_TICKS_LEFT = RULER_TICKS_TOP, /// Ticks on the left (if vertical)
RULER_TICKS_RIGHT = RULER_TICKS_BOTTOM, /// Ticks on the right (if vertical)
RULER_TICKS_CENTER = RULER_TICKS_TOP|RULER_TICKS_BOTTOM, /// Tickmarks centered
RULER_NUMBERS = 0x00040000, /// Show numbers
RULER_ARROW = 0x00080000, /// Draw small arrow for cursor position
RULER_MARKERS = 0x00100000, /// Draw markers for indentation settings
RULER_METRIC = 0, /// Metric subdivision (default)
RULER_ENGLISH = 0x00200000, /// English subdivision
RULER_MARGIN_ADJUST = 0x00400000, /// Allow margin adjustment
RULER_ALIGN_CENTER = 0, /// Center document horizontally
RULER_ALIGN_LEFT = 0x00800000, /// Align document to the left
RULER_ALIGN_RIGHT = 0x01000000, /// Align document to the right
RULER_ALIGN_TOP = RULER_ALIGN_LEFT, /// Align document to the top
RULER_ALIGN_BOTTOM = RULER_ALIGN_RIGHT, /// Align document to the bottom
RULER_ALIGN_STRETCH = RULER_ALIGN_LEFT|RULER_ALIGN_RIGHT, /// Stretch document to fit horizontally
RULER_ALIGN_NORMAL = RULER_ALIGN_CENTER /// Normally, document is centered both ways
};
class FXFont;
/**
* The ruler widget is placed alongside a document to measure position
* and size of entities within the document, such as margins, paragraph
* indents, and tickmarks.
* The ruler widget sends a SEL_CHANGED when the indentation or margins
* are interactively changed by the user.
* If the document size exceeds the available space, it is possible to
* scroll the document using setPosition(). When the document size is
* less than the available space, the alignment options can be used to
* center, left-adjust, or right-adjust the document.
* Finally, a special option exists to stretch the document to the
* available space, that is to say, the document will always be fitten
* with given left and right edges substracted from the available space.
*/
class FXAPI FXRuler : public FXFrame {
FXDECLARE(FXRuler)
protected:
FXFont *font; // Font for numbers
FXint documentSize; // Size of document
FXint edgeSpacing; // Edge spacing around document
FXint marginLower; // Lower margin
FXint marginUpper; // Upper margin
FXint indentFirst; // First line paragraph indent
FXint indentLower; // Lower paragraph indent
FXint indentUpper; // Upper paragraph indent
FXdouble pixelPerTick; // Number of pixels per tick increment
FXint numberTicks; // Tick increments between numbers
FXint majorTicks; // Tick increments between major ticks
FXint mediumTicks; // Tick increments between medium ticks
FXint tinyTicks; // Tick increments between tiny ticks
FXint arrowPos; // Arrow position
FXColor textColor; // Color for numbers and ticks
FXint shift; // Left edge of content
FXint pos; // Scroll position
FXint off; // Offset item was grabbed
FXString tip; // Tooltip text
FXString help; // Help text
FXuchar mode; // Mode widget is in
protected:
FXRuler();
FXint picked(FXint x,FXint y);
void drawLeftArrow(FXDCWindow& dc,FXint x,FXint y);
void drawRightArrow(FXDCWindow& dc,FXint x,FXint y);
void drawUpArrow(FXDCWindow& dc,FXint x,FXint y);
void drawDownArrow(FXDCWindow& dc,FXint x,FXint y);
void drawLeftMarker(FXDCWindow& dc,FXint x,FXint y);
void drawRightMarker(FXDCWindow& dc,FXint x,FXint y);
void drawUpMarker(FXDCWindow& dc,FXint x,FXint y);
void drawDownMarker(FXDCWindow& dc,FXint x,FXint y);
protected:
enum{
MOUSE_NONE, // No mouse operation
MOUSE_MARG_LOWER, // Drag lower margin
MOUSE_MARG_UPPER, // Drag upper margin
MOUSE_PARA_FIRST, // Drag first indent
MOUSE_PARA_LOWER, // Drag lower indent
MOUSE_PARA_UPPER // Drag upper indent
};
private:
FXRuler(const FXRuler&);
FXRuler &operator=(const FXRuler&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetIntValue(FXObject*,FXSelector,void*);
long onCmdGetIntValue(FXObject*,FXSelector,void*);
long onCmdSetHelp(FXObject*,FXSelector,void*);
long onCmdGetHelp(FXObject*,FXSelector,void*);
long onCmdSetTip(FXObject*,FXSelector,void*);
long onCmdGetTip(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
public:
enum{
ID_ARROW=FXFrame::ID_LAST,
ID_LAST
};
public:
/// Construct label with given text and icon
FXRuler(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=RULER_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Perform layout
virtual void layout();
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Set the current position
void setPosition(FXint pos,FXbool notify=FALSE);
/// Return the current position
FXint getPosition() const { return pos; }
/// Change/return content size
void setContentSize(FXint size,FXbool notify=FALSE);
FXint getContentSize() const;
/// Get lower edge of document
FXint getDocumentLower() const;
/// Get upper edge of document
FXint getDocumentUpper() const;
/// Change/return document size
void setDocumentSize(FXint size,FXbool notify=FALSE);
FXint getDocumentSize() const { return documentSize; }
/// Change/return document edge spacing
void setEdgeSpacing(FXint space,FXbool notify=FALSE);
FXint getEdgeSpacing() const { return edgeSpacing; }
/// Change/return lower document margin
void setMarginLower(FXint mgn,FXbool notify=FALSE);
FXint getMarginLower() const { return marginLower; }
/// Change/return upper document margin
void setMarginUpper(FXint mgn,FXbool notify=FALSE);
FXint getMarginUpper() const { return marginUpper; }
/// Change/return first line indent
void setIndentFirst(FXint ind,FXbool notify=FALSE);
FXint getIndentFirst() const { return indentFirst; }
/// Change/return lower indent
void setIndentLower(FXint ind,FXbool notify=FALSE);
FXint getIndentLower() const { return indentLower; }
/// Change/return upper indent
void setIndentUpper(FXint ind,FXbool notify=FALSE);
FXint getIndentUpper() const { return indentUpper; }
/// Change/return document number placement
void setNumberTicks(FXint ticks,FXbool notify=FALSE);
FXint getNumberTicks() const { return numberTicks; }
/// Change/return document major ticks
void setMajorTicks(FXint ticks,FXbool notify=FALSE);
FXint getMajorTicks() const { return majorTicks; }
/// Change/return document medium ticks
void setMediumTicks(FXint ticks,FXbool notify=FALSE);
FXint getMediumTicks() const { return mediumTicks; }
/// Change/return document tiny ticks
void setTinyTicks(FXint ticks,FXbool notify=FALSE);
FXint getTinyTicks() const { return tinyTicks; }
/// Change/return pixel per tick spacing
void setPixelPerTick(FXdouble space,FXbool notify=FALSE);
FXdouble getPixelPerTick() const { return pixelPerTick; }
/// Set the text font
void setFont(FXFont *fnt,FXbool notify=FALSE);
/// Get the text font
FXFont* getFont() const { return font; }
/// Change arrow value, relative to document position
void setValue(FXint value);
/// Return arrow value in document
FXint getValue() const { return arrowPos; }
/// Set ruler style
void setRulerStyle(FXuint style);
/// Get ruler style
FXuint getRulerStyle() const;
/// Set ruler alignment
void setRulerAlignment(FXuint alignment,FXbool notify=FALSE);
/// Get ruler alignment
FXuint getRulerAlignment() const;
/// Get the current text color
FXColor getTextColor() const { return textColor; }
/// Set the current text color
void setTextColor(FXColor clr);
/// Set the status line help text for the ruler
void setHelpText(const FXString& text){ help=text; }
/// Get the status line help text for the ruler
const FXString& getHelpText() const { return help; }
/// Set the tool tip message for the ruler
void setTipText(const FXString& text){ tip=text; }
/// Get the tool tip message for the ruler
const FXString& getTipText() const { return tip; }
/// Save label to a stream
virtual void save(FXStream& store) const;
/// Load label from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXRuler();
};
}
#endif
fox-1.6.49/include/FXIFFImage.h 0000664 0001750 0001750 00000006120 12130340076 012726 0000000 0000000 /********************************************************************************
* *
* I F F I m a g e O b j e c t *
* *
*********************************************************************************
* Copyright (C) 2004,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXIFFImage.h,v 1.10 2006/01/22 17:58:04 fox Exp $ *
********************************************************************************/
#ifndef FXIFFIMAGE_H
#define FXIFFIMAGE_H
#ifndef FXIMAGE_H
#include "FXImage.h"
#endif
namespace FX {
/**
* The IFF Image provides support for the EA/Amiga Image File Format.
*/
class FXAPI FXIFFImage : public FXImage {
FXDECLARE(FXIFFImage)
protected:
FXIFFImage(){}
private:
FXIFFImage(const FXIFFImage&);
FXIFFImage &operator=(const FXIFFImage&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct an image from memory stream formatted as IFF format
FXIFFImage(FXApp* a,const void *pix=NULL,FXuint opts=0,FXint w=1,FXint h=1);
/// Save pixels into stream in IFF format
virtual bool savePixels(FXStream& store) const;
/// Load pixels from stream in IFF format
virtual bool loadPixels(FXStream& store);
/// Destroy
virtual ~FXIFFImage();
};
#ifndef FXLOADIFF
#define FXLOADIFF
/**
* Check if stream contains a IFF, return TRUE if so.
*/
extern FXAPI bool fxcheckIFF(FXStream& store);
/**
* Load an IFF (EA Image File Format) file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadIFF(FXStream& store,FXColor*& data,FXint& width,FXint& height);
#endif
}
#endif
fox-1.6.49/include/FXFileDict.h 0000664 0001750 0001750 00000021644 12130340076 013052 0000000 0000000 /********************************************************************************
* *
* F i l e - A s s o c i a t i o n T a b l e *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXFileDict.h,v 1.31 2006/01/22 17:58:01 fox Exp $ *
********************************************************************************/
#ifndef FXFILEDICT_H
#define FXFILEDICT_H
#ifndef FXDICT_H
#include "FXDict.h"
#endif
namespace FX {
class FXIconDict;
/// Registers stuff to know about the extension
struct FXFileAssoc {
FXString command; /// Command to execute
FXString extension; /// Full extension name
FXString mimetype; /// Mime type name
FXIcon *bigicon; /// Big normal icon
FXIcon *bigiconopen; /// Big open icon
FXIcon *miniicon; /// Mini normal icon
FXIcon *miniiconopen; /// Mini open icon
FXDragType dragtype; /// Registered drag type
FXuint flags; /// Flags; 1=cd, 2=term
};
/**
* The File Association dictionary associates a file extension with a File
* Association record which contains command name, mime type, icons, and other
* information about the file type. The icons referenced by the file association
* are managed by the Icon Dictionary; this guarantees that each icon is loaded
* only once into memory.
* The associations are determined by the information by the FOX Registry settings;
* each entry under the FILETYPES registry section comprises the command line,
* extension name, large icon, small icon, and mime type:
*
* command ';' extension ';' bigicon [ ':' bigiconopen ] ';' icon [ ':' iconopen ] ';' mime [ ';' flags ]
*
* For example, the binding for "jpg" could be:
*
* xv %s &;JPEG Image;bigimage.xpm;miniimage.xpm;image/jpeg;term
*
* The association for a file name is determined by first looking at the entire
* file name, then at the whole extension, and then at sub-extensions.
* For example, "name.tar.gz", "tar.gz", and "gz" can each be given a different
* file association. Directory names may also be given associations; there is
* no command-line association for a directory, however. The association for a
* directory is found by first checking the whole pathname, then checking the
* pathname less the first component, and so on. So, "/usr/local/include",
* "/local/include", and "/include" can each be given their own file associations.
* If the above lookup procedure has not found a file association, the system
* uses a fallback associations: for files, the fallback association is determined
* by the binding "defaultfilebinding". For directories, the "defaultdirbinding"
* is used, and for executables the "defaultexecbinding" is used.
* The flags field is used for a number of bit-flags; two flags are currently
* defined: 'cd' and 'term'. The first one is intended to cause a launcher
* to execute the application in the shown directory; the second one is meant
* to indicate that the application is to be ran inside a new terminal.
*/
class FXAPI FXFileDict : public FXDict {
FXDECLARE(FXFileDict)
private:
FXSettings *settings; // Settings database where to get bindings
FXIconDict *icons; // Icon dictionary which keeps track of loaded icons
protected:
FXFileDict(){}
virtual void *createData(const void*);
virtual void deleteData(void*);
private:
FXFileDict(const FXFileDict&);
FXFileDict &operator=(const FXFileDict&);
public:
/// Registry key used to find fallback executable icons
static const FXchar defaultExecBinding[];
/// Registry key used to find fallback directory icons
static const FXchar defaultDirBinding[];
/// Registry key used to find fallback document icons
static const FXchar defaultFileBinding[];
public:
/**
* Construct a dictionary mapping file-extension to file associations,
* using the application registry settings as a source for the bindings.
* The pointer to the application class is passed down to the icon source
* which is inside the icon dictionary.
*/
FXFileDict(FXApp* app);
/**
* Construct a dictionary mapping file-extension to file associations,
* using the specified settings database as a source for the bindings.
* The pointer to the application class is passed down to the icon source
* which is inside the icon dictionary.
*/
FXFileDict(FXApp* app,FXSettings* db);
/// Change settings database
void setSettings(FXSettings* s){ settings=s; }
/// Return settings database
FXSettings* getSettings() const { return settings; }
/// Change icon dictionary
void setIconDict(FXIconDict *icns){ icons=icns; }
/// Return icon dictionary
FXIconDict* getIconDict() const { return icons; }
/**
* Set icon search path; the initial search path is determined by the
* "iconpath" registry setting in the SETTINGS section.
*/
void setIconPath(const FXString& path);
/// Return current icon search path
const FXString& getIconPath() const;
/**
* Replace file association.
* The new association is written into the settings database under the
* FILETYPES section; the format of the association is as follows:
*
* = " ; ; [ : ] ; [ : ] ; "
*
* Where is the command used to launch the application (e.g. "xv %s &"),
* and is the file type string (e.g. "GIF Image"),
* and are the large icons shown in "Icons" mode,
* and are the small icons shown in "Details" mode,
* and is the RFC2045 mime type of the file.
*
* For example:
*
* [FILETYPES]
* gif="xv %s &;GIF Image;big.xpm:bigopen.xpm;mini.xpm:miniopen.xpm;image/gif"
* /home/jeroen=";Home;home.xpm;minihome.xpm;application/x-folder"
*
*/
FXFileAssoc* replace(const FXchar* ext,const FXchar* str);
/// Remove file association
FXFileAssoc* remove(const FXchar* ext);
/// Find file association from registry
FXFileAssoc* find(const FXchar* ext);
/**
* Determine binding for the given file.
* The default implementation tries the whole filename first,
* then tries the extensions.
* For example, for a file "source.tar.gz":
*
* "source.tar.gz",
* "tar.gz",
* "gz"
*
* are tried in succession. If no association is found the
* key "defaultfilebinding" is tried as a fallback association.
* A NULL is returned if no association of any kind is found.
*/
virtual FXFileAssoc* findFileBinding(const FXchar* pathname);
/**
* Find directory binding from registry.
* The default implementation tries the whole pathname first,
* then tries successively smaller parts of the path.
* For example, a pathname "/usr/people/jeroen":
*
* "/usr/people/jeroen"
* "/people/jeroen"
* "/jeroen"
*
* are tried in succession. If no bindings are found, the
* key "defaultdirbinding" is tried as a fallback association.
* A NULL is returned if no association of any kind is found.
*/
virtual FXFileAssoc* findDirBinding(const FXchar* pathname);
/**
* Determine binding for the given executable.
* The default implementation returns the fallback binding associated with
* the key "defaultexecbinding".
* A NULL is returned if no association of any kind is found.
*/
virtual FXFileAssoc* findExecBinding(const FXchar* pathname);
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXFileDict();
};
}
#endif
fox-1.6.49/include/FX88599Codec.h 0000644 0001750 0001750 00000001104 11637250333 013025 0000000 0000000 #ifndef FX88599CODEC_H
#define FX88599CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// ISO-8859-9 Codec
class FXAPI FX88599Codec : public FXTextCodec {
FXDECLARE(FX88599Codec)
public:
FX88599Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FX88599Codec(){}
};
}
#endif
fox-1.6.49/include/FXFontDialog.h 0000664 0001750 0001750 00000005402 12130340076 013407 0000000 0000000 /********************************************************************************
* *
* F o n t S e l e c t i o n D i a l o g *
* *
*********************************************************************************
* Copyright (C) 1999,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXFontDialog.h,v 1.14 2006/01/22 17:58:02 fox Exp $ *
********************************************************************************/
#ifndef FXFONTDIALOG_H
#define FXFONTDIALOG_H
#ifndef FXDIALOGBOX_H
#include "FXDialogBox.h"
#endif
namespace FX {
class FXFontSelector;
/// Font selection dialog
class FXAPI FXFontDialog : public FXDialogBox {
FXDECLARE(FXFontDialog)
protected:
FXFontSelector *fontbox;
protected:
FXFontDialog(){}
private:
FXFontDialog(const FXFontDialog&);
FXFontDialog &operator=(const FXFontDialog&);
public:
/// Constructor
FXFontDialog(FXWindow* owner,const FXString& name,FXuint opts=0,FXint x=0,FXint y=0,FXint w=600,FXint h=380);
/// Save dialog to a stream
virtual void save(FXStream& store) const;
/// Load dialog from a stream
virtual void load(FXStream& store);
/// Set the current font selection
void setFontSelection(const FXFontDesc& fontdesc);
/// Get the current font selection
void getFontSelection(FXFontDesc& fontdesc) const;
/// Destructor
virtual ~FXFontDialog();
};
}
#endif
fox-1.6.49/include/Makefile.am 0000664 0001750 0001750 00000010560 12130340076 013007 0000000 0000000 ## Process this file with automake to produce Makefile.in
foxincludedir=$(includedir)/fox-1.6
CODECS = \
FX88591Codec.h \
FX88592Codec.h \
FX88593Codec.h \
FX88594Codec.h \
FX88595Codec.h \
FX88596Codec.h \
FX88597Codec.h \
FX88598Codec.h \
FX88599Codec.h \
FX885910Codec.h \
FX885911Codec.h \
FX885913Codec.h \
FX885914Codec.h \
FX885915Codec.h \
FX885916Codec.h \
FXCP437Codec.h \
FXCP850Codec.h \
FXCP852Codec.h \
FXCP855Codec.h \
FXCP856Codec.h \
FXCP857Codec.h \
FXCP860Codec.h \
FXCP861Codec.h \
FXCP862Codec.h \
FXCP863Codec.h \
FXCP864Codec.h \
FXCP865Codec.h \
FXCP866Codec.h \
FXCP869Codec.h \
FXCP874Codec.h \
FXCP1250Codec.h \
FXCP1251Codec.h \
FXCP1252Codec.h \
FXCP1253Codec.h \
FXCP1254Codec.h \
FXCP1255Codec.h \
FXCP1256Codec.h \
FXCP1257Codec.h \
FXCP1258Codec.h \
FXKOI8RCodec.h \
FXUTF8Codec.h \
FXUTF16Codec.h \
FXUTF32Codec.h
foxinclude_HEADERS = \
$(CODECS) \
FX4Splitter.h \
FX7Segment.h \
FXAccelTable.h \
FXApp.h \
FXArray.h \
FXArrowButton.h \
FXBMPIcon.h \
FXBMPImage.h \
FXBitmap.h \
FXBitmapFrame.h \
FXBitmapView.h \
FXButton.h \
FXBZFileStream.h \
FXCURCursor.h \
FXCanvas.h \
FXCheckButton.h \
FXChoiceBox.h \
FXColorBar.h \
FXColorDialog.h \
FXColorList.h \
FXColorRing.h \
FXColorSelector.h \
FXColorWell.h \
FXColorWheel.h \
FXComboBox.h \
FXComposeContext.h \
FXComposite.h \
FXCursor.h \
FXDate.h \
FXDC.h \
FXDCPrint.h \
FXDCWindow.h \
FXDLL.h \
FXDataTarget.h \
FXDebugTarget.h \
FXDelegator.h \
FXDial.h \
FXDialogBox.h \
FXDict.h \
FXDir.h \
FXDirBox.h \
FXDirDialog.h \
FXDirList.h \
FXDirSelector.h \
FXDockBar.h \
FXDockHandler.h \
FXDockSite.h \
FXDockTitle.h \
FXDocument.h \
FXDragCorner.h \
FXDrawable.h \
FXDriveBox.h \
FXElement.h \
FXException.h \
FXExpression.h \
FXExtentd.h \
FXExtentf.h \
FXFile.h \
FXFileDialog.h \
FXFileDict.h \
FXFileList.h \
FXFileSelector.h \
FXFileStream.h \
FXFoldingList.h \
FXFont.h \
FXFontDialog.h \
FXFontSelector.h \
FXFrame.h \
FXGIFCursor.h \
FXGIFIcon.h \
FXGIFImage.h \
FXGLCanvas.h \
FXGLCone.h \
FXGLContext.h \
FXGLCube.h \
FXGLCylinder.h \
FXGLObject.h \
FXGLShape.h \
FXGLSphere.h \
FXGLTriangleMesh.h \
FXGLViewer.h \
FXGLVisual.h \
FXGroupBox.h \
FXGradientBar.h \
FXGUISignal.h \
FXGZFileStream.h \
FXHash.h \
FXHeader.h \
FXHorizontalFrame.h \
FXICOIcon.h \
FXICOImage.h \
FXIFFImage.h \
FXIFFIcon.h \
FXIO.h \
FXIcon.h \
FXIconDict.h \
FXIconList.h \
FXIconSource.h \
FXId.h \
FXImage.h \
FXImageFrame.h \
FXImageView.h \
FXInputDialog.h \
FXJPGIcon.h \
FXJPGImage.h \
FXKnob.h \
FXLabel.h \
FXList.h \
FXListBox.h \
FXMDIButton.h \
FXMDIChild.h \
FXMDIClient.h \
FXMainWindow.h \
FXMat3d.h \
FXMat4d.h \
FXMat3f.h \
FXMat4f.h \
FXMatrix.h \
FXMemoryStream.h \
FXMemMap.h \
FXMenuBar.h \
FXMenuButton.h \
FXMenuCaption.h \
FXMenuCascade.h \
FXMenuCheck.h \
FXMenuRadio.h \
FXMenuCommand.h \
FXMenuPane.h \
FXMenuSeparator.h \
FXMenuTitle.h \
FXMessageBox.h \
FXObject.h \
FXObjectList.h \
FXOptionMenu.h \
FXPCXIcon.h \
FXPCXImage.h \
FXPNGIcon.h \
FXPNGImage.h \
FXPPMIcon.h \
FXPPMImage.h \
FXPacker.h \
FXPath.h \
FXPicker.h \
FXPipe.h \
FXPoint.h \
FXPopup.h \
FXPrintDialog.h \
FXProgressBar.h \
FXProgressDialog.h \
FXQuatd.h \
FXQuatf.h \
FXRASIcon.h \
FXRASImage.h \
FXRGBIcon.h \
FXRGBImage.h \
FXRadioButton.h \
FXRangef.h \
FXRanged.h \
FXRealSlider.h \
FXRealSpinner.h \
FXRecentFiles.h \
FXRectangle.h \
FXRegion.h \
FXRegistry.h \
FXReplaceDialog.h \
FXRex.h \
FXRootWindow.h \
FXRuler.h \
FXRulerView.h \
FXScrollArea.h \
FXScrollBar.h \
FXScrollPane.h \
FXScrollWindow.h \
FXSearchDialog.h \
FXSeparator.h \
FXSettings.h \
FXShell.h \
FXShutter.h \
FXSize.h \
FXSlider.h \
FXSocket.h \
FXSpinner.h \
FXSpheref.h \
FXSphered.h \
FXSplashWindow.h \
FXSplitter.h \
FXSpring.h \
FXStat.h \
FXStatusBar.h \
FXStatusLine.h \
FXStream.h \
FXString.h \
FXStringDict.h \
FXSwitcher.h \
FXSystem.h \
FXTGAIcon.h \
FXTGAImage.h \
FXTIFIcon.h \
FXTIFImage.h \
FXTabBar.h \
FXTabBook.h \
FXTabItem.h \
FXTable.h \
FXText.h \
FXTextCodec.h \
FXTextField.h \
FXThread.h \
FXToggleButton.h \
FXToolBar.h \
FXToolBarGrip.h \
FXToolBarShell.h \
FXToolBarTab.h \
FXToolTip.h \
FXTopWindow.h \
FXTranslator.h \
FXTreeList.h \
FXTreeListBox.h \
FXTriStateButton.h \
FXUndoList.h \
FXURL.h \
FXVec2d.h \
FXVec2f.h \
FXVec3d.h \
FXVec3f.h \
FXVec4d.h \
FXVec4f.h \
FXVerticalFrame.h \
FXVisual.h \
FXWindow.h \
FXWizard.h \
FXXBMIcon.h \
FXXBMImage.h \
FXXPMIcon.h \
FXXPMImage.h \
fx.h \
fx3d.h \
fxascii.h \
fxdefs.h \
fxkeys.h \
fxunicode.h \
fxver.h \
xincs.h
fox-1.6.49/include/FX88593Codec.h 0000644 0001750 0001750 00000001104 11637250333 013017 0000000 0000000 #ifndef FX88593CODEC_H
#define FX88593CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// ISO-8859-3 Codec
class FXAPI FX88593Codec : public FXTextCodec {
FXDECLARE(FX88593Codec)
public:
FX88593Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FX88593Codec(){}
};
}
#endif
fox-1.6.49/include/FXJPGImage.h 0000664 0001750 0001750 00000006710 12130340076 012747 0000000 0000000 /********************************************************************************
* *
* J P E G I m a g e O b j e c t *
* *
*********************************************************************************
* Copyright (C) 2000,2006 by David Tyree. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXJPGImage.h,v 1.20 2006/01/24 13:53:11 fox Exp $ *
********************************************************************************/
#ifndef FXJPGIMAGE_H
#define FXJPGIMAGE_H
#ifndef FXIMAGE_H
#include "FXImage.h"
#endif
namespace FX {
/// JPEG Image class
class FXAPI FXJPGImage : public FXImage {
FXDECLARE(FXJPGImage)
protected:
FXint quality;
protected:
FXJPGImage(){}
private:
FXJPGImage(const FXJPGImage&);
FXJPGImage &operator=(const FXJPGImage&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct an image from memory stream formatted in JPEG format
FXJPGImage(FXApp *a,const void *pix=NULL,FXuint opts=0,FXint w=1,FXint h=1,FXint q=75);
/// True if format is supported
static const bool supported;
/// Set image quality to save with
void setQuality(FXint q){ quality=q; }
/// Get image quality setting
FXint getQuality() const { return quality; }
/// Save pixels into stream in JPEG format
virtual bool loadPixels(FXStream& store);
/// Load pixels from stream in JPEG format
virtual bool savePixels(FXStream& store) const;
/// Destroy
virtual ~FXJPGImage();
};
/**
* Check if stream contains a JPG, return TRUE if so.
*/
extern FXAPI bool fxcheckJPG(FXStream& store);
/**
* Load an JPEG (Joint Photographics Experts Group) file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadJPG(FXStream& store,FXColor*& data,FXint& width,FXint& height,FXint& quality);
/**
* Save an JPEG (Joint Photographics Experts Group) file to a stream.
*/
extern FXAPI bool fxsaveJPG(FXStream& store,const FXColor* data,FXint width,FXint height,FXint quality);
}
#endif
fox-1.6.49/include/fxunicode.h 0000664 0001750 0001750 00000032522 12130340076 013112 0000000 0000000 /********************************************************************************
* *
* U N I C O D E C h a r a c t e r I n f o *
* *
*********************************************************************************
* Copyright (C) 2005,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: fxunicode.h,v 1.3 2006/01/22 17:58:14 fox Exp $ *
********************************************************************************/
#ifndef FXUNICODE_H
#define FXUNICODE_H
namespace FX {
/// General Category
enum {
CatNotAssigned = 0, /// Cn Other, Not Assigned (no characters in the file have this property)
CatControl = 1, /// Cc Other, Control
CatFormat = 2, /// Cf Other, Format
CatSurrogate = 3, /// Cs Other, Surrogate
CatOther = 4, /// Co Other, Private Use
CatMarkNonSpacing = 5, /// Mn Mark, Nonspacing
CatMarkSpacingCombining = 6, /// Mc Mark, Spacing Combining
CatMarkEnclosing = 7, /// Me Mark, Enclosing
CatSeparatorSpace = 8, /// Zs Separator, Space
CatSeparatorLine = 9, /// Zl Separator, Line
CatSeparatorParagraph = 10, /// Zp Separator, Paragraph
CatLetterUpper = 11, /// Lu Letter, Uppercase
CatLetterLower = 12, /// Ll Letter, Lowercase
CatLetterTitle = 13, /// Lt Letter, Titlecase
CatLetterModifier = 14, /// Lm Letter, Modifier
CatLetterOther = 15, /// Lo Letter, Other
CatNumberLetter = 16, /// Nl Number, Letter
CatNumberDecimal = 17, /// Nd Number, Decimal Digit
CatNumberOther = 18, /// No Number, Other
CatPunctConnector = 19, /// Pc Punctuation, Connector
CatPunctDash = 20, /// Pd Punctuation, Dash
CatPunctOpen = 21, /// Ps Punctuation, Open
CatPunctClose = 22, /// Pe Punctuation, Close
CatPunctInitial = 23, /// Pi Punctuation, Initial quote (may behave like Ps or Pe depending on usage)
CatPunctFinal = 24, /// Pf Punctuation, Final quote (may behave like Ps or Pe depending on usage)
CatPunctOther = 25, /// Po Punctuation, Other
CatSymbolMath = 26, /// Sm Symbol, Math
CatSymbolCurrency = 27, /// Sc Symbol, Currency
CatSymbolModifier = 28, /// Sk Symbol, Modifier
CatSymbolOther = 29 /// So Symbol, Other
};
/// Bidi types
enum {
DirL = 0, /// Left-to-Right
DirLRE = 1, /// Left-to-Right Embedding
DirLRO = 2, /// Left-to-Right Override
DirR = 3, /// Right-to-Left
DirAL = 4, /// Right-to-Left Arabic
DirRLE = 5, /// Right-to-Left Embedding
DirRLO = 6, /// Right-to-Left Override
DirPDF = 7, /// Pop Directional Format
DirEN = 8, /// European Number
DirES = 9, /// European Number Separator
DirET = 10, /// European Number Terminator
DirAN = 11, /// Arabic Number
DirCS = 12, /// Common Number Separator
DirNSM = 13, /// Non-Spacing Mark
DirBN = 14, /// Boundary Neutral
DirB = 15, /// Paragraph Separator
DirS = 16, /// Segment Separator
DirWS = 17, /// Whitespace
DirON = 18 /// Other Neutrals
};
/// Arabic joining
enum {
NonJoining = 0,
RightJoining = 1,
DualJoining = 2,
JoinCausing = 3
};
/// Combining class
enum {
CombBelowLeftAtt = 200, /// Below left attached
CombBelowAtt = 202, /// Below attached
CombBelowRightAtt = 204, /// Below right attached
CombLeftAtt = 208, /// Left attached (reordrant around single base character)
CombRightAtt = 210, /// Right attached
CombAboveLeftAtt = 212, /// Above left attached
CombAboveAtt = 214, /// Above attached
CombAboveRightAtt = 216, /// Above right attached
CombBelowLeft = 218, /// Below left
CombBelow = 220, /// Below
CombBelowRight = 222, /// Below right
CombLeft = 224, /// Left (reordrant around single base character)
CombRight = 226, /// Right
CombAboveLeft = 228, /// Above left
CombAbove = 230, /// Above
CombAboveRight = 232, /// Above right
CombDoubleBelow = 233, /// Double below
CombDoubleAbove = 234, /// Double above
CombIotaSub = 240 /// Below (iota subscript)
};
/// Decompose types
enum {
DecNone = 0, /// Non-decomposable
DecFont = 1, /// A font variant (e.g. a blackletter form)
DecNoBreak = 2, /// A no-break version of a space or hyphen
DecInitial = 3, /// An initial presentation form (Arabic)
DecMedial = 4, /// A medial presentation form (Arabic)
DecFinal = 5, /// A final presentation form (Arabic)
DecIsolated = 6, /// An isolated presentation form (Arabic)
DecCircle = 7, /// An encircled form
DecSuper = 8, /// A superscript form
DecSub = 9, /// A subscript form
DecVertical = 10, /// A vertical layout presentation form
DecWide = 11, /// A wide (or zenkaku) compatibility character
DecNarrow = 12, /// A narrow (or hankaku) compatibility character
DecSmall = 13, /// A small variant form (CNS compatibility)
DecSquare = 14, /// A CJK squared font variant
DecFraction = 15, /// A vulgar fraction form
DecCompat = 16, /// Compatible
DecCanonical = 17 /// Canonical (equivalent)
};
/// Line break types
enum {
BreakUnknown = 0, /// XX Unknown
BreakMandarory = 1, /// BK Mandatory Break
BreakReturn = 2, /// CR Carriage Return
BreakLineFeed = 3, /// LF Line Feed
BreakCombMark = 4, /// CM Attached Characters and Combining Marks
BreakNextLine = 5, /// NL Next Line
BreakSurrogate = 6, /// SG Surrogates
BreakWordJoiner = 7, /// WJ Word Joiner
BreakZWSpace = 8, /// ZW Zero Width Space
BreakGlue = 9, /// GL Non-breaking Glue
BreakContingent = 10, /// CB Contingent Break Opportunity
BreakSpace = 11, /// SP Space
BreakBoth = 12, /// B2 Break Opportunity Before and After
BreakAfter = 13, /// BA Break Opportunity After
BreakBefore = 14, /// BB Break Opportunity Before
BreakHyphen = 15, /// HY Hyphen
BreakOpen = 16, /// OP Opening Punctuation
BreakClose = 17, /// CL Closing Punctuation
BreakQuote = 18, /// QU Ambiguous Quotation
BreakExclaim = 19, /// EX Exclamation/Interrogation
BreakInsep = 20, /// IN Inseparable
BreakNonStart = 21, /// NS Non Starter
BreakInfix = 22, /// IS Infix Separator (Numeric)
BreakNumeric = 23, /// NU Numeric
BreakPostfix = 24, /// PO Postfix (Numeric)
BreakPrefix = 25, /// PR Prefix (Numeric)
BreakSymbol = 26, /// SY Symbols Allowing Breaks
BreakOrdinary = 27, /// AL Ordinary Alphabetic and Symbol Characters
BreakIdeograph = 28, /// ID Ideographic
BreakComplex = 29 /// SA Complex Context (South East Asian)
};
/// Scripts
enum {
ScriptCommon = 0, /// Zyyy
ScriptInherited = 1, /// Qaai
ScriptLatin = 2, /// Latn European scripts
ScriptGreek = 3, /// Grek
ScriptCyrillic = 4, /// Cyrl (Cyrs)
ScriptArmenian = 5, /// Armn
ScriptGeorgian = 6, /// Geor (Geon, Geoa)
ScriptRunic = 7, /// Runr
ScriptOgham = 8, /// Ogam
ScriptHebrew = 9, /// Hebr Middle eastern
ScriptArabic = 10, /// Arab
ScriptSyriac = 11, /// Syrc (Syrj, Syrn, Syre)
ScriptThaana = 12, /// Thaa
ScriptDevanagari = 13, /// Deva Indic
ScriptBengali = 14, /// Beng
ScriptGurmukhi = 15, /// Guru
ScriptGujarati = 16, /// Gujr
ScriptOriya = 17, /// Orya
ScriptTamil = 18, /// Taml
ScriptTelugu = 19, /// Telu
ScriptKannada = 20, /// Knda
ScriptMalayalam = 21, /// Mlym
ScriptSinhala = 22, /// Sinh
ScriptThai = 23, /// Thai
ScriptLao = 24, /// Laoo
ScriptTibetan = 25, /// Tibt
ScriptMyanmar = 26, /// Mymr
ScriptKhmer = 27, /// Khmr
ScriptHan = 28, /// Hani Asian
ScriptHiragana = 29, /// Hira
ScriptKatakana = 30, /// Kana
ScriptHangul = 31, /// Hang
ScriptBopomofo = 32, /// Bopo
ScriptYi = 33, /// Yiii
ScriptEthiopic = 34, /// Ethi Misc
ScriptCherokee = 35, /// Cher
ScriptCanadianAboriginal = 36, /// Cans
ScriptMongolian = 37, /// Mong
ScriptGothic = 38, /// Goth
ScriptTagalog = 39, /// Tglg
ScriptHanunoo = 40, /// Hano
ScriptBuhid = 41, /// Buhd
ScriptTagbanwa = 42, /// Tagb
ScriptLimbu = 43, /// Limb
ScriptTaiLe = 44, /// Tale
ScriptUgaritic = 45, /// Ugar
ScriptOsmanya = 46, /// Osma
ScriptCypriot = 47, /// Cprt
ScriptShavian = 48, /// Shaw
ScriptDeseret = 49, /// Dsrt
ScriptKatakanaHiragana = 50 /// Hrkt
};
/// Unicode versions of common character functions
namespace Unicode {
/// Character wide character category
extern FXAPI FXuint charCategory(FXwchar ucs);
/// Get character wide character direction
extern FXAPI FXuint charDirection(FXwchar ucs);
/// Get wide character decompose type
extern FXAPI FXuint decomposeType(FXwchar ucs);
/// Return number of wide characters in decomposition
extern FXAPI FXuint charNumDecompose(FXwchar ucs);
/// Return wide character decomposition
extern FXAPI const FXwchar* charDecompose(FXwchar ucs);
/// Return wide character composition from ucsa and ucsb
extern FXAPI FXwchar charCompose(FXwchar ucsa,FXwchar ucsb);
/// Get wide character joining
extern FXAPI FXuint joiningType(FXwchar ucs);
/// Get wide character symmetry
extern FXAPI FXuint isSymmetric(FXwchar ucs);
/// Get wide character combining type; zero means starter
extern FXAPI FXuint charCombining(FXwchar ucs);
/// Get numeric value of wide character (this includes hex value)
extern FXAPI FXint digitValue(FXwchar ucs);
/// Get linebreak type of wide character
extern FXAPI FXuint lineBreakType(FXwchar ucs);
/// Get mirror image of wide character or character itself
extern FXAPI FXwchar mirrorImage(FXwchar ucs);
/// Script type of wide character
extern FXAPI FXuint scriptType(FXwchar ucs);
/// Unicode flavor of common functions
extern FXAPI bool hasCase(FXwchar ucs);
extern FXAPI bool isUpper(FXwchar ucs);
extern FXAPI bool isLower(FXwchar ucs);
extern FXAPI bool isTitle(FXwchar ucs);
extern FXAPI bool isAscii(FXwchar ucs);
extern FXAPI bool isLetter(FXwchar ucs);
extern FXAPI bool isDigit(FXwchar ucs);
extern FXAPI bool isAlphaNumeric(FXwchar ucs);
extern FXAPI bool isControl(FXwchar ucs);
extern FXAPI bool isSpace(FXwchar ucs);
extern FXAPI bool isBlank(FXwchar ucs);
extern FXAPI bool isPunct(FXwchar ucs);
extern FXAPI bool isGraph(FXwchar ucs);
extern FXAPI bool isPrint(FXwchar ucs);
extern FXAPI bool isHexDigit(FXwchar ucs);
extern FXAPI bool isSymbol(FXwchar ucs);
extern FXAPI bool isMark(FXwchar ucs);
extern FXAPI bool isSep(FXwchar ucs);
/// Case conversion
extern FXAPI FXwchar toUpper(FXwchar ucs);
extern FXAPI FXwchar toLower(FXwchar ucs);
extern FXAPI FXwchar toTitle(FXwchar ucs);
}
}
#endif
fox-1.6.49/include/FXSpheref.h 0000664 0001750 0001750 00000012742 12130340076 012762 0000000 0000000 /********************************************************************************
* *
* S i n g l e - P r e c i s i o n S p h e r e C l a s s *
* *
*********************************************************************************
* Copyright (C) 2004,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXSpheref.h,v 1.18 2006/01/22 17:58:09 fox Exp $ *
********************************************************************************/
#ifndef FXSPHEREF_H
#define FXSPHEREF_H
namespace FX {
class FXRangef;
/// Spherical bounds
class FXAPI FXSpheref {
public:
FXVec3f center;
FXfloat radius;
public:
/// Default constructor
FXSpheref(){}
/// Copy constructor
FXSpheref(const FXSpheref& sphere):center(sphere.center),radius(sphere.radius){}
/// Initialize from center and radius
FXSpheref(const FXVec3f& cen,FXfloat rad=0.0f):center(cen),radius(rad){}
/// Initialize from center and radius
FXSpheref(FXfloat x,FXfloat y,FXfloat z,FXfloat rad=0.0f):center(x,y,z),radius(rad){}
/// Initialize sphere to fully contain the given bounding box
FXSpheref(const FXRangef& bounds);
/// Assignment
FXSpheref& operator=(const FXSpheref& sphere){ center=sphere.center; radius=sphere.radius; return *this; }
/// Set value from another sphere
FXSpheref& set(const FXSpheref& sphere){ center=sphere.center; radius=sphere.radius; return *this; }
/// Set value from center and radius
FXSpheref& set(const FXVec3f& cen,FXfloat rad){ center=cen; radius=rad; return *this; }
/// Set value from center and radius
FXSpheref& set(FXfloat x,FXfloat y,FXfloat z,FXfloat rad){ center.set(x,y,z); radius=rad; return *this; }
/// Comparison
bool operator==(const FXSpheref& s) const { return center==s.center && radius==s.radius;}
bool operator!=(const FXSpheref& s) const { return center!=s.center || radius!=s.radius;}
/// Diameter of sphere
FXfloat diameter() const { return radius*2.0f; }
/// Test if empty
bool empty() const { return radius<0.0f; }
/// Test if sphere contains point x,y,z
bool contains(FXfloat x,FXfloat y,FXfloat z) const;
/// Test if sphere contains point p
bool contains(const FXVec3f& p) const;
/// Test if sphere properly contains another box
bool contains(const FXRangef& box) const;
/// Test if sphere properly contains another sphere
bool contains(const FXSpheref& sphere) const;
/// Include point
FXSpheref& include(FXfloat x,FXfloat y,FXfloat z);
/// Include point
FXSpheref& include(const FXVec3f& p);
/// Expand radius to include point
FXSpheref& includeInRadius(FXfloat x,FXfloat y,FXfloat z);
/// Expand radius to include point
FXSpheref& includeInRadius(const FXVec3f& p);
/// Include given range into this one
FXSpheref& include(const FXRangef& box);
/// Expand radius to include box
FXSpheref& includeInRadius(const FXRangef& box);
/// Include given sphere into this one
FXSpheref& include(const FXSpheref& sphere);
/// Expand radius to include sphere
FXSpheref& includeInRadius(const FXSpheref& sphere);
/// Intersect sphere with normalized plane ax+by+cz+w; returns -1,0,+1
FXint intersect(const FXVec4f& plane) const;
/// Intersect sphere with ray u-v
bool intersect(const FXVec3f& u,const FXVec3f& v) const;
/// Test if box overlaps with sphere
friend FXAPI bool overlap(const FXRangef& a,const FXSpheref& b);
/// Test if sphere overlaps with box
friend FXAPI bool overlap(const FXSpheref& a,const FXRangef& b);
/// Test if spheres overlap
friend FXAPI bool overlap(const FXSpheref& a,const FXSpheref& b);
/// Save object to a stream
friend FXAPI FXStream& operator<<(FXStream& store,const FXSpheref& sphere);
/// Load object from a stream
friend FXAPI FXStream& operator>>(FXStream& store,FXSpheref& sphere);
};
extern FXAPI bool overlap(const FXRangef& a,const FXSpheref& b);
extern FXAPI bool overlap(const FXSpheref& a,const FXRangef& b);
extern FXAPI bool overlap(const FXSpheref& a,const FXSpheref& b);
extern FXAPI FXStream& operator<<(FXStream& store,const FXSpheref& sphere);
extern FXAPI FXStream& operator>>(FXStream& store,FXSpheref& sphere);
}
#endif
fox-1.6.49/include/FXTabBook.h 0000664 0001750 0001750 00000007411 12130340076 012704 0000000 0000000 /********************************************************************************
* *
* T a b B o o k W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXTabBook.h,v 1.10 2006/01/22 17:58:10 fox Exp $ *
********************************************************************************/
#ifndef FXTABBOOK_H
#define FXTABBOOK_H
#ifndef FXTABBAR_H
#include "FXTabBar.h"
#endif
namespace FX {
/**
* The tab book layout manager arranges pairs of children;
* the even numbered children (0,2,4,...) are usually tab items,
* and are placed on the top. The odd numbered children are
* usually layout managers, and are placed below; all the odd
* numbered children are placed on top of each other, similar
* to the switcher widget. When the user presses one of the
* tab items, the tab item is raised above the neighboring tabs,
* and the corresponding panel is raised to the top.
* Thus, a tab book can be used to present many GUI controls
* in a small space by placing several panels on top of each
* other and using tab items to select the desired panel.
* When one of the tab items is pressed, the tab book's setCurrent()
* is called with notify=TRUE. Thus causes the tab book to send a
* SEL_COMMAND message to its target.
*/
class FXAPI FXTabBook : public FXTabBar {
FXDECLARE(FXTabBook)
protected:
FXTabBook(){}
private:
FXTabBook(const FXTabBook&);
FXTabBook& operator=(const FXTabBook&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onFocusNext(FXObject*,FXSelector,void*);
long onFocusPrev(FXObject*,FXSelector,void*);
long onFocusUp(FXObject*,FXSelector,void*);
long onFocusDown(FXObject*,FXSelector,void*);
long onFocusLeft(FXObject*,FXSelector,void*);
long onFocusRight(FXObject*,FXSelector,void*);
long onCmdOpenItem(FXObject*,FXSelector,void*);
public:
/// Construct tab book
FXTabBook(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=TABBOOK_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_SPACING,FXint pr=DEFAULT_SPACING,FXint pt=DEFAULT_SPACING,FXint pb=DEFAULT_SPACING);
/// Perform layout
virtual void layout();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
};
}
#endif
fox-1.6.49/include/FXVec3d.h 0000664 0001750 0001750 00000021750 12130340076 012331 0000000 0000000 /********************************************************************************
* *
* D o u b l e - P r e c i s i o n 3 - E l e m e n t V e c t o r *
* *
*********************************************************************************
* Copyright (C) 1994,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXVec3d.h,v 1.22 2006/01/22 17:58:12 fox Exp $ *
********************************************************************************/
#ifndef FXVEC3D_H
#define FXVEC3D_H
namespace FX {
class FXMat3d;
class FXMat4d;
/// Double-precision 3-element vector
class FXAPI FXVec3d {
public:
FXdouble x;
FXdouble y;
FXdouble z;
public:
/// Default constructor
FXVec3d(){}
/// Initialize from another vector
FXVec3d(const FXVec3d& v){x=v.x;y=v.y;z=v.z;}
/// Initialize from array of doubles
FXVec3d(const FXdouble v[]){x=v[0];y=v[1];z=v[2];}
/// Initialize with components
FXVec3d(FXdouble xx,FXdouble yy,FXdouble zz=1.0){x=xx;y=yy;z=zz;}
/// Initialize with color
FXVec3d(FXColor color);
/// Return a non-const reference to the ith element
FXdouble& operator[](FXint i){return (&x)[i];}
/// Return a const reference to the ith element
const FXdouble& operator[](FXint i) const {return (&x)[i];}
/// Assign color
FXVec3d& operator=(FXColor color);
/// Assignment
FXVec3d& operator=(const FXVec3d& v){x=v.x;y=v.y;z=v.z;return *this;}
/// Assignment from array of doubles
FXVec3d& operator=(const FXdouble v[]){x=v[0];y=v[1];z=v[2];return *this;}
/// Set value from another vector
FXVec3d& set(const FXVec3d& v){x=v.x;y=v.y;z=v.z;return *this;}
/// Set value from array of floats
FXVec3d& set(const FXdouble v[]){x=v[0];y=v[1];z=v[2];return *this;}
/// Set value from components
FXVec3d& set(FXdouble xx,FXdouble yy,FXdouble zz){x=xx;y=yy;z=zz;return *this;}
/// Assigning operators
FXVec3d& operator*=(FXdouble n){x*=n;y*=n;z*=n;return *this;}
FXVec3d& operator/=(FXdouble n){x/=n;y/=n;z/=n;return *this;}
FXVec3d& operator+=(const FXVec3d& v){x+=v.x;y+=v.y;z+=v.z;return *this;}
FXVec3d& operator-=(const FXVec3d& v){x-=v.x;y-=v.y;z-=v.z;return *this;}
/// Conversions
operator FXdouble*(){return &x;}
operator const FXdouble*() const {return &x;}
operator FXVec2d&(){return *reinterpret_cast(this);}
operator const FXVec2d&() const {return *reinterpret_cast(this);}
/// Convert to color
operator FXColor() const;
/// Unary
FXVec3d operator+() const { return *this; }
FXVec3d operator-() const { return FXVec3d(-x,-y,-z); }
/// Vector and vector
FXVec3d operator+(const FXVec3d& v) const { return FXVec3d(x+v.x,y+v.y,z+v.z); }
FXVec3d operator-(const FXVec3d& v) const { return FXVec3d(x-v.x,y-v.y,z-v.z); }
/// Vector and matrix
FXVec3d operator*(const FXMat3d& m) const;
FXVec3d operator*(const FXMat4d& m) const;
/// Scaling
friend inline FXVec3d operator*(const FXVec3d& a,FXdouble n);
friend inline FXVec3d operator*(FXdouble n,const FXVec3d& a);
friend inline FXVec3d operator/(const FXVec3d& a,FXdouble n);
friend inline FXVec3d operator/(FXdouble n,const FXVec3d& a);
/// Dot product
FXdouble operator*(const FXVec3d& v) const { return x*v.x+y*v.y+z*v.z; }
/// Cross product
FXVec3d operator^(const FXVec3d& v) const { return FXVec3d(y*v.z-z*v.y, z*v.x-x*v.z, x*v.y-y*v.x); }
/// Test if zero
bool operator!() const { return x==0.0 && y==0.0 && z==0.0; }
/// Equality tests
bool operator==(const FXVec3d& v) const { return x==v.x && y==v.y && z==v.z; }
bool operator!=(const FXVec3d& v) const { return x!=v.x || y!=v.y || z!=v.z; }
friend inline bool operator==(const FXVec3d& a,FXdouble n);
friend inline bool operator!=(const FXVec3d& a,FXdouble n);
friend inline bool operator==(FXdouble n,const FXVec3d& a);
friend inline bool operator!=(FXdouble n,const FXVec3d& a);
/// Inequality tests
bool operator<(const FXVec3d& v) const { return x(const FXVec3d& v) const { return x>v.x && y>v.y && z>v.z; }
bool operator>=(const FXVec3d& v) const { return x>=v.x && y>=v.y && z>=v.z; }
friend inline bool operator<(const FXVec3d& a,FXdouble n);
friend inline bool operator<=(const FXVec3d& a,FXdouble n);
friend inline bool operator>(const FXVec3d& a,FXdouble n);
friend inline bool operator>=(const FXVec3d& a,FXdouble n);
friend inline bool operator<(FXdouble n,const FXVec3d& a);
friend inline bool operator<=(FXdouble n,const FXVec3d& a);
friend inline bool operator>(FXdouble n,const FXVec3d& a);
friend inline bool operator>=(FXdouble n,const FXVec3d& a);
/// Length and square of length
FXdouble length2() const { return x*x+y*y+z*z; }
FXdouble length() const { return sqrt(length2()); }
/// Clamp values of vector between limits
FXVec3d& clamp(FXdouble lo,FXdouble hi){x=FXCLAMP(lo,x,hi);y=FXCLAMP(lo,y,hi);z=FXCLAMP(lo,z,hi);return *this;}
/// Lowest or highest components
friend inline FXVec3d lo(const FXVec3d& a,const FXVec3d& b);
friend inline FXVec3d hi(const FXVec3d& a,const FXVec3d& b);
/// Compute normal from three points a,b,c
friend FXAPI FXVec3d normal(const FXVec3d& a,const FXVec3d& b,const FXVec3d& c);
/// Compute approximate normal from four points a,b,c,d
friend FXAPI FXVec3d normal(const FXVec3d& a,const FXVec3d& b,const FXVec3d& c,const FXVec3d& d);
/// Normalize vector
friend FXAPI FXVec3d normalize(const FXVec3d& v);
/// Save vector to a stream
friend FXAPI FXStream& operator<<(FXStream& store,const FXVec3d& v);
/// Load vector from a stream
friend FXAPI FXStream& operator>>(FXStream& store,FXVec3d& v);
};
inline FXVec3d operator*(const FXVec3d& a,FXdouble n){return FXVec3d(a.x*n,a.y*n,a.z*n);}
inline FXVec3d operator*(FXdouble n,const FXVec3d& a){return FXVec3d(n*a.x,n*a.y,n*a.z);}
inline FXVec3d operator/(const FXVec3d& a,FXdouble n){return FXVec3d(a.x/n,a.y/n,a.z/n);}
inline FXVec3d operator/(FXdouble n,const FXVec3d& a){return FXVec3d(n/a.x,n/a.y,n/a.z);}
inline bool operator==(const FXVec3d& a,FXdouble n){return a.x==n && a.y==n && a.z==n;}
inline bool operator!=(const FXVec3d& a,FXdouble n){return a.x!=n || a.y!=n || a.z!=n;}
inline bool operator==(FXdouble n,const FXVec3d& a){return n==a.x && n==a.y && n==a.z;}
inline bool operator!=(FXdouble n,const FXVec3d& a){return n!=a.x || n!=a.y || n!=a.z;}
inline bool operator<(const FXVec3d& a,FXdouble n){return a.x(const FXVec3d& a,FXdouble n){return a.x>n && a.y>n && a.z>n;}
inline bool operator>=(const FXVec3d& a,FXdouble n){return a.x>=n && a.y>=n && a.z>=n;}
inline bool operator<(FXdouble n,const FXVec3d& a){return n(FXdouble n,const FXVec3d& a){return n>a.x && n>a.y && n>a.z;}
inline bool operator>=(FXdouble n,const FXVec3d& a){return n>=a.x && n>=a.y && n>=a.z;}
inline FXVec3d lo(const FXVec3d& a,const FXVec3d& b){return FXVec3d(FXMIN(a.x,b.x),FXMIN(a.y,b.y),FXMIN(a.z,b.z));}
inline FXVec3d hi(const FXVec3d& a,const FXVec3d& b){return FXVec3d(FXMAX(a.x,b.x),FXMAX(a.y,b.y),FXMAX(a.z,b.z));}
extern FXAPI FXVec3d normal(const FXVec3d& a,const FXVec3d& b,const FXVec3d& c);
extern FXAPI FXVec3d normal(const FXVec3d& a,const FXVec3d& b,const FXVec3d& c,const FXVec3d& d);
extern FXAPI FXVec3d normalize(const FXVec3d& v);
extern FXAPI FXStream& operator<<(FXStream& store,const FXVec3d& v);
extern FXAPI FXStream& operator>>(FXStream& store,FXVec3d& v);
}
#endif
fox-1.6.49/include/fx3d.h 0000664 0001750 0001750 00000005565 12130340076 012001 0000000 0000000 /********************************************************************************
* *
* A d d i t i o n a l F O X I n c l u d e F i l e F o r 3 D *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: fx3d.h,v 1.22 2006/01/22 17:58:13 fox Exp $ *
********************************************************************************/
#ifndef FX3D_H
#define FX3D_H
// OpenGL includes
#ifdef WIN32
#ifndef STRICT
#define STRICT
#endif
#include
#endif
#ifdef HAVE_GL_H
#include
#endif
#ifndef GLAPIENTRY
#define GLAPIENTRY
#endif
#ifndef GLAPI
#define GLAPI
#endif
#ifdef HAVE_GLU_H
#include
#endif
// Additional FOX includes
#include "FXVec2f.h"
#include "FXVec2d.h"
#include "FXVec3f.h"
#include "FXVec3d.h"
#include "FXVec4f.h"
#include "FXVec4d.h"
#include "FXQuatf.h"
#include "FXQuatd.h"
#include "FXMat3f.h"
#include "FXMat3d.h"
#include "FXMat4f.h"
#include "FXMat4d.h"
#include "FXRangef.h"
#include "FXRanged.h"
#include "FXSpheref.h"
#include "FXSphered.h"
#include "FXExtentf.h"
#include "FXExtentd.h"
#include "FXGLVisual.h"
#include "FXGLContext.h"
#include "FXGLCanvas.h"
#include "FXGLViewer.h"
#include "FXGLObject.h"
#include "FXGLShape.h"
#include "FXGLCone.h"
#include "FXGLCube.h"
#include "FXGLCylinder.h"
#include "FXGLSphere.h"
#include "FXGLTriangleMesh.h"
#ifndef FX_NO_GLOBAL_NAMESPACE
using namespace FX;
#endif
#endif
fox-1.6.49/include/FX88591Codec.h 0000644 0001750 0001750 00000001104 11637250333 013015 0000000 0000000 #ifndef FX88591CODEC_H
#define FX88591CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// ISO-8859-1 Codec
class FXAPI FX88591Codec : public FXTextCodec {
FXDECLARE(FX88591Codec)
public:
FX88591Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FX88591Codec(){}
};
}
#endif
fox-1.6.49/include/FXCP861Codec.h 0000644 0001750 0001750 00000001077 11637250333 013071 0000000 0000000 #ifndef FXCP861CODEC_H
#define FXCP861CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// CP861 Codec
class FXAPI FXCP861Codec : public FXTextCodec {
FXDECLARE(FXCP861Codec)
public:
FXCP861Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FXCP861Codec(){}
};
}
#endif
fox-1.6.49/include/FXCursor.h 0000664 0001750 0001750 00000011066 12130340076 012641 0000000 0000000 /********************************************************************************
* *
* C u r s o r - O b j e c t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXCursor.h,v 1.28 2006/01/22 17:58:00 fox Exp $ *
********************************************************************************/
#ifndef FXCURSOR_H
#define FXCURSOR_H
#ifndef FXID_H
#include "FXId.h"
#endif
namespace FX {
// Stock cursors
enum FXStockCursor {
CURSOR_ARROW=1, /// Default left pointing arrow
CURSOR_RARROW, /// Right arrow
CURSOR_IBEAM, /// Text I-Beam
CURSOR_WATCH, /// Stopwatch or hourglass
CURSOR_CROSS, /// Crosshair
CURSOR_UPDOWN, /// Move up, down
CURSOR_LEFTRIGHT, /// Move left, right
CURSOR_MOVE /// Move up,down,left,right
};
/// Cursor options
enum {
CURSOR_KEEP = 0x00000100, /// Keep pixel data in client
CURSOR_OWNED = 0x00000200 /// Pixel data is owned by image
};
/// Cursor class
class FXAPI FXCursor : public FXId {
FXDECLARE(FXCursor)
protected:
FXColor *data; // Source data
FXint width; // Width
FXint height; // Height
FXint hotx; // Hot spot x
FXint hoty; // Hot spot y
FXuint options; // Options
protected:
FXCursor();
private:
FXCursor(const FXCursor&);
FXCursor &operator=(const FXCursor&);
public:
/// Make stock cursor
FXCursor(FXApp* a,FXStockCursor curid=CURSOR_ARROW);
/// Make cursor from source and mask; cursor size should at most 32x32 for portability!
FXCursor(FXApp* a,const FXuchar* src,const FXuchar* msk,FXint w=32,FXint h=32,FXint hx=0,FXint hy=0);
/// Make cursor from FXColor pixels; cursor size should be at most 32x32 for portability!
FXCursor(FXApp* a,const FXColor* pix,FXint w=32,FXint h=32,FXint hx=0,FXint hy=0);
/// Width of cursor; returns 0 for stock cursors
FXint getWidth() const { return width; }
/// Height of cursor; returns 0 for stock cursors
FXint getHeight() const { return height; }
/// Set hotspot x; returns 0 for stock cursors
void setHotX(FXint x){ hotx=x; }
/// Get hotspot x; returns 0 for stock cursors
FXint getHotX() const { return hotx; }
/// Set hotspot y; returns 0 for stock cursors
void setHotY(FXint y){ hoty=y; }
/// Get hotspot y; returns 0 for stock cursors
FXint getHotY() const { return hoty; }
/// Check if there is color in the cursor
bool isColor() const;
/// Create cursor
virtual void create();
/// Detach cursor
virtual void detach();
/// Destroy cursor
virtual void destroy();
/// Release pixels buffer if it was owned
virtual void release();
/// Save pixel data only
virtual bool savePixels(FXStream& store) const;
/// Load pixel data only
virtual bool loadPixels(FXStream& store);
/// Save cursor to a stream
virtual void save(FXStream& store) const;
/// Load cursor from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXCursor();
};
}
#endif
fox-1.6.49/include/fxver.h.in 0000664 0001750 0001750 00000000405 12130340076 012660 0000000 0000000 #ifndef FXVER_H
#define FXVER_H
// FOX version
#define FOX_MAJOR @FOX_MAJOR_VERSION@
#define FOX_MINOR @FOX_MINOR_VERSION@
#define FOX_LEVEL @FOX_PATCH_LEVEL@
// FOX byte order
#ifndef FOX_BIGENDIAN
#define FOX_BIGENDIAN @FOX_BYTEORDER@
#endif
#endif
fox-1.6.49/include/FXTIFImage.h 0000664 0001750 0001750 00000006631 12130340076 012753 0000000 0000000 /********************************************************************************
* *
* T I F F I m a g e O b j e c t *
* *
*********************************************************************************
* Copyright (C) 2001,2006 Eric Gillet. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXTIFImage.h,v 1.23 2006/01/22 17:58:10 fox Exp $ *
********************************************************************************/
#ifndef FXTIFIMAGE_H
#define FXTIFIMAGE_H
#ifndef FXIMAGE_H
#include "FXImage.h"
#endif
namespace FX {
/// TIFF Image class
class FXAPI FXTIFImage : public FXImage {
FXDECLARE(FXTIFImage)
protected:
FXushort codec;
protected:
FXTIFImage(){}
private:
FXTIFImage(const FXTIFImage&);
FXTIFImage &operator=(const FXTIFImage&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct an image from memory stream formatted in TIFF format
FXTIFImage(FXApp *a,const void *pix=NULL,FXuint opts=0,FXint w=1,FXint h=1);
/// True if format is supported
static const bool supported;
/// Set codec to save with
void setCodec(FXuint c){ codec=c; }
/// Get codec setting
FXuint getCodec() const { return codec; }
/// Load pixels into stream in TIFF format
virtual bool loadPixels(FXStream& store);
/// Save pixels from stream in TIFF format
virtual bool savePixels(FXStream& store) const;
/// Destroy
virtual ~FXTIFImage();
};
/**
* Check if stream contains a TIFF, return TRUE if so.
*/
extern FXAPI bool fxcheckTIF(FXStream& store);
/**
* Load an TIFF (Tagged Image File Format) file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadTIF(FXStream& store,FXColor*& data,FXint& width,FXint& height,FXushort& codec);
/**
* Save an TIFF (Tagged Image File Format) file to a stream.
*/
extern FXAPI bool fxsaveTIF(FXStream& store,const FXColor* data,FXint width,FXint height,FXushort codec);
}
#endif
fox-1.6.49/include/FX885915Codec.h 0000644 0001750 0001750 00000001113 11637250333 013102 0000000 0000000 #ifndef FX885915CODEC_H
#define FX885915CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// ISO-8859-15 Codec
class FXAPI FX885915Codec : public FXTextCodec {
FXDECLARE(FX885915Codec)
public:
FX885915Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FX885915Codec(){}
};
}
#endif
fox-1.6.49/include/FX88598Codec.h 0000644 0001750 0001750 00000001104 11637250333 013024 0000000 0000000 #ifndef FX88598CODEC_H
#define FX88598CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// ISO-8859-8 Codec
class FXAPI FX88598Codec : public FXTextCodec {
FXDECLARE(FX88598Codec)
public:
FX88598Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FX88598Codec(){}
};
}
#endif
fox-1.6.49/include/FXGLCylinder.h 0000664 0001750 0001750 00000005732 12130340076 013363 0000000 0000000 /********************************************************************************
* *
* O p e n G L C y l i n d e r O b j e c t *
* *
*********************************************************************************
* Copyright (C) 1999,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXGLCylinder.h,v 1.17 2006/01/22 17:58:02 fox Exp $ *
********************************************************************************/
#ifndef FXGLCYLINDER_H
#define FXGLCYLINDER_H
#ifndef FXGLSHAPE_H
#include "FXGLShape.h"
#endif
namespace FX {
/// OpenGL Cylinder Object
class FXAPI FXGLCylinder : public FXGLShape {
FXDECLARE(FXGLCylinder)
public:
FXfloat height;
FXfloat radius;
protected:
FXGLCylinder();
virtual void drawshape(FXGLViewer* viewer);
public:
/// Construct with specified origin, height and radius
FXGLCylinder(FXfloat x,FXfloat y,FXfloat z,FXfloat h=1.0f, FXfloat r=1.0f);
/// Construct with specified origin, height, radius and material
FXGLCylinder(FXfloat x,FXfloat y,FXfloat z,FXfloat h,FXfloat r,const FXMaterial& mtl);
/// Copy constructor
FXGLCylinder(const FXGLCylinder& orig);
/// Copy this object
virtual FXGLObject* copy();
/// Change radius
void setRadius(FXfloat r){ radius=r; }
FXfloat getRadius() const { return radius; }
/// Change height
void setHeight(FXfloat h){ height=h; }
FXfloat getHeight() const { return height; }
/// Save to a stream
virtual void save(FXStream& store) const;
/// Load from a stream
virtual void load(FXStream& store);
virtual ~FXGLCylinder();
};
}
#endif
fox-1.6.49/include/FXSwitcher.h 0000664 0001750 0001750 00000010746 12130340076 013160 0000000 0000000 /********************************************************************************
* *
* S w i t c h C o n t a i n e r W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXSwitcher.h,v 1.17 2006/01/22 17:58:10 fox Exp $ *
********************************************************************************/
#ifndef FXSWITCHER_H
#define FXSWITCHER_H
#ifndef FXPACKER_H
#include "FXPacker.h"
#endif
namespace FX {
/// Switcher options
enum {
SWITCHER_HCOLLAPSE = 0x00020000, /// Collapse horizontally to width of current child
SWITCHER_VCOLLAPSE = 0x00040000 /// Collapse vertically to height of current child
};
/**
* The Switcher layout manager automatically arranges its child
* windows such that one of them is placed on top; all other
* child windows are hidden.
* Switcher provides a convenient method to conserve screen
* real-estate by arranging several GUI panels to appear in the
* same space, depending on context.
* Switcher ignores all layout hints from its children:- all
* children are stretched according to the switcher layout
* managers own size.
* When the SWITCHER_HCOLLAPSE or SWITCHER_VCOLLAPSE options
* are used, Switcher's default size is based on the width or
* height of the current child, instead of the maximum width
* or height of all of the children.
*/
class FXAPI FXSwitcher : public FXPacker {
FXDECLARE(FXSwitcher)
protected:
FXint current;
protected:
FXSwitcher(){}
private:
FXSwitcher(const FXSwitcher&);
FXSwitcher& operator=(const FXSwitcher&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetIntValue(FXObject*,FXSelector,void*);
long onCmdGetIntValue(FXObject*,FXSelector,void*);
long onCmdOpen(FXObject*,FXSelector,void*);
long onUpdOpen(FXObject*,FXSelector,void*);
public:
enum {
ID_OPEN_FIRST=FXPacker::ID_LAST,
ID_OPEN_SECOND,
ID_OPEN_THIRD,
ID_OPEN_FOURTH,
ID_OPEN_FIFTH,
ID_OPEN_SIXTH,
ID_OPEN_SEVENTH,
ID_OPEN_EIGHTH,
ID_OPEN_NINETH,
ID_OPEN_TENTH,
ID_OPEN_LAST=ID_OPEN_FIRST+100,
ID_LAST
};
public:
/// Construct a switcher layout manager
FXSwitcher(FXComposite *p,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_SPACING,FXint pr=DEFAULT_SPACING,FXint pt=DEFAULT_SPACING,FXint pb=DEFAULT_SPACING);
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Perform layout
virtual void layout();
/// Bring the child window at index to the top
void setCurrent(FXint index,FXbool notify=FALSE);
/// Return the index of the child window currently on top
FXint getCurrent() const { return current; }
/// Set the switcher style flags
void setSwitcherStyle(FXuint style);
/// Get the switcher style flags
FXuint getSwitcherStyle() const;
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
};
}
#endif
fox-1.6.49/include/FXCP1257Codec.h 0000644 0001750 0001750 00000001106 11637250333 013142 0000000 0000000 #ifndef FXCP1257CODEC_H
#define FXCP1257CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// CP1257 Codec
class FXAPI FXCP1257Codec : public FXTextCodec {
FXDECLARE(FXCP1257Codec)
public:
FXCP1257Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FXCP1257Codec(){}
};
}
#endif
fox-1.6.49/include/FXStat.h 0000664 0001750 0001750 00000021320 12130340076 012271 0000000 0000000 /********************************************************************************
* *
* F i l e S t a t i s t i c s *
* *
*********************************************************************************
* Copyright (C) 2005,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXStat.h,v 1.24 2006/01/22 17:58:10 fox Exp $ *
********************************************************************************/
#ifndef FXSTAT_H
#define FXSTAT_H
namespace FX {
class FXFile;
/// Statistics about a file or directory
class FXAPI FXStat {
friend class FXFile;
private:
FXuint modeFlags; /// Mode bits
FXuint userNumber; /// User number
FXuint groupNumber; /// Group number
FXTime createTime; /// Create time
FXTime accessTime; /// Access time
FXTime modifyTime; /// Modify time
FXlong fileSize; /// File size
public:
/// Get statistics of the file into the stat buffer info
static bool statFile(const FXString& file,FXStat& info);
/// Get statistice of the link into the stat buffer info
static bool statLink(const FXString& file,FXStat& info);
/// Get statistics of already open file into stat buffer info
static bool stat(const FXFile& file,FXStat& info);
/// Return the mode flags for this file
FXuint mode() const { return modeFlags; }
/// Return file size in bytes
FXlong size() const { return fileSize; }
/// Return user number
FXuint user() const { return userNumber; }
/// Return group number
FXuint group() const { return groupNumber; }
/// Return time when last modified
FXTime modified() const { return modifyTime; }
/// Return time when last accessed
FXTime accessed() const { return accessTime; }
/// Return time when file was created
FXTime created() const { return createTime; }
/// Return time anything was changed
FXTime touched() const;
/// Return true if it is a hidden file (Windows-only)
bool isHidden() const;
/// Return true if it is a regular file
bool isFile() const;
/// Return true if it is a link
bool isLink() const;
/// Return true if character device
bool isCharacter() const;
/// Return true if block device
bool isBlock() const;
/// Return true if socket device
bool isSocket() const;
/// Return true if fifo (pipe) device
bool isFifo() const;
/// Return true if input path is a directory
bool isDirectory() const;
/// Return true if file is readable
bool isReadable() const;
/// Return true if file is writable
bool isWritable() const;
/// Return true if file is executable
bool isExecutable() const;
/// Return true if owner has read-write-execute permissions
bool isOwnerReadWriteExecute() const;
/// Return true if owner has read permissions
bool isOwnerReadable() const;
/// Return true if owner has write permissions
bool isOwnerWritable() const;
/// Return true if owner has execute permissions
bool isOwnerExecutable() const;
/// Return true if group has read-write-execute permissions
bool isGroupReadWriteExecute() const;
/// Return true if group has read permissions
bool isGroupReadable() const;
/// Return true if group has write permissions
bool isGroupWritable() const;
/// Return true if group has execute permissions
bool isGroupExecutable() const;
/// Return true if others have read-write-execute permissions
bool isOtherReadWriteExecute() const;
/// Return true if others have read permissions
bool isOtherReadable() const;
/// Return true if others have write permissions
bool isOtherWritable() const;
/// Return true if others have execute permissions
bool isOtherExecutable() const;
/// Return true if the file sets the user id on execution
bool isSetUid() const;
/// Return true if the file sets the group id on execution
bool isSetGid() const;
/// Return true if the file has the sticky bit set
bool isSetSticky() const;
/// Return the mode flags for this file
static FXuint mode(const FXString& file);
/// Change the mode flags for this file
static bool mode(const FXString& file,FXuint perm);
/// Return true if file exists
static bool exists(const FXString& file);
/// Return file size in bytes
static FXlong size(const FXString& file);
/**
* Return last modified time for this file, on filesystems
* where this is supported. This is the time when any data
* in the file was last modified.
*/
static FXTime modified(const FXString& file);
/**
* Return last accessed time for this file, on filesystems
* where this is supported.
*/
static FXTime accessed(const FXString& file);
/**
* Return created time for this file, on filesystems
* where this is supported. This is also the time when
* ownership, permissions, links, and other meta-data may
* have changed.
*/
static FXTime created(const FXString& file);
/**
* Return touched time for this file, on filesystems
* where this is supported. This is the time when anything
* at all, either contents or meta-data, about the file was
* changed.
*/
static FXTime touched(const FXString& file);
/// Return true if file is hidden
static bool isHidden(const FXString& file);
/// Return true if input path is a file name
static bool isFile(const FXString& file);
/// Return true if input path is a link
static bool isLink(const FXString& file);
/// Return true if input path is a directory
static bool isDirectory(const FXString& file);
/// Return true if file is readable
static bool isReadable(const FXString& file);
/// Return true if file is writable
static bool isWritable(const FXString& file);
/// Return true if file is executable
static bool isExecutable(const FXString& file);
/// Return true if owner has read-write-execute permissions
static bool isOwnerReadWriteExecute(const FXString& file);
/// Return true if owner has read permissions
static bool isOwnerReadable(const FXString& file);
/// Return true if owner has write permissions
static bool isOwnerWritable(const FXString& file);
/// Return true if owner has execute permissions
static bool isOwnerExecutable(const FXString& file);
/// Return true if group has read-write-execute permissions
static bool isGroupReadWriteExecute(const FXString& file);
/// Return true if group has read permissions
static bool isGroupReadable(const FXString& file);
/// Return true if group has write permissions
static bool isGroupWritable(const FXString& file);
/// Return true if group has execute permissions
static bool isGroupExecutable(const FXString& file);
/// Return true if others have read-write-execute permissions
static bool isOtherReadWriteExecute(const FXString& file);
/// Return true if others have read permissions
static bool isOtherReadable(const FXString& file);
/// Return true if others have write permissions
static bool isOtherWritable(const FXString& file);
/// Return true if others have execute permissions
static bool isOtherExecutable(const FXString& file);
/// Return true if the file sets the user id on execution
static bool isSetUid(const FXString& file);
/// Return true if the file sets the group id on execution
static bool isSetGid(const FXString& file);
/// Return true if the file has the sticky bit set
static bool isSetSticky(const FXString& file);
};
}
#endif
fox-1.6.49/include/FXStringDict.h 0000664 0001750 0001750 00000006473 12130340076 013444 0000000 0000000 /********************************************************************************
* *
* S t r i n g D i c t i o n a r y C l a s s *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXStringDict.h,v 1.16 2006/01/22 17:58:10 fox Exp $ *
********************************************************************************/
#ifndef FXSTRINGDICT_H
#define FXSTRINGDICT_H
#ifndef FXDICT_H
#include "FXDict.h"
#endif
namespace FX {
/**
* String dictionary maps a character string to a character string.
* The inserted strings are copied when they're inserted.
*/
class FXAPI FXStringDict : public FXDict {
FXDECLARE(FXStringDict)
protected:
virtual void *createData(const void*);
virtual void deleteData(void*);
public:
/// Construct a string dictionary
FXStringDict();
/// Copy constructor
FXStringDict(const FXStringDict& orig);
/// Assignment operator
FXStringDict &operator=(const FXStringDict& orig);
/// Insert a new string indexed by key, with given mark flag
const FXchar* insert(const FXchar* ky,const FXchar* str,bool mrk=false){ return (const FXchar*)FXDict::insert(ky,str,mrk); }
/// Replace or insert a new string indexed by key, unless given mark is lower that the existing mark
const FXchar* replace(const FXchar* ky,const FXchar* str,bool mrk=false){ return (const FXchar*)FXDict::replace(ky,str,mrk); }
/// Remove entry indexed by key
const FXchar* remove(const FXchar* ky){ return (const FXchar*)FXDict::remove(ky); }
/// Return the entry indexed by key, or return NULL if the key does not exist
const FXchar* find(const FXchar* ky) const { return (const FXchar*)FXDict::find(ky); }
/// Return the string at position pos
const FXchar* data(FXuint pos) const { return (const FXchar*)dict[pos].data; }
/// Destructor
virtual ~FXStringDict();
};
}
#endif
fox-1.6.49/include/FXScrollWindow.h 0000664 0001750 0001750 00000007107 12130340076 014013 0000000 0000000 /********************************************************************************
* *
* S c r o l l W i n d o w W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXScrollWindow.h,v 1.21 2006/01/22 17:58:09 fox Exp $ *
********************************************************************************/
#ifndef FXSCROLLWINDOW_H
#define FXSCROLLWINDOW_H
#ifndef FXSCROLLAREA_H
#include "FXScrollArea.h"
#endif
namespace FX {
/**
* The scroll window widget scrolls an arbitrary child window.
* Use the scroll window when parts of the user interface itself
* need to be scrolled, for example when applications need to run
* on small screens. The scroll window observes some layout hints of
* its content-window; it observes LAYOUT_FIX_WIDTH, LAYOUT_FIX_HEIGHT
* at all times. The hints LAYOUT_FILL_X, LAYOUT_LEFT, LAYOUT_RIGHT,
* LAYOUT_CENTER_X, as well as LAYOUT_FILL_Y, LAYOUT_TOP, LAYOUT_BOTTOM,
* LAYOUT_CENTER_Y are however only interpreted if the content size
* is smaller than the viewport size, because if the content size is
* larger than the viewport size, then content must be scrolled.
* Note that this means that the content window's position is not
* necessarily equal to the scroll position of the scroll window!
*/
class FXAPI FXScrollWindow : public FXScrollArea {
FXDECLARE(FXScrollWindow)
protected:
FXScrollWindow(){}
virtual void moveContents(FXint x,FXint y);
private:
FXScrollWindow(const FXScrollWindow&);
FXScrollWindow &operator=(const FXScrollWindow&);
public:
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onFocusSelf(FXObject*,FXSelector,void*);
public:
/// Construct a scroll window
FXScrollWindow(FXComposite* p,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Perform layout
virtual void layout();
/// Return a pointer to the contents window
FXWindow* contentWindow() const;
/// Return the width of the contents
virtual FXint getContentWidth();
/// Return the height of the contents
virtual FXint getContentHeight();
};
}
#endif
fox-1.6.49/include/FXTriStateButton.h 0000664 0001750 0001750 00000010763 12130340076 014322 0000000 0000000 /********************************************************************************
* *
* T r i - S t a t e B u t t o n W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2002,2006 by Charles Warren. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXTriStateButton.h,v 1.6 2006/01/22 17:58:11 fox Exp $ *
********************************************************************************/
#ifndef FXTRISTATEBUTTON_H
#define FXTRISTATEBUTTON_H
#ifndef FXTOGGLEBUTTON_H
#include "FXToggleButton.h"
#endif
namespace FX {
/**
* The tri-state button provides a three-state button, which toggles between the
* on and the off state each time it is pressed; programmatically, it may also be
* switched into the MAYBE state. The MAYBE state is useful to signify an unknown
* state in the application data.
* Like the toggle button, it sends a SEL_COMMAND to its target, with the
* message data set to the current state of the toggle button, of the type FXbool.
*/
class FXAPI FXTriStateButton : public FXToggleButton {
FXDECLARE(FXTriStateButton)
protected:
FXString maybelabel;
FXIcon *maybeicon;
FXString maybetip;
FXString maybehelp;
protected:
FXTriStateButton();
private:
FXTriStateButton(const FXTriStateButton&);
FXTriStateButton& operator=(const FXTriStateButton&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onUnknown(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
public:
/// Construct tri-state toggle button with three text labels, and three icons, one for each state
FXTriStateButton(FXComposite* p,const FXString& text1,const FXString& text2,const FXString& text3,FXIcon* icon1=NULL,FXIcon* icon2=NULL,FXIcon* icon3=NULL,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=TOGGLEBUTTON_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Get default width
virtual FXint getDefaultWidth();
/// Get default height
virtual FXint getDefaultHeight();
/// Change maybe text shown when toggled
void setMaybeText(const FXString& text);
/// Return maybe text
FXString getMaybeText() const { return maybelabel; }
/// Change maybe icon shown when toggled
void setMaybeIcon(FXIcon* ic);
/// Return maybe icon
FXIcon* getMaybeIcon() const { return maybeicon; }
/// Change maybe help text shown when toggled
void setMaybeHelpText(const FXString& text);
/// Return maybe help text
FXString getMaybeHelpText() const { return maybehelp; }
/// Change maybe tip text shown when toggled
void setMaybeTipText(const FXString& text);
/// Return maybe tip text
FXString getMaybeTipText() const { return maybetip; }
/// Save toggle button to a stream
virtual void save(FXStream& store) const;
/// Load toggle button from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXTriStateButton();
};
}
#endif
fox-1.6.49/include/FX885913Codec.h 0000644 0001750 0001750 00000001113 11637250333 013100 0000000 0000000 #ifndef FX885913CODEC_H
#define FX885913CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// ISO-8859-13 Codec
class FXAPI FX885913Codec : public FXTextCodec {
FXDECLARE(FX885913Codec)
public:
FX885913Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FX885913Codec(){}
};
}
#endif
fox-1.6.49/include/FXSplitter.h 0000664 0001750 0001750 00000013113 12130340076 013165 0000000 0000000 /********************************************************************************
* *
* S p l i t t e r W i n d o w W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXSplitter.h,v 1.29 2006/01/22 17:58:09 fox Exp $ *
********************************************************************************/
#ifndef FXSPLITTER_H
#define FXSPLITTER_H
#ifndef FXCOMPOSITE_H
#include "FXComposite.h"
#endif
namespace FX {
/// Splitter options
enum {
SPLITTER_HORIZONTAL = 0, /// Split horizontally
SPLITTER_VERTICAL = 0x00008000, /// Split vertically
SPLITTER_REVERSED = 0x00010000, /// Reverse-anchored
SPLITTER_TRACKING = 0x00020000, /// Track continuous during split
SPLITTER_NORMAL = SPLITTER_HORIZONTAL
};
/**
* Splitter window is used to interactively repartition
* two or more subpanels.
* Space may be subdivided horizontally (SPLITTER_HORIZONTAL, which
* the default) or vertically (SPLITTER_VERTICAL option).
* When the splitter is itself resized, the right-most (bottom-most)
* child window will be resized unless the splitter window is reversed;
* if the splitter is reversed, the left-most (top-most) child window
* will be resized instead.
* The splitter widget sends a SEL_CHANGED to its target
* during the resizing of the panels; at the end of the resize interaction,
* it sends a SEL_COMMAND to signify that the resize operation is complete.
* Normally, children are resizable from 0 upwards; however, if the child
* in a horizontally oriented splitter has LAYOUT_FILL_X in combination with
* LAYOUT_FIX_WIDTH, it will not be made smaller than its default width,
* except when the child is the last visible widget (or first when the option
* SPLITTER_REVERSED has been passed to the splitter).
* In a vertically oriented splitter, children with LAYOUT_FILL_Y and
* LAYOUT_FIX_HEIGHT behave analogously.
*/
class FXAPI FXSplitter : public FXComposite {
FXDECLARE(FXSplitter)
private:
FXWindow *window; // Window being resized
FXint split; // Split value
FXint offset; // Mouse offset
FXint barsize; // Size of the splitter bar
protected:
FXSplitter();
void adjustHLayout();
void adjustVLayout();
void moveHSplit(FXint amount);
void moveVSplit(FXint amount);
void drawHSplit(FXint pos);
void drawVSplit(FXint pos);
FXWindow* findHSplit(FXint pos);
FXWindow* findVSplit(FXint pos);
private:
FXSplitter(const FXSplitter&);
FXSplitter& operator=(const FXSplitter&);
public:
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onFocusNext(FXObject*,FXSelector,void*);
long onFocusPrev(FXObject*,FXSelector,void*);
long onFocusUp(FXObject*,FXSelector,void*);
long onFocusDown(FXObject*,FXSelector,void*);
long onFocusLeft(FXObject*,FXSelector,void*);
long onFocusRight(FXObject*,FXSelector,void*);
public:
/// Construct new splitter widget
FXSplitter(FXComposite* p,FXuint opts=SPLITTER_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Construct new splitter widget, which will notify target about size changes
FXSplitter(FXComposite* p,FXObject* tgt,FXSelector sel,FXuint opts=SPLITTER_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Get default width
virtual FXint getDefaultWidth();
/// Get default height
virtual FXint getDefaultHeight();
/// Perform layout
virtual void layout();
/// Return size of the panel at index
FXint getSplit(FXint index) const;
/// Change the size of panel at the given index
void setSplit(FXint index,FXint size);
/// Change splitter style
void setSplitterStyle(FXuint style);
/// Return current splitter style
FXuint getSplitterStyle() const;
/// Change splitter bar size
void setBarSize(FXint bs);
/// Return current bar size
FXint getBarSize() const { return barsize; }
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
/// Destroy splitter
virtual ~FXSplitter();
};
}
#endif
fox-1.6.49/include/FXScrollPane.h 0000664 0001750 0001750 00000006753 12130340076 013435 0000000 0000000 /********************************************************************************
* *
* S c r o l l i n g M e n u P a n e W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXScrollPane.h,v 1.10 2006/01/22 17:58:09 fox Exp $ *
********************************************************************************/
#ifndef FXSCROLLPANE_H
#define FXSCROLLPANE_H
#ifndef FXMENUPANE_H
#include "FXMenuPane.h"
#endif
namespace FX {
class FXArrowButton;
/**
* A Scroll Pane is a menu pane which provides scrolling of menu entries.
* It is useful when menus are populated programmatically and it is not
* known in advance how many entries will be added.
*/
class FXAPI FXScrollPane : public FXMenuPane {
FXDECLARE(FXScrollPane)
protected:
FXArrowButton *dn; // Button to scroll down
FXArrowButton *up; // Button to scroll up
FXint visible; // Visible entries
FXint top; // Top visible entry
protected:
FXScrollPane();
private:
FXScrollPane(const FXScrollPane&);
FXScrollPane &operator=(const FXScrollPane&);
public:
long onCmdIncrement(FXObject*,FXSelector,void*);
long onCmdDecrement(FXObject*,FXSelector,void*);
public:
enum {
ID_SCROLL_DN=FXMenuPane::ID_LAST,
ID_SCROLL_UP,
ID_LAST
};
public:
/// Construct menu pane
FXScrollPane(FXWindow* owner,FXint nvis,FXuint opts=0);
/// Return the default width of this window
virtual FXint getDefaultWidth();
/// Return the default height of this window
virtual FXint getDefaultHeight();
/// Show this window
virtual void show();
/// Perform layout
virtual void layout();
/// Return number of visible items
FXint getNumVisible() const { return visible; }
/// Change the number of visible items
void setNumVisible(FXint nvis);
/// Get index of top most menu item
FXint getTopItem() const { return top; }
/// Scroll item to top
void setTopItem(FXint t);
/// Destroy
virtual ~FXScrollPane();
};
}
#endif
fox-1.6.49/include/fxdefs.h 0000664 0001750 0001750 00000072217 12130340076 012412 0000000 0000000 /********************************************************************************
* *
* FOX Definitions, Types, and Macros *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: fxdefs.h,v 1.178.2.2 2006/11/09 23:21:43 fox Exp $ *
********************************************************************************/
#ifndef FXDEFS_H
#define FXDEFS_H
/******************************** Definitions ********************************/
// Truth values
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef MAYBE
#define MAYBE 2
#endif
#ifndef NULL
#define NULL 0
#endif
/// Pi
#ifndef PI
#define PI 3.1415926535897932384626433833
#endif
/// Euler constant
#define EULER 2.7182818284590452353602874713
/// Multiplier for degrees to radians
#define DTOR 0.0174532925199432957692369077
/// Multiplier for radians to degrees
#define RTOD 57.295779513082320876798154814
// Path separator
#ifdef WIN32
#define PATHSEP '\\'
#define PATHSEPSTRING "\\"
#define PATHLISTSEP ';'
#define PATHLISTSEPSTRING ";"
#define ISPATHSEP(c) ((c)=='/' || (c)=='\\')
#else
#define PATHSEP '/'
#define PATHSEPSTRING "/"
#define PATHLISTSEP ':'
#define PATHLISTSEPSTRING ":"
#define ISPATHSEP(c) ((c)=='/')
#endif
// End Of Line
#ifdef WIN32
#define ENDLINE "\r\n"
#else
#define ENDLINE "\n"
#endif
// For Windows
#ifdef _DEBUG
#ifndef DEBUG
#define DEBUG
#endif
#endif
#ifdef _NDEBUG
#ifndef NDEBUG
#define NDEBUG
#endif
#endif
// Shared library support
#ifdef WIN32
#define FXLOCAL
#define FXEXPORT __declspec(dllexport)
#define FXIMPORT __declspec(dllimport)
#else
#if defined(__GNUC__) && (__GNUC__ >= 4)
#define FXLOCAL __attribute__ ((visibility("hidden")))
#define FXEXPORT __attribute__ ((visibility("default")))
#define FXIMPORT
#else
#define FXLOCAL
#define FXEXPORT
#define FXIMPORT
#endif
#endif
// Define FXAPI for DLL builds
#ifdef FOXDLL
#ifdef FOXDLL_EXPORTS
#define FXAPI FXEXPORT
#define FXTEMPLATE_EXTERN
#else
#define FXAPI FXIMPORT
#define FXTEMPLATE_EXTERN extern
#endif
#else
#define FXAPI
#define FXTEMPLATE_EXTERN
#endif
// Callback
#ifdef WIN32
#ifndef CALLBACK
#define CALLBACK __stdcall
#endif
#endif
// Disable some warnings in VC++
#ifdef _MSC_VER
#pragma warning(disable: 4251)
#pragma warning(disable: 4231)
#pragma warning(disable: 4244)
#endif
// Checking printf and scanf format strings
#if defined(_CC_GNU_) || defined(__GNUG__) || defined(__GNUC__)
#define FX_PRINTF(fmt,arg) __attribute__((format(printf,fmt,arg)))
#define FX_SCANF(fmt,arg) __attribute__((format(scanf,fmt,arg)))
#else
#define FX_PRINTF(fmt,arg)
#define FX_SCANF(fmt,arg)
#endif
// Raw event type
#ifndef WIN32
union _XEvent;
#else
struct tagMSG;
#endif
namespace FX {
// FOX System Defined Selector Types
enum FXSelType {
SEL_NONE,
SEL_KEYPRESS, /// Key pressed
SEL_KEYRELEASE, /// Key released
SEL_LEFTBUTTONPRESS, /// Left mouse button pressed
SEL_LEFTBUTTONRELEASE, /// Left mouse button released
SEL_MIDDLEBUTTONPRESS, /// Middle mouse button pressed
SEL_MIDDLEBUTTONRELEASE, /// Middle mouse button released
SEL_RIGHTBUTTONPRESS, /// Right mouse button pressed
SEL_RIGHTBUTTONRELEASE, /// Right mouse button released
SEL_MOTION, /// Mouse motion
SEL_ENTER, /// Mouse entered window
SEL_LEAVE, /// Mouse left window
SEL_FOCUSIN, /// Focus into window
SEL_FOCUSOUT, /// Focus out of window
SEL_KEYMAP,
SEL_UNGRABBED, /// Lost the grab (Windows)
SEL_PAINT, /// Must repaint window
SEL_CREATE,
SEL_DESTROY,
SEL_UNMAP, /// Window was hidden
SEL_MAP, /// Window was shown
SEL_CONFIGURE, /// Resize
SEL_SELECTION_LOST, /// Widget lost selection
SEL_SELECTION_GAINED, /// Widget gained selection
SEL_SELECTION_REQUEST, /// Inquire selection data
SEL_RAISED, /// Window to top of stack
SEL_LOWERED, /// Window to bottom of stack
SEL_CLOSE, /// Close window
SEL_DELETE, /// Delete window
SEL_MINIMIZE, /// Iconified
SEL_RESTORE, /// No longer iconified or maximized
SEL_MAXIMIZE, /// Maximized
SEL_UPDATE, /// GUI update
SEL_COMMAND, /// GUI command
SEL_CLICKED, /// Clicked
SEL_DOUBLECLICKED, /// Double-clicked
SEL_TRIPLECLICKED, /// Triple-clicked
SEL_MOUSEWHEEL, /// Mouse wheel
SEL_CHANGED, /// GUI has changed
SEL_VERIFY, /// Verify change
SEL_DESELECTED, /// Deselected
SEL_SELECTED, /// Selected
SEL_INSERTED, /// Inserted
SEL_REPLACED, /// Replaced
SEL_DELETED, /// Deleted
SEL_OPENED, /// Opened
SEL_CLOSED, /// Closed
SEL_EXPANDED, /// Expanded
SEL_COLLAPSED, /// Collapsed
SEL_BEGINDRAG, /// Start a drag
SEL_ENDDRAG, /// End a drag
SEL_DRAGGED, /// Dragged
SEL_LASSOED, /// Lassoed
SEL_TIMEOUT, /// Timeout occurred
SEL_SIGNAL, /// Signal received
SEL_CLIPBOARD_LOST, /// Widget lost clipboard
SEL_CLIPBOARD_GAINED, /// Widget gained clipboard
SEL_CLIPBOARD_REQUEST, /// Inquire clipboard data
SEL_CHORE, /// Background chore
SEL_FOCUS_SELF, /// Focus on widget itself
SEL_FOCUS_RIGHT, /// Focus moved right
SEL_FOCUS_LEFT, /// Focus moved left
SEL_FOCUS_DOWN, /// Focus moved down
SEL_FOCUS_UP, /// Focus moved up
SEL_FOCUS_NEXT, /// Focus moved to next widget
SEL_FOCUS_PREV, /// Focus moved to previous widget
SEL_DND_ENTER, /// Drag action entering potential drop target
SEL_DND_LEAVE, /// Drag action leaving potential drop target
SEL_DND_DROP, /// Drop on drop target
SEL_DND_MOTION, /// Drag position changed over potential drop target
SEL_DND_REQUEST, /// Inquire drag and drop data
SEL_IO_READ, /// Read activity on a pipe
SEL_IO_WRITE, /// Write activity on a pipe
SEL_IO_EXCEPT, /// Except activity on a pipe
SEL_PICKED, /// Picked some location
SEL_QUERY_TIP, /// Message inquiring about tooltip
SEL_QUERY_HELP, /// Message inquiring about statusline help
SEL_DOCKED, /// Toolbar docked
SEL_FLOATED, /// Toolbar floated
SEL_SESSION_NOTIFY, /// Session is about to close
SEL_SESSION_CLOSED, /// Session is closed
SEL_LAST
};
/// FOX Keyboard and Button states
enum {
SHIFTMASK = 0x001, /// Shift key is down
CAPSLOCKMASK = 0x002, /// Caps Lock key is down
CONTROLMASK = 0x004, /// Ctrl key is down
#ifdef __APPLE__
ALTMASK = 0x2000, /// Alt key is down
METAMASK = 0x10, /// Meta key is down
#else
ALTMASK = 0x008, /// Alt key is down
METAMASK = 0x040, /// Meta key is down
#endif
NUMLOCKMASK = 0x010, /// Num Lock key is down
SCROLLLOCKMASK = 0x0E0, /// Scroll Lock key is down (seems to vary)
LEFTBUTTONMASK = 0x100, /// Left mouse button is down
MIDDLEBUTTONMASK = 0x200, /// Middle mouse button is down
RIGHTBUTTONMASK = 0x400 /// Right mouse button is down
};
/// FOX Mouse buttons
enum {
LEFTBUTTON = 1,
MIDDLEBUTTON = 2,
RIGHTBUTTON = 3
};
/// FOX window crossing modes
enum {
CROSSINGNORMAL, /// Normal crossing event
CROSSINGGRAB, /// Crossing due to mouse grab
CROSSINGUNGRAB /// Crossing due to mouse ungrab
};
/// FOX window visibility modes
enum {
VISIBILITYTOTAL,
VISIBILITYPARTIAL,
VISIBILITYNONE
};
/// Options for fxfilematch
enum {
FILEMATCH_FILE_NAME = 1, /// No wildcard can ever match `/'
FILEMATCH_NOESCAPE = 2, /// Backslashes don't quote special chars
FILEMATCH_PERIOD = 4, /// Leading `.' is matched only explicitly
FILEMATCH_LEADING_DIR = 8, /// Ignore `/...' after a match
FILEMATCH_CASEFOLD = 16 /// Compare without regard to case
};
/// Drag and drop actions
enum FXDragAction {
DRAG_REJECT = 0, /// Reject all drop actions
DRAG_ACCEPT = 1, /// Accept any drop action
DRAG_COPY = 2, /// Copy
DRAG_MOVE = 3, /// Move
DRAG_LINK = 4, /// Link
DRAG_PRIVATE = 5 /// Private
};
/// Origin of data
enum FXDNDOrigin {
FROM_SELECTION = 0, /// Primary selection
FROM_CLIPBOARD = 1, /// Clipboard
FROM_DRAGNDROP = 2 /// Drag and drop source
};
/// Exponent display
enum FXExponent {
EXP_NEVER=FALSE, /// Never use exponential notation
EXP_ALWAYS=TRUE, /// Always use exponential notation
EXP_AUTO=MAYBE /// Use exponential notation if needed
};
/// Search modes for search/replace dialogs
enum {
SEARCH_FORWARD = 0, /// Search forward (default)
SEARCH_BACKWARD = 1, /// Search backward
SEARCH_NOWRAP = 0, /// Don't wrap (default)
SEARCH_WRAP = 2, /// Wrap around to start
SEARCH_EXACT = 0, /// Exact match (default)
SEARCH_IGNORECASE = 4, /// Ignore case
SEARCH_REGEX = 8, /// Regular expression match
SEARCH_PREFIX = 16 /// Prefix of subject string
};
/********************************* Typedefs **********************************/
// Forward declarations
class FXObject;
class FXStream;
class FXString;
// Streamable types; these are fixed size!
typedef char FXchar;
typedef unsigned char FXuchar;
typedef FXuchar FXbool;
typedef unsigned short FXushort;
typedef short FXshort;
typedef unsigned int FXuint;
typedef int FXint;
typedef float FXfloat;
typedef double FXdouble;
typedef FXObject *FXObjectPtr;
#ifdef WIN32
typedef unsigned int FXwchar;
#if defined(_MSC_VER) && !defined(_NATIVE_WCHAR_T_DEFINED)
typedef unsigned short FXnchar;
#elif defined(__WATCOM_INT64__)
typedef long char FXnchar;
#else
typedef wchar_t FXnchar;
#endif
#else
typedef wchar_t FXwchar;
typedef unsigned short FXnchar;
#endif
#if defined(__LP64__) || defined(_LP64) || (_MIPS_SZLONG == 64) || (__WORDSIZE == 64)
typedef unsigned long FXulong;
typedef long FXlong;
#elif defined(_MSC_VER) || (defined(__BCPLUSPLUS__) && __BORLANDC__ > 0x500) || defined(__WATCOM_INT64__)
typedef unsigned __int64 FXulong;
typedef __int64 FXlong;
#elif defined(__GNUG__) || defined(__GNUC__) || defined(__SUNPRO_CC) || defined(__MWERKS__) || defined(__SC__) || defined(_LONGLONG)
typedef unsigned long long FXulong;
typedef long long FXlong;
#else
#error "FXlong and FXulong not defined for this architecture!"
#endif
// Integral types large enough to hold value of a pointer
#if defined(_MSC_VER) && defined(_WIN64)
typedef __int64 FXival;
typedef unsigned __int64 FXuval;
#elif defined(__GNUC__) && defined(_WIN64)
typedef long long FXival;
typedef unsigned long long FXuval;
#else
typedef long FXival;
typedef unsigned long FXuval;
#endif
// Handle to something in server
#ifndef WIN32
typedef unsigned long FXID;
#else
typedef void* FXID;
#endif
// Time since January 1, 1970 (UTC)
typedef long FXTime;
// Pixel type (could be color index)
typedef unsigned long FXPixel;
// RGBA pixel value
typedef FXuint FXColor;
// Hot key
typedef FXuint FXHotKey;
// Drag type
#ifndef WIN32
typedef FXID FXDragType;
#else
typedef FXushort FXDragType;
#endif
// Input source handle type
#ifndef WIN32
typedef FXint FXInputHandle;
#else
typedef void* FXInputHandle;
#endif
// Raw event type
#ifndef WIN32
typedef _XEvent FXRawEvent;
#else
typedef tagMSG FXRawEvent;
#endif
/********************************** Macros ***********************************/
/// Abolute value
#define FXABS(val) (((val)>=0)?(val):-(val))
/// Return the maximum of a or b
#define FXMAX(a,b) (((a)>(b))?(a):(b))
/// Return the minimum of a or b
#define FXMIN(a,b) (((a)>(b))?(b):(a))
/// Return the minimum of x, y and z
#define FXMIN3(x,y,z) ((x)<(y)?FXMIN(x,z):FXMIN(y,z))
/// Return the maximum of x, y and z
#define FXMAX3(x,y,z) ((x)>(y)?FXMAX(x,z):FXMAX(y,z))
/// Return the minimum of x, y, z, and w
#define FXMIN4(x,y,z,w) (FXMIN(FXMIN(x,y),FXMIN(z,w)))
/// Return the maximum of of x, y, z, and w
#define FXMAX4(x,y,z,w) (FXMAX(FXMAX(x,y),FXMAX(z,w)))
/// Return minimum and maximum of a, b
#define FXMINMAX(lo,hi,a,b) ((a)<(b)?((lo)=(a),(hi)=(b)):((lo)=(b),(hi)=(a)))
/// Clamp value x to range [lo..hi]
#define FXCLAMP(lo,x,hi) ((x)<(lo)?(lo):((x)>(hi)?(hi):(x)))
/// Swap a pair of numbers
#define FXSWAP(a,b,t) ((t)=(a),(a)=(b),(b)=(t))
/// Linear interpolation between a and b, where 0<=f<=1
#define FXLERP(a,b,f) ((a)+((b)-(a))*(f))
/// Offset of member in a structure
#define STRUCTOFFSET(str,member) (((char *)(&(((str *)0)->member)))-((char *)0))
/// Number of elements in a static array
#define ARRAYNUMBER(array) (sizeof(array)/sizeof(array[0]))
/// Container class of a member class
#define CONTAINER(ptr,str,mem) ((str*)(((char*)(ptr))-STRUCTOFFSET(str,mem)))
/// Make int out of two shorts
#define MKUINT(l,h) ((((FX::FXuint)(l))&0xffff) | (((FX::FXuint)(h))<<16))
/// Make selector from message type and message id
#define FXSEL(type,id) ((((FX::FXuint)(id))&0xffff) | (((FX::FXuint)(type))<<16))
/// Get type from selector
#define FXSELTYPE(s) ((FX::FXushort)(((s)>>16)&0xffff))
/// Get ID from selector
#define FXSELID(s) ((FX::FXushort)((s)&0xffff))
/// Reverse bits in byte
#define FXBITREVERSE(b) (((b&0x01)<<7)|((b&0x02)<<5)|((b&0x04)<<3)|((b&0x08)<<1)|((b&0x10)>>1)|((b&0x20)>>3)|((b&0x40)>>5)|((b&0x80)>>7))
/// Test if character c is at the start of a utf8 sequence
#define FXISUTF(c) (((c)&0xC0)!=0x80)
// Definitions for big-endian machines
#if FOX_BIGENDIAN == 1
/// Make RGBA color
#define FXRGBA(r,g,b,a) (((FX::FXuint)(FX::FXuchar)(r)<<24) | ((FX::FXuint)(FX::FXuchar)(g)<<16) | ((FX::FXuint)(FX::FXuchar)(b)<<8) | ((FX::FXuint)(FX::FXuchar)(a)))
/// Make RGB color
#define FXRGB(r,g,b) (((FX::FXuint)(FX::FXuchar)(r)<<24) | ((FX::FXuint)(FX::FXuchar)(g)<<16) | ((FX::FXuint)(FX::FXuchar)(b)<<8) | 0x000000ff)
/// Get red value from RGBA color
#define FXREDVAL(rgba) ((FX::FXuchar)(((rgba)>>24)&0xff))
/// Get green value from RGBA color
#define FXGREENVAL(rgba) ((FX::FXuchar)(((rgba)>>16)&0xff))
/// Get blue value from RGBA color
#define FXBLUEVAL(rgba) ((FX::FXuchar)(((rgba)>>8)&0xff))
/// Get alpha value from RGBA color
#define FXALPHAVAL(rgba) ((FX::FXuchar)((rgba)&0xff))
/// Get component value of RGBA color
#define FXRGBACOMPVAL(rgba,comp) ((FX::FXuchar)(((rgba)>>((3-(comp))<<3))&0xff))
#endif
// Definitions for little-endian machines
#if FOX_BIGENDIAN == 0
/// Make RGBA color
#define FXRGBA(r,g,b,a) (((FX::FXuint)(FX::FXuchar)(r)) | ((FX::FXuint)(FX::FXuchar)(g)<<8) | ((FX::FXuint)(FX::FXuchar)(b)<<16) | ((FX::FXuint)(FX::FXuchar)(a)<<24))
/// Make RGB color
#define FXRGB(r,g,b) (((FX::FXuint)(FX::FXuchar)(r)) | ((FX::FXuint)(FX::FXuchar)(g)<<8) | ((FX::FXuint)(FX::FXuchar)(b)<<16) | 0xff000000)
/// Get red value from RGBA color
#define FXREDVAL(rgba) ((FX::FXuchar)((rgba)&0xff))
/// Get green value from RGBA color
#define FXGREENVAL(rgba) ((FX::FXuchar)(((rgba)>>8)&0xff))
/// Get blue value from RGBA color
#define FXBLUEVAL(rgba) ((FX::FXuchar)(((rgba)>>16)&0xff))
/// Get alpha value from RGBA color
#define FXALPHAVAL(rgba) ((FX::FXuchar)(((rgba)>>24)&0xff))
/// Get component value of RGBA color
#define FXRGBACOMPVAL(rgba,comp) ((FX::FXuchar)(((rgba)>>((comp)<<3))&0xff))
#endif
/**
* FXASSERT() prints out a message when the expression fails,
* and nothing otherwise. Unlike assert(), FXASSERT() will not
* terminate the execution of the application.
* When compiling your application for release, all assertions
* are compiled out; thus there is no impact on execution speed.
*/
#ifndef NDEBUG
#define FXASSERT(exp) ((exp)?((void)0):(void)FX::fxassert(#exp,__FILE__,__LINE__))
#else
#define FXASSERT(exp) ((void)0)
#endif
/**
* FXTRACE() allows you to trace the execution of your application
* with increasing levels of detail the higher the trace level.
* The trace level is determined by variable fxTraceLevel, which
* may be set from the command line with "-tracelevel ".
* When compiling your application for release, all trace statements
* are compiled out, just like FXASSERT.
* A statement like: FXTRACE((10,"The value of x=%d\n",x)) will
* generate output only if fxTraceLevel is set to 11 or greater.
* The default value fxTraceLevel=0 will block all trace outputs.
* Note the double parentheses!
*/
#ifndef NDEBUG
#define FXTRACE(arguments) FX::fxtrace arguments
#else
#define FXTRACE(arguments) ((void)0)
#endif
/**
* Allocate a memory block of no elements of type and store a pointer
* to it into the address pointed to by ptr.
* Return FALSE if size!=0 and allocation fails, TRUE otherwise.
* An allocation of a zero size block returns a NULL pointer.
*/
#define FXMALLOC(ptr,type,no) (FX::fxmalloc((void **)(ptr),sizeof(type)*(no)))
/**
* Allocate a zero-filled memory block no elements of type and store a pointer
* to it into the address pointed to by ptr.
* Return FALSE if size!=0 and allocation fails, TRUE otherwise.
* An allocation of a zero size block returns a NULL pointer.
*/
#define FXCALLOC(ptr,type,no) (FX::fxcalloc((void **)(ptr),sizeof(type)*(no)))
/**
* Resize the memory block referred to by the pointer at the address ptr, to a
* hold no elements of type.
* Returns FALSE if size!=0 and reallocation fails, TRUE otherwise.
* If reallocation fails, pointer is left to point to old block; a reallocation
* to a zero size block has the effect of freeing it.
* The ptr argument must be the address where the pointer to the allocated
* block is to be stored.
*/
#define FXRESIZE(ptr,type,no) (FX::fxresize((void **)(ptr),sizeof(type)*(no)))
/**
* Allocate and initialize memory from another block.
* Return FALSE if size!=0 and source!=NULL and allocation fails, TRUE otherwise.
* An allocation of a zero size block returns a NULL pointer.
* The ptr argument must be the address where the pointer to the allocated
* block is to be stored.
*/
#define FXMEMDUP(ptr,src,type,no) (FX::fxmemdup((void **)(ptr),(const void*)(src),sizeof(type)*(no)))
/**
* Free a block of memory allocated with either FXMALLOC, FXCALLOC, FXRESIZE, or FXMEMDUP.
* It is OK to call free a NULL pointer. The argument must be the address of the
* pointer to the block to be released. The pointer is set to NULL to prevent
* any further references to the block after releasing it.
*/
#define FXFREE(ptr) (FX::fxfree((void **)(ptr)))
/**
* These are some of the ISO C99 standard single-precision transcendental functions.
* On LINUX, specify _GNU_SOURCE or _ISOC99_SOURCE to enable native implementation;
* otherwise, these macros will be used. Apple OS-X implements fabsf(x), ceilf(x),
* floorf(x), and fmodf(x,y).
* Define FLOAT_MATH_FUNCTIONS if these functions are available in some other
* library you're linking to.
*/
#ifdef __OpenBSD__
#define FLOAT_MATH_FUNCTIONS
#endif
#ifndef FLOAT_MATH_FUNCTIONS
#ifndef __USE_ISOC99
#ifndef __APPLE__
#define fabsf(x) ((float)fabs((double)(x)))
#define ceilf(x) ((float)ceil((double)(x)))
#define floorf(x) ((float)floor((double)(x)))
#define fmodf(x,y) ((float)fmod((double)(x),(double)(y)))
#endif
#define sqrtf(x) ((float)sqrt((double)(x)))
#define sinf(x) ((float)sin((double)(x)))
#define cosf(x) ((float)cos((double)(x)))
#define tanf(x) ((float)tan((double)(x)))
#define asinf(x) ((float)asin((double)(x)))
#define acosf(x) ((float)acos((double)(x)))
#define atanf(x) ((float)atan((double)(x)))
#define atan2f(y,x) ((float)atan2((double)(y),(double)(x)))
#define powf(x,y) ((float)pow((double)(x),(double)(y)))
#define expf(x) ((float)exp((double)(x)))
#define logf(x) ((float)log((double)(x)))
#define log10f(x) ((float)log10((double)(x)))
#endif
#endif
/********************************** Globals **********************************/
/// Simple, thread-safe, random number generator
extern FXAPI FXuint fxrandom(FXuint& seed);
/// Allocate memory
extern FXAPI FXint fxmalloc(void** ptr,unsigned long size);
/// Allocate cleaned memory
extern FXAPI FXint fxcalloc(void** ptr,unsigned long size);
/// Resize memory
extern FXAPI FXint fxresize(void** ptr,unsigned long size);
/// Duplicate memory
extern FXAPI FXint fxmemdup(void** ptr,const void* src,unsigned long size);
/// Free memory, resets ptr to NULL afterward
extern FXAPI void fxfree(void** ptr);
/// Error routine
extern FXAPI void fxerror(const char* format,...) FX_PRINTF(1,2) ;
/// Warning routine
extern FXAPI void fxwarning(const char* format,...) FX_PRINTF(1,2) ;
/// Log message to [typically] stderr
extern FXAPI void fxmessage(const char* format,...) FX_PRINTF(1,2) ;
/// Assert failed routine:- usually not called directly but called through FXASSERT
extern FXAPI void fxassert(const char* expression,const char* filename,unsigned int lineno);
/// Trace printout routine:- usually not called directly but called through FXTRACE
extern FXAPI void fxtrace(unsigned int level,const char* format,...) FX_PRINTF(2,3) ;
/// Sleep n microseconds
extern FXAPI void fxsleep(unsigned int n);
/// Match a file name with a pattern
extern FXAPI bool fxfilematch(const char *pattern,const char *string,FXuint flags=(FILEMATCH_NOESCAPE|FILEMATCH_FILE_NAME));
/// Get highlight color
extern FXAPI FXColor makeHiliteColor(FXColor clr);
/// Get shadow color
extern FXAPI FXColor makeShadowColor(FXColor clr);
/// Get process id
extern FXAPI FXint fxgetpid();
/// Convert string of length len to MSDOS; return new string and new length
extern FXAPI bool fxtoDOS(FXchar*& string,FXint& len);
/// Convert string of length len from MSDOS; return new string and new length
extern FXAPI bool fxfromDOS(FXchar*& string,FXint& len);
/// Duplicate string
extern FXAPI FXchar *fxstrdup(const FXchar* str);
/// Calculate a hash value from a string
extern FXAPI FXuint fxstrhash(const FXchar* str);
/// Get RGB value from color name
extern FXAPI FXColor fxcolorfromname(const FXchar* colorname);
/// Get name of (closest) color to RGB
extern FXAPI FXchar* fxnamefromcolor(FXchar *colorname,FXColor color);
/// Convert RGB to HSV
extern FXAPI void fxrgb_to_hsv(FXfloat& h,FXfloat& s,FXfloat& v,FXfloat r,FXfloat g,FXfloat b);
/// Convert HSV to RGB
extern FXAPI void fxhsv_to_rgb(FXfloat& r,FXfloat& g,FXfloat& b,FXfloat h,FXfloat s,FXfloat v);
/// Floating point number classification: 0=OK, +/-1=Inf, +/-2=NaN
extern FXAPI FXint fxieeefloatclass(FXfloat number);
extern FXAPI FXint fxieeedoubleclass(FXdouble number);
/// Convert keysym to unicode character
extern FXAPI FXwchar fxkeysym2ucs(FXwchar sym);
/// Convert unicode character to keysym
extern FXAPI FXwchar fxucs2keysym(FXwchar ucs);
/// Parse geometry, a-la X11 geometry specification
extern FXAPI FXint fxparsegeometry(const FXchar *string,FXint& x,FXint& y,FXint& w,FXint& h);
/// True if executable with given path is a console application
extern FXAPI FXbool fxisconsole(const FXchar *path);
/// Version number that the library has been compiled with
extern FXAPI const FXuchar fxversion[3];
/// Controls tracing level
extern FXAPI unsigned int fxTraceLevel;
/// Return wide character from utf8 string at ptr
extern FXAPI FXwchar wc(const FXchar *ptr);
/// Return wide character from utf16 string at ptr
extern FXAPI FXwchar wc(const FXnchar *ptr);
/// Return number of FXchar's of wide character at ptr
extern FXAPI FXint wclen(const FXchar *ptr);
/// Return number of FXnchar's of narrow character at ptr
extern FXAPI FXint wclen(const FXnchar *ptr);
/// Return start of utf8 character containing position
extern FXAPI FXint wcvalidate(const FXchar* string,FXint pos);
/// Return start of utf16 character containing position
extern FXAPI FXint wcvalidate(const FXnchar *string,FXint pos);
/// Advance to next utf8 character start
extern FXAPI FXint wcinc(const FXchar* string,FXint pos);
/// Advance to next utf16 character start
extern FXAPI FXint wcinc(const FXnchar *string,FXint pos);
/// Retreat to previous utf8 character start
extern FXAPI FXint wcdec(const FXchar* string,FXint pos);
/// Retreat to previous utf16 character start
extern FXAPI FXint wcdec(const FXnchar *string,FXint pos);
/// Length of utf8 representation of wide characters string str of length n
extern FXAPI FXint utfslen(const FXwchar *str,FXint n);
/// Length of utf8 representation of wide character string str
extern FXAPI FXint utfslen(const FXwchar *str);
/// Length of utf8 representation of narrow characters string str of length n
extern FXAPI FXint utfslen(const FXnchar *str,FXint n);
/// Length of utf8 representation of narrow characters string str
extern FXAPI FXint utfslen(const FXnchar *str);
/// Length of wide character representation of utf8 string str of length n
extern FXAPI FXint wcslen(const FXchar *str,FXint n);
/// Length of wide character representation of utf8 string str
extern FXAPI FXint wcslen(const FXchar *str);
/// Length of narrow character representation of utf8 string str of length n
extern FXAPI FXint ncslen(const FXchar *str,FXint n);
/// Length of narrow character representation of utf8 string str
extern FXAPI FXint ncslen(const FXchar *str);
/// Copy utf8 string of length n to wide character string dst
extern FXAPI FXint utf2wcs(FXwchar *dst,const FXchar *src,FXint n);
/// Copy utf8 string to wide character string dst
extern FXAPI FXint utf2wcs(FXwchar *dst,const FXchar *src);
/// Copy utf8 string of length n to narrow character string dst
extern FXAPI FXint utf2ncs(FXnchar *dst,const FXchar *src,FXint n);
/// Copy utf8 string to narrow character string dst
extern FXAPI FXint utf2ncs(FXnchar *dst,const FXchar *src);
/// Copy wide character substring of length n to dst
extern FXAPI FXint wc2utfs(FXchar* dst,const FXwchar *src,FXint n);
/// Copy wide character string to dst
extern FXAPI FXint wc2utfs(FXchar* dst,const FXwchar *src);
/// Copy narrow character substring of length n to dst
extern FXAPI FXint nc2utfs(FXchar* dst,const FXnchar *src,FXint n);
/// Copy narrow character string to dst
extern FXAPI FXint nc2utfs(FXchar* dst,const FXnchar *src);
}
#endif
fox-1.6.49/include/FX88595Codec.h 0000644 0001750 0001750 00000001104 11637250333 013021 0000000 0000000 #ifndef FX88595CODEC_H
#define FX88595CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// ISO-8859-5 Codec
class FXAPI FX88595Codec : public FXTextCodec {
FXDECLARE(FX88595Codec)
public:
FX88595Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FX88595Codec(){}
};
}
#endif
fox-1.6.49/include/FXRadioButton.h 0000664 0001750 0001750 00000012616 12130340076 013620 0000000 0000000 /********************************************************************************
* *
* R a d i o B u t t o n W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXRadioButton.h,v 1.29 2006/01/22 17:58:08 fox Exp $ *
********************************************************************************/
#ifndef FXRADIOBUTTON_H
#define FXRADIOBUTTON_H
#ifndef FXLABEL_H
#include "FXLabel.h"
#endif
namespace FX {
/// RadioButton flags
enum {
RADIOBUTTON_AUTOGRAY = 0x00800000, /// Automatically gray out when not updated
RADIOBUTTON_AUTOHIDE = 0x01000000, /// Automatically hide when not updated
RADIOBUTTON_NORMAL = JUSTIFY_NORMAL|ICON_BEFORE_TEXT
};
/**
* A radio button is a tri-state button. Normally, it is either
* TRUE or FALSE; a third state MAYBE may be set to indicate that no selection
* has been made yet by the user, or that the state is ambiguous.
* When pressed, the radio button sets its state to TRUE and sends a SEL_COMMAND
* to its target, and the message data set to the state of the radio button,
* of the type FXbool.
* A group of radio buttons can be made mutually exclusive by linking them
* to a common data target. Alternatively, an application can implement a
* common SEL_UPDATED handler to check and uncheck radio buttons as appropriate.
*/
class FXAPI FXRadioButton : public FXLabel {
FXDECLARE(FXRadioButton)
protected:
FXColor radioColor; // Color of radio ball
FXColor diskColor; // Color of radio disk
FXbool check; // Radio state
FXbool oldcheck; // Old radio state
protected:
FXRadioButton();
private:
FXRadioButton(const FXRadioButton&);
FXRadioButton &operator=(const FXRadioButton&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onUpdate(FXObject*,FXSelector,void*);
long onEnter(FXObject*,FXSelector,void*);
long onLeave(FXObject*,FXSelector,void*);
long onFocusIn(FXObject*,FXSelector,void*);
long onFocusOut(FXObject*,FXSelector,void*);
long onUngrabbed(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onHotKeyPress(FXObject*,FXSelector,void*);
long onHotKeyRelease(FXObject*,FXSelector,void*);
long onCheck(FXObject*,FXSelector,void*);
long onUncheck(FXObject*,FXSelector,void*);
long onUnknown(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetIntValue(FXObject*,FXSelector,void*);
long onCmdGetIntValue(FXObject*,FXSelector,void*);
public:
/// Construct new radio button
FXRadioButton(FXComposite* p,const FXString& text,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=RADIOBUTTON_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Returns true because a radio button can receive focus
virtual bool canFocus() const;
/// Get default width
virtual FXint getDefaultWidth();
/// Get default height
virtual FXint getDefaultHeight();
/// Set radio button state (TRUE, FALSE or MAYBE)
void setCheck(FXbool s=TRUE,FXbool notify=FALSE);
/// Get radio button state (TRUE, FALSE or MAYBE)
FXbool getCheck() const { return check; }
/// Change radio button style
void setRadioButtonStyle(FXuint style);
/// Return current radio button style
FXuint getRadioButtonStyle() const;
/// Get the radio ball color
FXColor getRadioColor() const { return radioColor; }
/// Set the radio ball color
void setRadioColor(FXColor clr);
/// Get the radio disk color
FXColor getDiskColor() const { return diskColor; }
/// Set the radio disk color
void setDiskColor(FXColor clr);
/// Save radio button to a stream
virtual void save(FXStream& store) const;
/// Load radio button from a stream
virtual void load(FXStream& store);
};
}
#endif
fox-1.6.49/include/FXGLContext.h 0000664 0001750 0001750 00000010361 12130340076 013230 0000000 0000000 /********************************************************************************
* *
* G L C o n t e x t C l a s s *
* *
*********************************************************************************
* Copyright (C) 2000,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXGLContext.h,v 1.14 2006/01/22 17:58:02 fox Exp $ *
********************************************************************************/
#ifndef FXGLCONTEXT_H
#define FXGLCONTEXT_H
////////////////////////////// UNDER DEVELOPMENT //////////////////////////////
namespace FX {
class FXApp;
class FXDrawable;
class FXGLVisual;
/**
* A GL context is an object representing the OpenGL state information.
* Multiple GL context may share display lists to conserve memory.
* When drawing multiple windows, it may be advantageous to share not only
* display lists, but also GL contexts. Since the GL context is created
* for a certain frame-buffer configuration, sharing of GL contexts is
* only possible if the windows sharing the GL context all have the same
* GL visual.
* However, display lists may be shared between different GL contexts.
*/
class FXAPI FXGLContext : public FXId {
FXDECLARE(FXGLContext)
private:
FXGLVisual *visual; // Visual for this context
FXDrawable *surface; // Drawable context is locked on
FXGLContext *sgnext; // Share group next in share list
FXGLContext *sgprev; // Share group previous in share list
protected:
void *ctx; // GL Context
protected:
FXGLContext():visual(NULL),surface(NULL),sgnext(NULL),sgprev(NULL),ctx(NULL){}
private:
FXGLContext(const FXGLContext&);
FXGLContext &operator=(const FXGLContext&);
public:
/**
* Construct an OpenGL context with its own private display list.
*/
FXGLContext(FXApp* a,FXGLVisual *vis);
/**
* Construct an OpenGL context sharing display lists with an existing GL context.
*/
FXGLContext(FXApp* a,FXGLVisual *vis,FXGLContext *shared);
/// Return TRUE if it is sharing display lists
FXbool isShared() const;
/// Get the visual
FXGLVisual* getVisual() const { return visual; }
/// Create context
virtual void create();
/// Detach the server-side resources for this window
virtual void detach();
/// Destroy the server-side resources for this window
virtual void destroy();
/// Make OpenGL context current prior to performing OpenGL commands
FXbool begin(FXDrawable *drawable);
/// Make OpenGL context non current
FXbool end();
/// Swap front and back buffer
void swapBuffers();
/// Copy part of backbuffer to front buffer [Mesa]
void swapSubBuffers(FXint x,FXint y,FXint w,FXint h);
/// Save object to stream
virtual void save(FXStream& store) const;
/// Load object from stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXGLContext();
};
}
#endif
fox-1.6.49/include/FXHorizontalFrame.h 0000664 0001750 0001750 00000005554 12130340076 014475 0000000 0000000 /********************************************************************************
* *
* H o r i z o n t a l C o n t a i n e r W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXHorizontalFrame.h,v 1.17 2006/01/22 17:58:04 fox Exp $ *
********************************************************************************/
#ifndef FXHORIZONTALFRAME_H
#define FXHORIZONTALFRAME_H
#ifndef FXPACKER_H
#include "FXPacker.h"
#endif
namespace FX {
/**
* Horizontal frame layout manager widget is used to automatically
* place child-windows horizontally from left-to-right, or right-to-left,
* depending on the child window's layout hints.
*/
class FXAPI FXHorizontalFrame : public FXPacker {
FXDECLARE(FXHorizontalFrame)
protected:
FXHorizontalFrame(){}
private:
FXHorizontalFrame(const FXHorizontalFrame&);
FXHorizontalFrame &operator=(const FXHorizontalFrame&);
public:
/// Construct a horizontal frame layout manager
FXHorizontalFrame(FXComposite *p,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_SPACING,FXint pr=DEFAULT_SPACING,FXint pt=DEFAULT_SPACING,FXint pb=DEFAULT_SPACING,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING);
/// Perform layout
virtual void layout();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
};
}
#endif
fox-1.6.49/include/FXDriveBox.h 0000664 0001750 0001750 00000007633 12130340076 013113 0000000 0000000 /********************************************************************************
* *
* D r i v e B o x W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1999,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXDriveBox.h,v 1.17 2006/01/22 17:58:01 fox Exp $ *
********************************************************************************/
#ifndef FXDRIVEBOX_H
#define FXDRIVEBOX_H
#ifndef FXLISTBOX_H
#include "FXListBox.h"
#endif
namespace FX {
class FXIcon;
class FXFileDict;
/// Drive Box options
enum {
DRIVEBOX_NO_OWN_ASSOC = 0x00020000 /// Do not create associations for files
};
/// Directory Box
class FXAPI FXDriveBox : public FXListBox {
FXDECLARE(FXDriveBox)
protected:
FXFileDict *associations; // Association table
FXIcon *foldericon; // Folder icons
FXIcon *cdromicon; // CDROM icon
FXIcon *harddiskicon; // Hard disk icon
FXIcon *netdriveicon; // Networked drive icon
FXIcon *floppyicon; // Floppy icon
FXIcon *nethoodicon; // Network neighborhood icon
FXIcon *zipdiskicon; // Zip drive icon
protected:
FXDriveBox(){}
void listDrives();
private:
FXDriveBox(const FXDriveBox&);
FXDriveBox &operator=(const FXDriveBox&);
public:
long onListChanged(FXObject*,FXSelector,void*);
long onListClicked(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetStringValue(FXObject*,FXSelector,void*);
long onCmdGetStringValue(FXObject*,FXSelector,void*);
public:
/// Constructor
FXDriveBox(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=FRAME_SUNKEN|FRAME_THICK|LISTBOX_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Destroy server-side resources
virtual void destroy();
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
/// Set current drive
FXbool setDrive(const FXString& drive);
/// Return current drive
FXString getDrive() const;
/// Change file associations
void setAssociations(FXFileDict* assoc);
/// Return file associations
FXFileDict* getAssociations() const { return associations; }
/// Destructor
virtual ~FXDriveBox();
};
}
#endif
fox-1.6.49/include/xincs.h 0000664 0001750 0001750 00000022740 12130340076 012253 0000000 0000000 /********************************************************************************
* *
* F O X P r i v a t e I n c l u d e F i l e s *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: xincs.h,v 1.73 2006/01/22 17:58:14 fox Exp $ *
********************************************************************************/
#ifndef XINCS_H
#define XINCS_H
//////////////////// DO NOT INCLUDE THIS PRIVATE HEADER FILE //////////////////
// Thread safe
#ifndef _POSIX_PTHREAD_SEMANTICS
#define _POSIX_PTHREAD_SEMANTICS
#endif
// GNU extras if we can get them
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
// Use 64-bit files
#ifndef WIN32
#ifndef _FILE_OFFSET_BITS
#define _FILE_OFFSET_BITS 64
#endif
#endif
// Basic includes
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#ifndef WIN32
#include
#include
#include
#ifdef HAVE_SYS_FILIO_H // Get FIONREAD on Solaris
#include
#endif
#else
#include // For _access()
#if defined(_MSC_VER) || defined(__WATCOMC__) // Microsoft Visual C++ or Watcom C++
#include
#define stat _stat
#define lstat _stat
#define getcwd _getcwd
#define mkdir _mkdir
#define access _access
#define vsnprintf _vsnprintf
#define execl _execl
#define execlp _execlp
#define execle _execle
#define execv _execv
#define execve _execve
#define execvp _execvp
#define strdup _strdup
#define alloca _alloca
#endif
#ifdef __BORLANDC__ // Borland C++ Builder
#include
#if __BORLANDC__ <= 0x0530 // C++ Builder 3.0
#define vsnprintf(a, b, c, d) vsprintf(a, c, d)
#endif
#define lstat stat
#endif
#ifdef __MINGW32__ // GCC MingW32
#include
#define vsnprintf _vsnprintf
#endif
#ifdef __SC__ // Digital Mars C++ Compiler
#include
#include // For _access()
#define vsnprintf _vsnprintf
#endif
#endif
#ifdef HAVE_UNISTD_H
#include
#endif
#ifdef HAVE_SYS_WAIT_H
#include
#endif
#ifdef TIME_WITH_SYS_TIME
#include
#include
#else
#ifdef HAVE_SYS_TIME_H
#include
#else
#include
#endif
#endif
#ifdef HAVE_SYS_PARAM_H
#include
#endif
#ifdef HAVE_SYS_SELECT_H
#if (!defined(__MINGW32__)) && (!defined(hpux))
#include
#endif
#endif
#ifdef HAVE_DIRENT_H
#include
#define NAMLEN(dirent) strlen((dirent)->d_name)
#else
#define dirent direct
#define NAMLEN(dirent) (dirent)->d_namlen
#ifdef HAVE_SYS_NDIR_H
#include
#endif
#ifdef HAVE_SYS_DIR_H
#include
#endif
#ifdef HAVE_NDIR_H
#include
#endif
#endif
#ifdef HAVE_XSHM_H
#include
#include
#endif
#ifdef HAVE_MMAP
#include
#endif
// For thread-safe readdir_r, we sometimes need extra
// space above and beyond the space for dirent itself
#ifdef HAVE_DIRENT_H
#ifndef WIN32
struct fxdirent : public dirent {
char buffer[256];
};
#endif
#endif
// MS-Windows
#ifdef WIN32
#ifndef STRICT
#define STRICT
#endif
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include
#ifndef __CYGWIN__
#include
#endif
#include // For _TrackMouseEvent
#include
// X windows includes
#else
#include
#define XRegisterIMInstantiateCallback broken_XRegisterIMInstantiateCallback
#define XUnregisterIMInstantiateCallback broken_XUnregisterIMInstantiateCallback
#define XSetIMValues broken_XSetIMValues
#include
#undef XRegisterIMInstantiateCallback
#undef XUnregisterIMInstantiateCallback
#undef XSetIMValues
#include
#include
#include
#include
#include
#ifdef HUMMINGBIRD
#include
#endif
#ifdef HAVE_XSHM_H
#include
#endif
#ifdef HAVE_XCURSOR_H
#include
#endif
#ifdef HAVE_XFT_H
#include
#endif
#ifdef HAVE_XSHAPE_H
#include
#endif
#ifdef HAVE_XRANDR_H
#include
#endif
#ifndef NO_XIM
#ifndef XlibSpecificationRelease // Not defined until X11R5
#define NO_XIM
#elif XlibSpecificationRelease < 6 // Need at least Xlib X11R6
#define NO_XIM
#endif
#endif
#ifndef NO_XIM
extern "C" Bool XRegisterIMInstantiateCallback(Display*,struct _XrmHashBucketRec*,char*,char*,XIMProc,XPointer);
extern "C" Bool XUnregisterIMInstantiateCallback(Display*,struct _XrmHashBucketRec*,char*,char*,XIMProc,XPointer);
extern "C" char *XSetIMValues(XIM,...);
#endif
#endif
// OpenGL includes
#ifdef HAVE_GL_H
#ifndef SUN_OGL_NO_VERTEX_MACROS
#define SUN_OGL_NO_VERTEX_MACROS
#endif
#ifndef HPOGL_SUPPRESS_FAST_API
#define HPOGL_SUPPRESS_FAST_API
#endif
#include
#ifndef WIN32
#include
#endif
#endif
#ifndef GLAPIENTRY
#define GLAPIENTRY
#endif
#ifndef GLAPI
#define GLAPI
#endif
#ifdef HAVE_GLU_H
#include
#endif
// Maximum path length
#ifndef MAXPATHLEN
#if defined(PATH_MAX)
#define MAXPATHLEN PATH_MAX
#elif defined(_MAX_PATH)
#define MAXPATHLEN _MAX_PATH
#elif defined(MAX_PATH)
#define MAXPATHLEN MAX_PATH
#else
#define MAXPATHLEN 1024
#endif
#endif
// Modes for access(filename,mode) on Windows
#ifdef WIN32
#ifndef R_OK
#define R_OK 4
#endif
#ifndef W_OK
#define W_OK 2
#endif
#ifndef X_OK
#define X_OK 1
#endif
#ifndef F_OK
#define F_OK 0
#endif
#endif
// File open modes on Windows
#ifdef WIN32
#if defined(_MSC_VER)
#define O_APPEND _O_APPEND
#define O_CREAT _O_CREAT
#define O_EXCL _O_EXCL
#define O_RDONLY _O_RDONLY
#define O_RDWR _O_RDWR
#define O_TRUNC _O_TRUNC
#define O_WRONLY _O_WRONLY
#define O_BINARY _O_BINARY
#endif
#endif
// Some systems don't have it
#ifndef SEEK_SET
#define SEEK_SET 0
#endif
#ifndef SEEK_CUR
#define SEEK_CUR 1
#endif
#ifndef SEEK_END
#define SEEK_END 2
#endif
// Printer stuff
#ifdef WIN32
#include
#endif
// Wheel support (OS >= W98, OS>=NT4.0)
#ifdef WIN32
// Missing wheel message id's
#ifndef SPI_GETWHEELSCROLLLINES
#define SPI_GETWHEELSCROLLLINES 104
#endif
#ifndef WM_MOUSEWHEEL
#define WM_MOUSEWHEEL 0x020A
#endif
// GetSystemMetrics parameters missing in header files
#ifndef SM_XVIRTUALSCREEN
#define SM_XVIRTUALSCREEN 76
#endif
#ifndef SM_YVIRTUALSCREEN
#define SM_YVIRTUALSCREEN 77
#endif
#ifndef SM_CXVIRTUALSCREEN
#define SM_CXVIRTUALSCREEN 78
#endif
#ifndef SM_CYVIRTUALSCREEN
#define SM_CYVIRTUALSCREEN 79
#endif
#ifndef SM_CMONITORS
#define SM_CMONITORS 80
#endif
#ifndef SM_SAMEDISPLAYFORMAT
#define SM_SAMEDISPLAYFORMAT 81
#endif
// Missing in CYGWIN
#ifndef IMAGE_SUBSYSTEM_NATIVE_WINDOWS
#define IMAGE_SUBSYSTEM_NATIVE_WINDOWS 8
#endif
#ifndef IMAGE_SUBSYSTEM_WINDOWS_CE_GUI
#define IMAGE_SUBSYSTEM_WINDOWS_CE_GUI 9
#endif
#endif
// IBM VisualAge for C++ 3.5
#if defined(__IBMCPP__) && defined(WIN32)
#include
#include // for _access()
#define _mkdir(x) mkdir((char *)(x))
#define _vsnprintf(a, b, c, d) vsprintf(a, c, d)
#define ICON_SMALL 0
#define ICON_BIG 1
#define bool int
// This declarations come from Microsoft SDK
#define TME_HOVER 0x00000001
#define TME_LEAVE 0x00000002
#define TME_QUERY 0x40000000
#define TME_CANCEL 0x80000000
#define HOVER_DEFAULT 0xFFFFFFFF
#define WM_MOUSEHOVER 0x02A1
#define WM_MOUSELEAVE 0x02A3
typedef struct tagTRACKMOUSEEVENT {
DWORD cbSize;
DWORD dwFlags;
HWND hwndTrack;
DWORD dwHoverTime;
} TRACKMOUSEEVENT, *LPTRACKMOUSEEVENT;
WINUSERAPI
BOOL
WINAPI
TrackMouseEvent(
IN OUT LPTRACKMOUSEEVENT lpEventTrack);
#ifdef __GL_H__
#define GL_COLOR_LOGIC_OP 0x0BF2
#define GL_POLYGON_OFFSET_POINT 0x2A01
#define GL_POLYGON_OFFSET_LINE 0x2A02
WINGDIAPI void APIENTRY glPolygonOffset (GLfloat factor,GLfloat units);
#endif
#endif
#endif
fox-1.6.49/include/FXPrintDialog.h 0000664 0001750 0001750 00000013077 12130340076 013604 0000000 0000000 /********************************************************************************
* *
* P r i n t J o b D i a l o g *
* *
*********************************************************************************
* Copyright (C) 1999,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXPrintDialog.h,v 1.17 2006/01/22 17:58:07 fox Exp $ *
********************************************************************************/
#ifndef FXPRINTDIALOG_H
#define FXPRINTDIALOG_H
#ifndef FXDIALOGBOX_H
#include "FXDialogBox.h"
#endif
namespace FX {
class FXRadioButton;
class FXComboBox;
class FXListBox;
class FXTextField;
class FXSpinner;
class FXIcon;
/// Printer selection dialog
class FXAPI FXPrintDialog : public FXDialogBox {
FXDECLARE(FXPrintDialog)
protected:
FXRadioButton *sendtoprinter;
FXComboBox *printername;
FXRadioButton *sendtofile;
FXTextField *filename;
FXRadioButton *printall;
FXRadioButton *printeven;
FXRadioButton *printodd;
FXRadioButton *printrange;
FXRadioButton *firstpagefirst;
FXRadioButton *lastpagefirst;
FXRadioButton *printincolor;
FXRadioButton *printinblacknwhite;
FXRadioButton *orientportrait;
FXRadioButton *orientlanscape;
FXListBox *media;
FXSpinner *firstpage;
FXSpinner *lastpage;
FXSpinner *numberofcopies;
FXIcon *landscapeIcon;
FXIcon *portraitIcon;
FXPrinter printer;
protected:
FXPrintDialog(){}
private:
FXPrintDialog(const FXPrintDialog&);
FXPrintDialog &operator=(const FXPrintDialog&);
public:
long onCmdToPrinter(FXObject*,FXSelector,void*);
long onUpdToPrinter(FXObject*,FXSelector,void*);
long onCmdToFile(FXObject*,FXSelector,void*);
long onUpdToFile(FXObject*,FXSelector,void*);
long onCmdBrowse(FXObject*,FXSelector,void*);
long onUpdBrowse(FXObject*,FXSelector,void*);
long onCmdProps(FXObject*,FXSelector,void*);
long onUpdProps(FXObject*,FXSelector,void*);
long onCmdPortrait(FXObject*,FXSelector,void*);
long onUpdPortrait(FXObject*,FXSelector,void*);
long onCmdLandscape(FXObject*,FXSelector,void*);
long onUpdLandscape(FXObject*,FXSelector,void*);
long onCmdPages(FXObject*,FXSelector,void*);
long onUpdPages(FXObject*,FXSelector,void*);
long onCmdColor(FXObject*,FXSelector,void*);
long onUpdColor(FXObject*,FXSelector,void*);
long onCmdGray(FXObject*,FXSelector,void*);
long onUpdGray(FXObject*,FXSelector,void*);
long onCmdNumCopies(FXObject*,FXSelector,void*);
long onUpdNumCopies(FXObject*,FXSelector,void*);
long onCmdFirstPage(FXObject*,FXSelector,void*);
long onUpdFirstPage(FXObject*,FXSelector,void*);
long onCmdLastPage(FXObject*,FXSelector,void*);
long onUpdLastPage(FXObject*,FXSelector,void*);
long onCmdCollateNormal(FXObject*,FXSelector,void*);
long onUpdCollateNormal(FXObject*,FXSelector,void*);
long onCmdCollateReversed(FXObject*,FXSelector,void*);
long onUpdCollateReversed(FXObject*,FXSelector,void*);
long onCmdFileName(FXObject*,FXSelector,void*);
long onUpdFileName(FXObject*,FXSelector,void*);
long onCmdPrinterName(FXObject*,FXSelector,void*);
long onUpdPrinterName(FXObject*,FXSelector,void*);
long onCmdAccept(FXObject*,FXSelector,void*);
long onCmdMedia(FXObject*,FXSelector,void*);
long onUpdMedia(FXObject*,FXSelector,void*);
public:
enum{
ID_TO_PRINTER=FXDialogBox::ID_LAST,
ID_TO_FILE,
ID_PRINTER_NAME,
ID_FILE_NAME,
ID_LANDSCAPE,
ID_PORTRAIT,
ID_MEDIA,
ID_COLLATE_NORMAL,
ID_COLLATE_REVERSED,
ID_PAGES_ALL,
ID_PAGES_EVEN,
ID_PAGES_ODD,
ID_PAGES_RANGE,
ID_PAGES_FIRST,
ID_PAGES_LAST,
ID_BROWSE_FILE,
ID_PROPERTIES,
ID_COLOR_PRINTER,
ID_GRAY_PRINTER,
ID_NUM_COPIES
};
public:
/// Construct print dialog
FXPrintDialog(FXWindow* owner,const FXString& name,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Create dialog
virtual void create();
/// Set printer info
void setPrinter(const FXPrinter& pr);
/// Get printer info
void getPrinter(FXPrinter& pr);
/// Save dialog to a stream
virtual void save(FXStream& store) const;
/// Load dialog from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXPrintDialog();
};
}
#endif
fox-1.6.49/include/FXSettings.h 0000664 0001750 0001750 00000014224 12130340076 013163 0000000 0000000 /********************************************************************************
* *
* S e t t i n g s C l a s s *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXSettings.h,v 1.33 2006/01/22 17:58:09 fox Exp $ *
********************************************************************************/
#ifndef FXSETTINGS_H
#define FXSETTINGS_H
#ifndef FXDICT_H
#include "FXDict.h"
#endif
namespace FX {
class FXStringDict;
/**
* The Settings class manages a key-value database. This is normally used as
* part of Registry, but can also be used separately in applications that need
* to maintain a key-value database in a file of their own.
* String values can contain any character, and will be escaped when written
* to the file.
*/
class FXAPI FXSettings : public FXDict {
FXDECLARE(FXSettings)
protected:
bool modified;
protected:
virtual void *createData(const void*);
virtual void deleteData(void*);
FXchar* dequote(FXchar* text) const;
FXchar* enquote(FXchar* result,const FXchar* text);
FXStringDict* insert(const FXchar* ky){ return (FXStringDict*)FXDict::insert(ky,NULL); }
FXStringDict* replace(const FXchar* ky,FXStringDict* section){ return (FXStringDict*)FXDict::replace(ky,section,true); }
FXStringDict* remove(const FXchar* ky){ return (FXStringDict*)FXDict::remove(ky); }
public:
/// Construct settings database.
FXSettings();
/// Construct copy of existing database.
FXSettings(const FXSettings& orig);
/// Assignment operator
FXSettings &operator=(const FXSettings& orig);
/// Parse a file containing a settings database.
bool parseFile(const FXString& filename,bool mark);
/// Unparse settings database into given file.
bool unparseFile(const FXString& filename);
/// Obtain the string dictionary for the given section
FXStringDict* data(FXuint pos) const { return (FXStringDict*)FXDict::data(pos); }
/// Find string dictionary for the given section; may be NULL
FXStringDict* find(const FXchar *section) const { return (FXStringDict*)FXDict::find(section); }
/// Read a formatted registry entry, using scanf-style format
FXint readFormatEntry(const FXchar *section,const FXchar *key,const FXchar *fmt,...) FX_SCANF(4,5) ;
/// Read a string registry entry; if no value is found, the default value def is returned
const FXchar *readStringEntry(const FXchar *section,const FXchar *key,const FXchar *def=NULL);
/// Read a integer registry entry; if no value is found, the default value def is returned
FXint readIntEntry(const FXchar *section,const FXchar *key,FXint def=0);
/// Read a unsigned integer registry entry; if no value is found, the default value def is returned
FXuint readUnsignedEntry(const FXchar *section,const FXchar *key,FXuint def=0);
/// Read a double-precision floating point registry entry; if no value is found, the default value def is returned
FXdouble readRealEntry(const FXchar *section,const FXchar *key,FXdouble def=0.0);
/// Read a color value registry entry; if no value is found, the default value def is returned
FXColor readColorEntry(const FXchar *section,const FXchar *key,FXColor def=0);
/// Read a boolean registry entry
FXbool readBoolEntry(const FXchar *section,const FXchar *key,FXbool def=FALSE);
/// Write a formatted registry entry, using printf-style format
FXint writeFormatEntry(const FXchar *section,const FXchar *key,const FXchar *fmt,...) FX_PRINTF(4,5) ;
/// Write a string registry entry
bool writeStringEntry(const FXchar *section,const FXchar *key,const FXchar *val);
/// Write a integer registry entry
bool writeIntEntry(const FXchar *section,const FXchar *key,FXint val);
/// Write a unsigned integer registry entry
bool writeUnsignedEntry(const FXchar *section,const FXchar *key,FXuint val);
/// Write a double-precision floating point registry entry
bool writeRealEntry(const FXchar *section,const FXchar *key,FXdouble val);
/// Write a color value entry
bool writeColorEntry(const FXchar *section,const FXchar *key,FXColor val);
/// Write a boolean value entry
bool writeBoolEntry(const FXchar *section,const FXchar *key,FXbool val);
/// Delete a registry entry
bool deleteEntry(const FXchar *section,const FXchar *key);
/// See if entry exists
bool existingEntry(const FXchar *section,const FXchar *key);
/// Delete section
bool deleteSection(const FXchar *section);
/// See if section exists
bool existingSection(const FXchar *section);
/// Clear all sections
bool clear();
/// Mark as changed
void setModified(bool mdfy=true){ modified=mdfy; }
/// Is it modified
bool isModified() const { return modified; }
/// Cleanup
virtual ~FXSettings();
};
}
#endif
fox-1.6.49/include/FXRASIcon.h 0000664 0001750 0001750 00000006303 12130340076 012620 0000000 0000000 /********************************************************************************
* *
* S U N R A S T E R I m a g e O b j e c t *
* *
*********************************************************************************
* Copyright (C) 2004,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXRASIcon.h,v 1.8 2006/01/22 17:58:07 fox Exp $ *
********************************************************************************/
#ifndef FXRASICON_H
#define FXRASICON_H
#ifndef FXICON_H
#include "FXIcon.h"
#endif
namespace FX {
/// SUN Raster Image format icon
class FXAPI FXRASIcon : public FXIcon {
FXDECLARE(FXRASIcon)
protected:
FXRASIcon(){}
private:
FXRASIcon(const FXRASIcon&);
FXRASIcon &operator=(const FXRASIcon&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct icon from memory stream formatted in SUN Raster Image format
FXRASIcon(FXApp* a,const void *pix=NULL,FXColor clr=FXRGB(192,192,192),FXuint opts=0,FXint w=1,FXint h=1);
/// Save pixels into stream in SUN Raster Image format
virtual bool savePixels(FXStream& store) const;
/// Load pixels from stream in SUN Raster Image format
virtual bool loadPixels(FXStream& store);
/// Destroy icon
virtual ~FXRASIcon();
};
/**
* Check if stream contains a RAS, return TRUE if so.
*/
extern FXAPI bool fxcheckRAS(FXStream& store);
/**
* Load an SUN Raster Image format file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadRAS(FXStream& store,FXColor*& data,FXint& width,FXint& height);
/**
* Save an SUN Raster Image format file to a stream.
*/
extern FXAPI bool fxsaveRAS(FXStream& store,const FXColor *data,FXint width,FXint height);
}
#endif
fox-1.6.49/include/FXList.h 0000664 0001750 0001750 00000041060 12130340076 012274 0000000 0000000 /********************************************************************************
* *
* L i s t W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXList.h,v 1.88.2.2 2006/11/17 16:02:31 fox Exp $ *
********************************************************************************/
#ifndef FXLIST_H
#define FXLIST_H
#ifndef FXSCROLLAREA_H
#include "FXScrollArea.h"
#endif
namespace FX {
/// List styles
enum {
LIST_EXTENDEDSELECT = 0, /// Extended selection mode allows for drag-selection of ranges of items
LIST_SINGLESELECT = 0x00100000, /// Single selection mode allows up to one item to be selected
LIST_BROWSESELECT = 0x00200000, /// Browse selection mode enforces one single item to be selected at all times
LIST_MULTIPLESELECT = 0x00300000, /// Multiple selection mode is used for selection of individual items
LIST_AUTOSELECT = 0x00400000, /// Automatically select under cursor
LIST_NORMAL = LIST_EXTENDEDSELECT
};
class FXIcon;
class FXFont;
class FXList;
/// List item
class FXAPI FXListItem : public FXObject {
FXDECLARE(FXListItem)
friend class FXList;
protected:
FXString label;
FXIcon *icon;
void *data;
FXuint state;
FXint x,y;
private:
FXListItem(const FXListItem&);
FXListItem& operator=(const FXListItem&);
protected:
FXListItem():icon(NULL),data(NULL),state(0),x(0),y(0){}
virtual void draw(const FXList* list,FXDC& dc,FXint x,FXint y,FXint w,FXint h);
virtual FXint hitItem(const FXList* list,FXint x,FXint y) const;
public:
enum {
SELECTED = 1, /// Selected
FOCUS = 2, /// Focus
DISABLED = 4, /// Disabled
DRAGGABLE = 8, /// Draggable
ICONOWNED = 16 /// Icon owned by item
};
public:
/// Construct new item with given text, icon, and user-data
FXListItem(const FXString& text,FXIcon* ic=NULL,void* ptr=NULL):label(text),icon(ic),data(ptr),state(0),x(0),y(0){}
/// Change item's text label
virtual void setText(const FXString& txt);
/// Return item's text label
const FXString& getText() const { return label; }
/// Change item's icon, deleting the old icon if it was owned
virtual void setIcon(FXIcon* icn,FXbool owned=FALSE);
/// Return item's icon
FXIcon* getIcon() const { return icon; }
/// Change item's user data
void setData(void* ptr){ data=ptr; }
/// Get item's user data
void* getData() const { return data; }
/// Make item draw as focused
virtual void setFocus(FXbool focus);
/// Return true if item has focus
FXbool hasFocus() const { return (state&FOCUS)!=0; }
/// Select item
virtual void setSelected(FXbool selected);
/// Return true if this item is selected
FXbool isSelected() const { return (state&SELECTED)!=0; }
/// Enable or disable item
virtual void setEnabled(FXbool enabled);
/// Return true if this item is enabled
FXbool isEnabled() const { return (state&DISABLED)==0; }
/// Make item draggable
virtual void setDraggable(FXbool draggable);
/// Return true if this item is draggable
FXbool isDraggable() const { return (state&DRAGGABLE)!=0; }
/// Return width of item as drawn in list
virtual FXint getWidth(const FXList* list) const;
/// Return height of item as drawn in list
virtual FXint getHeight(const FXList* list) const;
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Destroy server-side resources
virtual void destroy();
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
/// Destroy item and free icons if owned
virtual ~FXListItem();
};
/// List item collate function
typedef FXint (*FXListSortFunc)(const FXListItem*,const FXListItem*);
/// List of FXListItem's
typedef FXObjectListOf FXListItemList;
/**
* A List Widget displays a list of items, each with a text and
* optional icon. When an item's selected state changes, the list sends
* a SEL_SELECTED or SEL_DESELECTED message. A change of the current
* item is signified by the SEL_CHANGED message.
* The list sends SEL_COMMAND messages when the user clicks on an item,
* and SEL_CLICKED, SEL_DOUBLECLICKED, and SEL_TRIPLECLICKED when the user
* clicks once, twice, or thrice, respectively.
* When items are added, replaced, or removed, the list sends messages of
* the type SEL_INSERTED, SEL_REPLACED, or SEL_DELETED.
* In each of these cases, the index to the item, if any, is passed in the
* 3rd argument of the message.
*/
class FXAPI FXList : public FXScrollArea {
FXDECLARE(FXList)
protected:
FXListItemList items; // Item list
FXint anchor; // Anchor item
FXint current; // Current item
FXint extent; // Extent item
FXint cursor; // Cursor item
FXint viewable; // Viewable item
FXFont *font; // Font
FXColor textColor; // Text color
FXColor selbackColor; // Selected back color
FXColor seltextColor; // Selected text color
FXint listWidth; // List width
FXint listHeight; // List height
FXint visible; // Number of rows high
FXString help; // Help text
FXListSortFunc sortfunc; // Item sort function
FXint grabx; // Grab point x
FXint graby; // Grab point y
FXString lookup; // Lookup string
FXbool state; // State of item
protected:
FXList();
void recompute();
virtual FXListItem *createItem(const FXString& text,FXIcon* icon,void* ptr);
private:
FXList(const FXList&);
FXList &operator=(const FXList&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onEnter(FXObject*,FXSelector,void*);
long onLeave(FXObject*,FXSelector,void*);
long onUngrabbed(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onRightBtnPress(FXObject*,FXSelector,void*);
long onRightBtnRelease(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onFocusIn(FXObject*,FXSelector,void*);
long onFocusOut(FXObject*,FXSelector,void*);
long onAutoScroll(FXObject*,FXSelector,void*);
long onClicked(FXObject*,FXSelector,void*);
long onDoubleClicked(FXObject*,FXSelector,void*);
long onTripleClicked(FXObject*,FXSelector,void*);
long onCommand(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
long onTipTimer(FXObject*,FXSelector,void*);
long onLookupTimer(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);public:
long onCmdGetIntValue(FXObject*,FXSelector,void*);
long onCmdSetIntValue(FXObject*,FXSelector,void*);
public:
static FXint ascending(const FXListItem* a,const FXListItem* b);
static FXint descending(const FXListItem* a,const FXListItem* b);
static FXint ascendingCase(const FXListItem* a,const FXListItem* b);
static FXint descendingCase(const FXListItem* a,const FXListItem* b);
public:
enum {
ID_LOOKUPTIMER=FXScrollArea::ID_LAST,
ID_LAST
};
public:
/// Construct a list with initially no items in it
FXList(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=LIST_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Perform layout
virtual void layout();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Compute and return content width
virtual FXint getContentWidth();
/// Return content height
virtual FXint getContentHeight();
/// Recalculate layout
virtual void recalc();
/// List widget can receive focus
virtual bool canFocus() const;
/// Move the focus to this window
virtual void setFocus();
/// Remove the focus from this window
virtual void killFocus();
/// Return the number of items in the list
FXint getNumItems() const { return items.no(); }
/// Return number of visible items
FXint getNumVisible() const { return visible; }
/// Change the number of visible items
void setNumVisible(FXint nvis);
/// Return the item at the given index
FXListItem *getItem(FXint index) const;
/// Replace the item with a [possibly subclassed] item
FXint setItem(FXint index,FXListItem* item,FXbool notify=FALSE);
/// Replace items text, icon, and user-data pointer
FXint setItem(FXint index,const FXString& text,FXIcon *icon=NULL,void* ptr=NULL,FXbool notify=FALSE);
/// Fill list by appending items from array of strings
FXint fillItems(const FXchar** strings,FXIcon *icon=NULL,void* ptr=NULL,FXbool notify=FALSE);
/// Fill list by appending items from newline separated strings
FXint fillItems(const FXString& strings,FXIcon *icon=NULL,void* ptr=NULL,FXbool notify=FALSE);
/// Insert a new [possibly subclassed] item at the give index
FXint insertItem(FXint index,FXListItem* item,FXbool notify=FALSE);
/// Insert item at index with given text, icon, and user-data pointer
FXint insertItem(FXint index,const FXString& text,FXIcon *icon=NULL,void* ptr=NULL,FXbool notify=FALSE);
/// Append a [possibly subclassed] item to the list
FXint appendItem(FXListItem* item,FXbool notify=FALSE);
/// Append new item with given text and optional icon, and user-data pointer
FXint appendItem(const FXString& text,FXIcon *icon=NULL,void* ptr=NULL,FXbool notify=FALSE);
/// Prepend a [possibly subclassed] item to the list
FXint prependItem(FXListItem* item,FXbool notify=FALSE);
/// Prepend new item with given text and optional icon, and user-data pointer
FXint prependItem(const FXString& text,FXIcon *icon=NULL,void* ptr=NULL,FXbool notify=FALSE);
/// Move item from oldindex to newindex
FXint moveItem(FXint newindex,FXint oldindex,FXbool notify=FALSE);
/// Extract item from list
FXListItem* extractItem(FXint index,FXbool notify=FALSE);
/// Remove item from list
void removeItem(FXint index,FXbool notify=FALSE);
/// Remove all items from list
void clearItems(FXbool notify=FALSE);
/// Return item width
FXint getItemWidth(FXint index) const;
/// Return item height
FXint getItemHeight(FXint index) const;
/// Return index of item at x,y, if any
virtual FXint getItemAt(FXint x,FXint y) const;
/// Return item hit code: 0 no hit; 1 hit the icon; 2 hit the text
FXint hitItem(FXint index,FXint x,FXint y) const;
/**
* Search items by name, beginning from item start. If the start
* item is -1 the search will start at the first item in the list.
* Flags may be SEARCH_FORWARD or SEARCH_BACKWARD to control the
* search direction; this can be combined with SEARCH_NOWRAP or SEARCH_WRAP
* to control whether the search wraps at the start or end of the list.
* The option SEARCH_IGNORECASE causes a case-insensitive match. Finally,
* passing SEARCH_PREFIX causes searching for a prefix of the item name.
* Return -1 if no matching item is found.
*/
FXint findItem(const FXString& text,FXint start=-1,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const;
/**
* Search items by associated user data, beginning from item start. If the
* start item is -1 the search will start at the first item in the list.
* Flags may be SEARCH_FORWARD or SEARCH_BACKWARD to control the
* search direction; this can be combined with SEARCH_NOWRAP or SEARCH_WRAP
* to control whether the search wraps at the start or end of the list.
*/
FXint findItemByData(const void *ptr,FXint start=-1,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const;
/// Scroll to bring item into view
virtual void makeItemVisible(FXint index);
/// Change item text
void setItemText(FXint index,const FXString& text);
/// Return item text
FXString getItemText(FXint index) const;
/// Change item icon, deleting the old icon if it was owned
void setItemIcon(FXint index,FXIcon* icon,FXbool owned=FALSE);
/// Return item icon, if any
FXIcon* getItemIcon(FXint index) const;
/// Change item user-data pointer
void setItemData(FXint index,void* ptr);
/// Return item user-data pointer
void* getItemData(FXint index) const;
/// Return TRUE if item is selected
FXbool isItemSelected(FXint index) const;
/// Return TRUE if item is current
FXbool isItemCurrent(FXint index) const;
/// Return TRUE if item is visible
FXbool isItemVisible(FXint index) const;
/// Return TRUE if item is enabled
FXbool isItemEnabled(FXint index) const;
/// Repaint item
void updateItem(FXint index) const;
/// Enable item
virtual FXbool enableItem(FXint index);
/// Disable item
virtual FXbool disableItem(FXint index);
/// Select item
virtual FXbool selectItem(FXint index,FXbool notify=FALSE);
/// Deselect item
virtual FXbool deselectItem(FXint index,FXbool notify=FALSE);
/// Toggle item selection state
virtual FXbool toggleItem(FXint index,FXbool notify=FALSE);
/// Extend selection from anchor item to index
virtual FXbool extendSelection(FXint index,FXbool notify=FALSE);
/// Deselect all items
virtual FXbool killSelection(FXbool notify=FALSE);
/// Change current item
virtual void setCurrentItem(FXint index,FXbool notify=FALSE);
/// Return current item, if any
FXint getCurrentItem() const { return current; }
/// Change anchor item
void setAnchorItem(FXint index);
/// Return anchor item, if any
FXint getAnchorItem() const { return anchor; }
/// Get item under the cursor, if any
FXint getCursorItem() const { return cursor; }
/// Sort items using current sort function
void sortItems();
/// Return sort function
FXListSortFunc getSortFunc() const { return sortfunc; }
/// Change sort function
void setSortFunc(FXListSortFunc func){ sortfunc=func; }
/// Change text font
void setFont(FXFont* fnt);
/// Return text font
FXFont* getFont() const { return font; }
/// Return normal text color
FXColor getTextColor() const { return textColor; }
/// Change normal text color
void setTextColor(FXColor clr);
/// Return selected text background
FXColor getSelBackColor() const { return selbackColor; }
/// Change selected text background
void setSelBackColor(FXColor clr);
/// Return selected text color
FXColor getSelTextColor() const { return seltextColor; }
/// Change selected text color
void setSelTextColor(FXColor clr);
/// Return list style
FXuint getListStyle() const;
/// Change list style
void setListStyle(FXuint style);
/// Set the status line help text for this list
void setHelpText(const FXString& text);
/// Get the status line help text for this list
const FXString& getHelpText() const { return help; }
/// Save list to a stream
virtual void save(FXStream& store) const;
/// Load list from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXList();
};
}
#endif
fox-1.6.49/include/FXQuatd.h 0000664 0001750 0001750 00000012232 12130340076 012436 0000000 0000000 /********************************************************************************
* *
* D o u b l e - P r e c i s i o n Q u a t e r n i o n *
* *
*********************************************************************************
* Copyright (C) 1994,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXQuatd.h,v 1.15 2006/01/22 17:58:07 fox Exp $ *
********************************************************************************/
#ifndef FXQUATD_H
#define FXQUATD_H
namespace FX {
class FXMat3d;
/// Double-precision quaternion
class FXAPI FXQuatd : public FXVec4d {
public:
/// Constructors
FXQuatd(){}
/// Copy constructor
FXQuatd(const FXQuatd& q):FXVec4d(q){}
/// Construct from components
FXQuatd(FXdouble xx,FXdouble yy,FXdouble zz,FXdouble ww):FXVec4d(xx,yy,zz,ww){}
/// Construct from array of doubles
FXQuatd(const FXdouble v[]):FXVec4d(v){}
/// Construct from axis and angle
FXQuatd(const FXVec3d& axis,FXdouble phi=0.0);
/// Construct from euler angles yaw (z), pitch (y), and roll (x)
FXQuatd(FXdouble roll,FXdouble pitch,FXdouble yaw);
/// Construct quaternion from two unit vectors
FXQuatd(const FXVec3d& fr,const FXVec3d& to);
/// Construct quaternion from three axes
FXQuatd(const FXVec3d& ex,const FXVec3d& ey,const FXVec3d& ez);
/// Construct quaternion from 3x3 matrix
FXQuatd(const FXMat3d& mat);
/// Adjust quaternion length
FXQuatd& adjust();
/// Set quaternion from axis and angle
void setAxisAngle(const FXVec3d& axis,FXdouble phi=0.0);
/// Obtain axis and angle from quaternion
void getAxisAngle(FXVec3d& axis,FXdouble& phi) const;
/// Set quaternion from roll (x), pitch (y), yaw (z)
void setRollPitchYaw(FXdouble roll,FXdouble pitch,FXdouble yaw);
void getRollPitchYaw(FXdouble& roll,FXdouble& pitch,FXdouble& yaw) const;
/// Set quaternion from yaw (z), pitch (y), roll (x)
void setYawPitchRoll(FXdouble yaw,FXdouble pitch,FXdouble roll);
void getYawPitchRoll(FXdouble& yaw,FXdouble& pitch,FXdouble& roll) const;
/// Set quaternion from roll (x), yaw (z), pitch (y)
void setRollYawPitch(FXdouble roll,FXdouble yaw,FXdouble pitch);
void getRollYawPitch(FXdouble& roll,FXdouble& yaw,FXdouble& pitch) const;
/// Set quaternion from pitch (y), roll (x),yaw (z)
void setPitchRollYaw(FXdouble pitch,FXdouble roll,FXdouble yaw);
void getPitchRollYaw(FXdouble& pitch,FXdouble& roll,FXdouble& yaw) const;
/// Set quaternion from pitch (y), yaw (z), roll (x)
void setPitchYawRoll(FXdouble pitch,FXdouble yaw,FXdouble roll);
void getPitchYawRoll(FXdouble& pitch,FXdouble& yaw,FXdouble& roll) const;
/// Set quaternion from yaw (z), roll (x), pitch (y)
void setYawRollPitch(FXdouble yaw,FXdouble roll,FXdouble pitch);
void getYawRollPitch(FXdouble& yaw,FXdouble& roll,FXdouble& pitch) const;
/// Set quaternion from axes
void setAxes(const FXVec3d& ex,const FXVec3d& ey,const FXVec3d& ez);
/// Get quaternion axes
void getAxes(FXVec3d& ex,FXVec3d& ey,FXVec3d& ez) const;
/// Obtain local x axis
FXVec3d getXAxis() const;
/// Obtain local y axis
FXVec3d getYAxis() const;
/// Obtain local z axis
FXVec3d getZAxis() const;
/// Exponentiate quaternion
FXQuatd exp() const;
/// Take logarithm of quaternion
FXQuatd log() const;
/// Invert quaternion
FXQuatd invert() const;
/// Invert unit quaternion
FXQuatd unitinvert() const;
/// Conjugate quaternion
FXQuatd conj() const;
/// Construct quaternion from arc a->b on unit sphere
FXQuatd& arc(const FXVec3d& a,const FXVec3d& b);
/// Spherical lerp
FXQuatd& lerp(const FXQuatd& u,const FXQuatd& v,FXdouble f);
/// Multiply quaternions
FXQuatd operator*(const FXQuatd& q) const;
/// Rotation of a vector by a quaternion
FXVec3d operator*(const FXVec3d& v) const;
};
}
#endif
fox-1.6.49/include/FXException.h 0000664 0001750 0001750 00000010704 12130340076 013320 0000000 0000000 /********************************************************************************
* *
* E x c e p t i o n T y p e s *
* *
*********************************************************************************
* Copyright (C) 2000,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXException.h,v 1.14 2006/01/22 17:58:01 fox Exp $ *
********************************************************************************/
#ifndef FXEXCEPTION_H
#define FXEXCEPTION_H
namespace FX {
/// Generic catch-all exception
class FXAPI FXException {
private:
const FXchar *message;
private:
static const FXchar exceptionName[];
public:
FXException():message(FXException::exceptionName){}
FXException(const FXchar *msg):message(msg){}
const FXchar *what() const { return message; }
~FXException(){}
};
/// Generic error exception
class FXAPI FXErrorException : public FXException {
private:
static const FXchar exceptionName[];
public:
FXErrorException():FXException(FXErrorException::exceptionName){}
FXErrorException(const FXchar *msg):FXException(msg){}
};
/// Index out of range
class FXAPI FXRangeException : public FXErrorException {
private:
static const FXchar exceptionName[];
public:
FXRangeException():FXErrorException(FXRangeException::exceptionName){}
FXRangeException(const FXchar *msg):FXErrorException(msg){}
};
/// Invalid pointer
class FXAPI FXPointerException : public FXErrorException {
private:
static const FXchar exceptionName[];
public:
FXPointerException():FXErrorException(FXPointerException::exceptionName){}
FXPointerException(const FXchar *msg):FXErrorException(msg){}
};
/// Generic resource exception
class FXAPI FXResourceException : public FXException {
private:
static const FXchar exceptionName[];
public:
FXResourceException():FXException(FXResourceException::exceptionName){}
FXResourceException(const FXchar *msg):FXException(msg){}
};
/// Out of memory
class FXAPI FXMemoryException : public FXResourceException {
private:
static const FXchar exceptionName[];
public:
FXMemoryException():FXResourceException(FXMemoryException::exceptionName){}
FXMemoryException(const FXchar *msg):FXResourceException(msg){}
};
/// Window exception
class FXAPI FXWindowException : public FXResourceException {
private:
static const FXchar exceptionName[];
public:
FXWindowException():FXResourceException(FXWindowException::exceptionName){}
FXWindowException(const FXchar *msg):FXResourceException(msg){}
};
/// Image, cursor, bitmap exception
class FXAPI FXImageException : public FXResourceException {
private:
static const FXchar exceptionName[];
public:
FXImageException():FXResourceException(FXImageException::exceptionName){}
FXImageException(const FXchar *msg):FXResourceException(msg){}
};
/// Font exception
class FXAPI FXFontException : public FXResourceException {
private:
static const FXchar exceptionName[];
public:
FXFontException():FXResourceException(FXFontException::exceptionName){}
FXFontException(const FXchar *msg):FXResourceException(msg){}
};
}
#endif
fox-1.6.49/include/FXBitmapView.h 0000664 0001750 0001750 00000011224 12130340076 013427 0000000 0000000 /********************************************************************************
* *
* B i t m a p V i e w W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2000,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXBitmapView.h,v 1.8 2006/01/22 17:57:59 fox Exp $ *
********************************************************************************/
#ifndef FXBITMAPVIEW_H
#define FXBITMAPVIEW_H
#ifndef FXSCROLLAREA_H
#include "FXScrollArea.h"
#endif
namespace FX {
class FXBitmap;
/// Bitmap alignment styles
enum {
BITMAPVIEW_NORMAL = 0, /// Normal mode is centered
BITMAPVIEW_CENTER_X = 0, /// Centered horizontally
BITMAPVIEW_LEFT = 0x00100000, /// Left-aligned
BITMAPVIEW_RIGHT = 0x00200000, /// Right-aligned
BITMAPVIEW_CENTER_Y = 0, /// Centered vertically
BITMAPVIEW_TOP = 0x00400000, /// Top-aligned
BITMAPVIEW_BOTTOM = 0x00800000 /// Bottom-aligned
};
/**
* The Bitmap View widget display a scrollable view of a monochrome bitmap image;
* the bitmap is not owned by the bitmap frame so it must be explicitly deleted
* elsewhere. Thus, a single bitmap image can be displayed inside multiple bitmap
* view widgets.
*/
class FXAPI FXBitmapView : public FXScrollArea {
FXDECLARE(FXBitmapView)
protected:
FXBitmap *bitmap; // Image to view
FXColor onColor; // Color for on pixels
FXColor offColor; // Color for off pixels
FXint grabx; // Grab point x
FXint graby; // Grab point y
protected:
FXBitmapView();
private:
FXBitmapView(const FXBitmapView&);
FXBitmapView &operator=(const FXBitmapView&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onRightBtnPress(FXObject*,FXSelector,void*);
long onRightBtnRelease(FXObject*,FXSelector,void*);
public:
enum {
ID_XYZ=FXScrollArea::ID_LAST,
ID_LAST
};
public:
/// Construct a scroll window
FXBitmapView(FXComposite* p,FXBitmap* bmp=NULL,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Perform layout immediately
virtual void layout();
/// Image view widget can receive focus
virtual bool canFocus() const;
/// Return the width of the contents
virtual FXint getContentWidth();
/// Return the height of the contents
virtual FXint getContentHeight();
/// Change image
void setBitmap(FXBitmap* bmp);
/// Return image
FXBitmap* getBitmap() const { return bitmap; }
/// Set on color
void setOnColor(FXColor clr);
/// Get on color
FXColor getOnColor() const { return onColor; }
/// Set off color
void setOffColor(FXColor clr);
/// Get off color
FXColor getOffColor() const { return offColor; }
/// Set the current alignment.
void setAlignment(FXuint mode);
/// Get the current alignment.
FXuint getAlignment() const;
/// Save list to a stream
virtual void save(FXStream& store) const;
/// Load list from a stream
virtual void load(FXStream& store);
/// Destroy
virtual ~FXBitmapView();
};
}
#endif
fox-1.6.49/include/FXMenuSeparator.h 0000664 0001750 0001750 00000006035 12130340076 014151 0000000 0000000 /********************************************************************************
* *
* M e n u S e p a r a t o r W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXMenuSeparator.h,v 1.17 2006/01/22 17:58:06 fox Exp $ *
********************************************************************************/
#ifndef FXMENUSEPARATOR_H
#define FXMENUSEPARATOR_H
#ifndef FXWINDOW_H
#include "FXWindow.h"
#endif
namespace FX {
/**
* The menu separator is a simple decorative groove
* used to delineate items in a popup menu.
*/
class FXAPI FXMenuSeparator : public FXWindow {
FXDECLARE(FXMenuSeparator)
protected:
FXColor hiliteColor;
FXColor shadowColor;
protected:
FXMenuSeparator();
private:
FXMenuSeparator(const FXMenuSeparator&);
FXMenuSeparator &operator=(const FXMenuSeparator&);
public:
long onPaint(FXObject*,FXSelector,void*);
public:
/// Construct a menu separator
FXMenuSeparator(FXComposite* p,FXuint opts=0);
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Change highlight color
void setHiliteColor(FXColor clr);
/// Get highlight color
FXColor getHiliteColor() const { return hiliteColor; }
/// Change shadow color
void setShadowColor(FXColor clr);
/// Get shadow color
FXColor getShadowColor() const { return shadowColor; }
/// Save menu to a stream
virtual void save(FXStream& store) const;
/// Load menu from a stream
virtual void load(FXStream& store);
};
}
#endif
fox-1.6.49/include/FXMemMap.h 0000664 0001750 0001750 00000007067 12130340076 012546 0000000 0000000 /********************************************************************************
* *
* M e m o r y M a p p e d F i l e *
* *
*********************************************************************************
* Copyright (C) 2004,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXMemMap.h,v 1.8 2006/01/22 17:58:06 fox Exp $ *
********************************************************************************/
#ifndef FXMEMMAP_H
#define FXMEMMAP_H
namespace FX {
/**
* A Memory Map provides a view of a file as an array of memory;
* this allows the file itself to be used as backing for the data
* and very simplified file access results.
* Moreover, mapped files may be shared by processes, resuling
* in far less "real" memory being used than would otherwise be
* the case.
*/
class FXAPI FXMemMap {
private:
void* mapbase; // Memory base where it is mapped
long maplength; // Length of the map
long mapoffset; // Offset of the map
FXInputHandle handle; // Handle for the map
FXInputHandle file; // Handle for the file
private:
FXMemMap(const FXMemMap&);
FXMemMap &operator=(const FXMemMap&);
public:
/// Memory map access modes
enum {
NONE = 0, /// Map is inaccessible
READ = 1, /// Readable
WRITE = 2, /// Writable
EXEC = 4, /// Executable (where supported)
TRUNC = 8 /// Truncate file to 0
};
/// Share mode
enum {
PRIV = 0, /// Private
SHAR = 1 /// Shared
};
public:
/// Construct a memory map
FXMemMap();
/// Map a view of the file; the offset must be a multiple of the page size
void* mapFile(const FXString& filename,long off=0,long len=-1L,FXuint access=READ,FXuint share=PRIV);
/// Unmap the view of the file
void* unmap();
/// Synchronize disk
void sync();
/// Return pointer to memory area
void* base() const { return mapbase; }
/// Obtain length of the map
long length() const { return maplength; }
/// Obtain offset of the map
long offset() const { return mapoffset; }
/// Destroy the map
~FXMemMap();
};
}
#endif
fox-1.6.49/include/FXApp.h 0000664 0001750 0001750 00000102132 12130340076 012077 0000000 0000000 /********************************************************************************
* *
* A p p l i c a t i o n O b j e c t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXApp.h,v 1.230 2006/01/22 17:57:58 fox Exp $ *
********************************************************************************/
#ifndef FXAPP_H
#define FXAPP_H
#ifndef FXOBJECT_H
#include "FXObject.h"
#endif
namespace FX {
// Forward declarations
class FXApp;
class FXWindow;
class FXIcon;
class FXBitmap;
class FXCursor;
class FXRootWindow;
class FXMainWindow;
class FXPopup;
class FXFont;
class FXDC;
class FXDCWindow;
class FXVisual;
class FXGLVisual;
class FXGLContext;
class FXTranslator;
class FXComposeContext;
// Opaque FOX objects
struct FXTimer;
struct FXChore;
struct FXSignal;
struct FXRepaint;
struct FXInput;
struct FXInvocation;
/// File input modes for addInput
enum FXInputMode {
INPUT_NONE = 0, /// Inactive
INPUT_READ = 1, /// Read input fd
INPUT_WRITE = 2, /// Write input fd
INPUT_EXCEPT = 4 /// Except input fd
};
/// All ways of being modal
enum FXModality {
MODAL_FOR_NONE, /// Non modal event loop (dispatch normally)
MODAL_FOR_WINDOW, /// Modal dialog (beep if outside of modal dialog)
MODAL_FOR_POPUP /// Modal for popup (always dispatch to popup)
};
/// Default cursors provided by the application
enum FXDefaultCursor {
DEF_ARROW_CURSOR, /// Arrow cursor
DEF_RARROW_CURSOR, /// Reverse arrow cursor
DEF_TEXT_CURSOR, /// Text cursor
DEF_HSPLIT_CURSOR, /// Horizontal split cursor
DEF_VSPLIT_CURSOR, /// Vertical split cursor
DEF_XSPLIT_CURSOR, /// Cross split cursor
DEF_SWATCH_CURSOR, /// Color swatch drag cursor
DEF_MOVE_CURSOR, /// Move cursor
DEF_DRAGH_CURSOR, /// Resize horizontal edge
DEF_DRAGV_CURSOR, /// Resize vertical edge
DEF_DRAGTL_CURSOR, /// Resize upper-leftcorner
DEF_DRAGBR_CURSOR=DEF_DRAGTL_CURSOR, /// Resize bottom-right corner
DEF_DRAGTR_CURSOR, /// Resize upper-right corner
DEF_DRAGBL_CURSOR=DEF_DRAGTR_CURSOR, /// Resize bottom-left corner
DEF_DNDSTOP_CURSOR, /// Drag and drop stop
DEF_DNDCOPY_CURSOR, /// Drag and drop copy
DEF_DNDMOVE_CURSOR, /// Drag and drop move
DEF_DNDLINK_CURSOR, /// Drag and drop link
DEF_CROSSHAIR_CURSOR, /// Cross hair cursor
DEF_CORNERNE_CURSOR, /// North-east cursor
DEF_CORNERNW_CURSOR, /// North-west cursor
DEF_CORNERSE_CURSOR, /// South-east cursor
DEF_CORNERSW_CURSOR, /// South-west cursor
DEF_HELP_CURSOR, /// Help arrow cursor
DEF_HAND_CURSOR, /// Hand cursor
DEF_ROTATE_CURSOR, /// Rotate cursor
DEF_WAIT_CURSOR /// Wait cursor
};
/// FOX Event
struct FXAPI FXEvent {
FXuint type; /// Event type
FXuint time; /// Time of last event
FXint win_x; /// Window-relative x-coord
FXint win_y; /// Window-relative y-coord
FXint root_x; /// Root x-coord
FXint root_y; /// Root y-coord
FXint state; /// Mouse button and modifier key state
FXint code; /// Button, Keysym, or mode; DDE Source
FXString text; /// Text of keyboard event
FXint last_x; /// Window-relative x-coord of previous mouse location
FXint last_y; /// Window-relative y-coord of previous mouse location
FXint click_x; /// Window-relative x-coord of mouse press
FXint click_y; /// Window-relative y-coord of mouse press
FXint rootclick_x; /// Root-relative x-coord of mouse press
FXint rootclick_y; /// Root-relative y-coord of mouse press
FXuint click_time; /// Time of mouse button press
FXuint click_button; /// Mouse button pressed
FXint click_count; /// Click-count
FXbool moved; /// Moved cursor since press
FXRectangle rect; /// Rectangle
FXbool synthetic; /// True if synthetic expose event
FXDragType target; /// Target drag type being requested
};
/// Application Object
class FXAPI FXApp : public FXObject {
FXDECLARE(FXApp)
// We've got many friends
friend class FXId;
friend class FXBitmap;
friend class FXImage;
friend class FXIcon;
friend class FXCursor;
friend class FXDrawable;
friend class FXWindow;
friend class FXShell;
friend class FXRootWindow;
friend class FXTopWindow;
friend class FXMainWindow;
friend class FXPopup;
friend class FXFont;
friend class FXVisual;
friend class FXGLVisual;
friend class FXGLContext;
friend class FXDC;
friend class FXDCWindow;
friend class FXDragCorner;
friend class FXDockHandler;
friend class FXComposeContext;
private:
// Platform independent private data
void *display; // Display we're talking to
const FXchar *dpy; // Initial display guess
FXHash hash; // Window handle hash table
FXRegistry registry; // Application setting registry
FXWindow *activeWindow; // Active toplevel window
FXWindow *cursorWindow; // Window under the cursor
FXWindow *mouseGrabWindow; // Window which grabbed the mouse
FXWindow *keyboardGrabWindow; // Window which grabbed the keyboard
FXWindow *keyWindow; // Window in which keyboard key was pressed
FXWindow *selectionWindow; // Selection window
FXWindow *clipboardWindow; // Clipboard window
FXWindow *dropWindow; // Drop target window
FXWindow *dragWindow; // Drag source window
FXWindow *refresher; // GUI refresher pointer
FXWindow *refresherstop; // GUI refresher end pointer
FXPopup *popupWindow; // Current popup window
FXRootWindow *root; // Root window
FXVisual *monoVisual; // Monochrome visual
FXVisual *defaultVisual; // Default [color] visual
FXTimer *timers; // List of timers, sorted by time
FXChore *chores; // List of chores
FXRepaint *repaints; // Unhandled repaint rectangles
FXTimer *timerrecs; // List of recycled timer records
FXChore *chorerecs; // List of recycled chore records
FXRepaint *repaintrecs; // List of recycled repaint records
FXInvocation *invocation; // Modal loop invocation
FXSignal *signals; // Array of signal records
FXint nsignals; // Number of signals
FXFont *normalFont; // Normal font
FXFont *stockFont; // Stock font
FXMutex appMutex; // Application wide mutex
FXEvent event; // Event
FXuint stickyMods; // Sticky modifier state
FXInput *inputs; // Input file descriptors being watched
FXint ninputs; // Number of inputs
FXint maxinput; // Maximum input number
FXuchar *ddeData; // DDE array
FXuint ddeSize; // DDE array size
FXuint maxcolors; // Maximum number of colors to allocate
FXuint typingSpeed; // Typing speed
FXuint clickSpeed; // Double click speed
FXuint scrollSpeed; // Scroll speed
FXuint scrollDelay; // Scroll delay
FXuint blinkSpeed; // Cursor blink speed
FXuint animSpeed; // Animation speed
FXuint menuPause; // Menu popup delay
FXuint tooltipPause; // Tooltip popup delay
FXuint tooltipTime; // Tooltip display time
FXint dragDelta; // Minimum distance considered a move
FXint wheelLines; // Scroll by this many lines
FXint scrollBarSize; // Scrollbar size
FXColor borderColor; // Border color
FXColor baseColor; // Background color of GUI controls
FXColor hiliteColor; // Highlight color of GUI controls
FXColor shadowColor; // Shadow color of GUI controls
FXColor backColor; // Background color
FXColor foreColor; // Foreground color
FXColor selforeColor; // Select foreground color
FXColor selbackColor; // Select background color
FXColor tipforeColor; // Tooltip foreground color
FXColor tipbackColor; // Tooltip background color
FXColor selMenuTextColor; // Select foreground color in menus
FXColor selMenuBackColor; // Select background color in menus
FXCursor *waitCursor; // Current wait cursor
FXuint waitCount; // Number of times wait cursor was called
FXuint windowCount; // Number of windows
FXCursor *cursor[DEF_WAIT_CURSOR+1];
FXTranslator *translator; // Message translator
FXint appArgc; // Argument count
const FXchar *const *appArgv; // Argument vector
const FXchar *inputmethod; // Input method name
const FXchar *inputstyle; // Input method style
bool initialized; // Has been initialized
private:
static FXApp *app; // Application pointer
// Platform dependent private stuff
#ifndef WIN32
private:
FXID wmDeleteWindow; // Catch delete window
FXID wmQuitApp; // Catch quit application
FXID wmProtocols; // Window manager protocols
FXID wmMotifHints; // Motif hints
FXID wmTakeFocus; // Focus explicitly set by app
FXID wmState; // Window state
FXID wmNetState; // Extended Window Manager window state
FXID wmNetIconName; // Extended Window Manager icon name
FXID wmNetWindowName; // Extended Window Manager window name
FXID wmNetSupported; // Extended Window Manager states list
FXID wmNetWindowType; // Extended Window Manager types
FXID wmNetHMaximized; // Extended Window Manager horizontally maximized
FXID wmNetVMaximized; // Extended Window Manager vertically maximized
FXID wmNetMoveResize; // Extended Window Manager drag corner
FXID wmNetPing; // Extended Window Manager ping
FXID wmNetTypes[8]; // Extended Window Manager window types
FXID wmNetStates[12]; // Extended Window Manager state
FXID wmWindowRole; // Window Role
FXID wmClientLeader; // Client leader
FXID wmClientId; // Client id
FXID embedAtom; // XEMBED support
FXID embedInfoAtom; // XEMBED info support
FXID timestampAtom; // Server time
FXID ddeTargets; // DDE targets atom
FXID ddeAtom; // DDE exchange atom
FXID ddeDelete; // DDE delete target atom
FXID ddeIncr; // DDE incremental data exchange atom
FXDragType *ddeTypeList; // DDE drop type list
FXuint ddeNumTypes; // DDE number of drop types
FXDragAction ddeAction; // DDE action
FXDragAction ansAction; // Reply action
FXID xcbSelection; // Clipboard selection
FXDragType *xcbTypeList; // Clipboard type list
FXuint xcbNumTypes; // Clipboard number of types on list
FXDragType *xselTypeList; // Selection type list
FXuint xselNumTypes; // Selection number of types on list
FXDragType *xdndTypeList; // XDND type list
FXuint xdndNumTypes; // XDND number of types
FXID xdndProxy; // XDND proxy atom
FXID xdndAware; // XDND awareness atom
FXID xdndEnter; // XDND enter window message
FXID xdndLeave; // XDND leave window message
FXID xdndPosition; // XDND position update message
FXID xdndStatus; // XDND status feedback message
FXID xdndDrop; // XDND drop message
FXID xdndFinished; // XDND finished message
FXID xdndSelection; // XDND selection atom
FXID xdndActionMove; // XDND Move action
FXID xdndActionCopy; // XDND Copy action
FXID xdndActionLink; // XDND Link action
FXID xdndActionPrivate; // XDND Private action
FXID xdndTypes; // XDND types list atom
FXID xdndSource; // XDND drag source window
FXID xdndTarget; // XDND drop target window
FXID xdndProxyTarget; // XDND window to set messages to
FXbool xdndStatusPending; // XDND waiting for status feedback
FXbool xdndStatusReceived; // XDND received at least one status
FXbool xdndWantUpdates; // XDND target wants new positions while in rect
FXbool xdndFinishSent; // XDND finish sent
FXRectangle xdndRect; // XDND rectangle bounding target
FXint xrreventbase; // XRR event base
FXID stipples[23]; // Standard stipple patterns
void *r_fds; // Set of file descriptors for read
void *w_fds; // Set of file descriptors for write
void *e_fds; // Set of file descriptors for exceptions
void *xim; // Input method
FXbool shmi; // Use XSHM Image possible
FXbool shmp; // Use XSHM Pixmap possible
FXbool synchronize; // Synchronized
#else
FXushort ddeTargets; // DDE targets atom
FXushort ddeAtom; // DDE Exchange Atom
FXDragType ddeDelete; // DDE Delete Target Atom
FXDragType *ddeTypeList; // DDE drop type list
FXuint ddeNumTypes; // DDE number of drop types
FXDragAction ddeAction; // DDE action
FXDragAction ansAction; // Reply action
FXDragType *xselTypeList; // Selection type list
FXuint xselNumTypes; // Selection number of types on list
void* xdndTypes; // Handle to file mapping object for types list
FXushort xdndAware; // XDND awareness atom
FXID xdndSource; // XDND drag source window
FXID xdndTarget; // XDND drop target window
FXbool xdndStatusPending; // XDND waiting for status feedback
FXbool xdndFinishPending; // XDND waiting for drop-confirmation
FXbool xdndStatusReceived; // XDND received at least one status
FXbool xdndFinishSent; // XDND finish sent
FXRectangle xdndRect; // XDND rectangle bounding target
FXID stipples[17]; // Standard stipple bitmaps
void **handles; // Waitable object handles
#endif
private:
// Internal helper functions
FXApp(const FXApp&);
FXApp &operator=(const FXApp&);
static void signalhandler(int sig);
static void immediatesignalhandler(int sig);
void leaveWindow(FXWindow *window,FXWindow *ancestor);
void enterWindow(FXWindow *window,FXWindow *ancestor);
void selectionSetData(const FXWindow* window,FXDragType type,FXuchar* data,FXuint size);
void selectionGetData(const FXWindow* window,FXDragType type,FXuchar*& data,FXuint& size);
void selectionGetTypes(const FXWindow* window,FXDragType*& types,FXuint& numtypes);
void clipboardSetData(const FXWindow* window,FXDragType type,FXuchar* data,FXuint size);
void clipboardGetData(const FXWindow* window,FXDragType type,FXuchar*& data,FXuint& size);
void clipboardGetTypes(const FXWindow* window,FXDragType*& types,FXuint& numtypes);
void dragdropSetData(const FXWindow* window,FXDragType type,FXuchar* data,FXuint size);
void dragdropGetData(const FXWindow* window,FXDragType type,FXuchar*& data,FXuint& size);
void dragdropGetTypes(const FXWindow* window,FXDragType*& types,FXuint& numtypes);
#ifndef WIN32
void addRepaint(FXID win,FXint x,FXint y,FXint w,FXint h,FXbool synth=0);
void removeRepaints(FXID win,FXint x,FXint y,FXint w,FXint h);
void scrollRepaints(FXID win,FXint dx,FXint dy);
static void imcreatecallback(void*,FXApp*,void*);
static void imdestroycallback(void*,FXApp*,void*);
#else
static FXival CALLBACK wndproc(FXID hwnd,FXuint iMsg,FXuval wParam,FXival lParam);
protected:
virtual FXival dispatchEvent(FXID hwnd,FXuint iMsg,FXuval wParam,FXival lParam);
#endif
protected:
/// Return TRUE when new raw event is available
virtual bool getNextEvent(FXRawEvent& ev,bool blocking=true);
/// Dispatch raw event
virtual bool dispatchEvent(FXRawEvent& ev);
public:
long onCmdQuit(FXObject*,FXSelector,void*);
long onCmdDump(FXObject*,FXSelector,void*);
long onCmdHover(FXObject*,FXSelector,void*);
public:
/// Messages applications understand
enum {
ID_QUIT=1, /// Terminate the application normally
ID_DUMP, /// Dump the current widget tree
ID_HOVER,
ID_LAST
};
public:
/// Information
static const FXuchar copyright[]; /// Copyright notice of library
public:
/**
* Construct application object; the name and vendor strings are used
* as keys into the registry database for this application's settings.
* Only one single application object can be constructed.
*/
FXApp(const FXString& name="Application",const FXString& vendor="FoxDefault");
/// Get application name
const FXString& getAppName() const { return registry.getAppKey(); }
/// Get vendor name
const FXString& getVendorName() const { return registry.getVendorKey(); }
/// Connection to display; this is called by init()
bool openDisplay(const FXchar* dpyname=NULL);
/// Close connection to the display
bool closeDisplay();
/// Return pointer
void* getDisplay() const { return display; }
/// Is application initialized
bool isInitialized() const { return initialized; }
/// Get argument count
FXint getArgc() const { return appArgc; }
/// Get argument vector
const FXchar *const *getArgv() const { return appArgv; }
/// Return true if input method support
bool hasInputMethod() const;
/// Get default visual
FXVisual* getDefaultVisual() const { return defaultVisual; }
/// Change default visual
void setDefaultVisual(FXVisual* vis);
/// Get monochrome visual
FXVisual* getMonoVisual() const { return monoVisual; }
/// Get root Window
FXRootWindow* getRootWindow() const { return root; }
/// Set root Window
void setRootWindow(FXRootWindow* rt);
/// Return window at the end of the focus chain
FXWindow *getFocusWindow() const;
/// Get the window under the cursor, if any
FXWindow *getCursorWindow() const { return cursorWindow; }
/// Get the active toplevel window, if any
FXWindow *getActiveWindow() const { return activeWindow; }
/// Get current popup window, if any
FXPopup* getPopupWindow() const { return popupWindow; }
/// Find window from id
FXWindow* findWindowWithId(FXID xid) const;
/// Find window from root x,y, starting from given window
FXWindow* findWindowAt(FXint rx,FXint ry,FXID window=0) const;
/// Create application's windows
virtual void create();
/// Destroy application's windows
virtual void destroy();
/// Detach application's windows
virtual void detach();
/**
* Add timeout message to be sent to target object in ms milliseconds;
* the timer fires only once after the interval expires. The void* ptr
* is user data which will be passed into the void* ptr of the message
* handler. If a timer with the same target and message already exists,
* it will be rescheduled.
*/
void addTimeout(FXObject* tgt,FXSelector sel,FXuint ms=1000,void* ptr=NULL);
/**
* Remove timeout identified by tgt and sel.
*/
void removeTimeout(FXObject* tgt,FXSelector sel);
/**
* Return TRUE if given timeout has been set
*/
bool hasTimeout(FXObject *tgt,FXSelector sel) const;
/**
* Return, in ms, the time remaining until the given timer fires.
* If the timer is past due, 0 is returned. If there is no such
* timer, infinity (UINT_MAX) is returned.
*/
FXuint remainingTimeout(FXObject *tgt,FXSelector sel);
/**
* Process any timeouts due at this time.
*/
void handleTimeouts();
/**
* Add a idle processing message to be sent to target object when
* the system becomes idle, i.e. there are no events to be processed.
* The void* ptr is user data which will be passed into the void* ptr
* of the message handler. If a chore with the same target and message
* already exists, it will be rescheduled.
*/
void addChore(FXObject* tgt,FXSelector sel,void *ptr=NULL);
/**
* Remove idle processing message identified by tgt and sel.
*/
void removeChore(FXObject* tgt,FXSelector sel);
/**
* Return TRUE if given chore has been set
*/
bool hasChore(FXObject *tgt,FXSelector sel) const;
/**
* Add signal processing message to be sent to target object when
* the signal sig is raised; flags are to be set as per POSIX definitions.
* When immediate is TRUE, the message will be sent to the target right away;
* this should be used with extreme care as the application is interrupted
* at an unknown point in its execution.
*/
void addSignal(FXint sig,FXObject* tgt,FXSelector sel,FXbool immediate=FALSE,FXuint flags=0);
/// Remove signal message for signal sig
void removeSignal(FXint sig);
/**
* Add a file descriptor fd to be watched for activity as determined
* by mode, where mode is a bitwise OR (INPUT_READ, INPUT_WRITE, INPUT_EXCEPT).
* A message of type SEL_IO_READ, SEL_IO_WRITE, or SEL_IO_EXCEPT will be sent
* to the target when the specified activity is detected on the file descriptor.
*/
bool addInput(FXInputHandle fd,FXuint mode,FXObject *tgt,FXSelector sel);
/**
* Remove input message and target object for the specified file descriptor
* and mode, which is a bitwise OR of (INPUT_READ, INPUT_WRITE, INPUT_EXCEPT).
*/
bool removeInput(FXInputHandle fd,FXuint mode);
/// Return key state of given key
bool getKeyState(FXuint keysym) const;
/// Peek to determine if there's an event
bool peekEvent();
/// Perform one event dispatch; return true if event was dispatched
bool runOneEvent(bool blocking=true);
/**
* Run the main application event loop until stop() is called,
* and return the exit code passed as argument to stop().
*/
FXint run();
/**
* Run an event loop till some flag becomes non-zero, and
* then return.
*/
FXint runUntil(FXuint& condition);
/**
* Run event loop while events are available, non-modally.
* Return when no more events, timers, or chores are outstanding.
*/
FXint runWhileEvents();
/**
* Run event loop while there are events are available in the queue.
* Returns 1 when all events in the queue have been handled, and 0 when
* the event loop was terminated due to stop() or stopModal().
* Except for the modal window and its children, user input to all windows
* is blocked; if the modal window is NULL, all user input is blocked.
*/
FXint runModalWhileEvents(FXWindow* window=NULL);
/**
* Run modal event loop, blocking keyboard and mouse events to all windows
* until stopModal is called.
*/
FXint runModal();
/**
* Run a modal event loop for the given window, until stop() or stopModal() is
* called. Except for the modal window and its children, user input to all
* windows is blocked; if the modal window is NULL all user input is blocked.
*/
FXint runModalFor(FXWindow* window);
/**
* Run modal while window is shown, or until stop() or stopModal() is called.
* Except for the modal window and its children, user input to all windows
* is blocked; if the modal window is NULL all user input is blocked.
*/
FXint runModalWhileShown(FXWindow* window);
/**
* Run popup menu while shown, until stop() or stopModal() is called.
* Also returns when entering previous cascading popup menu.
*/
FXint runPopup(FXWindow* window);
/// True if the window is modal
bool isModal(FXWindow* window) const;
/// Return window of current modal loop
FXWindow* getModalWindow() const;
/// Return mode of current modal loop
FXModality getModality() const;
/**
* Terminate the outermost event loop, and all inner modal loops;
* All more deeper nested event loops will be terminated with code equal
* to 0, while the outermost event loop will return code equal to value.
*/
void stop(FXint value=0);
/**
* Break out of the matching modal loop, returning code equal to value.
* All deeper nested event loops are terminated with code equal to 0.
*/
void stopModal(FXWindow* window,FXint value=0);
/**
* Break out of the innermost modal loop, returning code equal to value.
*/
void stopModal(FXint value=0);
/// Force GUI refresh
void forceRefresh();
/// Schedule a refresh
void refresh();
/// Flush pending repaints
void flush(bool sync=false);
/**
* Paint all windows marked for repainting.
* On return all the applications windows have been painted.
*/
void repaint();
/**
* Initialize application.
* Parses and removes common command line arguments, reads the registry.
* Finally, if connect is TRUE, it opens the display.
*/
virtual void init(int& argc,char** argv,bool connect=true);
/**
* Exit application.
* Closes the display and writes the registry.
*/
virtual void exit(FXint code=0);
/**
* Return a reference to the registry. The registry keeps
* settings and configuration information for an application,
* which are automatically loaded when the application starts
* up, and saved when the application terminates.
*/
FXRegistry& reg(){ return registry; }
/// Register new DND type
FXDragType registerDragType(const FXString& name) const;
/// Get drag type name
FXString getDragTypeName(FXDragType type) const;
/// Return drag window if a drag operation is in progress
FXWindow* getDragWindow() const { return dragWindow; }
/// Beep
void beep();
/// Return application instance
static inline FXApp* instance(){ return app; }
/// Change default font
void setNormalFont(FXFont* font);
/// Return default font
FXFont* getNormalFont() const { return normalFont; }
/// Begin of wait-cursor block; wait-cursor blocks may be nested.
void beginWaitCursor();
/// End of wait-cursor block
void endWaitCursor();
/// Change to a new wait cursor
void setWaitCursor(FXCursor *cur);
/// Return current wait cursor
FXCursor* getWaitCursor() const { return waitCursor; }
/// Obtain a default cursor
FXCursor* getDefaultCursor(FXDefaultCursor which) const { return cursor[which]; }
/// Change default cursor
void setDefaultCursor(FXDefaultCursor which,FXCursor* cur);
/**
* Write a window and its children, and all resources reachable from this
* window, into the stream store. (EXPERIMENTAL!)
*/
FXbool writeWindow(FXStream& store,FXWindow *window);
/**
* Read a window and its children from the stream store, and append
* it under father; note it is initially not created yet. (EXPERIMENTAL!)
*/
FXbool readWindow(FXStream& store,FXWindow*& window,FXWindow* father,FXWindow* owner);
/**
* Return a reference to the application-wide mutex.
* Normally, the main user interface thread holds this mutex,
* insuring that no other threads are modifying data during the
* processing of user interface messages. However, whenever the
* main user interface thread blocks for messages, it releases
* this mutex, to allow other threads to modify the same data.
* When a new message becomes available, the main user interface
* thread regains the mutex prior to dispatching the message.
* Other threads should hold this mutex only for short durations,
* so as to not starve the main user interface thread.
*/
FXMutex& mutex(){ return appMutex; }
/**
* Change message translator.
* The new translator will be owned by FXApp.
*/
void setTranslator(FXTranslator* trans);
/// Return message translator
FXTranslator* getTranslator() const { return translator; }
/// Obtain application-wide settings
FXuint getTypingSpeed() const { return typingSpeed; }
FXuint getClickSpeed() const { return clickSpeed; }
FXuint getScrollSpeed() const { return scrollSpeed; }
FXuint getScrollDelay() const { return scrollDelay; }
FXuint getBlinkSpeed() const { return blinkSpeed; }
FXuint getAnimSpeed() const { return animSpeed; }
FXuint getMenuPause() const { return menuPause; }
FXuint getTooltipPause() const { return tooltipPause; }
FXuint getTooltipTime() const { return tooltipTime; }
FXint getDragDelta() const { return dragDelta; }
FXint getWheelLines() const { return wheelLines; }
FXint getScrollBarSize() const { return scrollBarSize; }
/// Change application-wide settings
void setTypingSpeed(FXuint speed);
void setClickSpeed(FXuint speed);
void setScrollSpeed(FXuint speed);
void setScrollDelay(FXuint delay);
void setBlinkSpeed(FXuint speed);
void setAnimSpeed(FXuint speed);
void setMenuPause(FXuint pause);
void setTooltipPause(FXuint pause);
void setTooltipTime(FXuint time);
void setDragDelta(FXint delta);
void setWheelLines(FXint lines);
void setScrollBarSize(FXint size);
/// Obtain default colors
FXColor getBorderColor() const { return borderColor; }
FXColor getBaseColor() const { return baseColor; }
FXColor getHiliteColor() const { return hiliteColor; }
FXColor getShadowColor() const { return shadowColor; }
FXColor getBackColor() const { return backColor; }
FXColor getForeColor() const { return foreColor; }
FXColor getSelforeColor() const { return selforeColor; }
FXColor getSelbackColor() const { return selbackColor; }
FXColor getTipforeColor() const { return tipforeColor; }
FXColor getTipbackColor() const { return tipbackColor; }
FXColor getSelMenuTextColor() const { return selMenuTextColor; }
FXColor getSelMenuBackColor() const { return selMenuBackColor; }
/// Change default colors
void setBorderColor(FXColor color);
void setBaseColor(FXColor color);
void setHiliteColor(FXColor color);
void setShadowColor(FXColor color);
void setBackColor(FXColor color);
void setForeColor(FXColor color);
void setSelforeColor(FXColor color);
void setSelbackColor(FXColor color);
void setTipforeColor(FXColor color);
void setTipbackColor(FXColor color);
void setSelMenuTextColor(FXColor color);
void setSelMenuBackColor(FXColor color);
/// Get number of existing windows
FXuint getWindowCount() const { return windowCount; }
/// Save
virtual void save(FXStream& store) const;
/// Load
virtual void load(FXStream& store);
/// Dump widget information
void dumpWidgets() const;
/// Destroy the application and all reachable resources
virtual ~FXApp();
};
}
#endif
fox-1.6.49/include/FXTreeList.h 0000664 0001750 0001750 00000053131 12130340076 013116 0000000 0000000 /********************************************************************************
* *
* T r e e L i s t W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXTreeList.h,v 1.101 2006/01/22 17:58:11 fox Exp $ *
********************************************************************************/
#ifndef FXTREELIST_H
#define FXTREELIST_H
#ifndef FXSCROLLAREA_H
#include "FXScrollArea.h"
#endif
namespace FX {
class FXIcon;
class FXFont;
class FXTreeList;
class FXDirList;
/// Tree list styles
enum {
TREELIST_EXTENDEDSELECT = 0, /// Extended selection mode allows for drag-selection of ranges of items
TREELIST_SINGLESELECT = 0x00100000, /// Single selection mode allows up to one item to be selected
TREELIST_BROWSESELECT = 0x00200000, /// Browse selection mode enforces one single item to be selected at all times
TREELIST_MULTIPLESELECT = 0x00300000, /// Multiple selection mode is used for selection of individual items
TREELIST_AUTOSELECT = 0x00400000, /// Automatically select under cursor
TREELIST_SHOWS_LINES = 0x00800000, /// Lines shown
TREELIST_SHOWS_BOXES = 0x01000000, /// Boxes to expand shown
TREELIST_ROOT_BOXES = 0x02000000, /// Display root boxes also
TREELIST_NORMAL = TREELIST_EXTENDEDSELECT
};
/// Tree list Item
class FXAPI FXTreeItem : public FXObject {
FXDECLARE(FXTreeItem)
friend class FXTreeList;
friend class FXDirList;
protected:
FXTreeItem *parent; // Parent item
FXTreeItem *prev; // Previous item
FXTreeItem *next; // Next item
FXTreeItem *first; // First child item
FXTreeItem *last; // Last child item
FXString label; // Text of item
FXIcon *openIcon; // Icon of item
FXIcon *closedIcon; // Icon of item
void *data; // Item user data pointer
FXuint state; // Item state flags
FXint x,y;
private:
FXTreeItem(const FXTreeItem&);
FXTreeItem& operator=(const FXTreeItem&);
protected:
FXTreeItem():parent(NULL),prev(NULL),next(NULL),first(NULL),last(NULL),openIcon(NULL),closedIcon(NULL),data(NULL),state(0),x(0),y(0){}
virtual void draw(const FXTreeList* list,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const;
virtual FXint hitItem(const FXTreeList* list,FXint x,FXint y) const;
public:
enum{
SELECTED = 1, /// Selected
FOCUS = 2, /// Focus
DISABLED = 4, /// Disabled
OPENED = 8, /// Opened
EXPANDED = 16, /// Expanded
HASITEMS = 32, /// Has virtual subitems
DRAGGABLE = 64, /// Draggable
OPENICONOWNED = 128, /// Open icon owned by item
CLOSEDICONOWNED = 256 /// Close icon owned by item
};
public:
/// Constructor
FXTreeItem(const FXString& text,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL):parent(NULL),prev(NULL),next(NULL),first(NULL),last(NULL),label(text),openIcon(oi),closedIcon(ci),data(ptr),state(0),x(0),y(0){}
/// Get parent item
FXTreeItem* getParent() const { return parent; }
/// Get next sibling item
FXTreeItem* getNext() const { return next; }
/// Get previous sibling item
FXTreeItem* getPrev() const { return prev; }
/// Get first child item
FXTreeItem* getFirst() const { return first; }
/// Get las child item
FXTreeItem* getLast() const { return last; }
/// Get item below this one in list
FXTreeItem* getBelow() const;
/// Get item above this one in list
FXTreeItem* getAbove() const;
/// Get number of children of item
FXint getNumChildren() const;
/// Change item label
virtual void setText(const FXString& txt);
/// Get item label
const FXString& getText() const { return label; }
/// Change open icon, deleting the old icon if it was owned
virtual void setOpenIcon(FXIcon* icn,FXbool owned=FALSE);
/// Get open icon
FXIcon* getOpenIcon() const { return openIcon; }
/// Change closed icon, deleting the old icon if it was owned
virtual void setClosedIcon(FXIcon* icn,FXbool owned=FALSE);
/// Get closed icon
FXIcon* getClosedIcon() const { return closedIcon; }
/// Change item user data
void setData(void* ptr){ data=ptr; }
/// Get item user data
void* getData() const { return data; }
/// Make item draw as focused
virtual void setFocus(FXbool focus);
/// Return true if item has focus
FXbool hasFocus() const { return (state&FOCUS)!=0; }
/// Select item
virtual void setSelected(FXbool selected);
/// Return true if this item is selected
FXbool isSelected() const { return (state&SELECTED)!=0; }
/// Make item show as open
virtual void setOpened(FXbool opened);
/// Return true if this item is open
FXbool isOpened() const { return (state&OPENED)!=0; }
/// Expand or collapse item
virtual void setExpanded(FXbool expanded);
/// Return true if this item is expanded into sub items
FXbool isExpanded() const { return (state&EXPANDED)!=0; }
/// Enable or disable item
virtual void setEnabled(FXbool enabled);
/// Return true if this item is enabled
FXbool isEnabled() const { return (state&DISABLED)==0; }
/// Make item draggable
virtual void setDraggable(FXbool draggable);
/// Return true if this item is draggable
FXbool isDraggable() const { return (state&DRAGGABLE)!=0; }
/// Return TRUE if subitems, real or imagined
FXbool hasItems() const { return (state&HASITEMS)!=0; }
/// Change has items flag
void setHasItems(FXbool flag);
/// Return true if descendent of parent item
FXbool isChildOf(const FXTreeItem* item) const;
/// Return true if ancestor of child item
FXbool isParentOf(const FXTreeItem* item) const;
/// Return width of item as drawn in list
virtual FXint getWidth(const FXTreeList* list) const;
/// Return height of item as drawn in list
virtual FXint getHeight(const FXTreeList* list) const;
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Destroy server-side resources
virtual void destroy();
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
/// Destroy item and free icons if owned
virtual ~FXTreeItem();
};
/// Tree item collate function
typedef FXint (*FXTreeListSortFunc)(const FXTreeItem*,const FXTreeItem*);
/**
* A Tree List Widget organizes items in a hierarchical, tree-like fashion.
* Subtrees can be collapsed or expanded by double-clicking on an item
* or by clicking on the optional plus button in front of the item.
* Each item may have a text and optional open-icon as well as a closed-icon.
* The items may be connected by optional lines to show the hierarchical
* relationship.
* When an item's selected state changes, the treelist emits a SEL_SELECTED
* or SEL_DESELECTED message. If an item is opened or closed, a message
* of type SEL_OPENED or SEL_CLOSED is sent. When the subtree under an
* item is expanded, a SEL_EXPANDED or SEL_COLLAPSED message is issued.
* A change of the current item is signified by the SEL_CHANGED message.
* In addition, the tree list sends SEL_COMMAND messages when the user
* clicks on an item, and SEL_CLICKED, SEL_DOUBLECLICKED, and SEL_TRIPLECLICKED
* when the user clicks once, twice, or thrice, respectively.
* When items are added or removed, the tree list sends messages of the
* type SEL_INSERTED or SEL_DELETED.
* In each of these cases, a pointer to the item, if any, is passed in the
* 3rd argument of the message.
*/
class FXAPI FXTreeList : public FXScrollArea {
FXDECLARE(FXTreeList)
protected:
FXTreeItem *firstitem; // First root item
FXTreeItem *lastitem; // Last root item
FXTreeItem *anchoritem; // Selection anchor item
FXTreeItem *currentitem; // Current item
FXTreeItem *extentitem; // Selection extent
FXTreeItem *cursoritem; // Item under cursor
FXTreeItem *viewableitem; // Visible item
FXFont *font; // Font
FXTreeListSortFunc sortfunc; // Item sort function
FXColor textColor; // Text color
FXColor selbackColor; // Selected background color
FXColor seltextColor; // Selected text color
FXColor lineColor; // Line color
FXint treeWidth; // Tree width
FXint treeHeight; // Tree height
FXint visible; // Number of visible items
FXint indent; // Parent to child indentation
FXint grabx; // Grab point x
FXint graby; // Grab point y
FXString lookup; // Lookup string
FXString tip;
FXString help; // Help string
FXbool state; // State of item
protected:
FXTreeList();
virtual FXTreeItem* createItem(const FXString& text,FXIcon* oi,FXIcon* ci,void* ptr);
void sort(FXTreeItem*& f1,FXTreeItem*& t1,FXTreeItem*& f2,FXTreeItem*& t2,int n);
void recompute();
private:
FXTreeList(const FXTreeList&);
FXTreeList& operator=(const FXTreeList&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onEnter(FXObject*,FXSelector,void*);
long onLeave(FXObject*,FXSelector,void*);
long onUngrabbed(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onRightBtnPress(FXObject*,FXSelector,void*);
long onRightBtnRelease(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
long onTipTimer(FXObject*,FXSelector,void*);
long onFocusIn(FXObject*,FXSelector,void*);
long onFocusOut(FXObject*,FXSelector,void*);
long onAutoScroll(FXObject*,FXSelector,void*);
long onClicked(FXObject*,FXSelector,void*);
long onDoubleClicked(FXObject*,FXSelector,void*);
long onTripleClicked(FXObject*,FXSelector,void*);
long onCommand(FXObject*,FXSelector,void*);
long onLookupTimer(FXObject*,FXSelector,void*);
public:
static FXint ascending(const FXTreeItem*,const FXTreeItem*);
static FXint descending(const FXTreeItem*,const FXTreeItem*);
static FXint ascendingCase(const FXTreeItem*,const FXTreeItem*);
static FXint descendingCase(const FXTreeItem*,const FXTreeItem*);
public:
enum {
ID_LOOKUPTIMER=FXScrollArea::ID_LAST,
ID_LAST
};
public:
/// Construct a new, initially empty tree list
FXTreeList(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=TREELIST_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Perform layout
virtual void layout();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Compute and return content width
virtual FXint getContentWidth();
/// Return content height
virtual FXint getContentHeight();
/// Recalculate layout
virtual void recalc();
/// Tree list can receive focus
virtual bool canFocus() const;
/// Move the focus to this window
virtual void setFocus();
/// Remove the focus from this window
virtual void killFocus();
/// Return number of items
FXint getNumItems() const;
/// Return number of visible items
FXint getNumVisible() const { return visible; }
/// Change number of visible items
void setNumVisible(FXint nvis);
/// Return first root item
FXTreeItem* getFirstItem() const { return firstitem; }
/// Return last root item
FXTreeItem* getLastItem() const { return lastitem; }
/// Fill tree list by appending items from array of strings
FXint fillItems(FXTreeItem* father,const FXchar** strings,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL,FXbool notify=FALSE);
/// Fill tree list by appending items from newline separated strings
FXint fillItems(FXTreeItem* father,const FXString& strings,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL,FXbool notify=FALSE);
/// Insert [possibly subclassed] item under father before other item
FXTreeItem* insertItem(FXTreeItem* other,FXTreeItem* father,FXTreeItem* item,FXbool notify=FALSE);
/// Insert item with given text and optional icons, and user-data pointer under father before other item
FXTreeItem* insertItem(FXTreeItem* other,FXTreeItem* father,const FXString& text,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL,FXbool notify=FALSE);
/// Append [possibly subclassed] item as last child of father
FXTreeItem* appendItem(FXTreeItem* father,FXTreeItem* item,FXbool notify=FALSE);
/// Append item with given text and optional icons, and user-data pointer as last child of father
FXTreeItem* appendItem(FXTreeItem* father,const FXString& text,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL,FXbool notify=FALSE);
/// Prepend [possibly subclassed] item as first child of father
FXTreeItem* prependItem(FXTreeItem* father,FXTreeItem* item,FXbool notify=FALSE);
/// Prepend item with given text and optional icons, and user-data pointer as first child of father
FXTreeItem* prependItem(FXTreeItem* father,const FXString& text,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL,FXbool notify=FALSE);
/// Move item under father before other item
FXTreeItem *moveItem(FXTreeItem* other,FXTreeItem* father,FXTreeItem* item);
/// Extract item
FXTreeItem* extractItem(FXTreeItem* item,FXbool notify=FALSE);
/// Remove item
void removeItem(FXTreeItem* item,FXbool notify=FALSE);
/// Remove items in range [fm, to] inclusively
void removeItems(FXTreeItem* fm,FXTreeItem* to,FXbool notify=FALSE);
/// Remove all items from list
void clearItems(FXbool notify=FALSE);
/// Return item width
FXint getItemWidth(const FXTreeItem* item) const { return item->getWidth(this); }
/// Return item height
FXint getItemHeight(const FXTreeItem* item) const { return item->getHeight(this); }
/// Get item at x,y, if any
virtual FXTreeItem* getItemAt(FXint x,FXint y) const;
/**
* Search items by name, beginning from item start. If the start item
* is NULL the search will start at the first, top-most item in the list.
* Flags may be SEARCH_FORWARD or SEARCH_BACKWARD to control the search
* direction; this can be combined with SEARCH_NOWRAP or SEARCH_WRAP
* to control whether the search wraps at the start or end of the list.
* The option SEARCH_IGNORECASE causes a case-insensitive match. Finally,
* passing SEARCH_PREFIX causes searching for a prefix of the item name.
* Return NULL if no matching item is found.
*/
FXTreeItem* findItem(const FXString& name,FXTreeItem* start=NULL,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const;
/**
* Search items by associated user data, beginning from item start. If the
* start item is NULL the search will start at the first, top-most item
* in the list. Flags may be SEARCH_FORWARD or SEARCH_BACKWARD to control
* the search direction; this can be combined with SEARCH_NOWRAP or SEARCH_WRAP
* to control whether the search wraps at the start or end of the list.
*/
FXTreeItem* findItemByData(const void *ptr,FXTreeItem* start=NULL,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const;
/// Scroll to make item visible
virtual void makeItemVisible(FXTreeItem* item);
/// Change item's text
void setItemText(FXTreeItem* item,const FXString& text);
/// Return item's text
FXString getItemText(const FXTreeItem* item) const;
/// Change item's open icon
void setItemOpenIcon(FXTreeItem* item,FXIcon* icon,FXbool owned=FALSE);
/// Return item's open icon, deleting the old icon if it was owned
FXIcon* getItemOpenIcon(const FXTreeItem* item) const;
/// Chance item's closed icon, deleting the old icon if it was owned
void setItemClosedIcon(FXTreeItem* item,FXIcon* icon,FXbool owned=FALSE);
/// Return item's closed icon
FXIcon* getItemClosedIcon(const FXTreeItem* item) const;
/// Change item user-data pointer
void setItemData(FXTreeItem* item,void* ptr) const;
/// Return item user-data pointer
void* getItemData(const FXTreeItem* item) const;
/// Return TRUE if item is selected
FXbool isItemSelected(const FXTreeItem* item) const;
/// Return TRUE if item is current
FXbool isItemCurrent(const FXTreeItem* item) const;
/// Return TRUE if item is visible
FXbool isItemVisible(const FXTreeItem* item) const;
/// Return TRUE if item opened
FXbool isItemOpened(const FXTreeItem* item) const;
/// Return TRUE if item expanded
FXbool isItemExpanded(const FXTreeItem* item) const;
/// Return TRUE if item is a leaf-item, i.e. has no children
FXbool isItemLeaf(const FXTreeItem* item) const;
/// Return TRUE if item is enabled
FXbool isItemEnabled(const FXTreeItem* item) const;
/// Return item hit code: 0 outside, 1 icon, 2 text, 3 box
FXint hitItem(const FXTreeItem* item,FXint x,FXint y) const;
/// Repaint item
void updateItem(FXTreeItem* item) const;
/// Enable item
virtual FXbool enableItem(FXTreeItem* item);
/// Disable item
virtual FXbool disableItem(FXTreeItem* item);
/// Select item
virtual FXbool selectItem(FXTreeItem* item,FXbool notify=FALSE);
/// Deselect item
virtual FXbool deselectItem(FXTreeItem* item,FXbool notify=FALSE);
/// Toggle item selection
virtual FXbool toggleItem(FXTreeItem* item,FXbool notify=FALSE);
/// Extend selection from anchor item to item
virtual FXbool extendSelection(FXTreeItem* item,FXbool notify=FALSE);
/// Deselect all items
virtual FXbool killSelection(FXbool notify=FALSE);
/// Open item
virtual FXbool openItem(FXTreeItem* item,FXbool notify=FALSE);
/// Close item
virtual FXbool closeItem(FXTreeItem* item,FXbool notify=FALSE);
/// Collapse tree
virtual FXbool collapseTree(FXTreeItem* tree,FXbool notify=FALSE);
/// Expand tree
virtual FXbool expandTree(FXTreeItem* tree,FXbool notify=FALSE);
/// Change current item
virtual void setCurrentItem(FXTreeItem* item,FXbool notify=FALSE);
/// Return current item, if any
FXTreeItem* getCurrentItem() const { return currentitem; }
/// Change anchor item
void setAnchorItem(FXTreeItem* item);
/// Return anchor item, if any
FXTreeItem* getAnchorItem() const { return anchoritem; }
/// Return item under cursor, if any
FXTreeItem* getCursorItem() const { return cursoritem; }
/// Sort all items recursively
void sortItems();
/// Sort root items
void sortRootItems();
/// Sort children of item
void sortChildItems(FXTreeItem* item);
/// Return sort function
FXTreeListSortFunc getSortFunc() const { return sortfunc; }
/// Change sort function
void setSortFunc(FXTreeListSortFunc func){ sortfunc=func; }
/// Change text font
void setFont(FXFont* fnt);
/// Return text font
FXFont* getFont() const { return font; }
/// Change parent-child indent amount
void setIndent(FXint in);
/// Return parent-child indent amount
FXint getIndent() const { return indent; }
/// Return normal text color
FXColor getTextColor() const { return textColor; }
/// Change normal text color
void setTextColor(FXColor clr);
/// Return selected text background
FXColor getSelBackColor() const { return selbackColor; }
/// Change selected text background
void setSelBackColor(FXColor clr);
/// Return selected text color
FXColor getSelTextColor() const { return seltextColor; }
/// Change selected text color
void setSelTextColor(FXColor clr);
/// Return line color
FXColor getLineColor() const { return lineColor; }
/// Change line color
void setLineColor(FXColor clr);
/// Return list style
FXuint getListStyle() const;
/// Change list style
void setListStyle(FXuint style);
/// Set the status line help text for this list
void setHelpText(const FXString& text);
/// Get the status line help text for this list
const FXString& getHelpText() const { return help; }
/// Save object to a stream
virtual void save(FXStream& store) const;
/// Load object from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXTreeList();
};
}
#endif
fox-1.6.49/include/FXCP1253Codec.h 0000644 0001750 0001750 00000001106 11637250333 013136 0000000 0000000 #ifndef FXCP1253CODEC_H
#define FXCP1253CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// CP1253 Codec
class FXAPI FXCP1253Codec : public FXTextCodec {
FXDECLARE(FXCP1253Codec)
public:
FXCP1253Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FXCP1253Codec(){}
};
}
#endif
fox-1.6.49/include/FXCheckButton.h 0000664 0001750 0001750 00000013360 12130340076 013574 0000000 0000000 /********************************************************************************
* *
* C h e c k B u t t o n W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXCheckButton.h,v 1.32 2006/01/22 17:57:59 fox Exp $ *
********************************************************************************/
#ifndef FXCHECKBUTTON_H
#define FXCHECKBUTTON_H
#ifndef FXLABEL_H
#include "FXLabel.h"
#endif
namespace FX {
/// CheckButton styles
enum {
CHECKBUTTON_AUTOGRAY = 0x00800000, /// Automatically gray out when not updated
CHECKBUTTON_AUTOHIDE = 0x01000000, /// Automatically hide when not updated
CHECKBUTTON_PLUS = 0x02000000, /// Draw a + for unchecked and - for checked
CHECKBUTTON_NORMAL = JUSTIFY_NORMAL|ICON_BEFORE_TEXT
};
/**
* A Check Button is a tri-state button. Normally, it is either
* TRUE or FALSE, and toggles between TRUE or FALSE whenever it is pressed.
* A third state MAYBE may be set to indicate that no selection has been made yet
* by the user, or that the state is ambiguous.
* When pressed, the Check Button sends a SEL_COMMAND to its target, and the
* message data represents the state of the check button.
* The option CHECKBUTTON_AUTOGRAY (CHECKBUTTON_AUTOHIDE) causes the button to be
* grayed out (hidden) if its handler does not respond to the SEL_UPDATE message.
* With the CHECKBUTTON_PLUS option, the Check Button will draw a + or - sign instead
* of a check. You can use this to make collapsable panels, by hooking up a Check
* Button to a layout manager via the ID_TOGGLE_SHOWN message. This will give a
* similar visual element as collapsing folders in a Tree List.
*/
class FXAPI FXCheckButton : public FXLabel {
FXDECLARE(FXCheckButton)
protected:
FXColor checkColor; // Color of check mark
FXColor boxColor; // Color of check box
FXbool check; // Check state
FXbool oldcheck; // Old check state
protected:
FXCheckButton();
private:
FXCheckButton(const FXCheckButton&);
FXCheckButton &operator=(const FXCheckButton&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onUpdate(FXObject*,FXSelector,void*);
long onEnter(FXObject*,FXSelector,void*);
long onLeave(FXObject*,FXSelector,void*);
long onFocusIn(FXObject*,FXSelector,void*);
long onFocusOut(FXObject*,FXSelector,void*);
long onUngrabbed(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onHotKeyPress(FXObject*,FXSelector,void*);
long onHotKeyRelease(FXObject*,FXSelector,void*);
long onCheck(FXObject*,FXSelector,void*);
long onUncheck(FXObject*,FXSelector,void*);
long onUnknown(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetIntValue(FXObject*,FXSelector,void*);
long onCmdGetIntValue(FXObject*,FXSelector,void*);
public:
/// Construct new check button
FXCheckButton(FXComposite* p,const FXString& text,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=CHECKBUTTON_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Returns true because a check button can receive focus
virtual bool canFocus() const;
/// Get default width
virtual FXint getDefaultWidth();
/// Get default height
virtual FXint getDefaultHeight();
/// Set check button state (TRUE, FALSE or MAYBE)
void setCheck(FXbool state=TRUE,FXbool notify=FALSE);
/// Get check button state (TRUE, FALSE or MAYBE)
FXbool getCheck() const { return check; }
/// Change check button style
void setCheckButtonStyle(FXuint style);
/// Return current check button style
FXuint getCheckButtonStyle() const;
/// Get the box background color
FXColor getBoxColor() const { return boxColor; }
/// Set the box background color
void setBoxColor(FXColor clr);
/// Get the box check color
FXColor getCheckColor() const { return checkColor; }
/// Set the box check color
void setCheckColor(FXColor clr);
/// Save check button to a stream
virtual void save(FXStream& store) const;
/// Load check button from a stream
virtual void load(FXStream& store);
};
}
#endif
fox-1.6.49/include/FXComposeContext.h 0000664 0001750 0001750 00000006654 12130340076 014345 0000000 0000000 /********************************************************************************
* *
* C o m p o s e - C o n t e x t *
* *
*********************************************************************************
* Copyright (C) 2005,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXComposeContext.h,v 1.8 2006/01/22 17:57:59 fox Exp $ *
********************************************************************************/
#ifndef FXCOMPOSECONTEXT_H
#define FXCOMPOSECONTEXT_H
#ifndef FXID_H
#include "FXId.h"
#endif
namespace FX {
class FXApp;
class FXWindow;
/**
* Compose Context manages the state of an input method
* if input method support is enabled.
*/
class FXAPI FXComposeContext : public FXId {
FXDECLARE(FXComposeContext)
protected:
FXWindow *window; // Window we belong to
FXSelector message; // Message to send it
private:
#ifndef WIN32
static int editStartCallback(void*,FXComposeContext*,void*);
static void editDoneCallback(void*,FXComposeContext*,void*);
static void editDrawCallback(void*,FXComposeContext*,void*);
static void editCaretCallback(void*,FXComposeContext*,void*);
static void statusStartCallback(void*,FXComposeContext*,void*);
static void statusDoneCallback(void*,FXComposeContext*,void*);
static void statusDrawCallback(void*,FXComposeContext*,void*);
#endif
protected:
FXComposeContext();
private:
FXComposeContext(const FXComposeContext&);
FXComposeContext &operator=(const FXComposeContext&);
public:
/// Construct compose context for given window
FXComposeContext(FXApp* a,FXWindow* win=NULL,FXSelector sel=0);
/// Create resource
virtual void create();
/// Destroy resource
virtual void destroy();
/// Focus in
void focusIn();
/// Focus out
void focusOut();
/// Set the spot
void setSpot(FXint x,FXint y);
/// Set the area
void setArea(FXint x,FXint y,FXint w,FXint h);
/// Translate key event
FXString translateEvent(FXRawEvent& event);
/// Destructor
virtual ~FXComposeContext();
};
}
#endif
fox-1.6.49/include/FXDockSite.h 0000664 0001750 0001750 00000015371 12130340076 013074 0000000 0000000 /********************************************************************************
* *
* D o c k S i t e W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2004,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXDockSite.h,v 1.30 2006/01/22 17:58:01 fox Exp $ *
********************************************************************************/
#ifndef FXDOCKSITE_H
#define FXDOCKSITE_H
#ifndef FXPACKER_H
#include "FXPacker.h"
#endif
namespace FX {
class FXDockBar;
/// Dock site options
enum {
DOCKSITE_WRAP = 0, /// Dockbars are wrapped to another galley when not enough space on current galley
DOCKSITE_NO_WRAP = 0x00020000 /// Never wrap dockbars to another galley even if not enough space
};
/**
* The dock site widget is a widget where dock bars can be docked.
* Dock site widgets are typically embedded inside the main window, placed
* against those sides where docking of toolbars is to be allowed.
* Dock bars placed inside a dock site are laid out in horizontal or vertical bands
* called galleys. A toolbar with the LAYOUT_DOCK_SAME hint is preferentially placed
* on the same galley as its previous sibling. A dock bar with the LAYOUT_DOCK_NEXT is
* always placed on the next galley.
* Each galley will have at least one dock bar shown in it. Several dock bars
* may be placed side-by-side inside one galley, unless there is insufficient
* room. If there is insufficient room to place another dock bar, that dock bar
* will be moved to the next galley, even though its LAYOUT_DOCK_NEXT option
* is not set. This implies that when the main window is resized and more room
* becomes available, it will jump back to its preferred galley.
* Within a galley, dock bars will be placed from left to right, at the given
* x and y coordinates, with the constraints that the dock bar will stay within
* the galley, and do not overlap each other. It is possible to use LAYOUT_FILL_X
* and/or LAYOUT_FILL_Y to stretch a toolbar to the available space on its galley.
* The galleys are oriented horizontally if the dock site is placed inside
* a top level window using LAYOUT_SIDE_TOP or LAYOUT_SIDE_BOTTOM, and
* vertically oriented if placed with LAYOUT_SIDE_LEFT or LAYOUT_SIDE_RIGHT.
*/
class FXAPI FXDockSite : public FXPacker {
FXDECLARE(FXDockSite)
protected:
FXDockSite(){}
private:
FXDockSite(const FXDockSite&);
FXDockSite &operator=(const FXDockSite&);
protected:
void moveVerBar(FXWindow* bar,FXWindow *begin,FXWindow* end,FXint bx,FXint by);
void moveHorBar(FXWindow* bar,FXWindow *begin,FXWindow* end,FXint bx,FXint by);
FXint galleyWidth(FXWindow *begin,FXWindow*& end,FXint space,FXint& require,FXint& expand) const;
FXint galleyHeight(FXWindow *begin,FXWindow*& end,FXint space,FXint& require,FXint& expand) const;
public:
/**
* Construct a toolbar dock layout manager. Passing LAYOUT_SIDE_TOP or LAYOUT_SIDE_BOTTOM
* causes the toolbar dock to be oriented horizontally. Passing LAYOUT_SIDE_LEFT or
* LAYOUT_SIDE_RIGHT causes it to be oriented vertically.
*/
FXDockSite(FXComposite *p,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=0,FXint pr=0,FXint pt=0,FXint pb=0,FXint hs=0,FXint vs=0);
/**
* Return default width. This is the width the toolbar
* dock would have if no toolbars need to be moved to other
* galleys than they would be logically placed.
*/
virtual FXint getDefaultWidth();
/**
* Return default height. This is the height the toolbar
* dock would have if no toolbars need to be moved to other
* galleys than they would be logically placed.
*/
virtual FXint getDefaultHeight();
/**
* For a vertically oriented dock site, this computes
* the total width of all the galleys based on any "wrapping"
* needed to fit the toolbars on a galley.
*/
virtual FXint getWidthForHeight(FXint h);
/**
* For a horizontally oriented dock site, this computes
* the total height of all the galleys based on any "wrapping"
* needed to fit the toolbars on a galley.
*/
virtual FXint getHeightForWidth(FXint w);
/// Perform layout
virtual void layout();
/**
* Move tool bar, changing its options to suite the new position.
* Used by the toolbar dragging to rearrange the toolbars inside the
* toolbar dock.
*/
virtual void moveToolBar(FXDockBar* bar,FXint barx,FXint bary);
/**
* The dock site is notified that the given bar has been added
* logically before the given window, and is to placed on a new
* galley all by itself. The default implementation adjusts
* the layout options of the bars accordingly.
*/
virtual void dockToolBar(FXDockBar* bar,FXWindow* before);
/**
* The dock site is informed that the given bar has been docked
* at the given coordinates. The default implementation determines
* where to insert the newly docked bar and adjusts the layout
* options of the bars accordingly.
*/
virtual void dockToolBar(FXDockBar* bar,FXint barx,FXint bary);
/**
* The dock site is informed that the given bar has been removed.
* In the default implementation, the dock site fixes the layout
* options of the remaining bars so they stay in the same place
* if possible.
*/
virtual void undockToolBar(FXDockBar* bar);
/// Change wrap option
void wrapGalleys(FXbool wrap);
/// Get wrap option
FXbool wrapGalleys() const;
};
}
#endif
fox-1.6.49/include/FXReplaceDialog.h 0000664 0001750 0001750 00000011413 12130340076 014053 0000000 0000000 /********************************************************************************
* *
* T e x t R e p l a c e D i a l o g *
* *
*********************************************************************************
* Copyright (C) 2000,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXReplaceDialog.h,v 1.22 2006/01/22 17:58:08 fox Exp $ *
********************************************************************************/
#ifndef FXREPLACEDIALOG_H
#define FXREPLACEDIALOG_H
#ifndef FXDIALOGBOX_H
#include "FXDialogBox.h"
#endif
namespace FX {
class FXButton;
class FXLabel;
class FXTextField;
class FXHorizontalFrame;
/// Text replace dialog
class FXAPI FXReplaceDialog : public FXDialogBox {
FXDECLARE(FXReplaceDialog)
protected:
FXLabel *searchlabel;
FXTextField *searchtext;
FXHorizontalFrame *searchbox;
FXLabel *replacelabel;
FXTextField *replacetext;
FXHorizontalFrame *replacebox;
FXButton *accept;
FXButton *cancel;
FXButton *every;
FXuint searchmode;
FXuint current;
protected:
FXReplaceDialog(){}
void appendHistory(const FXString& search,const FXString& replace,FXuint mode);
private:
FXReplaceDialog(const FXReplaceDialog&);
FXReplaceDialog &operator=(const FXReplaceDialog&);
public:
long onCmdAll(FXObject*,FXSelector,void*);
long onCmdNext(FXObject*,FXSelector,void*);
long onUpdDir(FXObject*,FXSelector,void*);
long onCmdDir(FXObject*,FXSelector,void*);
long onUpdMode(FXObject*,FXSelector,void*);
long onCmdMode(FXObject*,FXSelector,void*);
long onSearchKey(FXObject*,FXSelector,void*);
long onReplaceKey(FXObject*,FXSelector,void*);
long onCmdSearchHist(FXObject*,FXSelector,void*);
long onCmdReplaceHist(FXObject*,FXSelector,void*);
long onCmdAccept(FXObject*,FXSelector,void*);
public:
enum{
ID_NEXT=FXDialogBox::ID_LAST,
ID_PREV,
ID_SEARCH_UP,
ID_SEARCH_DN,
ID_REPLACE_UP,
ID_REPLACE_DN,
ID_ALL,
ID_DIR,
ID_SEARCH_TEXT,
ID_REPLACE_TEXT,
ID_MODE,
ID_LAST=ID_MODE+32
};
public:
enum {
DONE = 0, /// Cancel search
SEARCH = 1, /// Search first occurrence
REPLACE = 1, /// Replace first occurrence
SEARCH_NEXT = 2, /// Search next occurrence
REPLACE_NEXT = 2, /// Replace next occurrence
REPLACE_ALL = 3 /// Replace all occurrences
};
public:
/// Construct search and replace dialog box
FXReplaceDialog(FXWindow* owner,const FXString& caption,FXIcon* ic=NULL,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Set text or pattern to search for
void setSearchText(const FXString& text);
/// Return text or pattern the user has entered
FXString getSearchText() const;
/// Set replace text
void setReplaceText(const FXString& text);
/// Return replace text the user has entered
FXString getReplaceText() const;
/// Set search match mode
void setSearchMode(FXuint mode){ searchmode=mode; }
/// Return search mode the user has selected
FXuint getSearchMode() const { return searchmode; }
/// Run modal invocation of the dialog
virtual FXuint execute(FXuint placement=PLACEMENT_CURSOR);
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXReplaceDialog();
};
}
#endif
fox-1.6.49/include/FXIcon.h 0000664 0001750 0001750 00000012144 12130340076 012252 0000000 0000000 /********************************************************************************
* *
* I c o n - O b j e c t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXIcon.h,v 1.29 2006/01/22 17:58:04 fox Exp $ *
********************************************************************************/
#ifndef FXICON_H
#define FXICON_H
#ifndef FXIMAGE_H
#include "FXImage.h"
#endif
namespace FX {
class FXDC;
class FXDCWindow;
class FXDrawable;
class FXTopWindow;
/**
* An Icon is an image with two additional server-side resources: a shape
* bitmap, which is used to mask those pixels where the background should
* be preserved during the drawing, and a etch bitmap, which is used to
* draw the icon when it is disabled.
*/
class FXAPI FXIcon : public FXImage {
FXDECLARE(FXIcon)
friend class FXDC;
friend class FXWindow;
friend class FXDCWindow;
friend class FXDrawable;
friend class FXTopWindow;
protected:
FXID shape; // Shape pixmap
FXID etch; // Etch pixmap
FXColor transp; // Transparency color
protected:
FXIcon(){}
FXColor guesstransp();
private:
FXIcon(const FXIcon&);
FXIcon &operator=(const FXIcon&);
public:
/**
* Create an icon with an initial pixel buffer pix, a transparent color clr,
* and options as in FXImage. The transparent color is used to determine which
* pixel values are transparent, i.e. need to be masked out in the absence of
* a true alpha channel.
* If the flag IMAGE_OPAQUE is passed, the shape and etch bitmaps are generated
* as if the image is fully opaque, even if it has an alpha channel or transparancy
* color. The flag IMAGE_ALPHACOLOR is used to force a specific alpha color instead
* of the alpha channel obtained from the image file.
* Specifying IMAGE_ALPHAGUESS causes Icon to obtain the alpha color from the background
* color of the image; it has the same effect as IMAGE_ALPHACOLOR in the sense that
* the icon will be transparent for those colors matching the alpha color.
*/
FXIcon(FXApp* a,const FXColor *pix=NULL,FXColor clr=0,FXuint opts=0,FXint w=1,FXint h=1);
/**
* Create the server side pixmap, the shape bitmap, and the etch bitmap, then
* call render() to fill it with the pixel data from the client-side buffer. After
* the server-side pixmap and bitmaps have been created, the client-side pixel
* buffer will be deleted unless IMAGE_KEEP has been specified. If the pixel buffer
* is not owned, i.e. the flag IMAGE_OWNED is not set, the pixel buffer will not
* be deleted; however the pixel buffer will be set to NULL.
*/
virtual void create();
/**
* Detach the server side pixmap, shape bitmap, and etch bitmap from the Icon.
* Afterwards, the Icon is left as if it never had a server-side resources.
*/
virtual void detach();
/**
* Destroy the server-side pixmap and the shape bitmap and etch bitmap.
* The client-side pixel buffer is not affected.
*/
virtual void destroy();
/**
* Render the server-side pixmap, shape bitmap and etch bitmap for the icon
* from the client-side pixel buffer.
*/
virtual void render();
/**
* Resize both client-side and server-side representations (if any) to the
* given width and height. The new representations typically contain garbage
* after this operation and need to be re-filled.
*/
virtual void resize(FXint w,FXint h);
/// Obtain transparency color
FXColor getTransparentColor() const { return transp; }
/// Change transparency color
void setTransparentColor(FXColor color){ transp=color; }
/// Destructor
virtual ~FXIcon();
};
}
#endif
fox-1.6.49/include/FXCP865Codec.h 0000644 0001750 0001750 00000001077 11637250333 013075 0000000 0000000 #ifndef FXCP865CODEC_H
#define FXCP865CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// CP865 Codec
class FXAPI FXCP865Codec : public FXTextCodec {
FXDECLARE(FXCP865Codec)
public:
FXCP865Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FXCP865Codec(){}
};
}
#endif
fox-1.6.49/include/FXGLObject.h 0000664 0001750 0001750 00000014631 12130340076 013016 0000000 0000000 /********************************************************************************
* *
* O p e n G L O b j e c t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXGLObject.h,v 1.28.2.3 2006/11/17 16:02:31 fox Exp $ *
********************************************************************************/
#ifndef FXGLOBJECT_H
#define FXGLOBJECT_H
#ifndef FXOBJECT_H
#include "FXObject.h"
#endif
namespace FX {
class FXGLViewer;
class FXGLObject;
/// Basic OpenGL object
class FXAPI FXGLObject : public FXObject {
FXDECLARE(FXGLObject)
public:
enum {
ID_LAST=10000 // Leaving ample room for FXGLViewer subclasses
};
public:
/// Constructors
FXGLObject(){}
/// Copy constructor
FXGLObject(const FXGLObject& orig):FXObject(orig){}
/// Called by the viewer to get bounds for this object
virtual void bounds(FXRangef& box);
/// Draw this object in a viewer
virtual void draw(FXGLViewer* viewer);
/// Draw this object for hit-testing purposes
virtual void hit(FXGLViewer* viewer);
/// Copy this object
virtual FXGLObject* copy();
/// Identify sub-object given path
virtual FXGLObject* identify(FXuint* path);
/// Return true if this object can be dragged around
virtual FXbool canDrag() const;
/// Return true if this object can be deleted from the scene
virtual FXbool canDelete() const;
/// Drag this object from one position to another
virtual FXbool drag(FXGLViewer* viewer,FXint fx,FXint fy,FXint tx,FXint ty);
/// Destructor
virtual ~FXGLObject(){}
};
/// List of GL objects
typedef FXObjectListOf FXGLObjectList;
/// Group object
class FXAPI FXGLGroup : public FXGLObject {
FXDECLARE(FXGLGroup)
protected:
FXGLObjectList list; // List of all objects
public:
/// Constructor
FXGLGroup(){ }
/// Copy constructor
FXGLGroup(const FXGLGroup& orig):FXGLObject(orig),list(orig.list){ }
/// Return list of childern
FXGLObjectList& getList(){ return list; }
/// Return bounding box
virtual void bounds(FXRangef& box);
/// Draw into viewer
virtual void draw(FXGLViewer* viewer);
/// Hit in viewer
virtual void hit(FXGLViewer* viewer);
/// Copy this object
virtual FXGLObject* copy();
/// Identify object by means of path
virtual FXGLObject* identify(FXuint* path);
/// Return TRUE if group can be dragged
virtual FXbool canDrag() const;
/// Drag group object
virtual FXbool drag(FXGLViewer* viewer,FXint fx,FXint fy,FXint tx,FXint ty);
/// Return number of children
FXint no() const { return list.no(); }
/// Child at position
FXGLObject* child(FXint pos) const { return list[pos]; }
/// Insert child object at given position
void insert(FXint pos,FXGLObject* obj){ list.insert(pos,obj); }
/// Prepend child object
void prepend(FXGLObject* obj){ list.prepend(obj); }
/// Append child object
void append(FXGLObject* obj){ list.append(obj); }
/// Replace child object
void replace(FXint pos,FXGLObject* obj){ list.replace(pos,obj); }
/// Remove child object
void remove(FXGLObject* obj){ list.remove(obj); }
/// Remove child object at given position
void erase(FXint pos){ list.erase(pos); }
/// Remove all children
void clear(){ list.clear(); }
/// Stream save and load
virtual void save(FXStream& store) const;
virtual void load(FXStream& store);
/// Destructor
virtual ~FXGLGroup();
};
/// OpenGL Point Object
class FXAPI FXGLPoint : public FXGLObject {
FXDECLARE(FXGLPoint)
public:
FXVec3f pos;
public:
/// Default constructor
FXGLPoint();
/// Copy constructor
FXGLPoint(const FXGLPoint& orig);
/// Construct with specified coordinates
FXGLPoint(FXfloat x,FXfloat y,FXfloat z);
/// Copy this object
virtual FXGLObject* copy();
/// Called by the viewer to get bounds for this object
virtual void bounds(FXRangef& box);
/// Draw this object in a viewer
virtual void draw(FXGLViewer* viewer);
/// Draw this object for hit-testing purposes
virtual void hit(FXGLViewer* viewer);
/// Save to a stream
virtual void save(FXStream& store) const;
/// Load from a stream
virtual void load(FXStream& store);
};
/// OpenGL Line Object
class FXAPI FXGLLine : public FXGLObject {
FXDECLARE(FXGLLine)
public:
FXGLPoint fm,to;
public:
/// Default constructor
FXGLLine();
/// Copy constructor
FXGLLine(const FXGLLine& orig);
/// Construct with specified endpoints
FXGLLine(FXfloat fx,FXfloat fy,FXfloat fz,FXfloat tx,FXfloat ty,FXfloat tz);
/// Called by the viewer to get bounds for this object
virtual void bounds(FXRangef& box);
/// Draw this object in a viewer
virtual void draw(FXGLViewer* viewer);
/// Copy this object
virtual FXGLObject* copy();
/// Draw this object for hit-testing purposes
virtual void hit(FXGLViewer* viewer);
/// Save to a stream
virtual void save(FXStream& store) const;
/// Load from a stream
virtual void load(FXStream& store);
};
}
#endif
fox-1.6.49/include/FXCanvas.h 0000664 0001750 0001750 00000004746 12130340076 012606 0000000 0000000 /********************************************************************************
* *
* C a n v a s W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXCanvas.h,v 1.21 2006/01/22 17:57:59 fox Exp $ *
********************************************************************************/
#ifndef FXCANVAS_H
#define FXCANVAS_H
#ifndef FXWINDOW_H
#include "FXWindow.h"
#endif
namespace FX {
/// Canvas, an area drawn by another object
class FXAPI FXCanvas : public FXWindow {
FXDECLARE(FXCanvas)
protected:
FXCanvas();
private:
FXCanvas(const FXCanvas&);
FXCanvas &operator=(const FXCanvas&);
public:
long onPaint(FXObject*,FXSelector,void*);
public:
/// Construct new drawing canvas widget
FXCanvas(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=FRAME_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Return TRUE because canvas can receive focus
virtual bool canFocus() const;
};
}
#endif
fox-1.6.49/include/FXRectangle.h 0000664 0001750 0001750 00000012750 12130340076 013271 0000000 0000000 /********************************************************************************
* *
* R e c t a n g l e C l a s s *
* *
*********************************************************************************
* Copyright (C) 1994,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXRectangle.h,v 1.19 2006/01/22 17:58:08 fox Exp $ *
********************************************************************************/
#ifndef FXRECTANGLE_H
#define FXRECTANGLE_H
#ifndef FXPOINT_H
#include "FXPoint.h"
#endif
namespace FX {
/// Rectangle
class FXAPI FXRectangle {
public:
FXshort x;
FXshort y;
FXshort w;
FXshort h;
public:
/// Constructors
FXRectangle(){ }
FXRectangle(FXshort xx,FXshort yy,FXshort ww,FXshort hh):x(xx),y(yy),w(ww),h(hh){ }
FXRectangle(const FXPoint& p,const FXSize& s):x(p.x),y(p.y),w(s.w),h(s.h){ }
FXRectangle(const FXPoint& topleft,const FXPoint& bottomright):x(topleft.x),y(topleft.y),w(bottomright.x-topleft.x+1),h(bottomright.y-topleft.y+1){ }
/// Test if empty
bool empty() const { return w<=0 || h<=0; }
/// Test if zero
bool operator!() const { return x==0 && y==0 && w==0 && h==0; }
/// Equality
bool operator==(const FXRectangle& r) const { return x==r.x && y==r.y && w==r.w && h==r.h; }
bool operator!=(const FXRectangle& r) const { return x!=r.x || y!=r.y || w!=r.w || h!=r.h; }
/// Point in rectangle
bool contains(const FXPoint& p) const { return x<=p.x && y<=p.y && p.x>(FXStream& store,FXRectangle& r);
};
inline bool overlap(const FXRectangle& a,const FXRectangle& b){ return b.x>(FXStream& store,FXRectangle& r);
}
#endif
fox-1.6.49/include/FXDCWindow.h 0000664 0001750 0001750 00000022006 12130340076 013036 0000000 0000000 /********************************************************************************
* *
* D e v i c e C o n t e x t F o r W i n d o w s a n d I m a g e s *
* *
*********************************************************************************
* Copyright (C) 1999,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXDCWindow.h,v 1.46 2006/01/22 17:58:00 fox Exp $ *
********************************************************************************/
#ifndef FXDCWINDOW_H
#define FXDCWINDOW_H
#ifndef FXDC_H
#include "FXDC.h"
#endif
namespace FX {
class FXApp;
class FXDrawable;
class FXImage;
class FXBitmap;
class FXIcon;
class FXFont;
class FXVisual;
/**
* Window Device Context
*
* The Window Device Context allows drawing into an FXDrawable, such as an
* on-screen window (FXWindow and derivatives) or an off-screen image (FXImage
* and its derivatives).
* Because certain hardware resources are locked down, only one FXDCWindow may be
* locked on a drawable at any one time.
*/
class FXAPI FXDCWindow : public FXDC {
friend class FXFont;
protected:
FXDrawable *surface; // Drawable surface
FXVisual *visual; // Visual of drawable
FXRectangle rect; // Paint rectangle inside drawable
#ifndef WIN32
FXuint flags; // GC Flags
FXPixel devfg; // Device foreground pixel value
FXPixel devbg; // Device background pixel value
void *xftDraw; // Hook used only for XFT support
#else
FXID oldpalette;
FXID oldbrush;
FXID oldpen;
FXPixel devfg; // Device foreground pixel value
FXPixel devbg; // Device background pixel value
FXbool needsNewBrush;
FXbool needsNewPen;
FXbool needsPath;
FXbool needsClipReset;
#endif
private:
#ifdef WIN32
void updateBrush();
void updatePen();
#endif
private:
FXDCWindow();
FXDCWindow(const FXDCWindow&);
FXDCWindow &operator=(const FXDCWindow&);
public:
/// Construct for painting in response to expose;
/// This sets the clip rectangle to the exposed rectangle
FXDCWindow(FXDrawable* drawable,FXEvent* event);
/// Construct for normal drawing;
/// This sets clip rectangle to the whole drawable
FXDCWindow(FXDrawable* drawable);
/// Begin locks in a drawable surface
void begin(FXDrawable *drawable);
/// End unlock the drawable surface
void end();
/// Read back pixel
virtual FXColor readPixel(FXint x,FXint y);
/// Draw points
virtual void drawPoint(FXint x,FXint y);
virtual void drawPoints(const FXPoint* points,FXuint npoints);
virtual void drawPointsRel(const FXPoint* points,FXuint npoints);
/// Draw lines
virtual void drawLine(FXint x1,FXint y1,FXint x2,FXint y2);
virtual void drawLines(const FXPoint* points,FXuint npoints);
virtual void drawLinesRel(const FXPoint* points,FXuint npoints);
virtual void drawLineSegments(const FXSegment* segments,FXuint nsegments);
/// Draw rectangles
virtual void drawRectangle(FXint x,FXint y,FXint w,FXint h);
virtual void drawRectangles(const FXRectangle* rectangles,FXuint nrectangles);
/// Draw rounded rectangle with ellipse with ew and ellips height eh
virtual void drawRoundRectangle(FXint x,FXint y,FXint w,FXint h,FXint ew,FXint eh);
/// Draw arcs
virtual void drawArc(FXint x,FXint y,FXint w,FXint h,FXint ang1,FXint ang2);
virtual void drawArcs(const FXArc* arcs,FXuint narcs);
/// Draw ellipse
virtual void drawEllipse(FXint x,FXint y,FXint w,FXint h);
/// Filled rectangles
virtual void fillRectangle(FXint x,FXint y,FXint w,FXint h);
virtual void fillRectangles(const FXRectangle* rectangles,FXuint nrectangles);
/// Filled rounded rectangle with ellipse with ew and ellips height eh
virtual void fillRoundRectangle(FXint x,FXint y,FXint w,FXint h,FXint ew,FXint eh);
/// Fill chord
virtual void fillChord(FXint x,FXint y,FXint w,FXint h,FXint ang1,FXint ang2);
virtual void fillChords(const FXArc* chords,FXuint nchords);
/// Draw arcs
virtual void fillArc(FXint x,FXint y,FXint w,FXint h,FXint ang1,FXint ang2);
virtual void fillArcs(const FXArc* arcs,FXuint narcs);
/// Fill ellipse
virtual void fillEllipse(FXint x,FXint y,FXint w,FXint h);
/// Filled polygon
virtual void fillPolygon(const FXPoint* points,FXuint npoints);
virtual void fillConcavePolygon(const FXPoint* points,FXuint npoints);
virtual void fillComplexPolygon(const FXPoint* points,FXuint npoints);
/// Filled polygon with relative points
virtual void fillPolygonRel(const FXPoint* points,FXuint npoints);
virtual void fillConcavePolygonRel(const FXPoint* points,FXuint npoints);
virtual void fillComplexPolygonRel(const FXPoint* points,FXuint npoints);
/// Draw hashed box
virtual void drawHashBox(FXint x,FXint y,FXint w,FXint h,FXint b=1);
/// Draw focus rectangle
virtual void drawFocusRectangle(FXint x,FXint y,FXint w,FXint h);
/// Draw area from source
virtual void drawArea(const FXDrawable* source,FXint sx,FXint sy,FXint sw,FXint sh,FXint dx,FXint dy);
/// Draw area stretched area from source
virtual void drawArea(const FXDrawable* source,FXint sx,FXint sy,FXint sw,FXint sh,FXint dx,FXint dy,FXint dw,FXint dh);
/// Draw image
virtual void drawImage(const FXImage* image,FXint dx,FXint dy);
/// Draw bitmap
virtual void drawBitmap(const FXBitmap* bitmap,FXint dx,FXint dy);
/// Draw icon
virtual void drawIcon(const FXIcon* icon,FXint dx,FXint dy);
virtual void drawIconShaded(const FXIcon* icon,FXint dx,FXint dy);
virtual void drawIconSunken(const FXIcon* icon,FXint dx,FXint dy);
/// Draw string with base line starting at x, y
virtual void drawText(FXint x,FXint y,const FXString& string);
virtual void drawText(FXint x,FXint y,const FXchar* string,FXuint length);
/// Draw text starting at x, y over filled background
virtual void drawImageText(FXint x,FXint y,const FXString& string);
virtual void drawImageText(FXint x,FXint y,const FXchar* string,FXuint length);
/// Set foreground/background drawing color
virtual void setForeground(FXColor clr);
virtual void setBackground(FXColor clr);
/// Set dash pattern
virtual void setDashes(FXuint dashoffset,const FXchar *dashpattern,FXuint dashlength);
/// Set line width
virtual void setLineWidth(FXuint linewidth=0);
/// Set line cap style
virtual void setLineCap(FXCapStyle capstyle=CAP_BUTT);
/// Set line join style
virtual void setLineJoin(FXJoinStyle joinstyle=JOIN_MITER);
/// Set line style
virtual void setLineStyle(FXLineStyle linestyle=LINE_SOLID);
/// Set fill style
virtual void setFillStyle(FXFillStyle fillstyle=FILL_SOLID);
/// Set fill rule
virtual void setFillRule(FXFillRule fillrule=RULE_EVEN_ODD);
/// Set blit function
virtual void setFunction(FXFunction func=BLT_SRC);
/// Set the tile
virtual void setTile(FXImage* tile,FXint dx=0,FXint dy=0);
/// Set the stipple pattern
virtual void setStipple(FXBitmap *stipple,FXint dx=0,FXint dy=0);
/// Set the stipple pattern
virtual void setStipple(FXStipplePattern stipple,FXint dx=0,FXint dy=0);
/// Set clip region
virtual void setClipRegion(const FXRegion& region);
/// Set clip rectangle
virtual void setClipRectangle(FXint x,FXint y,FXint w,FXint h);
/// Set clip rectangle
virtual void setClipRectangle(const FXRectangle& rectangle);
/// Clear clipping
virtual void clearClipRectangle();
/// Set clip mask
virtual void setClipMask(FXBitmap* mask,FXint dx=0,FXint dy=0);
/// Clear clip mask
virtual void clearClipMask();
/// Set font to draw text with
virtual void setFont(FXFont *fnt);
/// Clip against child windows
virtual void clipChildren(FXbool yes);
/// Destructor
virtual ~FXDCWindow();
};
}
#endif
fox-1.6.49/include/FXVec3f.h 0000664 0001750 0001750 00000021664 12130340076 012337 0000000 0000000 /********************************************************************************
* *
* S i n g l e - P r e c i s i o n 3 - E l e m e n t V e c t o r *
* *
*********************************************************************************
* Copyright (C) 1994,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXVec3f.h,v 1.26 2006/01/22 17:58:12 fox Exp $ *
********************************************************************************/
#ifndef FXVEC3F_H
#define FXVEC3F_H
namespace FX {
class FXMat3f;
class FXMat4f;
/// Single-precision 3-element vector
class FXAPI FXVec3f {
public:
FXfloat x;
FXfloat y;
FXfloat z;
public:
/// Default constructor
FXVec3f(){}
/// Initialize from another vector
FXVec3f(const FXVec3f& v){x=v.x;y=v.y;z=v.z;}
/// Initialize from array of floats
FXVec3f(const FXfloat v[]){x=v[0];y=v[1];z=v[2];}
/// Initialize from components
FXVec3f(FXfloat xx,FXfloat yy,FXfloat zz=1.0f){x=xx;y=yy;z=zz;}
/// Initialize with color
FXVec3f(FXColor color);
/// Return a non-const reference to the ith element
FXfloat& operator[](FXint i){return (&x)[i];}
/// Return a const reference to the ith element
const FXfloat& operator[](FXint i) const {return (&x)[i];}
/// Assign color
FXVec3f& operator=(FXColor color);
/// Assignment
FXVec3f& operator=(const FXVec3f& v){x=v.x;y=v.y;z=v.z;return *this;}
/// Assignment from array of floats
FXVec3f& operator=(const FXfloat v[]){x=v[0];y=v[1];z=v[2];return *this;}
/// Set value from another vector
FXVec3f& set(const FXVec3f& v){x=v.x;y=v.y;z=v.z;return *this;}
/// Set value from array of floats
FXVec3f& set(const FXfloat v[]){x=v[0];y=v[1];z=v[2];return *this;}
/// Set value from components
FXVec3f& set(FXfloat xx,FXfloat yy,FXfloat zz){x=xx;y=yy;z=zz;return *this;}
/// Assigning operators
FXVec3f& operator*=(FXfloat n){x*=n;y*=n;z*=n;return *this;}
FXVec3f& operator/=(FXfloat n){x/=n;y/=n;z/=n;return *this;}
FXVec3f& operator+=(const FXVec3f& v){x+=v.x;y+=v.y;z+=v.z;return *this;}
FXVec3f& operator-=(const FXVec3f& v){x-=v.x;y-=v.y;z-=v.z;return *this;}
/// Conversions
operator FXfloat*(){return &x;}
operator const FXfloat*() const {return &x;}
operator FXVec2f&(){return *reinterpret_cast(this);}
operator const FXVec2f&() const {return *reinterpret_cast(this);}
/// Convert to color
operator FXColor() const;
/// Unary
FXVec3f operator+() const { return *this; }
FXVec3f operator-() const { return FXVec3f(-x,-y,-z); }
/// Vector and vector
FXVec3f operator+(const FXVec3f& v) const { return FXVec3f(x+v.x,y+v.y,z+v.z); }
FXVec3f operator-(const FXVec3f& v) const { return FXVec3f(x-v.x,y-v.y,z-v.z); }
/// Vector and matrix
FXVec3f operator*(const FXMat3f& m) const;
FXVec3f operator*(const FXMat4f& m) const;
/// Scaling
friend inline FXVec3f operator*(const FXVec3f& a,FXfloat n);
friend inline FXVec3f operator*(FXfloat n,const FXVec3f& a);
friend inline FXVec3f operator/(const FXVec3f& a,FXfloat n);
friend inline FXVec3f operator/(FXfloat n,const FXVec3f& a);
/// Dot product
FXfloat operator*(const FXVec3f& v) const { return x*v.x+y*v.y+z*v.z; }
/// Cross product
FXVec3f operator^(const FXVec3f& v) const { return FXVec3f(y*v.z-z*v.y, z*v.x-x*v.z, x*v.y-y*v.x); }
/// Test if zero
bool operator!() const { return x==0.0f && y==0.0f && z==0.0f; }
/// Equality tests
bool operator==(const FXVec3f& v) const { return x==v.x && y==v.y && z==v.z; }
bool operator!=(const FXVec3f& v) const { return x!=v.x || y!=v.y || z!=v.z; }
friend inline bool operator==(const FXVec3f& a,FXfloat n);
friend inline bool operator!=(const FXVec3f& a,FXfloat n);
friend inline bool operator==(FXfloat n,const FXVec3f& a);
friend inline bool operator!=(FXfloat n,const FXVec3f& a);
/// Inequality tests
bool operator<(const FXVec3f& v) const { return x(const FXVec3f& v) const { return x>v.x && y>v.y && z>v.z; }
bool operator>=(const FXVec3f& v) const { return x>=v.x && y>=v.y && z>=v.z; }
friend inline bool operator<(const FXVec3f& a,FXfloat n);
friend inline bool operator<=(const FXVec3f& a,FXfloat n);
friend inline bool operator>(const FXVec3f& a,FXfloat n);
friend inline bool operator>=(const FXVec3f& a,FXfloat n);
friend inline bool operator<(FXfloat n,const FXVec3f& a);
friend inline bool operator<=(FXfloat n,const FXVec3f& a);
friend inline bool operator>(FXfloat n,const FXVec3f& a);
friend inline bool operator>=(FXfloat n,const FXVec3f& a);
/// Length and square of length
FXfloat length2() const { return x*x+y*y+z*z; }
FXfloat length() const { return sqrtf(length2()); }
/// Clamp values of vector between limits
FXVec3f& clamp(FXfloat lo,FXfloat hi){x=FXCLAMP(lo,x,hi);y=FXCLAMP(lo,y,hi);z=FXCLAMP(lo,z,hi);return *this;}
/// Lowest or highest components
friend inline FXVec3f lo(const FXVec3f& a,const FXVec3f& b);
friend inline FXVec3f hi(const FXVec3f& a,const FXVec3f& b);
/// Compute normal from three points a,b,c
friend FXAPI FXVec3f normal(const FXVec3f& a,const FXVec3f& b,const FXVec3f& c);
/// Compute approximate normal from four points a,b,c,d
friend FXAPI FXVec3f normal(const FXVec3f& a,const FXVec3f& b,const FXVec3f& c,const FXVec3f& d);
/// Normalize vector
friend FXAPI FXVec3f normalize(const FXVec3f& v);
/// Save vector to a stream
friend FXAPI FXStream& operator<<(FXStream& store,const FXVec3f& v);
/// Load vector from a stream
friend FXAPI FXStream& operator>>(FXStream& store,FXVec3f& v);
};
inline FXVec3f operator*(const FXVec3f& a,FXfloat n){return FXVec3f(a.x*n,a.y*n,a.z*n);}
inline FXVec3f operator*(FXfloat n,const FXVec3f& a){return FXVec3f(n*a.x,n*a.y,n*a.z);}
inline FXVec3f operator/(const FXVec3f& a,FXfloat n){return FXVec3f(a.x/n,a.y/n,a.z/n);}
inline FXVec3f operator/(FXfloat n,const FXVec3f& a){return FXVec3f(n/a.x,n/a.y,n/a.z);}
inline bool operator==(const FXVec3f& a,FXfloat n){return a.x==n && a.y==n && a.z==n;}
inline bool operator!=(const FXVec3f& a,FXfloat n){return a.x!=n || a.y!=n || a.z!=n;}
inline bool operator==(FXfloat n,const FXVec3f& a){return n==a.x && n==a.y && n==a.z;}
inline bool operator!=(FXfloat n,const FXVec3f& a){return n!=a.x || n!=a.y || n!=a.z;}
inline bool operator<(const FXVec3f& a,FXfloat n){return a.x(const FXVec3f& a,FXfloat n){return a.x>n && a.y>n && a.z>n;}
inline bool operator>=(const FXVec3f& a,FXfloat n){return a.x>=n && a.y>=n && a.z>=n;}
inline bool operator<(FXfloat n,const FXVec3f& a){return n(FXfloat n,const FXVec3f& a){return n>a.x && n>a.y && n>a.z;}
inline bool operator>=(FXfloat n,const FXVec3f& a){return n>=a.x && n>=a.y && n>=a.z;}
inline FXVec3f lo(const FXVec3f& a,const FXVec3f& b){return FXVec3f(FXMIN(a.x,b.x),FXMIN(a.y,b.y),FXMIN(a.z,b.z));}
inline FXVec3f hi(const FXVec3f& a,const FXVec3f& b){return FXVec3f(FXMAX(a.x,b.x),FXMAX(a.y,b.y),FXMAX(a.z,b.z));}
extern FXAPI FXVec3f normal(const FXVec3f& a,const FXVec3f& b,const FXVec3f& c);
extern FXAPI FXVec3f normal(const FXVec3f& a,const FXVec3f& b,const FXVec3f& c,const FXVec3f& d);
extern FXAPI FXVec3f normalize(const FXVec3f& v);
extern FXAPI FXStream& operator<<(FXStream& store,const FXVec3f& v);
extern FXAPI FXStream& operator>>(FXStream& store,FXVec3f& v);
}
#endif
fox-1.6.49/include/FXSocket.h 0000664 0001750 0001750 00000005347 12130340076 012621 0000000 0000000 /********************************************************************************
* *
* S o c k e t C l a s s *
* *
*********************************************************************************
* Copyright (C) 2005,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXSocket.h,v 1.6 2006/01/22 17:58:09 fox Exp $ *
********************************************************************************/
#ifndef FXSOCKET_H
#define FXSOCKET_H
#ifndef FXIO_H
#include "FXIO.h"
#endif
//////////////////////////// UNDER DEVELOPMENT ////////////////////////////////
namespace FX {
/**
* Socket i/o device.
*/
class FXAPI FXSocket : public FXIO {
private:
FXSocket(const FXSocket&);
FXSocket &operator=(const FXSocket&);
public:
/// Construct socket
FXSocket(){ }
/// Construct file and attach existing handle h
FXSocket(FXInputHandle handle,FXuint mode);
/// Open device with access mode and handle
virtual bool open(FXInputHandle handle,FXuint mode);
/// Read block of bytes, returning number of bytes read
virtual FXival readBlock(void* data,FXival count);
/// Write block of bytes, returning number of bytes written
virtual FXival writeBlock(const void* data,FXival count);
/// Close socket
virtual bool close();
/// Destroy
virtual ~FXSocket();
};
}
#endif
fox-1.6.49/include/FXCP874Codec.h 0000644 0001750 0001750 00000001077 11637250333 013075 0000000 0000000 #ifndef FXCP874CODEC_H
#define FXCP874CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// CP874 Codec
class FXAPI FXCP874Codec : public FXTextCodec {
FXDECLARE(FXCP874Codec)
public:
FXCP874Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FXCP874Codec(){}
};
}
#endif
fox-1.6.49/include/FXBitmap.h 0000664 0001750 0001750 00000016767 12130340076 012615 0000000 0000000 /********************************************************************************
* *
* B i t m a p O b j e c t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXBitmap.h,v 1.37 2006/01/22 17:57:59 fox Exp $ *
********************************************************************************/
#ifndef FXBITMAP_H
#define FXBITMAP_H
#ifndef FXDRAWABLE_H
#include "FXDrawable.h"
#endif
namespace FX {
// Image rendering hints
enum {
BITMAP_KEEP = 0x00000001, // Keep pixel data in client
BITMAP_OWNED = 0x00000002, // Pixel data is owned by image
BITMAP_SHMI = 0x00000020, // Using shared memory image
BITMAP_SHMP = 0x00000040 // Using shared memory pixmap
};
// Forward declarations
class FXDC;
class FXDCWindow;
/**
* A Bitmap is a rectangular array of pixels. It supports two representations
* of these pixels: a client-side pixel buffer, and a server-side pixmap which
* is stored in an organization directly compatible with the screen, for fast
* drawing onto the device.
* The server-side representation is not directly accessible from the current
* process as it lives in the process of the X Server or GDI.
* The client-side pixel array is of size height x (width+7)/8 bytes, in other
* words 8 pixels packed into a single byte, starting at bit 0 on the left.
*/
class FXAPI FXBitmap : public FXDrawable {
FXDECLARE(FXBitmap)
friend class FXDC;
friend class FXDCWindow;
private:
#ifdef WIN32
virtual FXID GetDC() const;
virtual int ReleaseDC(FXID) const;
#endif
protected:
FXuchar *data; // Pixel data
FXint bytewidth; // Number of bytes across
FXuint options; // Options
protected:
FXBitmap();
private:
FXBitmap(const FXBitmap&);
FXBitmap &operator=(const FXBitmap&);
public:
/**
* Create a bitmap. If a client-side pixel buffer has been specified,
* the bitmap does not own the pixel buffer unless the BITMAP_OWNED flag is
* set. If the BITMAP_OWNED flag is set but a NULL pixel buffer is
* passed, a pixel buffer will be automatically created and will be owned
* by the bitmap. The flags BITMAP_SHMI and BITMAP_SHMP may be specified for
* large bitmaps to instruct render() to use shared memory to communicate
* with the server.
*/
FXBitmap(FXApp* a,const void *pix=NULL,FXuint opts=0,FXint w=1,FXint h=1);
/// Change options
void setOptions(FXuint opts);
/// To get to the option flags
FXuint getOptions() const { return options; }
/**
* Populate the bitmap with new pixel data of the same size; it will assume
* ownership of the pixel data if image BITMAP_OWNED option is passed.
* The server-side representation of the image, if it exists, is not updated.
* This can be done by calling render().
*/
virtual void setData(FXuchar *pix,FXuint opts=0);
/**
* Populate the bitmap with new pixel data of a new size; it will assume ownership
* of the pixel data if image BITMAP_OWNED option is passed. The size of the server-
* side representation of the image, if it exists, is adjusted but the contents are
* not updated yet. This can be done by calling render().
*/
virtual void setData(FXuchar *pix,FXuint opts,FXint w,FXint h);
/// To get to the pixel data
FXuchar* getData() const { return data; }
/// Get pixel at x,y
FXbool getPixel(FXint x,FXint y) const { return (FXbool)((data[y*bytewidth+(x>>3)]>>(x&7))&1); }
/// Change pixel at x,y
void setPixel(FXint x,FXint y,FXbool color){ color ? data[y*bytewidth+(x>>3)]|=(1<<(x&7)) : data[y*bytewidth+(x>>3)]&=~(1<<(x&7)); }
/**
* Create the server side pixmap, then call render() to fill it with the
* pixel data from the client-side buffer. After the server-side image has
* been created, the client-side pixel buffer will be deleted unless
* BITMAP_KEEP has been specified. If the pixel buffer is not owned, i.e.
* the flag BITMAP_OWNED is not set, the pixel buffer will not be deleted.
*/
virtual void create();
/**
* Detach the server side pixmap from the Bitmap.
* Afterwards, the Bitmap is left as if it never had a server-side resources.
*/
virtual void detach();
/**
* Destroy the server-side pixmap.
* The client-side pixel buffer is not affected.
*/
virtual void destroy();
/**
* Retrieves pixels from the server-side bitmap.
*/
virtual void restore();
/**
* Render the server-side representation of the bitmap from client-side
* pixels.
*/
virtual void render();
/**
* Release the client-side pixels buffer, free it if it was owned.
* If it is not owned, the image just forgets about the buffer.
*/
virtual void release();
/**
* Resize both client-side and server-side representations (if any) to the
* given width and height. The new representations typically contain garbage
* after this operation and need to be re-filled.
*/
virtual void resize(FXint w,FXint h);
/**
* Rescale pixels image to the specified width and height; this calls
* resize() to adjust the client and server side representations.
*/
virtual void scale(FXint w,FXint h);
/// Mirror bitmap horizontally and/or vertically
virtual void mirror(FXbool horizontal,FXbool vertical);
/// Rotate bitmap by degrees ccw
virtual void rotate(FXint degrees);
/**
* Crop bitmap to given rectangle; this calls resize() to adjust the client
* and server side representations. The new bitmap may be smaller or larger
* than the old one; blank areas are filled with color. There must be at
* least one pixel of overlap between the old and the new bitmap.
*/
virtual void crop(FXint x,FXint y,FXint w,FXint h,FXbool color=0);
/// Fill bitmap with uniform value
virtual void fill(FXbool color);
/// Save object to stream
virtual void save(FXStream& store) const;
/// Load object from stream
virtual void load(FXStream& store);
/// Save pixel data only
virtual bool savePixels(FXStream& store) const;
/// Load pixel data only
virtual bool loadPixels(FXStream& store);
/// Cleanup
virtual ~FXBitmap();
};
}
#endif
fox-1.6.49/include/FXId.h 0000664 0001750 0001750 00000005726 12130340076 011726 0000000 0000000 /********************************************************************************
* *
* X - O b j e c t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXId.h,v 1.18 2006/01/22 17:58:05 fox Exp $ *
********************************************************************************/
#ifndef FXID_H
#define FXID_H
#ifndef FXOBJECT_H
#include "FXObject.h"
#endif
namespace FX {
class FXApp;
/// Encapsulates server side resource
class FXAPI FXId : public FXObject {
FXDECLARE_ABSTRACT(FXId)
private:
FXApp *app; // Back link to application object
void *data; // User data
protected:
FXID xid;
private:
FXId(const FXId&);
FXId &operator=(const FXId&);
protected:
FXId():app((FXApp*)-1L),data(NULL),xid(0){}
FXId(FXApp* a):app(a),data(NULL),xid(0){}
public:
/// Get application
FXApp* getApp() const { return app; }
/// Get XID handle
FXID id() const { return xid; }
/// Create resource
virtual void create(){}
/// Detach resource
virtual void detach(){}
/// Destroy resource
virtual void destroy(){}
/// Set user data pointer
void setUserData(void *ptr){ data=ptr; }
/// Get user data pointer
void* getUserData() const { return data; }
/// Save object to stream
virtual void save(FXStream& store) const;
/// Load object from stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXId(){app=(FXApp*)-1L;}
};
}
#endif
fox-1.6.49/include/fxkeys.h 0000664 0001750 0001750 00000172460 12130340076 012445 0000000 0000000 /********************************************************************************
* *
* F O X K e y b o a r d S y m b o l D e f i n i t i o n s *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: fxkeys.h,v 1.14 2006/03/07 05:30:46 fox Exp $ *
********************************************************************************/
#ifndef FXKEYS_H
#define FXKEYS_H
namespace FX {
enum {
// Void symbol
KEY_VoidSymbol = 0,
// Miscellaneous
KEY_BackSpace = 0xFF08,
KEY_Tab = 0xFF09,
KEY_Linefeed = 0xFF0A,
KEY_Clear = 0xFF0B,
KEY_Return = 0xFF0D,
KEY_Pause = 0xFF13,
KEY_Scroll_Lock = 0xFF14,
KEY_Sys_Req = 0xFF15,
KEY_Escape = 0xFF1B,
KEY_Delete = 0xFFFF,
KEY_Multi_key = 0xFF20,
// Japanese
KEY_Kanji = 0xFF21,
KEY_Muhenkan = 0xFF22,
KEY_Henkan_Mode = 0xFF23,
KEY_Henkan = 0xFF23,
KEY_Romaji = 0xFF24,
KEY_Hiragana = 0xFF25,
KEY_Katakana = 0xFF26,
KEY_Hiragana_Katakana = 0xFF27,
KEY_Zenkaku = 0xFF28,
KEY_Hankaku = 0xFF29,
KEY_Zenkaku_Hankaku = 0xFF2A,
KEY_Touroku = 0xFF2B,
KEY_Massyo = 0xFF2C,
KEY_Kana_Lock = 0xFF2D,
KEY_Kana_Shift = 0xFF2E,
KEY_Eisu_Shift = 0xFF2F,
KEY_Eisu_toggle = 0xFF30,
// Cursor
KEY_Home = 0xFF50,
KEY_Left = 0xFF51,
KEY_Up = 0xFF52,
KEY_Right = 0xFF53,
KEY_Down = 0xFF54,
KEY_Prior = 0xFF55,
KEY_Page_Up = 0xFF55,
KEY_Next = 0xFF56,
KEY_Page_Down = 0xFF56,
KEY_End = 0xFF57,
KEY_Begin = 0xFF58,
// Functions
KEY_Select = 0xFF60,
KEY_Print = 0xFF61,
KEY_Execute = 0xFF62,
KEY_Insert = 0xFF63,
KEY_Undo = 0xFF65,
KEY_Redo = 0xFF66,
KEY_Menu = 0xFF67,
KEY_Find = 0xFF68,
KEY_Cancel = 0xFF69,
KEY_Help = 0xFF6A,
KEY_Break = 0xFF6B,
KEY_Mode_switch = 0xFF7E,
KEY_script_switch = 0xFF7E,
KEY_Num_Lock = 0xFF7F,
// Keypad
KEY_KP_Space = 0xFF80,
KEY_KP_Tab = 0xFF89,
KEY_KP_Enter = 0xFF8D,
KEY_KP_F1 = 0xFF91,
KEY_KP_F2 = 0xFF92,
KEY_KP_F3 = 0xFF93,
KEY_KP_F4 = 0xFF94,
KEY_KP_Home = 0xFF95,
KEY_KP_Left = 0xFF96,
KEY_KP_Up = 0xFF97,
KEY_KP_Right = 0xFF98,
KEY_KP_Down = 0xFF99,
KEY_KP_Prior = 0xFF9A,
KEY_KP_Page_Up = 0xFF9A,
KEY_KP_Next = 0xFF9B,
KEY_KP_Page_Down = 0xFF9B,
KEY_KP_End = 0xFF9C,
KEY_KP_Begin = 0xFF9D,
KEY_KP_Insert = 0xFF9E,
KEY_KP_Delete = 0xFF9F,
KEY_KP_Equal = 0xFFBD,
KEY_KP_Multiply = 0xFFAA,
KEY_KP_Add = 0xFFAB,
KEY_KP_Separator = 0xFFAC,
KEY_KP_Subtract = 0xFFAD,
KEY_KP_Decimal = 0xFFAE,
KEY_KP_Divide = 0xFFAF,
// Keypad numbers
KEY_KP_0 = 0xFFB0,
KEY_KP_1 = 0xFFB1,
KEY_KP_2 = 0xFFB2,
KEY_KP_3 = 0xFFB3,
KEY_KP_4 = 0xFFB4,
KEY_KP_5 = 0xFFB5,
KEY_KP_6 = 0xFFB6,
KEY_KP_7 = 0xFFB7,
KEY_KP_8 = 0xFFB8,
KEY_KP_9 = 0xFFB9,
// Function keys
KEY_F1 = 0xFFBE,
KEY_F2 = 0xFFBF,
KEY_F3 = 0xFFC0,
KEY_F4 = 0xFFC1,
KEY_F5 = 0xFFC2,
KEY_F6 = 0xFFC3,
KEY_F7 = 0xFFC4,
KEY_F8 = 0xFFC5,
KEY_F9 = 0xFFC6,
KEY_F10 = 0xFFC7,
KEY_F11 = 0xFFC8,
KEY_L1 = 0xFFC8,
KEY_F12 = 0xFFC9,
KEY_L2 = 0xFFC9,
KEY_F13 = 0xFFCA,
KEY_L3 = 0xFFCA,
KEY_F14 = 0xFFCB,
KEY_L4 = 0xFFCB,
KEY_F15 = 0xFFCC,
KEY_L5 = 0xFFCC,
KEY_F16 = 0xFFCD,
KEY_L6 = 0xFFCD,
KEY_F17 = 0xFFCE,
KEY_L7 = 0xFFCE,
KEY_F18 = 0xFFCF,
KEY_L8 = 0xFFCF,
KEY_F19 = 0xFFD0,
KEY_L9 = 0xFFD0,
KEY_F20 = 0xFFD1,
KEY_L10 = 0xFFD1,
KEY_F21 = 0xFFD2,
KEY_R1 = 0xFFD2,
KEY_F22 = 0xFFD3,
KEY_R2 = 0xFFD3,
KEY_F23 = 0xFFD4,
KEY_R3 = 0xFFD4,
KEY_F24 = 0xFFD5,
KEY_R4 = 0xFFD5,
KEY_F25 = 0xFFD6,
KEY_R5 = 0xFFD6,
KEY_F26 = 0xFFD7,
KEY_R6 = 0xFFD7,
KEY_F27 = 0xFFD8,
KEY_R7 = 0xFFD8,
KEY_F28 = 0xFFD9,
KEY_R8 = 0xFFD9,
KEY_F29 = 0xFFDA,
KEY_R9 = 0xFFDA,
KEY_F30 = 0xFFDB,
KEY_R10 = 0xFFDB,
KEY_F31 = 0xFFDC,
KEY_R11 = 0xFFDC,
KEY_F32 = 0xFFDD,
KEY_R12 = 0xFFDD,
KEY_F33 = 0xFFDE,
KEY_R13 = 0xFFDE,
KEY_F34 = 0xFFDF,
KEY_R14 = 0xFFDF,
KEY_F35 = 0xFFE0,
KEY_R15 = 0xFFE0,
// Modifiers
KEY_Shift_L = 0xFFE1,
KEY_Shift_R = 0xFFE2,
KEY_Control_L = 0xFFE3,
KEY_Control_R = 0xFFE4,
KEY_Caps_Lock = 0xFFE5,
KEY_Shift_Lock = 0xFFE6,
KEY_Meta_L = 0xFFE7,
KEY_Meta_R = 0xFFE8,
KEY_Alt_L = 0xFFE9,
KEY_Alt_R = 0xFFEA,
KEY_Super_L = 0xFFEB,
KEY_Super_R = 0xFFEC,
KEY_Hyper_L = 0xFFED,
KEY_Hyper_R = 0xFFEE,
// ISO 9995
KEY_ISO_Lock = 0xFE01,
KEY_ISO_Level2_Latch = 0xFE02,
KEY_ISO_Level3_Shift = 0xFE03,
KEY_ISO_Level3_Latch = 0xFE04,
KEY_ISO_Level3_Lock = 0xFE05,
KEY_ISO_Group_Shift = 0xFF7E,
KEY_ISO_Group_Latch = 0xFE06,
KEY_ISO_Group_Lock = 0xFE07,
KEY_ISO_Next_Group = 0xFE08,
KEY_ISO_Next_Group_Lock = 0xFE09,
KEY_ISO_Prev_Group = 0xFE0A,
KEY_ISO_Prev_Group_Lock = 0xFE0B,
KEY_ISO_First_Group = 0xFE0C,
KEY_ISO_First_Group_Lock = 0xFE0D,
KEY_ISO_Last_Group = 0xFE0E,
KEY_ISO_Last_Group_Lock = 0xFE0F,
KEY_ISO_Left_Tab = 0xFE20,
KEY_ISO_Move_Line_Up = 0xFE21,
KEY_ISO_Move_Line_Down = 0xFE22,
KEY_ISO_Partial_Line_Up = 0xFE23,
KEY_ISO_Partial_Line_Down = 0xFE24,
KEY_ISO_Partial_Space_Left = 0xFE25,
KEY_ISO_Partial_Space_Right = 0xFE26,
KEY_ISO_Set_Margin_Left = 0xFE27,
KEY_ISO_Set_Margin_Right = 0xFE28,
KEY_ISO_Release_Margin_Left = 0xFE29,
KEY_ISO_Release_Margin_Right = 0xFE2A,
KEY_ISO_Release_Both_Margins = 0xFE2B,
KEY_ISO_Fast_Cursor_Left = 0xFE2C,
KEY_ISO_Fast_Cursor_Right = 0xFE2D,
KEY_ISO_Fast_Cursor_Up = 0xFE2E,
KEY_ISO_Fast_Cursor_Down = 0xFE2F,
KEY_ISO_Continuous_Underline = 0xFE30,
KEY_ISO_Discontinuous_Underline = 0xFE31,
KEY_ISO_Emphasize = 0xFE32,
KEY_ISO_Center_Object = 0xFE33,
KEY_ISO_Enter = 0xFE34,
KEY_dead_grave = 0xFE50,
KEY_dead_acute = 0xFE51,
KEY_dead_circumflex = 0xFE52,
KEY_dead_tilde = 0xFE53,
KEY_dead_macron = 0xFE54,
KEY_dead_breve = 0xFE55,
KEY_dead_abovedot = 0xFE56,
KEY_dead_diaeresis = 0xFE57,
KEY_dead_abovering = 0xFE58,
KEY_dead_doubleacute = 0xFE59,
KEY_dead_caron = 0xFE5A,
KEY_dead_cedilla = 0xFE5B,
KEY_dead_ogonek = 0xFE5C,
KEY_dead_iota = 0xFE5D,
KEY_dead_voiced_sound = 0xFE5E,
KEY_dead_semivoiced_sound = 0xFE5F,
KEY_dead_belowdot = 0xFE60,
KEY_First_Virtual_Screen = 0xFED0,
KEY_Prev_Virtual_Screen = 0xFED1,
KEY_Next_Virtual_Screen = 0xFED2,
KEY_Last_Virtual_Screen = 0xFED4,
KEY_Terminate_Server = 0xFED5,
KEY_AccessX_Enable = 0xFE70,
KEY_AccessX_Feedback_Enable = 0xFE71,
KEY_RepeatKeys_Enable = 0xFE72,
KEY_SlowKeys_Enable = 0xFE73,
KEY_BounceKeys_Enable = 0xFE74,
KEY_StickyKeys_Enable = 0xFE75,
KEY_MouseKeys_Enable = 0xFE76,
KEY_MouseKeys_Accel_Enable = 0xFE77,
KEY_Overlay1_Enable = 0xFE78,
KEY_Overlay2_Enable = 0xFE79,
KEY_AudibleBell_Enable = 0xFE7A,
KEY_Pointer_Left = 0xFEE0,
KEY_Pointer_Right = 0xFEE1,
KEY_Pointer_Up = 0xFEE2,
KEY_Pointer_Down = 0xFEE3,
KEY_Pointer_UpLeft = 0xFEE4,
KEY_Pointer_UpRight = 0xFEE5,
KEY_Pointer_DownLeft = 0xFEE6,
KEY_Pointer_DownRight = 0xFEE7,
KEY_Pointer_Button_Dflt = 0xFEE8,
KEY_Pointer_Button1 = 0xFEE9,
KEY_Pointer_Button2 = 0xFEEA,
KEY_Pointer_Button3 = 0xFEEB,
KEY_Pointer_Button4 = 0xFEEC,
KEY_Pointer_Button5 = 0xFEED,
KEY_Pointer_DblClick_Dflt = 0xFEEE,
KEY_Pointer_DblClick1 = 0xFEEF,
KEY_Pointer_DblClick2 = 0xFEF0,
KEY_Pointer_DblClick3 = 0xFEF1,
KEY_Pointer_DblClick4 = 0xFEF2,
KEY_Pointer_DblClick5 = 0xFEF3,
KEY_Pointer_Drag_Dflt = 0xFEF4,
KEY_Pointer_Drag1 = 0xFEF5,
KEY_Pointer_Drag2 = 0xFEF6,
KEY_Pointer_Drag3 = 0xFEF7,
KEY_Pointer_Drag4 = 0xFEF8,
KEY_Pointer_Drag5 = 0xFEFD,
KEY_Pointer_EnableKeys = 0xFEF9,
KEY_Pointer_Accelerate = 0xFEFA,
KEY_Pointer_DfltBtnNext = 0xFEFB,
KEY_Pointer_DfltBtnPrev = 0xFEFC,
// 3270 Terminal
KEY_3270_Duplicate = 0xFD01,
KEY_3270_FieldMark = 0xFD02,
KEY_3270_Right2 = 0xFD03,
KEY_3270_Left2 = 0xFD04,
KEY_3270_BackTab = 0xFD05,
KEY_3270_EraseEOF = 0xFD06,
KEY_3270_EraseInput = 0xFD07,
KEY_3270_Reset = 0xFD08,
KEY_3270_Quit = 0xFD09,
KEY_3270_PA1 = 0xFD0A,
KEY_3270_PA2 = 0xFD0B,
KEY_3270_PA3 = 0xFD0C,
KEY_3270_Test = 0xFD0D,
KEY_3270_Attn = 0xFD0E,
KEY_3270_CursorBlink = 0xFD0F,
KEY_3270_AltCursor = 0xFD10,
KEY_3270_KeyClick = 0xFD11,
KEY_3270_Jump = 0xFD12,
KEY_3270_Ident = 0xFD13,
KEY_3270_Rule = 0xFD14,
KEY_3270_Copy = 0xFD15,
KEY_3270_Play = 0xFD16,
KEY_3270_Setup = 0xFD17,
KEY_3270_Record = 0xFD18,
KEY_3270_ChangeScreen = 0xFD19,
KEY_3270_DeleteWord = 0xFD1A,
KEY_3270_ExSelect = 0xFD1B,
KEY_3270_CursorSelect = 0xFD1C,
KEY_3270_PrintScreen = 0xFD1D,
KEY_3270_Enter = 0xFD1E,
// Latin 1
KEY_space = 0x0020,
KEY_exclam = 0x0021,
KEY_quotedbl = 0x0022,
KEY_numbersign = 0x0023,
KEY_dollar = 0x0024,
KEY_percent = 0x0025,
KEY_ampersand = 0x0026,
KEY_apostrophe = 0x0027,
KEY_quoteright = 0x0027,
KEY_parenleft = 0x0028,
KEY_parenright = 0x0029,
KEY_asterisk = 0x002A,
KEY_plus = 0x002B,
KEY_comma = 0x002C,
KEY_minus = 0x002D,
KEY_period = 0x002E,
KEY_slash = 0x002F,
KEY_0 = 0x0030,
KEY_1 = 0x0031,
KEY_2 = 0x0032,
KEY_3 = 0x0033,
KEY_4 = 0x0034,
KEY_5 = 0x0035,
KEY_6 = 0x0036,
KEY_7 = 0x0037,
KEY_8 = 0x0038,
KEY_9 = 0x0039,
KEY_colon = 0x003A,
KEY_semicolon = 0x003B,
KEY_less = 0x003C,
KEY_equal = 0x003D,
KEY_greater = 0x003E,
KEY_question = 0x003F,
KEY_at = 0x0040,
KEY_A = 0x0041,
KEY_B = 0x0042,
KEY_C = 0x0043,
KEY_D = 0x0044,
KEY_E = 0x0045,
KEY_F = 0x0046,
KEY_G = 0x0047,
KEY_H = 0x0048,
KEY_I = 0x0049,
KEY_J = 0x004A,
KEY_K = 0x004B,
KEY_L = 0x004C,
KEY_M = 0x004D,
KEY_N = 0x004E,
KEY_O = 0x004F,
KEY_P = 0x0050,
KEY_Q = 0x0051,
KEY_R = 0x0052,
KEY_S = 0x0053,
KEY_T = 0x0054,
KEY_U = 0x0055,
KEY_V = 0x0056,
KEY_W = 0x0057,
KEY_X = 0x0058,
KEY_Y = 0x0059,
KEY_Z = 0x005A,
KEY_bracketleft = 0x005B,
KEY_backslash = 0x005C,
KEY_bracketright = 0x005D,
KEY_asciicircum = 0x005E,
KEY_underscore = 0x005F,
KEY_grave = 0x0060,
KEY_quoteleft = 0x0060,
KEY_a = 0x0061,
KEY_b = 0x0062,
KEY_c = 0x0063,
KEY_d = 0x0064,
KEY_e = 0x0065,
KEY_f = 0x0066,
KEY_g = 0x0067,
KEY_h = 0x0068,
KEY_i = 0x0069,
KEY_j = 0x006A,
KEY_k = 0x006B,
KEY_l = 0x006C,
KEY_m = 0x006D,
KEY_n = 0x006E,
KEY_o = 0x006F,
KEY_p = 0x0070,
KEY_q = 0x0071,
KEY_r = 0x0072,
KEY_s = 0x0073,
KEY_t = 0x0074,
KEY_u = 0x0075,
KEY_v = 0x0076,
KEY_w = 0x0077,
KEY_x = 0x0078,
KEY_y = 0x0079,
KEY_z = 0x007A,
KEY_braceleft = 0x007B,
KEY_bar = 0x007C,
KEY_braceright = 0x007D,
KEY_asciitilde = 0x007E,
KEY_nobreakspace = 0x00A0,
KEY_exclamdown = 0x00A1,
KEY_cent = 0x00A2,
KEY_sterling = 0x00A3,
KEY_currency = 0x00A4,
KEY_yen = 0x00A5,
KEY_brokenbar = 0x00A6,
KEY_section = 0x00A7,
KEY_diaeresis = 0x00A8,
KEY_copyright = 0x00A9,
KEY_ordfeminine = 0x00AA,
KEY_guillemotleft = 0x00AB,
KEY_notsign = 0x00AC,
KEY_hyphen = 0x00AD,
KEY_registered = 0x00AE,
KEY_macron = 0x00AF,
KEY_degree = 0x00B0,
KEY_plusminus = 0x00B1,
KEY_twosuperior = 0x00B2,
KEY_threesuperior = 0x00B3,
KEY_acute = 0x00B4,
KEY_mu = 0x00B5,
KEY_paragraph = 0x00B6,
KEY_periodcentered = 0x00B7,
KEY_cedilla = 0x00B8,
KEY_onesuperior = 0x00B9,
KEY_masculine = 0x00BA,
KEY_guillemotright = 0x00BB,
KEY_onequarter = 0x00BC,
KEY_onehalf = 0x00BD,
KEY_threequarters = 0x00BE,
KEY_questiondown = 0x00BF,
KEY_Agrave = 0x00C0,
KEY_Aacute = 0x00C1,
KEY_Acircumflex = 0x00C2,
KEY_Atilde = 0x00C3,
KEY_Adiaeresis = 0x00C4,
KEY_Aring = 0x00C5,
KEY_AE = 0x00C6,
KEY_Ccedilla = 0x00C7,
KEY_Egrave = 0x00C8,
KEY_Eacute = 0x00C9,
KEY_Ecircumflex = 0x00CA,
KEY_Ediaeresis = 0x00CB,
KEY_Igrave = 0x00CC,
KEY_Iacute = 0x00CD,
KEY_Icircumflex = 0x00CE,
KEY_Idiaeresis = 0x00CF,
KEY_ETH = 0x00D0,
KEY_Eth = 0x00D0,
KEY_Ntilde = 0x00D1,
KEY_Ograve = 0x00D2,
KEY_Oacute = 0x00D3,
KEY_Ocircumflex = 0x00D4,
KEY_Otilde = 0x00D5,
KEY_Odiaeresis = 0x00D6,
KEY_multiply = 0x00D7,
KEY_Ooblique = 0x00D8,
KEY_Ugrave = 0x00D9,
KEY_Uacute = 0x00DA,
KEY_Ucircumflex = 0x00DB,
KEY_Udiaeresis = 0x00DC,
KEY_Yacute = 0x00DD,
KEY_THORN = 0x00DE,
KEY_Thorn = 0x00DE,
KEY_ssharp = 0x00DF,
KEY_agrave = 0x00E0,
KEY_aacute = 0x00E1,
KEY_acircumflex = 0x00E2,
KEY_atilde = 0x00E3,
KEY_adiaeresis = 0x00E4,
KEY_aring = 0x00E5,
KEY_ae = 0x00E6,
KEY_ccedilla = 0x00E7,
KEY_egrave = 0x00E8,
KEY_eacute = 0x00E9,
KEY_ecircumflex = 0x00EA,
KEY_ediaeresis = 0x00EB,
KEY_igrave = 0x00EC,
KEY_iacute = 0x00ED,
KEY_icircumflex = 0x00EE,
KEY_idiaeresis = 0x00EF,
KEY_eth = 0x00F0,
KEY_ntilde = 0x00F1,
KEY_ograve = 0x00F2,
KEY_oacute = 0x00F3,
KEY_ocircumflex = 0x00F4,
KEY_otilde = 0x00F5,
KEY_odiaeresis = 0x00F6,
KEY_division = 0x00F7,
KEY_oslash = 0x00F8,
KEY_ugrave = 0x00F9,
KEY_uacute = 0x00FA,
KEY_ucircumflex = 0x00FB,
KEY_udiaeresis = 0x00FC,
KEY_yacute = 0x00FD,
KEY_thorn = 0x00FE,
KEY_ydiaeresis = 0x00FF,
// Latin 2
KEY_Aogonek = 0x01A1,
KEY_breve = 0x01A2,
KEY_Lstroke = 0x01A3,
KEY_Lcaron = 0x01A5,
KEY_Sacute = 0x01A6,
KEY_Scaron = 0x01A9,
KEY_Scedilla = 0x01AA,
KEY_Tcaron = 0x01AB,
KEY_Zacute = 0x01AC,
KEY_Zcaron = 0x01AE,
KEY_Zabovedot = 0x01AF,
KEY_aogonek = 0x01B1,
KEY_ogonek = 0x01B2,
KEY_lstroke = 0x01B3,
KEY_lcaron = 0x01B5,
KEY_sacute = 0x01B6,
KEY_caron = 0x01B7,
KEY_scaron = 0x01B9,
KEY_scedilla = 0x01BA,
KEY_tcaron = 0x01BB,
KEY_zacute = 0x01BC,
KEY_doubleacute = 0x01BD,
KEY_zcaron = 0x01BE,
KEY_zabovedot = 0x01BF,
KEY_Racute = 0x01C0,
KEY_Abreve = 0x01C3,
KEY_Lacute = 0x01C5,
KEY_Cacute = 0x01C6,
KEY_Ccaron = 0x01C8,
KEY_Eogonek = 0x01CA,
KEY_Ecaron = 0x01CC,
KEY_Dcaron = 0x01CF,
KEY_Dstroke = 0x01D0,
KEY_Nacute = 0x01D1,
KEY_Ncaron = 0x01D2,
KEY_Odoubleacute = 0x01D5,
KEY_Rcaron = 0x01D8,
KEY_Uring = 0x01D9,
KEY_Udoubleacute = 0x01DB,
KEY_Tcedilla = 0x01DE,
KEY_racute = 0x01E0,
KEY_abreve = 0x01E3,
KEY_lacute = 0x01E5,
KEY_cacute = 0x01E6,
KEY_ccaron = 0x01E8,
KEY_eogonek = 0x01EA,
KEY_ecaron = 0x01EC,
KEY_dcaron = 0x01EF,
KEY_dstroke = 0x01F0,
KEY_nacute = 0x01F1,
KEY_ncaron = 0x01F2,
KEY_odoubleacute = 0x01F5,
KEY_udoubleacute = 0x01FB,
KEY_rcaron = 0x01F8,
KEY_uring = 0x01F9,
KEY_tcedilla = 0x01FE,
KEY_abovedot = 0x01FF,
// Latin 3
KEY_Hstroke = 0x02A1,
KEY_Hcircumflex = 0x02A6,
KEY_Iabovedot = 0x02A9,
KEY_Gbreve = 0x02AB,
KEY_Jcircumflex = 0x02AC,
KEY_hstroke = 0x02B1,
KEY_hcircumflex = 0x02B6,
KEY_idotless = 0x02B9,
KEY_gbreve = 0x02BB,
KEY_jcircumflex = 0x02BC,
KEY_Cabovedot = 0x02C5,
KEY_Ccircumflex = 0x02C6,
KEY_Gabovedot = 0x02D5,
KEY_Gcircumflex = 0x02D8,
KEY_Ubreve = 0x02DD,
KEY_Scircumflex = 0x02DE,
KEY_cabovedot = 0x02E5,
KEY_ccircumflex = 0x02E6,
KEY_gabovedot = 0x02F5,
KEY_gcircumflex = 0x02F8,
KEY_ubreve = 0x02FD,
KEY_scircumflex = 0x02FE,
// Latin 4
KEY_kra = 0x03A2,
KEY_kappa = 0x03A2,
KEY_Rcedilla = 0x03A3,
KEY_Itilde = 0x03A5,
KEY_Lcedilla = 0x03A6,
KEY_Emacron = 0x03AA,
KEY_Gcedilla = 0x03AB,
KEY_Tslash = 0x03AC,
KEY_rcedilla = 0x03B3,
KEY_itilde = 0x03B5,
KEY_lcedilla = 0x03B6,
KEY_emacron = 0x03BA,
KEY_gcedilla = 0x03BB,
KEY_tslash = 0x03BC,
KEY_ENG = 0x03BD,
KEY_eng = 0x03BF,
KEY_Amacron = 0x03C0,
KEY_Iogonek = 0x03C7,
KEY_Eabovedot = 0x03CC,
KEY_Imacron = 0x03CF,
KEY_Ncedilla = 0x03D1,
KEY_Omacron = 0x03D2,
KEY_Kcedilla = 0x03D3,
KEY_Uogonek = 0x03D9,
KEY_Utilde = 0x03DD,
KEY_Umacron = 0x03DE,
KEY_amacron = 0x03E0,
KEY_iogonek = 0x03E7,
KEY_eabovedot = 0x03EC,
KEY_imacron = 0x03EF,
KEY_ncedilla = 0x03F1,
KEY_omacron = 0x03F2,
KEY_kcedilla = 0x03F3,
KEY_uogonek = 0x03F9,
KEY_utilde = 0x03FD,
KEY_umacron = 0x03FE,
// Katakana
KEY_overline = 0x047E,
KEY_kana_fullstop = 0x04A1,
KEY_kana_openingbracket = 0x04A2,
KEY_kana_closingbracket = 0x04A3,
KEY_kana_comma = 0x04A4,
KEY_kana_conjunctive = 0x04A5,
KEY_kana_middledot = 0x04A5,
KEY_kana_WO = 0x04A6,
KEY_kana_a = 0x04A7,
KEY_kana_i = 0x04A8,
KEY_kana_u = 0x04A9,
KEY_kana_e = 0x04AA,
KEY_kana_o = 0x04AB,
KEY_kana_ya = 0x04AC,
KEY_kana_yu = 0x04AD,
KEY_kana_yo = 0x04AE,
KEY_kana_tsu = 0x04AF,
KEY_kana_tu = 0x04AF,
KEY_prolongedsound = 0x04B0,
KEY_kana_A = 0x04B1,
KEY_kana_I = 0x04B2,
KEY_kana_U = 0x04B3,
KEY_kana_E = 0x04B4,
KEY_kana_O = 0x04B5,
KEY_kana_KA = 0x04B6,
KEY_kana_KI = 0x04B7,
KEY_kana_KU = 0x04B8,
KEY_kana_KE = 0x04B9,
KEY_kana_KO = 0x04BA,
KEY_kana_SA = 0x04BB,
KEY_kana_SHI = 0x04BC,
KEY_kana_SU = 0x04BD,
KEY_kana_SE = 0x04BE,
KEY_kana_SO = 0x04BF,
KEY_kana_TA = 0x04C0,
KEY_kana_CHI = 0x04C1,
KEY_kana_TI = 0x04C1,
KEY_kana_TSU = 0x04C2,
KEY_kana_TU = 0x04C2,
KEY_kana_TE = 0x04C3,
KEY_kana_TO = 0x04C4,
KEY_kana_NA = 0x04C5,
KEY_kana_NI = 0x04C6,
KEY_kana_NU = 0x04C7,
KEY_kana_NE = 0x04C8,
KEY_kana_NO = 0x04C9,
KEY_kana_HA = 0x04CA,
KEY_kana_HI = 0x04CB,
KEY_kana_FU = 0x04CC,
KEY_kana_HU = 0x04CC,
KEY_kana_HE = 0x04CD,
KEY_kana_HO = 0x04CE,
KEY_kana_MA = 0x04CF,
KEY_kana_MI = 0x04D0,
KEY_kana_MU = 0x04D1,
KEY_kana_ME = 0x04D2,
KEY_kana_MO = 0x04D3,
KEY_kana_YA = 0x04D4,
KEY_kana_YU = 0x04D5,
KEY_kana_YO = 0x04D6,
KEY_kana_RA = 0x04D7,
KEY_kana_RI = 0x04D8,
KEY_kana_RU = 0x04D9,
KEY_kana_RE = 0x04DA,
KEY_kana_RO = 0x04DB,
KEY_kana_WA = 0x04DC,
KEY_kana_N = 0x04DD,
KEY_voicedsound = 0x04DE,
KEY_semivoicedsound = 0x04DF,
KEY_kana_switch = 0x0FF7,
// Arabic
KEY_Arabic_comma = 0x05AC,
KEY_Arabic_semicolon = 0x05BB,
KEY_Arabic_question_mark = 0x05BF,
KEY_Arabic_hamza = 0x05C1,
KEY_Arabic_maddaonalef = 0x05C2,
KEY_Arabic_hamzaonalef = 0x05C3,
KEY_Arabic_hamzaonwaw = 0x05C4,
KEY_Arabic_hamzaunderalef = 0x05C5,
KEY_Arabic_hamzaonyeh = 0x05C6,
KEY_Arabic_alef = 0x05C7,
KEY_Arabic_beh = 0x05C8,
KEY_Arabic_tehmarbuta = 0x05C9,
KEY_Arabic_teh = 0x05CA,
KEY_Arabic_theh = 0x05CB,
KEY_Arabic_jeem = 0x05CC,
KEY_Arabic_hah = 0x05CD,
KEY_Arabic_khah = 0x05CE,
KEY_Arabic_dal = 0x05CF,
KEY_Arabic_thal = 0x05D0,
KEY_Arabic_ra = 0x05D1,
KEY_Arabic_zain = 0x05D2,
KEY_Arabic_seen = 0x05D3,
KEY_Arabic_sheen = 0x05D4,
KEY_Arabic_sad = 0x05D5,
KEY_Arabic_dad = 0x05D6,
KEY_Arabic_tah = 0x05D7,
KEY_Arabic_zah = 0x05D8,
KEY_Arabic_ain = 0x05D9,
KEY_Arabic_ghain = 0x05DA,
KEY_Arabic_tatweel = 0x05E0,
KEY_Arabic_feh = 0x05E1,
KEY_Arabic_qaf = 0x05E2,
KEY_Arabic_kaf = 0x05E3,
KEY_Arabic_lam = 0x05E4,
KEY_Arabic_meem = 0x05E5,
KEY_Arabic_noon = 0x05E6,
KEY_Arabic_ha = 0x05E7,
KEY_Arabic_heh = 0x05E7,
KEY_Arabic_waw = 0x05E8,
KEY_Arabic_alefmaksura = 0x05E9,
KEY_Arabic_yeh = 0x05EA,
KEY_Arabic_fathatan = 0x05EB,
KEY_Arabic_dammatan = 0x05EC,
KEY_Arabic_kasratan = 0x05ED,
KEY_Arabic_fatha = 0x05EE,
KEY_Arabic_damma = 0x05EF,
KEY_Arabic_kasra = 0x05F0,
KEY_Arabic_shadda = 0x05F1,
KEY_Arabic_sukun = 0x05F2,
KEY_Arabic_switch = 0xFF7E,
// Cyrillic
KEY_Serbian_dje = 0x06A1,
KEY_Macedonia_gje = 0x06A2,
KEY_Cyrillic_io = 0x06A3,
KEY_Ukrainian_ie = 0x06A4,
KEY_Ukranian_je = 0x06A4,
KEY_Macedonia_dse = 0x06A5,
KEY_Ukrainian_i = 0x06A6,
KEY_Ukranian_i = 0x06A6,
KEY_Ukrainian_yi = 0x06A7,
KEY_Ukranian_yi = 0x06A7,
KEY_Cyrillic_je = 0x06A8,
KEY_Serbian_je = 0x06A8,
KEY_Cyrillic_lje = 0x06A9,
KEY_Serbian_lje = 0x06A9,
KEY_Cyrillic_nje = 0x06AA,
KEY_Serbian_nje = 0x06AA,
KEY_Serbian_tshe = 0x06AB,
KEY_Macedonia_kje = 0x06AC,
KEY_Byelorussian_shortu = 0x06AE,
KEY_Cyrillic_dzhe = 0x06AF,
KEY_Serbian_dze = 0x06AF,
KEY_numerosign = 0x06B0,
KEY_Serbian_DJE = 0x06B1,
KEY_Macedonia_GJE = 0x06B2,
KEY_Cyrillic_IO = 0x06B3,
KEY_Ukrainian_IE = 0x06B4,
KEY_Ukranian_JE = 0x06B4,
KEY_Macedonia_DSE = 0x06B5,
KEY_Ukrainian_I = 0x06B6,
KEY_Ukranian_I = 0x06B6,
KEY_Ukrainian_YI = 0x06B7,
KEY_Ukranian_YI = 0x06B7,
KEY_Cyrillic_JE = 0x06B8,
KEY_Serbian_JE = 0x06B8,
KEY_Cyrillic_LJE = 0x06B9,
KEY_Serbian_LJE = 0x06B9,
KEY_Cyrillic_NJE = 0x06BA,
KEY_Serbian_NJE = 0x06BA,
KEY_Serbian_TSHE = 0x06BB,
KEY_Macedonia_KJE = 0x06BC,
KEY_Byelorussian_SHORTU = 0x06BE,
KEY_Cyrillic_DZHE = 0x06BF,
KEY_Serbian_DZE = 0x06BF,
KEY_Cyrillic_yu = 0x06C0,
KEY_Cyrillic_a = 0x06C1,
KEY_Cyrillic_be = 0x06C2,
KEY_Cyrillic_tse = 0x06C3,
KEY_Cyrillic_de = 0x06C4,
KEY_Cyrillic_ie = 0x06C5,
KEY_Cyrillic_ef = 0x06C6,
KEY_Cyrillic_ghe = 0x06C7,
KEY_Cyrillic_ha = 0x06C8,
KEY_Cyrillic_i = 0x06C9,
KEY_Cyrillic_shorti = 0x06CA,
KEY_Cyrillic_ka = 0x06CB,
KEY_Cyrillic_el = 0x06CC,
KEY_Cyrillic_em = 0x06CD,
KEY_Cyrillic_en = 0x06CE,
KEY_Cyrillic_o = 0x06CF,
KEY_Cyrillic_pe = 0x06D0,
KEY_Cyrillic_ya = 0x06D1,
KEY_Cyrillic_er = 0x06D2,
KEY_Cyrillic_es = 0x06D3,
KEY_Cyrillic_te = 0x06D4,
KEY_Cyrillic_u = 0x06D5,
KEY_Cyrillic_zhe = 0x06D6,
KEY_Cyrillic_ve = 0x06D7,
KEY_Cyrillic_softsign = 0x06D8,
KEY_Cyrillic_yeru = 0x06D9,
KEY_Cyrillic_ze = 0x06DA,
KEY_Cyrillic_sha = 0x06DB,
KEY_Cyrillic_e = 0x06DC,
KEY_Cyrillic_shcha = 0x06DD,
KEY_Cyrillic_che = 0x06DE,
KEY_Cyrillic_hardsign = 0x06DF,
KEY_Cyrillic_YU = 0x06E0,
KEY_Cyrillic_A = 0x06E1,
KEY_Cyrillic_BE = 0x06E2,
KEY_Cyrillic_TSE = 0x06E3,
KEY_Cyrillic_DE = 0x06E4,
KEY_Cyrillic_IE = 0x06E5,
KEY_Cyrillic_EF = 0x06E6,
KEY_Cyrillic_GHE = 0x06E7,
KEY_Cyrillic_HA = 0x06E8,
KEY_Cyrillic_I = 0x06E9,
KEY_Cyrillic_SHORTI = 0x06EA,
KEY_Cyrillic_KA = 0x06EB,
KEY_Cyrillic_EL = 0x06EC,
KEY_Cyrillic_EM = 0x06ED,
KEY_Cyrillic_EN = 0x06EE,
KEY_Cyrillic_O = 0x06EF,
KEY_Cyrillic_PE = 0x06F0,
KEY_Cyrillic_YA = 0x06F1,
KEY_Cyrillic_ER = 0x06F2,
KEY_Cyrillic_ES = 0x06F3,
KEY_Cyrillic_TE = 0x06F4,
KEY_Cyrillic_U = 0x06F5,
KEY_Cyrillic_ZHE = 0x06F6,
KEY_Cyrillic_VE = 0x06F7,
KEY_Cyrillic_SOFTSIGN = 0x06F8,
KEY_Cyrillic_YERU = 0x06F9,
KEY_Cyrillic_ZE = 0x06FA,
KEY_Cyrillic_SHA = 0x06FB,
KEY_Cyrillic_E = 0x06FC,
KEY_Cyrillic_SHCHA = 0x06FD,
KEY_Cyrillic_CHE = 0x06FE,
KEY_Cyrillic_HARDSIGN = 0x06FF,
// Greek
KEY_Greek_ALPHAaccent = 0x07A1,
KEY_Greek_EPSILONaccent = 0x07A2,
KEY_Greek_ETAaccent = 0x07A3,
KEY_Greek_IOTAaccent = 0x07A4,
KEY_Greek_IOTAdiaeresis = 0x07A5,
KEY_Greek_OMICRONaccent = 0x07A7,
KEY_Greek_UPSILONaccent = 0x07A8,
KEY_Greek_UPSILONdieresis = 0x07A9,
KEY_Greek_OMEGAaccent = 0x07AB,
KEY_Greek_accentdieresis = 0x07AE,
KEY_Greek_horizbar = 0x07AF,
KEY_Greek_alphaaccent = 0x07B1,
KEY_Greek_epsilonaccent = 0x07B2,
KEY_Greek_etaaccent = 0x07B3,
KEY_Greek_iotaaccent = 0x07B4,
KEY_Greek_iotadieresis = 0x07B5,
KEY_Greek_iotaaccentdieresis = 0x07B6,
KEY_Greek_omicronaccent = 0x07B7,
KEY_Greek_upsilonaccent = 0x07B8,
KEY_Greek_upsilondieresis = 0x07B9,
KEY_Greek_upsilonaccentdieresis = 0x07BA,
KEY_Greek_omegaaccent = 0x07BB,
KEY_Greek_ALPHA = 0x07C1,
KEY_Greek_BETA = 0x07C2,
KEY_Greek_GAMMA = 0x07C3,
KEY_Greek_DELTA = 0x07C4,
KEY_Greek_EPSILON = 0x07C5,
KEY_Greek_ZETA = 0x07C6,
KEY_Greek_ETA = 0x07C7,
KEY_Greek_THETA = 0x07C8,
KEY_Greek_IOTA = 0x07C9,
KEY_Greek_KAPPA = 0x07CA,
KEY_Greek_LAMDA = 0x07CB,
KEY_Greek_LAMBDA = 0x07CB,
KEY_Greek_MU = 0x07CC,
KEY_Greek_NU = 0x07CD,
KEY_Greek_XI = 0x07CE,
KEY_Greek_OMICRON = 0x07CF,
KEY_Greek_PI = 0x07D0,
KEY_Greek_RHO = 0x07D1,
KEY_Greek_SIGMA = 0x07D2,
KEY_Greek_TAU = 0x07D4,
KEY_Greek_UPSILON = 0x07D5,
KEY_Greek_PHI = 0x07D6,
KEY_Greek_CHI = 0x07D7,
KEY_Greek_PSI = 0x07D8,
KEY_Greek_OMEGA = 0x07D9,
KEY_Greek_alpha = 0x07E1,
KEY_Greek_beta = 0x07E2,
KEY_Greek_gamma = 0x07E3,
KEY_Greek_delta = 0x07E4,
KEY_Greek_epsilon = 0x07E5,
KEY_Greek_zeta = 0x07E6,
KEY_Greek_eta = 0x07E7,
KEY_Greek_theta = 0x07E8,
KEY_Greek_iota = 0x07E9,
KEY_Greek_kappa = 0x07EA,
KEY_Greek_lamda = 0x07EB,
KEY_Greek_lambda = 0x07EB,
KEY_Greek_mu = 0x07EC,
KEY_Greek_nu = 0x07ED,
KEY_Greek_xi = 0x07EE,
KEY_Greek_omicron = 0x07EF,
KEY_Greek_pi = 0x07F0,
KEY_Greek_rho = 0x07F1,
KEY_Greek_sigma = 0x07F2,
KEY_Greek_finalsmallsigma = 0x07F3,
KEY_Greek_tau = 0x07F4,
KEY_Greek_upsilon = 0x07F5,
KEY_Greek_phi = 0x07F6,
KEY_Greek_chi = 0x07F7,
KEY_Greek_psi = 0x07F8,
KEY_Greek_omega = 0x07F9,
KEY_Greek_switch = 0xFF7E,
// Technical
KEY_leftradical = 0x08A1,
KEY_topleftradical = 0x08A2,
KEY_horizconnector = 0x08A3,
KEY_topintegral = 0x08A4,
KEY_botintegral = 0x08A5,
KEY_vertconnector = 0x08A6,
KEY_topleftsqbracket = 0x08A7,
KEY_botleftsqbracket = 0x08A8,
KEY_toprightsqbracket = 0x08A9,
KEY_botrightsqbracket = 0x08AA,
KEY_topleftparens = 0x08AB,
KEY_botleftparens = 0x08AC,
KEY_toprightparens = 0x08AD,
KEY_botrightparens = 0x08AE,
KEY_leftmiddlecurlybrace = 0x08AF,
KEY_rightmiddlecurlybrace = 0x08B0,
KEY_topleftsummation = 0x08B1,
KEY_botleftsummation = 0x08B2,
KEY_topvertsummationconnector = 0x08B3,
KEY_botvertsummationconnector = 0x08B4,
KEY_toprightsummation = 0x08B5,
KEY_botrightsummation = 0x08B6,
KEY_rightmiddlesummation = 0x08B7,
KEY_lessthanequal = 0x08BC,
KEY_notequal = 0x08BD,
KEY_greaterthanequal = 0x08BE,
KEY_integral = 0x08BF,
KEY_therefore = 0x08C0,
KEY_variation = 0x08C1,
KEY_infinity = 0x08C2,
KEY_nabla = 0x08C5,
KEY_approximate = 0x08C8,
KEY_similarequal = 0x08C9,
KEY_ifonlyif = 0x08CD,
KEY_implies = 0x08CE,
KEY_identical = 0x08CF,
KEY_radical = 0x08D6,
KEY_includedin = 0x08DA,
KEY_includes = 0x08DB,
KEY_intersection = 0x08DC,
KEY_union = 0x08DD,
KEY_logicaland = 0x08DE,
KEY_logicalor = 0x08DF,
KEY_partialderivative = 0x08EF,
KEY_function = 0x08F6,
KEY_leftarrow = 0x08FB,
KEY_uparrow = 0x08FC,
KEY_rightarrow = 0x08FD,
KEY_downarrow = 0x08FE,
// Special
KEY_blank = 0x09DF,
KEY_soliddiamond = 0x09E0,
KEY_checkerboard = 0x09E1,
KEY_ht = 0x09E2,
KEY_ff = 0x09E3,
KEY_cr = 0x09E4,
KEY_lf = 0x09E5,
KEY_nl = 0x09E8,
KEY_vt = 0x09E9,
KEY_lowrightcorner = 0x09EA,
KEY_uprightcorner = 0x09EB,
KEY_upleftcorner = 0x09EC,
KEY_lowleftcorner = 0x09ED,
KEY_crossinglines = 0x09EE,
KEY_horizlinescan1 = 0x09EF,
KEY_horizlinescan3 = 0x09F0,
KEY_horizlinescan5 = 0x09F1,
KEY_horizlinescan7 = 0x09F2,
KEY_horizlinescan9 = 0x09F3,
KEY_leftt = 0x09F4,
KEY_rightt = 0x09F5,
KEY_bott = 0x09F6,
KEY_topt = 0x09F7,
KEY_vertbar = 0x09F8,
// Publishing
KEY_emspace = 0x0AA1,
KEY_enspace = 0x0AA2,
KEY_em3space = 0x0AA3,
KEY_em4space = 0x0AA4,
KEY_digitspace = 0x0AA5,
KEY_punctspace = 0x0AA6,
KEY_thinspace = 0x0AA7,
KEY_hairspace = 0x0AA8,
KEY_emdash = 0x0AA9,
KEY_endash = 0x0AAA,
KEY_signifblank = 0x0AAC,
KEY_ellipsis = 0x0AAE,
KEY_doubbaselinedot = 0x0AAF,
KEY_onethird = 0x0AB0,
KEY_twothirds = 0x0AB1,
KEY_onefifth = 0x0AB2,
KEY_twofifths = 0x0AB3,
KEY_threefifths = 0x0AB4,
KEY_fourfifths = 0x0AB5,
KEY_onesixth = 0x0AB6,
KEY_fivesixths = 0x0AB7,
KEY_careof = 0x0AB8,
KEY_figdash = 0x0ABB,
KEY_leftanglebracket = 0x0ABC,
KEY_decimalpoint = 0x0ABD,
KEY_rightanglebracket = 0x0ABE,
KEY_marker = 0x0ABF,
KEY_oneeighth = 0x0AC3,
KEY_threeeighths = 0x0AC4,
KEY_fiveeighths = 0x0AC5,
KEY_seveneighths = 0x0AC6,
KEY_trademark = 0x0AC9,
KEY_signaturemark = 0x0ACA,
KEY_trademarkincircle = 0x0ACB,
KEY_leftopentriangle = 0x0ACC,
KEY_rightopentriangle = 0x0ACD,
KEY_emopencircle = 0x0ACE,
KEY_emopenrectangle = 0x0ACF,
KEY_leftsinglequotemark = 0x0AD0,
KEY_rightsinglequotemark = 0x0AD1,
KEY_leftdoublequotemark = 0x0AD2,
KEY_rightdoublequotemark = 0x0AD3,
KEY_prescription = 0x0AD4,
KEY_minutes = 0x0AD6,
KEY_seconds = 0x0AD7,
KEY_latincross = 0x0AD9,
KEY_hexagram = 0x0ADA,
KEY_filledrectbullet = 0x0ADB,
KEY_filledlefttribullet = 0x0ADC,
KEY_filledrighttribullet = 0x0ADD,
KEY_emfilledcircle = 0x0ADE,
KEY_emfilledrect = 0x0ADF,
KEY_enopencircbullet = 0x0AE0,
KEY_enopensquarebullet = 0x0AE1,
KEY_openrectbullet = 0x0AE2,
KEY_opentribulletup = 0x0AE3,
KEY_opentribulletdown = 0x0AE4,
KEY_openstar = 0x0AE5,
KEY_enfilledcircbullet = 0x0AE6,
KEY_enfilledsqbullet = 0x0AE7,
KEY_filledtribulletup = 0x0AE8,
KEY_filledtribulletdown = 0x0AE9,
KEY_leftpointer = 0x0AEA,
KEY_rightpointer = 0x0AEB,
KEY_club = 0x0AEC,
KEY_diamond = 0x0AED,
KEY_heart = 0x0AEE,
KEY_maltesecross = 0x0AF0,
KEY_dagger = 0x0AF1,
KEY_doubledagger = 0x0AF2,
KEY_checkmark = 0x0AF3,
KEY_ballotcross = 0x0AF4,
KEY_musicalsharp = 0x0AF5,
KEY_musicalflat = 0x0AF6,
KEY_malesymbol = 0x0AF7,
KEY_femalesymbol = 0x0AF8,
KEY_telephone = 0x0AF9,
KEY_telephonerecorder = 0x0AFA,
KEY_phonographcopyright = 0x0AFB,
KEY_caret = 0x0AFC,
KEY_singlelowquotemark = 0x0AFD,
KEY_doublelowquotemark = 0x0AFE,
KEY_cursor = 0x0AFF,
// APL
KEY_leftcaret = 0x0BA3,
KEY_rightcaret = 0x0BA6,
KEY_downcaret = 0x0BA8,
KEY_upcaret = 0x0BA9,
KEY_overbar = 0x0BC0,
KEY_downtack = 0x0BC2,
KEY_upshoe = 0x0BC3,
KEY_downstile = 0x0BC4,
KEY_underbar = 0x0BC6,
KEY_jot = 0x0BCA,
KEY_quad = 0x0BCC,
KEY_uptack = 0x0BCE,
KEY_circle = 0x0BCF,
KEY_upstile = 0x0BD3,
KEY_downshoe = 0x0BD6,
KEY_rightshoe = 0x0BD8,
KEY_leftshoe = 0x0BDA,
KEY_lefttack = 0x0BDC,
KEY_righttack = 0x0BFC,
// Hebrew
KEY_hebrew_doublelowline = 0x0CDF,
KEY_hebrew_aleph = 0x0CE0,
KEY_hebrew_bet = 0x0CE1,
KEY_hebrew_beth = 0x0CE1,
KEY_hebrew_gimel = 0x0CE2,
KEY_hebrew_gimmel = 0x0CE2,
KEY_hebrew_dalet = 0x0CE3,
KEY_hebrew_daleth = 0x0CE3,
KEY_hebrew_he = 0x0CE4,
KEY_hebrew_waw = 0x0CE5,
KEY_hebrew_zain = 0x0CE6,
KEY_hebrew_zayin = 0x0CE6,
KEY_hebrew_chet = 0x0CE7,
KEY_hebrew_het = 0x0CE7,
KEY_hebrew_tet = 0x0CE8,
KEY_hebrew_teth = 0x0CE8,
KEY_hebrew_yod = 0x0CE9,
KEY_hebrew_finalkaph = 0x0CEA,
KEY_hebrew_kaph = 0x0CEB,
KEY_hebrew_lamed = 0x0CEC,
KEY_hebrew_finalmem = 0x0CED,
KEY_hebrew_mem = 0x0CEE,
KEY_hebrew_finalnun = 0x0CEF,
KEY_hebrew_nun = 0x0CF0,
KEY_hebrew_samech = 0x0CF1,
KEY_hebrew_samekh = 0x0CF1,
KEY_hebrew_ayin = 0x0CF2,
KEY_hebrew_finalpe = 0x0CF3,
KEY_hebrew_pe = 0x0CF4,
KEY_hebrew_finalzade = 0x0CF5,
KEY_hebrew_finalzadi = 0x0CF5,
KEY_hebrew_zade = 0x0CF6,
KEY_hebrew_zadi = 0x0CF6,
KEY_hebrew_qoph = 0x0CF7,
KEY_hebrew_kuf = 0x0CF7,
KEY_hebrew_resh = 0x0CF8,
KEY_hebrew_shin = 0x0CF9,
KEY_hebrew_taw = 0x0CFA,
KEY_hebrew_taf = 0x0CFA,
KEY_Hebrew_switch = 0xFF7E,
// Thai
KEY_Thai_kokai = 0x0DA1,
KEY_Thai_khokhai = 0x0DA2,
KEY_Thai_khokhuat = 0x0DA3,
KEY_Thai_khokhwai = 0x0DA4,
KEY_Thai_khokhon = 0x0DA5,
KEY_Thai_khorakhang = 0x0DA6,
KEY_Thai_ngongu = 0x0DA7,
KEY_Thai_chochan = 0x0DA8,
KEY_Thai_choching = 0x0DA9,
KEY_Thai_chochang = 0x0DAA,
KEY_Thai_soso = 0x0DAB,
KEY_Thai_chochoe = 0x0DAC,
KEY_Thai_yoying = 0x0DAD,
KEY_Thai_dochada = 0x0DAE,
KEY_Thai_topatak = 0x0DAF,
KEY_Thai_thothan = 0x0DB0,
KEY_Thai_thonangmontho = 0x0DB1,
KEY_Thai_thophuthao = 0x0DB2,
KEY_Thai_nonen = 0x0DB3,
KEY_Thai_dodek = 0x0DB4,
KEY_Thai_totao = 0x0DB5,
KEY_Thai_thothung = 0x0DB6,
KEY_Thai_thothahan = 0x0DB7,
KEY_Thai_thothong = 0x0DB8,
KEY_Thai_nonu = 0x0DB9,
KEY_Thai_bobaimai = 0x0DBA,
KEY_Thai_popla = 0x0DBB,
KEY_Thai_phophung = 0x0DBC,
KEY_Thai_fofa = 0x0DBD,
KEY_Thai_phophan = 0x0DBE,
KEY_Thai_fofan = 0x0DBF,
KEY_Thai_phosamphao = 0x0DC0,
KEY_Thai_moma = 0x0DC1,
KEY_Thai_yoyak = 0x0DC2,
KEY_Thai_rorua = 0x0DC3,
KEY_Thai_ru = 0x0DC4,
KEY_Thai_loling = 0x0DC5,
KEY_Thai_lu = 0x0DC6,
KEY_Thai_wowaen = 0x0DC7,
KEY_Thai_sosala = 0x0DC8,
KEY_Thai_sorusi = 0x0DC9,
KEY_Thai_sosua = 0x0DCA,
KEY_Thai_hohip = 0x0DCB,
KEY_Thai_lochula = 0x0DCC,
KEY_Thai_oang = 0x0DCD,
KEY_Thai_honokhuk = 0x0DCE,
KEY_Thai_paiyannoi = 0x0DCF,
KEY_Thai_saraa = 0x0DD0,
KEY_Thai_maihanakat = 0x0DD1,
KEY_Thai_saraaa = 0x0DD2,
KEY_Thai_saraam = 0x0DD3,
KEY_Thai_sarai = 0x0DD4,
KEY_Thai_saraii = 0x0DD5,
KEY_Thai_saraue = 0x0DD6,
KEY_Thai_sarauee = 0x0DD7,
KEY_Thai_sarau = 0x0DD8,
KEY_Thai_sarauu = 0x0DD9,
KEY_Thai_phinthu = 0x0DDA,
KEY_Thai_maihanakat_maitho = 0x0DDE,
KEY_Thai_baht = 0x0DDF,
KEY_Thai_sarae = 0x0DE0,
KEY_Thai_saraae = 0x0DE1,
KEY_Thai_sarao = 0x0DE2,
KEY_Thai_saraaimaimuan = 0x0DE3,
KEY_Thai_saraaimaimalai = 0x0DE4,
KEY_Thai_lakkhangyao = 0x0DE5,
KEY_Thai_maiyamok = 0x0DE6,
KEY_Thai_maitaikhu = 0x0DE7,
KEY_Thai_maiek = 0x0DE8,
KEY_Thai_maitho = 0x0DE9,
KEY_Thai_maitri = 0x0DEA,
KEY_Thai_maichattawa = 0x0DEB,
KEY_Thai_thanthakhat = 0x0DEC,
KEY_Thai_nikhahit = 0x0DED,
KEY_Thai_leksun = 0x0DF0,
KEY_Thai_leknung = 0x0DF1,
KEY_Thai_leksong = 0x0DF2,
KEY_Thai_leksam = 0x0DF3,
KEY_Thai_leksi = 0x0DF4,
KEY_Thai_lekha = 0x0DF5,
KEY_Thai_lekhok = 0x0DF6,
KEY_Thai_lekchet = 0x0DF7,
KEY_Thai_lekpaet = 0x0DF8,
KEY_Thai_lekkao = 0x0DF9,
// Korean
KEY_Hangul = 0xFF31,
KEY_Hangul_Start = 0xFF32,
KEY_Hangul_End = 0xFF33,
KEY_Hangul_Hanja = 0xFF34,
KEY_Hangul_Jamo = 0xFF35,
KEY_Hangul_Romaja = 0xFF36,
KEY_Hangul_Codeinput = 0xFF37,
KEY_Hangul_Jeonja = 0xFF38,
KEY_Hangul_Banja = 0xFF39,
KEY_Hangul_PreHanja = 0xFF3A,
KEY_Hangul_PostHanja = 0xFF3B,
KEY_Hangul_SingleCandidate = 0xFF3C,
KEY_Hangul_MultipleCandidate = 0xFF3D,
KEY_Hangul_PreviousCandidate = 0xFF3E,
KEY_Hangul_Special = 0xFF3F,
KEY_Hangul_switch = 0xFF7E,
KEY_Hangul_Kiyeog = 0x0EA1,
KEY_Hangul_SsangKiyeog = 0x0EA2,
KEY_Hangul_KiyeogSios = 0x0EA3,
KEY_Hangul_Nieun = 0x0EA4,
KEY_Hangul_NieunJieuj = 0x0EA5,
KEY_Hangul_NieunHieuh = 0x0EA6,
KEY_Hangul_Dikeud = 0x0EA7,
KEY_Hangul_SsangDikeud = 0x0EA8,
KEY_Hangul_Rieul = 0x0EA9,
KEY_Hangul_RieulKiyeog = 0x0EAA,
KEY_Hangul_RieulMieum = 0x0EAB,
KEY_Hangul_RieulPieub = 0x0EAC,
KEY_Hangul_RieulSios = 0x0EAD,
KEY_Hangul_RieulTieut = 0x0EAE,
KEY_Hangul_RieulPhieuf = 0x0EAF,
KEY_Hangul_RieulHieuh = 0x0EB0,
KEY_Hangul_Mieum = 0x0EB1,
KEY_Hangul_Pieub = 0x0EB2,
KEY_Hangul_SsangPieub = 0x0EB3,
KEY_Hangul_PieubSios = 0x0EB4,
KEY_Hangul_Sios = 0x0EB5,
KEY_Hangul_SsangSios = 0x0EB6,
KEY_Hangul_Ieung = 0x0EB7,
KEY_Hangul_Jieuj = 0x0EB8,
KEY_Hangul_SsangJieuj = 0x0EB9,
KEY_Hangul_Cieuc = 0x0EBA,
KEY_Hangul_Khieuq = 0x0EBB,
KEY_Hangul_Tieut = 0x0EBC,
KEY_Hangul_Phieuf = 0x0EBD,
KEY_Hangul_Hieuh = 0x0EBE,
KEY_Hangul_A = 0x0EBF,
KEY_Hangul_AE = 0x0EC0,
KEY_Hangul_YA = 0x0EC1,
KEY_Hangul_YAE = 0x0EC2,
KEY_Hangul_EO = 0x0EC3,
KEY_Hangul_E = 0x0EC4,
KEY_Hangul_YEO = 0x0EC5,
KEY_Hangul_YE = 0x0EC6,
KEY_Hangul_O = 0x0EC7,
KEY_Hangul_WA = 0x0EC8,
KEY_Hangul_WAE = 0x0EC9,
KEY_Hangul_OE = 0x0ECA,
KEY_Hangul_YO = 0x0ECB,
KEY_Hangul_U = 0x0ECC,
KEY_Hangul_WEO = 0x0ECD,
KEY_Hangul_WE = 0x0ECE,
KEY_Hangul_WI = 0x0ECF,
KEY_Hangul_YU = 0x0ED0,
KEY_Hangul_EU = 0x0ED1,
KEY_Hangul_YI = 0x0ED2,
KEY_Hangul_I = 0x0ED3,
KEY_Hangul_J_Kiyeog = 0x0ED4,
KEY_Hangul_J_SsangKiyeog = 0x0ED5,
KEY_Hangul_J_KiyeogSios = 0x0ED6,
KEY_Hangul_J_Nieun = 0x0ED7,
KEY_Hangul_J_NieunJieuj = 0x0ED8,
KEY_Hangul_J_NieunHieuh = 0x0ED9,
KEY_Hangul_J_Dikeud = 0x0EDA,
KEY_Hangul_J_Rieul = 0x0EDB,
KEY_Hangul_J_RieulKiyeog = 0x0EDC,
KEY_Hangul_J_RieulMieum = 0x0EDD,
KEY_Hangul_J_RieulPieub = 0x0EDE,
KEY_Hangul_J_RieulSios = 0x0EDF,
KEY_Hangul_J_RieulTieut = 0x0EE0,
KEY_Hangul_J_RieulPhieuf = 0x0EE1,
KEY_Hangul_J_RieulHieuh = 0x0EE2,
KEY_Hangul_J_Mieum = 0x0EE3,
KEY_Hangul_J_Pieub = 0x0EE4,
KEY_Hangul_J_PieubSios = 0x0EE5,
KEY_Hangul_J_Sios = 0x0EE6,
KEY_Hangul_J_SsangSios = 0x0EE7,
KEY_Hangul_J_Ieung = 0x0EE8,
KEY_Hangul_J_Jieuj = 0x0EE9,
KEY_Hangul_J_Cieuc = 0x0EEA,
KEY_Hangul_J_Khieuq = 0x0EEB,
KEY_Hangul_J_Tieut = 0x0EEC,
KEY_Hangul_J_Phieuf = 0x0EED,
KEY_Hangul_J_Hieuh = 0x0EEE,
KEY_Hangul_RieulYeorinHieuh = 0x0EEF,
KEY_Hangul_SunkyeongeumMieum = 0x0EF0,
KEY_Hangul_SunkyeongeumPieub = 0x0EF1,
KEY_Hangul_PanSios = 0x0EF2,
KEY_Hangul_KkogjiDalrinIeung = 0x0EF3,
KEY_Hangul_SunkyeongeumPhieuf = 0x0EF4,
KEY_Hangul_YeorinHieuh = 0x0EF5,
KEY_Hangul_AraeA = 0x0EF6,
KEY_Hangul_AraeAE = 0x0EF7,
KEY_Hangul_J_PanSios = 0x0EF8,
KEY_Hangul_J_KkogjiDalrinIeung = 0x0EF9,
KEY_Hangul_J_YeorinHieuh = 0x0EFA,
KEY_Korean_Won = 0x0EFF
};
}
#ifndef FX_NO_GLOBAL_NAMESPACE
using namespace FX;
#endif
#endif
fox-1.6.49/include/FXFontSelector.h 0000664 0001750 0001750 00000011200 12130340076 013761 0000000 0000000 /********************************************************************************
* *
* F o n t S e l e c t i o n B o x *
* *
*********************************************************************************
* Copyright (C) 1999,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXFontSelector.h,v 1.18 2006/01/22 17:58:02 fox Exp $ *
********************************************************************************/
#ifndef FXFONTSELECTOR_H
#define FXFONTSELECTOR_H
#ifndef FXPACKER_H
#include "FXPacker.h"
#endif
namespace FX {
class FXTextField;
class FXList;
class FXComboBox;
class FXLabel;
class FXButton;
class FXCheckButton;
class FXFont;
/// Font selection widget
class FXAPI FXFontSelector : public FXPacker {
FXDECLARE(FXFontSelector)
protected:
FXTextField *family;
FXList *familylist;
FXTextField *weight;
FXList *weightlist;
FXTextField *style;
FXList *stylelist;
FXTextField *size;
FXList *sizelist;
FXComboBox *charset;
FXComboBox *setwidth;
FXComboBox *pitch;
FXCheckButton *scalable;
FXCheckButton *allfonts;
FXButton *accept;
FXButton *cancel;
FXLabel *preview;
FXFont *previewfont;
FXFontDesc selected;
protected:
FXFontSelector(){}
void listFontFaces();
void listWeights();
void listSlants();
void listFontSizes();
void previewFont();
private:
FXFontSelector(const FXFontSelector&);
FXFontSelector &operator=(const FXFontSelector&);
public:
long onCmdFamily(FXObject*,FXSelector,void*);
long onCmdWeight(FXObject*,FXSelector,void*);
long onCmdStyle(FXObject*,FXSelector,void*);
long onCmdStyleText(FXObject*,FXSelector,void*);
long onCmdSize(FXObject*,FXSelector,void*);
long onCmdSizeText(FXObject*,FXSelector,void*);
long onCmdCharset(FXObject*,FXSelector,void*);
long onUpdCharset(FXObject*,FXSelector,void*);
long onCmdSetWidth(FXObject*,FXSelector,void*);
long onUpdSetWidth(FXObject*,FXSelector,void*);
long onCmdPitch(FXObject*,FXSelector,void*);
long onUpdPitch(FXObject*,FXSelector,void*);
long onCmdScalable(FXObject*,FXSelector,void*);
long onUpdScalable(FXObject*,FXSelector,void*);
long onCmdAllFonts(FXObject*,FXSelector,void*);
long onUpdAllFonts(FXObject*,FXSelector,void*);
public:
enum{
ID_FAMILY=FXPacker::ID_LAST,
ID_WEIGHT,
ID_STYLE,
ID_STYLE_TEXT,
ID_SIZE,
ID_SIZE_TEXT,
ID_CHARSET,
ID_SETWIDTH,
ID_PITCH,
ID_SCALABLE,
ID_ALLFONTS,
ID_LAST
};
public:
/// Constructor
FXFontSelector(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Create server-side resources
virtual void create();
/// Return a pointer to the "Accept" button
FXButton *acceptButton() const { return accept; }
/// Return a pointer to the "Cancel" button
FXButton *cancelButton() const { return cancel; }
/// Set font selection
void setFontSelection(const FXFontDesc& fontdesc);
/// Get font selection
void getFontSelection(FXFontDesc& fontdesc) const;
/// Save to a stream
virtual void save(FXStream& store) const;
/// Load from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXFontSelector();
};
}
#endif
fox-1.6.49/include/FXScrollArea.h 0000664 0001750 0001750 00000014465 12130340076 013421 0000000 0000000 /********************************************************************************
* *
* S c r o l l A r e a W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXScrollArea.h,v 1.29 2006/01/22 17:58:09 fox Exp $ *
********************************************************************************/
#ifndef FXSCROLLAREA_H
#define FXSCROLLAREA_H
#ifndef FXCOMPOSITE_H
#include "FXComposite.h"
#endif
namespace FX {
/// Scrollbar options
enum {
SCROLLERS_NORMAL = 0, /// Show the scrollbars when needed
HSCROLLER_ALWAYS = 0x00008000, /// Always show horizontal scrollers
HSCROLLER_NEVER = 0x00010000, /// Never show horizontal scrollers
VSCROLLER_ALWAYS = 0x00020000, /// Always show vertical scrollers
VSCROLLER_NEVER = 0x00040000, /// Never show vertical scrollers
HSCROLLING_ON = 0, /// Horizontal scrolling turned on (default)
HSCROLLING_OFF = HSCROLLER_NEVER|HSCROLLER_ALWAYS, /// Horizontal scrolling turned off
VSCROLLING_ON = 0, /// Vertical scrolling turned on (default)
VSCROLLING_OFF = VSCROLLER_NEVER|VSCROLLER_ALWAYS, /// Vertical scrolling turned off
SCROLLERS_TRACK = 0, /// Scrollers track continuously for smooth scrolling
SCROLLERS_DONT_TRACK = 0x00080000 /// Scrollers don't track continuously
};
class FXScrollBar;
class FXScrollCorner;
/**
* The scroll area widget manages a content area and a viewport
* area through which the content is viewed. When the content area
* becomes larger than the viewport area, scrollbars are placed to
* permit viewing of the entire content by scrolling the content.
* Depending on the mode, scrollbars may be displayed on an as-needed
* basis, always, or never.
* Normally, the scroll area's size and the content's size are independent;
* however, it is possible to disable scrolling in the horizontal
* (vertical) direction. In this case, the content width (height)
* will influence the width (height) of the scroll area widget.
* For content which is time-consuming to repaint, continuous
* scrolling may be turned off.
*/
class FXAPI FXScrollArea : public FXComposite {
FXDECLARE(FXScrollArea)
protected:
FXScrollBar *horizontal; // Horizontal scroll bar
FXScrollBar *vertical; // Vertical scroll bar
FXScrollCorner *corner; // Scroll corner
FXint viewport_w; // Viewport width
FXint viewport_h; // Viewport height
FXint pos_x; // X scroll position (pos_x<=0)
FXint pos_y; // Y scroll position (pos_y<=0)
protected:
FXScrollArea();
FXbool startAutoScroll(FXEvent *event,FXbool onlywheninside=FALSE);
void stopAutoScroll();
FXScrollArea(FXComposite* p,FXuint opts,FXint x,FXint y,FXint w,FXint h);
virtual void moveContents(FXint x,FXint y);
private:
FXScrollArea(const FXScrollArea&);
FXScrollArea &operator=(const FXScrollArea&);
public:
long onHMouseWheel(FXObject*,FXSelector,void*);
long onVMouseWheel(FXObject*,FXSelector,void*);
long onHScrollerChanged(FXObject*,FXSelector,void*);
long onVScrollerChanged(FXObject*,FXSelector,void*);
long onHScrollerDragged(FXObject*,FXSelector,void*);
long onVScrollerDragged(FXObject*,FXSelector,void*);
long onAutoScroll(FXObject*,FXSelector,void*);
public:
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Perform layout
virtual void layout();
/// Return viewport height
virtual FXint getViewportHeight();
/// Return viewport width
virtual FXint getViewportWidth();
/// Return content width
virtual FXint getContentWidth();
/// Return content height
virtual FXint getContentHeight();
/// Change scroll style
void setScrollStyle(FXuint style);
/// Return scroll style
FXuint getScrollStyle() const;
/// Return TRUE if horizontally scrollable
FXbool isHorizontalScrollable() const;
/// Return TRUE if vertically scrollable
FXbool isVerticalScrollable() const;
/// Return a pointer to the horizontal scrollbar
FXScrollBar* horizontalScrollBar() const { return horizontal; }
/// Return a pointer to the vertical scrollbar
FXScrollBar* verticalScrollBar() const { return vertical; }
/// Return the current x-position
FXint getXPosition() const { return pos_x; }
/// Return the current y-position
FXint getYPosition() const { return pos_y; }
/// Set the current position
void setPosition(FXint x,FXint y);
/// Get the current position
void getPosition(FXint& x,FXint& y) const { x=pos_x; y=pos_y; }
/// Destructor
virtual ~FXScrollArea();
};
}
#endif
fox-1.6.49/include/FXCP1252Codec.h 0000644 0001750 0001750 00000001106 11637250333 013135 0000000 0000000 #ifndef FXCP1252CODEC_H
#define FXCP1252CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// CP1252 Codec
class FXAPI FXCP1252Codec : public FXTextCodec {
FXDECLARE(FXCP1252Codec)
public:
FXCP1252Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FXCP1252Codec(){}
};
}
#endif
fox-1.6.49/include/FXMessageBox.h 0000664 0001750 0001750 00000014461 12130340076 013423 0000000 0000000 /********************************************************************************
* *
* M e s s a g e B o x e s *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXMessageBox.h,v 1.28 2006/01/22 17:58:06 fox Exp $ *
********************************************************************************/
#ifndef FXMESSAGEBOX_H
#define FXMESSAGEBOX_H
#ifndef FXDIALOGBOX_H
#include "FXDialogBox.h"
#endif
namespace FX {
// Message box buttons
enum {
MBOX_OK = 0x10000000, /// Message box has a only an OK button
MBOX_OK_CANCEL = 0x20000000, /// Message box has OK and CANCEL buttons
MBOX_YES_NO = 0x30000000, /// Message box has YES and NO buttons
MBOX_YES_NO_CANCEL = 0x40000000, /// Message box has YES, NO, and CANCEL buttons
MBOX_QUIT_CANCEL = 0x50000000, /// Message box has QUIT and CANCEL buttons
MBOX_QUIT_SAVE_CANCEL = 0x60000000, /// Message box has QUIT, SAVE, and CANCEL buttons
MBOX_SKIP_SKIPALL_CANCEL = 0x70000000, /// Message box has SKIP, SKIP ALL, and CANCEL buttons
MBOX_SAVE_CANCEL_DONTSAVE = 0x80000000 /// Message box has DON'T SAVE,CANCEL and SAVE buttons
};
// Return values
enum {
MBOX_CLICKED_YES = 1, /// The YES button was clicked
MBOX_CLICKED_NO = 2, /// The NO button was clicked
MBOX_CLICKED_OK = 3, /// The OK button was clicked
MBOX_CLICKED_CANCEL = 4, /// The CANCEL button was clicked
MBOX_CLICKED_QUIT = 5, /// The QUIT button was clicked
MBOX_CLICKED_SAVE = 6, /// The SAVE button was clicked
MBOX_CLICKED_SKIP = 7, /// The SKIP button was clicked
MBOX_CLICKED_SKIPALL = 8 /// The SKIP ALL button was clicked
};
/**
* A Message Box is a convenience class which provides a dialog for
* very simple common yes/no type interactions with the user.
* The message box has an optional icon, a title string, and the question
* which is presented to the user. It also has up to three buttons which
* furnish standard responses to the question.
* Message boxes are usually ran modally: the question must be answered
* before the program may continue.
*/
class FXAPI FXMessageBox : public FXDialogBox {
FXDECLARE(FXMessageBox)
protected:
FXMessageBox(){}
private:
FXMessageBox(const FXMessageBox&);
FXMessageBox &operator=(const FXMessageBox&);
void initialize(const FXString& text,FXIcon* ic,FXuint whichbuttons);
public:
long onCmdClicked(FXObject*,FXSelector,void*);
long onCmdCancel(FXObject*,FXSelector,void*);
public:
enum{
ID_CLICKED_YES=FXDialogBox::ID_LAST,
ID_CLICKED_NO,
ID_CLICKED_OK,
ID_CLICKED_CANCEL,
ID_CLICKED_QUIT,
ID_CLICKED_SAVE,
ID_CLICKED_SKIP,
ID_CLICKED_SKIPALL,
ID_LAST
};
public:
/// Construct message box with given caption, icon, and message text
FXMessageBox(FXWindow* owner,const FXString& caption,const FXString& text,FXIcon* ic=NULL,FXuint opts=0,FXint x=0,FXint y=0);
/// Construct free floating message box with given caption, icon, and message text
FXMessageBox(FXApp* app,const FXString& caption,const FXString& text,FXIcon* ic=NULL,FXuint opts=0,FXint x=0,FXint y=0);
/**
* Show a modal error message.
* The text message may contain printf-tyle formatting commands.
*/
static FXuint error(FXWindow* owner,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
/**
* Show modal error message, in free floating window.
*/
static FXuint error(FXApp* app,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
/**
* Show a modal warning message
* The text message may contain printf-tyle formatting commands.
*/
static FXuint warning(FXWindow* owner,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
/**
* Show modal warning message, in free floating window.
*/
static FXuint warning(FXApp* app,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
/**
* Show a modal question dialog
* The text message may contain printf-tyle formatting commands.
*/
static FXuint question(FXWindow* owner,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
/**
* Show modal question message, in free floating window.
*/
static FXuint question(FXApp* app,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
/**
* Show a modal information dialog
* The text message may contain printf-tyle formatting commands.
*/
static FXuint information(FXWindow* owner,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
/**
* Show modal information message, in free floating window.
*/
static FXuint information(FXApp* app,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
};
}
#endif
fox-1.6.49/include/FXRealSlider.h 0000664 0001750 0001750 00000020777 12130340076 013423 0000000 0000000 /********************************************************************************
* *
* R e a l S l i d e r W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXRealSlider.h,v 1.11 2006/01/22 17:58:08 fox Exp $ *
********************************************************************************/
#ifndef FXREALSLIDER_H
#define FXREALSLIDER_H
#ifndef FXFRAME_H
#include "FXFrame.h"
#endif
namespace FX {
/// Slider Control styles
enum {
REALSLIDER_HORIZONTAL = 0, /// Slider shown horizontally
REALSLIDER_VERTICAL = 0x00008000, /// Slider shown vertically
REALSLIDER_ARROW_UP = 0x00010000, /// Slider has arrow head pointing up
REALSLIDER_ARROW_DOWN = 0x00020000, /// Slider has arrow head pointing down
REALSLIDER_ARROW_LEFT = REALSLIDER_ARROW_UP, /// Slider has arrow head pointing left
REALSLIDER_ARROW_RIGHT = REALSLIDER_ARROW_DOWN, /// Slider has arrow head pointing right
REALSLIDER_INSIDE_BAR = 0x00040000, /// Slider is inside the slot rather than overhanging
REALSLIDER_TICKS_TOP = 0x00080000, /// Ticks on the top of horizontal slider
REALSLIDER_TICKS_BOTTOM = 0x00100000, /// Ticks on the bottom of horizontal slider
REALSLIDER_TICKS_LEFT = REALSLIDER_TICKS_TOP, /// Ticks on the left of vertical slider
REALSLIDER_TICKS_RIGHT = REALSLIDER_TICKS_BOTTOM, /// Ticks on the right of vertical slider
REALSLIDER_NORMAL = REALSLIDER_HORIZONTAL
};
/**
* The real slider widget is a valuator widget which provides simple linear value range.
* Two visual appearances are supported:- the sunken look, which is enabled with
* the SLIDER_INSIDE_BAR option and the regular look. The latter may have optional
* arrows on the slider thumb.
* While being moved, the real slider sends a SEL_CHANGED message to its target;
* at the end of the interaction, a SEL_COMMAND message is sent.
* The message data represents the current slider value, of type pointer to FXdouble.
*/
class FXAPI FXRealSlider : public FXFrame {
FXDECLARE(FXRealSlider)
protected:
FXdouble range[2]; // Reported data range
FXdouble pos; // Reported data position
FXdouble incr; // Increment when auto-sliding
FXdouble delta; // Interval between ticks
FXint headpos; // Head position
FXint headsize; // Head size
FXint slotsize; // Slot size
FXColor slotColor; // Color of slot the head moves in
FXint dragpoint; // Where on the head is grabbed
FXString help; // Help string
FXString tip; // Tip string
protected:
FXRealSlider();
void drawSliderHead(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawHorzTicks(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawVertTicks(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
private:
FXRealSlider(const FXRealSlider&);
FXRealSlider &operator=(const FXRealSlider&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onMouseWheel(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onMiddleBtnPress(FXObject*,FXSelector,void*);
long onMiddleBtnRelease(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onUngrabbed(FXObject*,FXSelector,void*);
long onAutoSlide(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetIntValue(FXObject*,FXSelector,void*);
long onCmdGetIntValue(FXObject*,FXSelector,void*);
long onCmdSetRealValue(FXObject*,FXSelector,void*);
long onCmdGetRealValue(FXObject*,FXSelector,void*);
long onCmdSetIntRange(FXObject*,FXSelector,void*);
long onCmdGetIntRange(FXObject*,FXSelector,void*);
long onCmdSetRealRange(FXObject*,FXSelector,void*);
long onCmdGetRealRange(FXObject*,FXSelector,void*);
long onCmdSetHelp(FXObject*,FXSelector,void*);
long onCmdGetHelp(FXObject*,FXSelector,void*);
long onCmdSetTip(FXObject*,FXSelector,void*);
long onCmdGetTip(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
public:
enum{
ID_AUTOSLIDE=FXFrame::ID_LAST,
ID_LAST
};
public:
/// Construct a slider widget
FXRealSlider(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=REALSLIDER_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=0,FXint pr=0,FXint pt=0,FXint pb=0);
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Returns true because a slider can receive focus
virtual bool canFocus() const;
/// Perform layout
virtual void layout();
/// Enable the slider
virtual void enable();
/// Disable the slider
virtual void disable();
/// Change slider value
void setValue(FXdouble value,FXbool notify=FALSE);
/// Return slider value
FXdouble getValue() const { return pos; }
/// Change the slider's range
void setRange(FXdouble lo,FXdouble hi,FXbool notify=FALSE);
/// Get the slider's current range
void getRange(FXdouble& lo,FXdouble& hi) const { lo=range[0]; hi=range[1]; }
/// Change the slider style
FXuint getSliderStyle() const;
/// Get the current slider style
void setSliderStyle(FXuint style);
/// Get the slider's head size
FXint getHeadSize() const { return headsize; }
/// Change the slider's head size
void setHeadSize(FXint hs);
/// Get the slider's current slot size
FXint getSlotSize() const { return slotsize; }
/// Change the slider's slot size
void setSlotSize(FXint bs);
/// Get the slider's auto-increment/decrement value
FXdouble getIncrement() const { return incr; }
/// Change the slider's auto-increment/decrement value
void setIncrement(FXdouble inc);
/// Change the delta between ticks
void setTickDelta(FXdouble dist);
/// Get delta between ticks
FXdouble getTickDelta() const { return delta; }
/// Change the color of the slot the slider head moves in
void setSlotColor(FXColor clr);
/// Get the current slot color
FXColor getSlotColor() const { return slotColor; }
/// Set the help text to be displayed on the status line
void setHelpText(const FXString& text){ help=text; }
/// Get the current help text
const FXString& getHelpText() const { return help; }
/// Set the tip text to be displayed in the tooltip
void setTipText(const FXString& text){ tip=text; }
/// Get the current tooltip text value
const FXString& getTipText() const { return tip; }
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
/// Destroy the slider
virtual ~FXRealSlider();
};
}
#endif
fox-1.6.49/include/FXRASImage.h 0000664 0001750 0001750 00000006256 12130340076 012761 0000000 0000000 /********************************************************************************
* *
* S U N R A S T E R I m a g e O b j e c t *
* *
*********************************************************************************
* Copyright (C) 2004,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXRASImage.h,v 1.8 2006/01/22 17:58:07 fox Exp $ *
********************************************************************************/
#ifndef FXRASIMAGE_H
#define FXRASIMAGE_H
#ifndef FXIMAGE_H
#include "FXImage.h"
#endif
namespace FX {
/// SUN Raster Image format
class FXAPI FXRASImage : public FXImage {
FXDECLARE(FXRASImage)
protected:
FXRASImage(){}
private:
FXRASImage(const FXRASImage&);
FXRASImage &operator=(const FXRASImage&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct image from memory stream formatted in SUN Raster Image format
FXRASImage(FXApp* a,const void *pix=NULL,FXuint opts=0,FXint w=1,FXint h=1);
/// Save pixels into stream in SUN Raster Image format
virtual bool savePixels(FXStream& store) const;
/// Load pixels from stream in SUN Raster Image format
virtual bool loadPixels(FXStream& store);
/// Destroy icon
virtual ~FXRASImage();
};
/**
* Check if stream contains a RAS, return TRUE if so.
*/
extern FXAPI bool fxcheckRAS(FXStream& store);
/**
* Load an SUN Raster Image format file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadRAS(FXStream& store,FXColor*& data,FXint& width,FXint& height);
/**
* Save an SUN Raster Image format file to a stream.
*/
extern FXAPI bool fxsaveRAS(FXStream& store,const FXColor *data,FXint width,FXint height);
}
#endif
fox-1.6.49/include/FXMenuCheck.h 0000664 0001750 0001750 00000007731 12130340076 013232 0000000 0000000 /********************************************************************************
* *
* M e n u C h e c k W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2002,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXMenuCheck.h,v 1.13 2006/01/22 17:58:06 fox Exp $ *
********************************************************************************/
#ifndef FXMENUCHECK_H
#define FXMENUCHECK_H
#ifndef FXMENUCOMMAND_H
#include "FXMenuCommand.h"
#endif
namespace FX {
/**
* The menu check widget is used to change a state in the
* application from a menu. Menu checks may reflect
* the state of the application by graying out, becoming hidden,
* or by a check mark.
* When activated, a menu check sends a SEL_COMMAND to its target;
* the void* argument of the message contains the new state.
*/
class FXAPI FXMenuCheck : public FXMenuCommand {
FXDECLARE(FXMenuCheck)
protected:
FXuchar check; // State of menu
FXColor boxColor; // Box color
protected:
FXMenuCheck();
private:
FXMenuCheck(const FXMenuCheck&);
FXMenuCheck &operator=(const FXMenuCheck&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onButtonPress(FXObject*,FXSelector,void*);
long onButtonRelease(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onHotKeyPress(FXObject*,FXSelector,void*);
long onHotKeyRelease(FXObject*,FXSelector,void*);
long onCheck(FXObject*,FXSelector,void*);
long onUncheck(FXObject*,FXSelector,void*);
long onUnknown(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetIntValue(FXObject*,FXSelector,void*);
long onCmdGetIntValue(FXObject*,FXSelector,void*);
long onCmdAccel(FXObject*,FXSelector,void*);
public:
/// Construct a menu check
FXMenuCheck(FXComposite* p,const FXString& text,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0);
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Set check state (TRUE, FALSE or MAYBE)
void setCheck(FXbool s=TRUE);
/// Get check state (TRUE, FALSE or MAYBE)
FXbool getCheck() const { return check; }
/// Get the box background color
FXColor getBoxColor() const { return boxColor; }
/// Set the box background color
void setBoxColor(FXColor clr);
/// Save menu to a stream
virtual void save(FXStream& store) const;
/// Load menu from a stream
virtual void load(FXStream& store);
};
}
#endif
fox-1.6.49/include/FXObjectList.h 0000664 0001750 0001750 00000012463 12130340076 013430 0000000 0000000 /********************************************************************************
* *
* O b j e c t L i s t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXObjectList.h,v 1.31.2.1 2007/01/29 20:22:29 fox Exp $ *
********************************************************************************/
#ifndef FXOBJECTLIST_H
#define FXOBJECTLIST_H
#ifndef FXOBJECT_H
#include "FXObject.h"
#endif
namespace FX {
/// List of pointers to objects
class FXAPI FXObjectList {
protected:
FXObject **ptr;
public:
/// Default constructor
FXObjectList();
/// Copy constructor
FXObjectList(const FXObjectList& orig);
/// Construct and init with single object
FXObjectList(FXObject* object);
/// Construct and init with list of objects
FXObjectList(FXObject** objects,FXint n);
/// Assignment operator
FXObjectList& operator=(const FXObjectList& orig);
/// Return number of objects
FXint no() const { return *((FXint*)(ptr-1)); }
/// Set number of objects
void no(FXint num);
/// Indexing operator
FXObject*& operator[](FXint i){ return ptr[i]; }
FXObject* const& operator[](FXint i) const { return ptr[i]; }
/// Indexing operator
FXObject*& at(FXint i){ return ptr[i]; }
FXObject* const& at(FXint i) const { return ptr[i]; }
/// Access to content array
FXObject** data() const { return ptr; }
/// Assign object p to list
FXObjectList& assign(FXObject* object);
/// Assign n objects to list
FXObjectList& assign(FXObject** objects,FXint n);
/// Assign objects to list
FXObjectList& assign(FXObjectList& objects);
/// Insert object at certain position
FXObjectList& insert(FXint pos,FXObject* object);
/// Insert n objects at specified position
FXObjectList& insert(FXint pos,FXObject** objects,FXint n);
/// Insert objects at specified position
FXObjectList& insert(FXint pos,FXObjectList& objects);
/// Prepend object
FXObjectList& prepend(FXObject* object);
/// Prepend n objects
FXObjectList& prepend(FXObject** objects,FXint n);
/// Prepend objects
FXObjectList& prepend(FXObjectList& objects);
/// Append object
FXObjectList& append(FXObject* object);
/// Append n objects
FXObjectList& append(FXObject** objects,FXint n);
/// Append objects
FXObjectList& append(FXObjectList& objects);
/// Replace object at position by given object
FXObjectList& replace(FXint pos,FXObject* object);
/// Replaces the m objects at pos with n objects
FXObjectList& replace(FXint pos,FXint m,FXObject** objects,FXint n);
/// Replace the m objects at pos with objects
FXObjectList& replace(FXint pos,FXint m,FXObjectList& objects);
/// Remove object at pos
FXObjectList& erase(FXint pos);
/// Remove n objects at pos
FXObjectList& erase(FXint pos,FXint n);
/// Remove object
FXObjectList& remove(const FXObject* object);
/// Find object in list, searching forward; return position or -1
FXint find(const FXObject *object,FXint pos=0) const;
/// Find object in list, searching backward; return position or -1
FXint rfind(const FXObject *object,FXint pos=2147483647) const;
/// Remove all objects
FXObjectList& clear();
/// Save to a stream
void save(FXStream& store) const;
/// Load from a stream
void load(FXStream& store);
/// Destructor
virtual ~FXObjectList();
};
/// Specialize list to pointers to TYPE
template
class FXObjectListOf : public FXObjectList {
public:
FXObjectListOf(){}
/// Indexing operator
TYPE*& operator[](FXint i){ return (TYPE*&)ptr[i]; }
TYPE *const& operator[](FXint i) const { return (TYPE*const&)ptr[i]; }
/// Access to list
TYPE*& at(FXint i){ return (TYPE*&)ptr[i]; }
TYPE *const& at(FXint i) const { return (TYPE*const&)ptr[i]; }
/// Access to content array
TYPE** data() const { return (TYPE**)ptr; }
};
}
#endif
fox-1.6.49/include/FXToolBarTab.h 0000664 0001750 0001750 00000012165 12130340076 013356 0000000 0000000 /********************************************************************************
* *
* T o o l B a r T a b W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1999,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXToolBarTab.h,v 1.11 2006/01/22 17:58:11 fox Exp $ *
********************************************************************************/
#ifndef FXTOOLBARTAB_H
#define FXTOOLBARTAB_H
#ifndef FXFRAME_H
#include "FXFrame.h"
#endif
namespace FX {
/// Tool Bar Tab styles
enum {
TOOLBARTAB_HORIZONTAL = 0, /// Default is for horizontal toolbar
TOOLBARTAB_VERTICAL = 0x00008000 /// For vertical toolbar
};
/**
* A toolbar tab is used to collapse or uncollapse a sibling
* widget. The sibling affected is the widget immediately following
* the toolbar tab or, if the toolbar tab is the last widget in the list,
* the widget immediately preceding the toolbar tab.
*/
class FXAPI FXToolBarTab : public FXFrame {
FXDECLARE(FXToolBarTab)
protected:
FXColor activeColor; // Color when active
FXString tip; // Tooltip
FXbool collapsed; // Is collapsed flat
FXbool down; // Button down
protected:
FXToolBarTab();
void drawUpArrow(FXDCWindow& dc);
void drawDownArrow(FXDCWindow& dc);
void drawRightArrow(FXDCWindow& dc);
void drawLeftArrow(FXDCWindow& dc);
void drawHSpeckles(FXDCWindow& dc,FXint x,FXint w);
void drawVSpeckles(FXDCWindow& dc,FXint y,FXint h);
private:
FXToolBarTab(const FXToolBarTab&);
FXToolBarTab& operator=(const FXToolBarTab&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onUpdate(FXObject*,FXSelector,void*);
long onEnter(FXObject*,FXSelector,void*);
long onLeave(FXObject*,FXSelector,void*);
long onUngrabbed(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onCmdCollapse(FXObject*,FXSelector,void*);
long onUpdCollapse(FXObject*,FXSelector,void*);
long onCmdUncollapse(FXObject*,FXSelector,void*);
long onUpdUncollapse(FXObject*,FXSelector,void*);
long onCmdSetTip(FXObject*,FXSelector,void*);
long onCmdGetTip(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
public:
enum {
ID_COLLAPSE=FXFrame::ID_LAST,
ID_UNCOLLAPSE,
ID_LAST
};
public:
/// Construct toolbar tab
FXToolBarTab(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=FRAME_RAISED,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Toolbar tab can receive focus
virtual bool canFocus() const;
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Enable the toolbar tab
virtual void enable();
/// Disable the toolbar tab
virtual void disable();
/// Collapse or uncollapse the toolbar
void collapse(FXbool fold,FXbool notify=FALSE);
/// Return true if the toolbar is collapsed
FXbool isCollapsed() const { return collapsed; }
/// Change the tab style
void setTabStyle(FXuint style);
/// Get current tab style
FXuint getTabStyle() const;
/// Get the active color
FXColor getActiveColor() const { return activeColor; }
/// Set the active color
void setActiveColor(FXColor clr);
/// Set the tool tip message for the toolbar tab
void setTipText(const FXString& text){ tip=text; }
/// Get the tool tip message for the toolbar tab
const FXString& getTipText() const { return tip; }
/// Save to a stream
virtual void save(FXStream& store) const;
/// Load from a stream
virtual void load(FXStream& store);
};
}
#endif
fox-1.6.49/include/FXRanged.h 0000664 0001750 0001750 00000013515 12130340076 012565 0000000 0000000 /********************************************************************************
* *
* D o u b l e - P r e c i s i o n R a n g e C l a s s *
* *
*********************************************************************************
* Copyright (C) 2004,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXRanged.h,v 1.17 2006/01/22 17:58:08 fox Exp $ *
********************************************************************************/
#ifndef FXRANGED_H
#define FXRANGED_H
namespace FX {
class FXSphered;
/// Bounds
class FXAPI FXRanged {
public:
FXVec3d lower;
FXVec3d upper;
public:
/// Default constructor
FXRanged(){}
/// Initialize from another range
FXRanged(const FXRanged& bounds):lower(bounds.lower),upper(bounds.upper){}
/// Initialize from two vectors
FXRanged(const FXVec3d& lo,const FXVec3d& hi):lower(lo),upper(hi){}
/// Initialize from six numbers
FXRanged(FXdouble xlo,FXdouble xhi,FXdouble ylo,FXdouble yhi,FXdouble zlo,FXdouble zhi):lower(xlo,ylo,zlo),upper(xhi,yhi,zhi){}
/// Initialize box to fully contain the given bounding sphere
FXRanged(const FXSphered& sphere);
/// Assignment
FXRanged& operator=(const FXRanged& bounds){ lower=bounds.lower; upper=bounds.upper; return *this; }
/// Set value from another range
FXRanged& set(const FXRanged& bounds){ lower=bounds.lower; upper=bounds.upper; return *this; }
/// Set value from two vectors
FXRanged& set(const FXVec3d& lo,const FXVec3d& hi){ lower=lo; upper=hi; return *this; }
/// Set value from six numbers
FXRanged& set(FXdouble xlo,FXdouble xhi,FXdouble ylo,FXdouble yhi,FXdouble zlo,FXdouble zhi){ lower.set(xlo,ylo,zlo); upper.set(xhi,yhi,zhi); return *this; }
/// Indexing with 0..1
FXVec3d& operator[](FXint i){ return (&lower)[i]; }
/// Indexing with 0..1
const FXVec3d& operator[](FXint i) const { return (&lower)[i]; }
/// Comparison
bool operator==(const FXRanged& r) const { return lower==r.lower && upper==r.upper; }
bool operator!=(const FXRanged& r) const { return lower!=r.lower || upper!=r.upper; }
/// Width of box
FXdouble width() const { return upper.x-lower.x; }
/// Height of box
FXdouble height() const { return upper.y-lower.y; }
/// Depth of box
FXdouble depth() const { return upper.z-lower.z; }
/// Longest side
FXdouble longest() const;
/// shortest side
FXdouble shortest() const;
/// Length of diagonal
FXdouble diameter() const;
/// Get radius of box
FXdouble radius() const;
/// Compute diagonal
FXVec3d diagonal() const;
/// Get center of box
FXVec3d center() const;
/// Test if empty
bool empty() const;
/// Test if box contains point x,y,z
bool contains(FXdouble x,FXdouble y,FXdouble z) const;
/// Test if box contains point p
bool contains(const FXVec3d& p) const;
/// Test if box properly contains another box
bool contains(const FXRanged& bounds) const;
/// Test if box properly contains sphere
bool contains(const FXSphered& sphere) const;
/// Include point
FXRanged& include(FXdouble x,FXdouble y,FXdouble z);
/// Include point
FXRanged& include(const FXVec3d& v);
/// Include given range into box
FXRanged& include(const FXRanged& box);
/// Include given sphere into this box
FXRanged& include(const FXSphered& sphere);
/// Intersect box with normalized plane ax+by+cz+w; returns -1,0,+1
FXint intersect(const FXVec4d &plane) const;
/// Intersect box with ray u-v
bool intersect(const FXVec3d& u,const FXVec3d& v);
/// Test if bounds overlap
friend FXAPI bool overlap(const FXRanged& a,const FXRanged& b);
/// Get corner number 0..7
FXVec3d corner(FXint c) const { return FXVec3d((&lower)[c&1].x, (&lower)[(c>>1)&1].y, (&lower)[c>>2].z); }
/// Union of two boxes
friend FXAPI FXRanged unite(const FXRanged& a,const FXRanged& b);
/// Intersection of two boxes
friend FXAPI FXRanged intersect(const FXRanged& a,const FXRanged& b);
/// Save object to a stream
friend FXAPI FXStream& operator<<(FXStream& store,const FXRanged& bounds);
/// Load object from a stream
friend FXAPI FXStream& operator>>(FXStream& store,FXRanged& bounds);
};
extern FXAPI bool overlap(const FXRanged& a,const FXRanged& b);
extern FXAPI FXRanged unite(const FXRanged& a,const FXRanged& b);
extern FXAPI FXRanged intersect(const FXRanged& a,const FXRanged& b);
extern FXAPI FXStream& operator<<(FXStream& store,const FXRanged& bounds);
extern FXAPI FXStream& operator>>(FXStream& store,FXRanged& bounds);
}
#endif
fox-1.6.49/include/FXProgressDialog.h 0000664 0001750 0001750 00000010530 12130340076 014303 0000000 0000000 /********************************************************************************
* *
* P r o g r e s s D i a l o g B o x *
* *
*********************************************************************************
* Copyright (C) 2001,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXProgressDialog.h,v 1.14 2006/01/22 17:58:07 fox Exp $ *
********************************************************************************/
#ifndef FXPROGRESSDIALOG_H
#define FXPROGRESSDIALOG_H
#ifndef FXDIALOGBOX_H
#include "FXDialogBox.h"
#endif
namespace FX {
enum {
PROGRESSDIALOG_NOCANCEL = 0, /// Default is no cancel button
PROGRESSDIALOG_CANCEL = 0x01000000, /// Enable the cancel button
PROGRESSDIALOG_NORMAL = (DECOR_TITLE|DECOR_BORDER)
};
class FXHorizontalSeparator;
class FXProgressBar;
class FXButton;
class FXLabel;
/**
* A Progress Dialog is a simple dialog which is used to
* keep a user informed of the progress of a lengthy operation
* in a program and that the program is in fact still working.
*/
class FXAPI FXProgressDialog : public FXDialogBox {
FXDECLARE(FXProgressDialog)
protected:
FXProgressBar *progress; // Progress bar
FXLabel *message; // Message
FXHorizontalSeparator *separator; // Separator
FXButton *cancel; // Cancel button
FXbool cancelled; // User hit cancel
protected:
FXProgressDialog();
private:
FXProgressDialog(const FXProgressDialog&);
FXProgressDialog &operator=(const FXProgressDialog&);
public:
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetIntValue(FXObject*,FXSelector,void*);
long onCmdGetIntValue(FXObject*,FXSelector,void*);
long onCmdSetStringValue(FXObject*,FXSelector,void*);
long onCmdGetStringValue(FXObject*,FXSelector,void*);
long onCmdCancel(FXObject*,FXSelector,void*);
public:
/// Construct input dialog box with given caption, icon, and prompt text
FXProgressDialog(FXWindow* owner,const FXString& caption,const FXString& label,FXuint opts=PROGRESSDIALOG_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Change the progress message
void setMessage(const FXString& msg);
/// Get progress message
FXString getMessage() const;
/// Change style of the progress bar widget
void setBarStyle(FXuint style);
/// Get style of the progress bar widget
FXuint getBarStyle() const;
/// Change the amount of progress
void setProgress(FXuint value);
/// Get current progress
FXuint getProgress() const;
/// Set total amount of progress
void setTotal(FXuint value);
/// Return total amount of progrss
FXuint getTotal() const;
/// Increment progress by given amount
void increment(FXuint value);
/// Has operation been cancelled?
FXbool isCancelled() const { return cancelled; }
/// Change cancelled flag
void setCancelled(FXbool flg){ cancelled=flg; }
/// Destroy
virtual ~FXProgressDialog();
};
}
#endif
fox-1.6.49/include/FXIconSource.h 0000664 0001750 0001750 00000015774 12130340076 013447 0000000 0000000 /********************************************************************************
* *
* I c o n S o u r c e *
* *
*********************************************************************************
* Copyright (C) 2005,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXIconSource.h,v 1.13 2006/02/03 00:44:32 fox Exp $ *
********************************************************************************/
#ifndef FXICONSOURCE_H
#define FXICONSOURCE_H
#ifndef FXOBJECT_H
#include "FXObject.h"
#endif
namespace FX {
class FXApp;
class FXIcon;
class FXImage;
/**
* An icon source is a class that loads an icon of any type.
* It exists purely for convenience, to make loading icons
* simpler by concentrating the knowledge of the supported
* icon formats in a single place.
* Needless to say, this class is subclassable, allowing users
* to add additional icon types and make them available to
* all widgets which deal with icons.
* Note, the icons are loaded, but NOT created (realized) yet;
* this allows users to manipulate the pixel data prior to
* realizing the icons.
*/
class FXAPI FXIconSource : public FXObject {
FXDECLARE(FXIconSource)
protected:
FXApp *app;
protected:
FXIconSource():app(NULL){}
private:
FXIconSource(const FXIconSource&);
FXIconSource &operator=(const FXIconSource&);
FXImage *scaleToSize(FXImage *image,FXint size,FXint qual) const;
public:
/// Construct an icon source
FXIconSource(FXApp* a);
/**
* Load an icon from the file filename. By default, the file extension is
* stripped and used as the icon type; if an explicit icon type is forced,
* then that type is used and the extension is ignored.
* For example, loadIcon("icon","gif") will try to load a CompuServe GIF
* file, since the filename does not give any clue as to the type of the
* icon.
*/
virtual FXIcon *loadIconFile(const FXString& filename,const FXString& type=FXString::null) const;
/**
* Load an icon of a given type (e.g. "gif") from reswrapped data.
* Returns NULL if there's some error loading the icon. [The optional
* parameter is actually mandatory at the time of this writing; future
* versions will attempt to inspect the first few bytes of the stream
* to divine the icon format if the parameter is omitted].
*/
virtual FXIcon *loadIconData(const void *pixels,const FXString& type=FXString::null) const;
/**
* Load an icon of a given type (e.g. "gif") from an already open stream.
* Returns NULL if there's some error loading the icon. [The optional
* parameter is actually mandatory at the time of this writing; future
* versions will attempt to inspect the first few bytes of the stream
* to divine the icon format if the parameter is omitted].
*/
virtual FXIcon *loadIconStream(FXStream& store,const FXString& type=FXString::null) const;
/**
* Load an image from the file filename. By default, the file extension is
* stripped and used as the image type; if an explicit image type is forced,
* then that type is used and the extension is ignored.
* For example, loadImage("image","gif") will try to load a CompuServe GIF
* file, since the filename does not give any clue as to the type of the
* image.
*/
virtual FXImage *loadImageFile(const FXString& filename,const FXString& type=FXString::null) const;
/**
* Load an image of a given type (e.g. "gif") from reswrapped data.
* Returns NULL if there's some error loading the icon. [The optional
* parameter is actually mandatory at the time of this writing; future
* versions will attempt to inspect the first few bytes of the stream
* to divine the icon format if the parameter is omitted].
*/
virtual FXImage *loadImageData(const void *pixels,const FXString& type=FXString::null) const;
/**
* Load an image of a given type (e.g. "gif") from an already open stream.
* Returns NULL if there's some error loading the image. [The optional
* parameter is actually mandatory at the time of this writing; future
* versions will attempt to inspect the first few bytes of the stream
* to divine the image format if the parameter is omitted].
*/
virtual FXImage *loadImageStream(FXStream& store,const FXString& type=FXString::null) const;
/// Load icon and scale it such that its dimensions does not exceed given size
virtual FXIcon *loadScaledIconFile(const FXString& filename,FXint size=32,FXint qual=0,const FXString& type=FXString::null) const;
/// Load icon and scale it such that its dimensions does not exceed given size
virtual FXIcon *loadScaledIconData(const void *pixels,FXint size=32,FXint qual=0,const FXString& type=FXString::null) const;
/// Load icon and scale it such that its dimensions does not exceed given size
virtual FXIcon *loadScaledIconStream(FXStream& store,FXint size=32,FXint qual=0,const FXString& type=FXString::null) const;
/// Load image and scale it such that its dimensions does not exceed given size
virtual FXImage *loadScaledImageFile(const FXString& filename,FXint size=32,FXint qual=0,const FXString& type=FXString::null) const;
/// Load image and scale it such that its dimensions does not exceed given size
virtual FXImage *loadScaledImageData(const void *pixels,FXint size=32,FXint qual=0,const FXString& type=FXString::null) const;
/// Load image and scale it such that its dimensions does not exceed given size
virtual FXImage *loadScaledImageStream(FXStream& store,FXint size=32,FXint qual=0,const FXString& type=FXString::null) const;
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
/// Destroy
virtual ~FXIconSource();
};
}
#endif
fox-1.6.49/include/FXGLCone.h 0000664 0001750 0001750 00000005673 12130340076 012502 0000000 0000000 /********************************************************************************
* *
* O p e n G L C o n e O b j e c t *
* *
*********************************************************************************
* Copyright (C) 1999,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXGLCone.h,v 1.17 2006/01/22 17:58:02 fox Exp $ *
********************************************************************************/
#ifndef FXGLCONE_H
#define FXGLCONE_H
#ifndef FXGLSHAPE_H
#include "FXGLShape.h"
#endif
namespace FX {
/// OpenGL Cone Object
class FXAPI FXGLCone : public FXGLShape {
FXDECLARE(FXGLCone)
public:
FXfloat height;
FXfloat radius;
protected:
FXGLCone();
virtual void drawshape(FXGLViewer* viewer);
public:
/// Construct with specified origin, height and radius
FXGLCone(FXfloat x,FXfloat y,FXfloat z,FXfloat h=1.0f,FXfloat r=1.0f);
/// Construct with specified origin, height, radius and material
FXGLCone(FXfloat x,FXfloat y,FXfloat z,FXfloat h,FXfloat r,const FXMaterial& mtl);
/// Copy constructor
FXGLCone(const FXGLCone& orig);
/// Copy this object
virtual FXGLObject* copy();
/// Change radius
void setRadius(FXfloat r){ radius=r; }
FXfloat getRadius() const { return radius; }
/// Change height
void setHeight(FXfloat h){ height=h; }
FXfloat getHeight() const { return height; }
/// Save to a stream
virtual void save(FXStream& store) const;
/// Load from a stream
virtual void load(FXStream& store);
/// Destroy
virtual ~FXGLCone();
};
}
#endif
fox-1.6.49/include/FXBMPImage.h 0000664 0001750 0001750 00000007032 12130340076 012743 0000000 0000000 /********************************************************************************
* *
* B M P I m a g e O b j e c t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXBMPImage.h,v 1.22 2006/01/22 17:57:59 fox Exp $ *
********************************************************************************/
#ifndef FXBMPIMAGE_H
#define FXBMPIMAGE_H
#ifndef FXIMAGE_H
#include "FXImage.h"
#endif
namespace FX {
/**
* The BMP Image class is a convenience class for working with images in the
* Microsoft Bitmap (.bmp) graphics file format. This makes it possible to
* use resources created with Windows development tools inside FOX without
* need for graphics file format translators. The bitmap loaded handles
* 1, 4, and 8 bit paletted bitmaps, 16 and 24 bit RGB bitmaps, and
* 32 bit RGBA bitmaps.
*/
class FXAPI FXBMPImage : public FXImage {
FXDECLARE(FXBMPImage)
protected:
FXBMPImage(){}
private:
FXBMPImage(const FXBMPImage&);
FXBMPImage &operator=(const FXBMPImage&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct image from memory stream formatted in Microsoft BMP format
FXBMPImage(FXApp* a,const void *pix=NULL,FXuint opts=0,FXint w=1,FXint h=1);
/// Save pixels into stream in Microsoft bitmap format
virtual bool savePixels(FXStream& store) const;
/// Load pixels from stream in Microsoft bitmap format
virtual bool loadPixels(FXStream& store);
/// Destroy icon
virtual ~FXBMPImage();
};
/**
* Check if stream contains a bitmap, return TRUE if so.
*/
extern FXAPI bool fxcheckBMP(FXStream& store);
/**
* Load an BMP (Microsoft Bitmap) file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadBMP(FXStream& store,FXColor*& data,FXint& width,FXint& height);
/**
* Save an BMP (Microsoft Bitmap) file to a stream.
*/
extern FXAPI bool fxsaveBMP(FXStream& store,const FXColor *data,FXint width,FXint height);
}
#endif
fox-1.6.49/include/FXDialogBox.h 0000664 0001750 0001750 00000006567 12130340076 013246 0000000 0000000 /********************************************************************************
* *
* D i a l o g B o x *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXDialogBox.h,v 1.23 2006/01/22 17:58:00 fox Exp $ *
********************************************************************************/
#ifndef FXDIALOGBOX_H
#define FXDIALOGBOX_H
#ifndef FXTOPWINDOW_H
#include "FXTopWindow.h"
#endif
namespace FX {
/**
* DialogBox window.
* When receiving ID_CANCEL or ID_ACCEPT, the DialogBox breaks out of the
* modal loop and returns FALSE or TRUE, respectively.
* To close the DialogBox when not running modally, simply send it ID_HIDE.
*/
class FXAPI FXDialogBox : public FXTopWindow {
FXDECLARE(FXDialogBox)
protected:
FXDialogBox(){}
private:
FXDialogBox(const FXDialogBox&);
FXDialogBox &operator=(const FXDialogBox&);
public:
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onCmdAccept(FXObject*,FXSelector,void*);
long onCmdCancel(FXObject*,FXSelector,void*);
public:
enum {
ID_CANCEL=FXTopWindow::ID_LAST, /// Closes the dialog, cancel the entry
ID_ACCEPT, /// Closes the dialog, accept the entry
ID_LAST
};
public:
/// Construct free-floating dialog
FXDialogBox(FXApp* a,const FXString& name,FXuint opts=DECOR_TITLE|DECOR_BORDER,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=10,FXint pr=10,FXint pt=10,FXint pb=10,FXint hs=4,FXint vs=4);
/// Construct dialog which will always float over the owner window
FXDialogBox(FXWindow* owner,const FXString& name,FXuint opts=DECOR_TITLE|DECOR_BORDER,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=10,FXint pr=10,FXint pt=10,FXint pb=10,FXint hs=4,FXint vs=4);
/// Run modal invocation of the dialog
virtual FXuint execute(FXuint placement=PLACEMENT_CURSOR);
};
}
#endif
fox-1.6.49/include/FXVec4d.h 0000664 0001750 0001750 00000023235 12130340076 012332 0000000 0000000 /********************************************************************************
* *
* D o u b l e - P r e c i s i o n 4 - E l e m e n t V e c t o r *
* *
*********************************************************************************
* Copyright (C) 1994,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXVec4d.h,v 1.27 2006/01/22 17:58:12 fox Exp $ *
********************************************************************************/
#ifndef FXVEC4D_H
#define FXVEC4D_H
namespace FX {
class FXMat4d;
/// Double-precision 4-element vector
class FXAPI FXVec4d {
public:
FXdouble x;
FXdouble y;
FXdouble z;
FXdouble w;
public:
/// Default constructor
FXVec4d(){}
/// Initialize from another vector
FXVec4d(const FXVec4d& v){x=v.x;y=v.y;z=v.z;w=v.w;}
/// Construct with 3-vector and optional scalar
FXVec4d(const FXVec3d& v,FXdouble ww=1.0){x=v.x;y=v.y;z=v.z;w=ww;}
/// Initialize from array of doubles
FXVec4d(const FXdouble v[]){x=v[0];y=v[1];z=v[2];w=v[3];}
/// Initialize with components
FXVec4d(FXdouble xx,FXdouble yy,FXdouble zz,FXdouble ww=1.0){x=xx;y=yy;z=zz;w=ww;}
/// Initialize with color
FXVec4d(FXColor color);
/// Return a non-const reference to the ith element
FXdouble& operator[](FXint i){return (&x)[i];}
/// Return a const reference to the ith element
const FXdouble& operator[](FXint i) const {return (&x)[i];}
/// Assign color
FXVec4d& operator=(FXColor color);
/// Assignment
FXVec4d& operator=(const FXVec3d& v){x=v.x;y=v.y;z=v.z;w=1.0;return *this;}
FXVec4d& operator=(const FXVec4d& v){x=v.x;y=v.y;z=v.z;w=v.w;return *this;}
/// Assignment from array of doubles
FXVec4d& operator=(const FXdouble v[]){x=v[0];y=v[1];z=v[2];w=v[3];return *this;}
/// Set value from another vector
FXVec4d& set(const FXVec4d& v){x=v.x;y=v.y;z=v.z;w=v.w;return *this;}
/// Set value from array of floats
FXVec4d& set(const FXdouble v[]){x=v[0];y=v[1];z=v[2];w=v[3];return *this;}
/// Set value from components
FXVec4d& set(FXdouble xx,FXdouble yy,FXdouble zz,FXdouble ww){x=xx;y=yy;z=zz;w=ww;return *this;}
/// Assigning operators
FXVec4d& operator*=(FXdouble n){x*=n;y*=n;z*=n;w*=n;return *this;}
FXVec4d& operator/=(FXdouble n){x/=n;y/=n;z/=n;w/=n;return *this;}
FXVec4d& operator+=(const FXVec4d& v){x+=v.x;y+=v.y;z+=v.z;w+=v.w;return *this;}
FXVec4d& operator-=(const FXVec4d& v){x-=v.x;y-=v.y;z-=v.z;w-=v.w;return *this;}
/// Conversion
operator FXdouble*(){return &x;}
operator const FXdouble*() const {return &x;}
operator FXVec3d&(){return *reinterpret_cast(this);}
operator const FXVec3d&() const {return *reinterpret_cast(this);}
/// Convert to color
operator FXColor() const;
/// Unary
FXVec4d operator+() const { return *this; }
FXVec4d operator-() const { return FXVec4d(-x,-y,-z,-w); }
/// Vector and vector
FXVec4d operator+(const FXVec4d& v) const { return FXVec4d(x+v.x,y+v.y,z+v.z,w+v.w); }
FXVec4d operator-(const FXVec4d& v) const { return FXVec4d(x-v.x,y-v.y,z-v.z,w-v.w); }
/// Vector and matrix
FXVec4d operator*(const FXMat4d& m) const;
/// Scaling
friend inline FXVec4d operator*(const FXVec4d& a,FXdouble n);
friend inline FXVec4d operator*(FXdouble n,const FXVec4d& a);
friend inline FXVec4d operator/(const FXVec4d& a,FXdouble n);
friend inline FXVec4d operator/(FXdouble n,const FXVec4d& a);
/// Dot product
FXdouble operator*(const FXVec4d& v) const { return x*v.x+y*v.y+z*v.z+w*v.w; }
/// Test if zero
bool operator!() const {return x==0.0 && y==0.0 && z==0.0 && w==0.0; }
/// Equality tests
bool operator==(const FXVec4d& v) const { return x==v.x && y==v.y && z==v.z && w==v.w; }
bool operator!=(const FXVec4d& v) const { return x!=v.x || y!=v.y || z!=v.z || w!=v.w; }
friend inline bool operator==(const FXVec4d& a,FXdouble n);
friend inline bool operator!=(const FXVec4d& a,FXdouble n);
friend inline bool operator==(FXdouble n,const FXVec4d& a);
friend inline bool operator!=(FXdouble n,const FXVec4d& a);
/// Inequality tests
bool operator<(const FXVec4d& v) const { return x(const FXVec4d& v) const { return x>v.x && y>v.y && z>v.z && w>v.w; }
bool operator>=(const FXVec4d& v) const { return x>=v.x && y>=v.y && z>=v.z && w>=v.w; }
friend inline bool operator<(const FXVec4d& a,FXdouble n);
friend inline bool operator<=(const FXVec4d& a,FXdouble n);
friend inline bool operator>(const FXVec4d& a,FXdouble n);
friend inline bool operator>=(const FXVec4d& a,FXdouble n);
friend inline bool operator<(FXdouble n,const FXVec4d& a);
friend inline bool operator<=(FXdouble n,const FXVec4d& a);
friend inline bool operator>(FXdouble n,const FXVec4d& a);
friend inline bool operator>=(FXdouble n,const FXVec4d& a);
/// Length and square of length
FXdouble length2() const { return x*x+y*y+z*z+w*w; }
FXdouble length() const { return sqrt(length2()); }
/// Clamp values of vector between limits
FXVec4d& clamp(FXdouble lo,FXdouble hi){x=FXCLAMP(lo,x,hi);y=FXCLAMP(lo,y,hi);z=FXCLAMP(lo,z,hi);w=FXCLAMP(lo,w,hi);return *this;}
/// Lowest or highest components
friend inline FXVec4d lo(const FXVec4d& a,const FXVec4d& b);
friend inline FXVec4d hi(const FXVec4d& a,const FXVec4d& b);
/// Compute normalized plane equation ax+by+cz+d=0
friend FXAPI FXVec4d plane(const FXVec4d& vec);
friend FXAPI FXVec4d plane(const FXVec3d& vec,FXdouble dist);
friend FXAPI FXVec4d plane(const FXVec3d& vec,const FXVec3d& p);
friend FXAPI FXVec4d plane(const FXVec3d& a,const FXVec3d& b,const FXVec3d& c);
/// Signed distance normalized plane and point
FXdouble distance(const FXVec3d& p) const;
/// Return true if edge a-b crosses plane
bool crosses(const FXVec3d& a,const FXVec3d& b) const;
/// Normalize vector
friend FXAPI FXVec4d normalize(const FXVec4d& v);
/// Save to a stream
friend FXAPI FXStream& operator<<(FXStream& store,const FXVec4d& v);
/// Load from a stream
friend FXAPI FXStream& operator>>(FXStream& store,FXVec4d& v);
};
inline FXVec4d operator*(const FXVec4d& a,FXdouble n){return FXVec4d(a.x*n,a.y*n,a.z*n,a.w*n);}
inline FXVec4d operator*(FXdouble n,const FXVec4d& a){return FXVec4d(n*a.x,n*a.y,n*a.z,n*a.w);}
inline FXVec4d operator/(const FXVec4d& a,FXdouble n){return FXVec4d(a.x/n,a.y/n,a.z/n,a.w/n);}
inline FXVec4d operator/(FXdouble n,const FXVec4d& a){return FXVec4d(n/a.x,n/a.y,n/a.z,n/a.w);}
inline bool operator==(const FXVec4d& a,FXdouble n){return a.x==n && a.y==n && a.z==n && a.w==n;}
inline bool operator!=(const FXVec4d& a,FXdouble n){return a.x!=n || a.y!=n || a.z!=n || a.w!=n;}
inline bool operator==(FXdouble n,const FXVec4d& a){return n==a.x && n==a.y && n==a.z && n==a.w;}
inline bool operator!=(FXdouble n,const FXVec4d& a){return n!=a.x || n!=a.y || n!=a.z || n!=a.w;}
inline bool operator<(const FXVec4d& a,FXdouble n){return a.x(const FXVec4d& a,FXdouble n){return a.x>n && a.y>n && a.z>n && a.w>n;}
inline bool operator>=(const FXVec4d& a,FXdouble n){return a.x>=n && a.y>=n && a.z>=n && a.w>=n;}
inline bool operator<(FXdouble n,const FXVec4d& a){return n(FXdouble n,const FXVec4d& a){return n>a.x && n>a.y && n>a.z && n>a.w;}
inline bool operator>=(FXdouble n,const FXVec4d& a){return n>=a.x && n>=a.y && n>=a.z && n>=a.w;}
inline FXVec4d lo(const FXVec4d& a,const FXVec4d& b){return FXVec4d(FXMIN(a.x,b.x),FXMIN(a.y,b.y),FXMIN(a.z,b.z),FXMIN(a.w,b.w));}
inline FXVec4d hi(const FXVec4d& a,const FXVec4d& b){return FXVec4d(FXMAX(a.x,b.x),FXMAX(a.y,b.y),FXMAX(a.z,b.z),FXMAX(a.w,b.w));}
extern FXAPI FXVec4d plane(const FXVec4d& vec);
extern FXAPI FXVec4d plane(const FXVec3d& vec,FXdouble dist);
extern FXAPI FXVec4d plane(const FXVec3d& vec,const FXVec3d& p);
extern FXAPI FXVec4d plane(const FXVec3d& a,const FXVec3d& b,const FXVec3d& c);
extern FXAPI FXVec4d normalize(const FXVec4d& v);
extern FXAPI FXStream& operator<<(FXStream& store,const FXVec4d& v);
extern FXAPI FXStream& operator>>(FXStream& store,FXVec4d& v);
}
#endif
fox-1.6.49/include/FXUTF32Codec.h 0000664 0001750 0001750 00000007151 12130340076 013125 0000000 0000000 /********************************************************************************
* *
* U T F - 3 2 T e x t C o d e c *
* *
*********************************************************************************
* Copyright (C) 2002,2006 by L.Johnson & J.van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXUTF32Codec.h,v 1.10 2006/01/22 17:58:12 fox Exp $ *
********************************************************************************/
#ifndef FXUTF32CODEC_H
#define FXUTF32CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// Codec for UTF-32BE
class FXAPI FXUTF32BECodec : public FXTextCodec {
FXDECLARE(FXUTF32BECodec)
public:
FXUTF32BECodec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual FXint mibEnum() const;
virtual const FXchar* const* aliases() const;
virtual ~FXUTF32BECodec(){}
};
/// Codec for UTF-32LE
class FXAPI FXUTF32LECodec : public FXTextCodec {
FXDECLARE(FXUTF32LECodec)
public:
FXUTF32LECodec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual FXint mibEnum() const;
virtual const FXchar* const* aliases() const;
virtual ~FXUTF32LECodec(){}
};
/// Codec for UTF-32
class FXAPI FXUTF32Codec : public FXTextCodec {
FXDECLARE(FXUTF32Codec)
public:
FXUTF32Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint mb2utflen(const FXchar* src,FXint nsrc) const;
virtual FXint mb2utf(FXchar* dst,FXint ndst,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint utf2mblen(const FXchar* src,FXint nsrc) const;
virtual FXint utf2mb(FXchar* dst,FXint ndst,const FXchar* src,FXint nsrc) const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual FXint mibEnum() const;
virtual const FXchar* const* aliases() const;
virtual ~FXUTF32Codec(){}
};
}
#endif
fox-1.6.49/include/FXExpression.h 0000664 0001750 0001750 00000007226 12130340076 013526 0000000 0000000 /********************************************************************************
* *
* E x p r e s s i o n E v a l u a t o r *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXExpression.h,v 1.13 2006/03/21 01:41:43 fox Exp $ *
********************************************************************************/
#ifndef FXEXPRESSION_H
#define FXEXPRESSION_H
namespace FX {
/// Expression error codes
enum FXExpressionError {
EXPRERR_OK,
EXPRERR_EMPTY, /// Empty input
EXPRERR_MEMORY, /// Out of memory
EXPRERR_PAREN, /// Unmatched parentheses
EXPRERR_TOKEN, /// Illegal token
EXPRERR_COMMA, /// Expected comma
EXPRERR_IDENT /// Unknown identifier
};
/// Expression
class FXAPI FXExpression {
private:
FXuchar *code;
private:
static const FXuchar initial[];
static const FXchar *const errors[];
public:
/// Construct empty expression object
FXExpression();
/// Copy expression object
FXExpression(const FXExpression& orig);
/// Compile expression; if error is not NULL, error code is returned
FXExpression(const FXchar* expression,const FXchar* variables=NULL,FXExpressionError* error=NULL);
/// Compile expression; if error is not NULL, error code is returned
FXExpression(const FXString& expression,const FXString& variables=FXString::null,FXExpressionError* error=NULL);
/// Assign another expression to this one
FXExpression& operator=(const FXExpression& orig);
/// See if expression is empty
bool empty() const { return (code==initial); }
/// Evaluate expression with given arguments, if any
FXdouble evaluate(const FXdouble *args=NULL);
/// Parse expression, return error code if syntax error is found
FXExpressionError parse(const FXchar* expression,const FXchar* variables=NULL);
/// Parse expression, return error code if syntax error is found
FXExpressionError parse(const FXString& expression,const FXString& variables=FXString::null);
/// Returns error code for given error
static const FXchar* getError(FXExpressionError err){ return errors[err]; }
/// Delete
~FXExpression();
};
}
#endif
fox-1.6.49/include/FXMenuTitle.h 0000664 0001750 0001750 00000010046 12130340076 013267 0000000 0000000 /********************************************************************************
* *
* M e n u T i t l e W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXMenuTitle.h,v 1.22 2006/01/22 17:58:06 fox Exp $ *
********************************************************************************/
#ifndef FXMENUTITLE_H
#define FXMENUTITLE_H
#ifndef FXMENUCAPTION_H
#include "FXMenuCaption.h"
#endif
namespace FX {
class FXPopup;
/**
* A menu title is a child of a menu bar which is responsible
* for popping up a pulldown menu.
*/
class FXAPI FXMenuTitle : public FXMenuCaption {
FXDECLARE(FXMenuTitle)
protected:
FXPopup *pane; // Pane to pop up
protected:
FXMenuTitle(){}
private:
FXMenuTitle(const FXMenuTitle&);
FXMenuTitle &operator=(const FXMenuTitle&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onEnter(FXObject*,FXSelector,void*);
long onLeave(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onHotKeyPress(FXObject*,FXSelector,void*);
long onHotKeyRelease(FXObject*,FXSelector,void*);
long onFocusUp(FXObject*,FXSelector,void*);
long onFocusDown(FXObject*,FXSelector,void*);
long onFocusIn(FXObject*,FXSelector,void*);
long onFocusOut(FXObject*,FXSelector,void*);
long onCmdPost(FXObject*,FXSelector,void*);
long onCmdUnpost(FXObject*,FXSelector,void*);
public:
/// Constructor
FXMenuTitle(FXComposite* p,const FXString& text,FXIcon* ic=NULL,FXPopup* pup=NULL,FXuint opts=0);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Yes it can receive the focus
virtual bool canFocus() const;
/// Move the focus to this window
virtual void setFocus();
/// Remove the focus from this window
virtual void killFocus();
/// Set popup menu to pop up
void setMenu(FXPopup *menu);
/// Return popup menu
FXPopup* getMenu() const { return pane; }
/// True if this menu or is popup logically contains the mouse
virtual bool contains(FXint parentx,FXint parenty) const;
/// Save menu to a stream
virtual void save(FXStream& store) const;
/// Load menu from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXMenuTitle();
};
}
#endif
fox-1.6.49/include/FXGLVisual.h 0000664 0001750 0001750 00000013437 12130340076 013056 0000000 0000000 /********************************************************************************
* *
* V i s u a l C l a s s *
* *
*********************************************************************************
* Copyright (C) 1999,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXGLVisual.h,v 1.24 2006/01/22 17:58:04 fox Exp $ *
********************************************************************************/
#ifndef FXGLVISUAL_H
#define FXGLVISUAL_H
#ifndef FXVISUAL_H
#include "FXVisual.h"
#endif
namespace FX {
class FXFont;
class FXWindow;
class FXImage;
class FXIcon;
class FXBitmap;
class FXDCWindow;
class FXGLCanvas;
/// Visual describes pixel format of a drawable
class FXAPI FXGLVisual : public FXVisual {
FXDECLARE(FXGLVisual)
friend class FXWindow;
friend class FXImage;
friend class FXIcon;
friend class FXBitmap;
friend class FXDCWindow;
friend class FXGLCanvas;
protected:
FXint redSize; // Desired #bits for red
FXint greenSize; // Desired #bits for green
FXint blueSize; // Desired #bits for blue
FXint alphaSize; // Desired #bits for alpha
FXint depthSize; // Desired #bits for Z
FXint stencilSize; // Desired #bits for stencil
FXint accumRedSize; // Desired #bits for accum red
FXint accumGreenSize; // Desired #bits for accum green
FXint accumBlueSize; // Desired #bits for accum blue
FXint accumAlphaSize; // Desired #bits for accum alpha
protected:
FXGLVisual();
private:
FXGLVisual(const FXGLVisual&);
FXGLVisual &operator=(const FXGLVisual&);
public:
/// Construct default visual
FXGLVisual(FXApp* a,FXuint flags);
/**
* Test if OpenGL is possible, and what level is supported.
* Because of remote display capability, the display server may
* support a different level of OpenGL than the client; it may
* even support no OpenGL at all! This function returns the lesser
* of the client support level and the display server support level.
*/
static FXbool supported(FXApp* application,int& major,int& minor);
/// Create visual
virtual void create();
/// Detach visual
virtual void detach();
/// Destroy visual
virtual void destroy();
/// Get sizes for bit-planes
FXint getRedSize() const { return redSize; }
FXint getGreenSize() const { return greenSize; }
FXint getBlueSize() const { return blueSize; }
FXint getAlphaSize() const { return alphaSize; }
FXint getDepthSize() const { return depthSize; }
FXint getStencilSize() const { return stencilSize; }
FXint getAccumRedSize() const { return accumRedSize; }
FXint getAccumGreenSize() const { return accumGreenSize; }
FXint getAccumBlueSize() const { return accumBlueSize; }
FXint getAccumAlphaSize() const { return accumAlphaSize; }
/// Set sizes for bit-planes
void setRedSize(FXint rs){ redSize=rs; }
void setGreenSize(FXint gs){ greenSize=gs; }
void setBlueSize(FXint bs){ blueSize=bs; }
void setAlphaSize(FXint as){ alphaSize=as; }
void setDepthSize(FXint ds){ depthSize=ds; }
void setStencilSize(FXint ss){ stencilSize=ss; }
void setAccumRedSize(FXint rs){ accumRedSize=rs; }
void setAccumGreenSize(FXint gs){ accumGreenSize=gs; }
void setAccumBlueSize(FXint bs){ accumBlueSize=bs; }
void setAccumAlphaSize(FXint as){ accumAlphaSize=as; }
/// Get ACTUAL sizes for bit-planes
FXint getActualRedSize() const;
FXint getActualGreenSize() const;
FXint getActualBlueSize() const;
FXint getActualAlphaSize() const;
FXint getActualDepthSize() const;
FXint getActualStencilSize() const;
FXint getActualAccumRedSize() const;
FXint getActualAccumGreenSize() const;
FXint getActualAccumBlueSize() const;
FXint getActualAccumAlphaSize() const;
/// Is it double buffered?
FXbool isDoubleBuffer() const;
/// Is it stereo?
FXbool isStereo() const;
/// Is it hardware-accelerated?
FXbool isAccelerated() const;
/// Does it swap by copying instead of flipping buffers
FXbool isBufferSwapCopy() const;
/// Save visual info to a stream
virtual void save(FXStream& store) const;
/// Load visual info to a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXGLVisual();
};
/// Create a display list of bitmaps from font glyphs in a font
extern FXAPI void glUseFXFont(FXFont* font,int first,int count,int list);
}
#endif
fox-1.6.49/include/FXGLCube.h 0000664 0001750 0001750 00000006123 12130340076 012463 0000000 0000000 /********************************************************************************
* *
* O p e n G L C u b e O b j e c t *
* *
*********************************************************************************
* Copyright (C) 1999,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXGLCube.h,v 1.17 2006/01/22 17:58:02 fox Exp $ *
********************************************************************************/
#ifndef FXGLCUBE_H
#define FXGLCUBE_H
#ifndef FXGLSHAPE_H
#include "FXGLShape.h"
#endif
namespace FX {
/// OpenGL Cube Object
class FXAPI FXGLCube : public FXGLShape {
FXDECLARE(FXGLCube)
public:
FXfloat width;
FXfloat height;
FXfloat depth;
protected:
FXGLCube();
virtual void drawshape(FXGLViewer* viewer);
public:
/// Construct with specified origin, width, height and depth
FXGLCube(FXfloat x,FXfloat y,FXfloat z,FXfloat w=1.0f,FXfloat h=1.0f,FXfloat d=1.0f);
/// Construct with specified origin, width, height, depth and material
FXGLCube(FXfloat x,FXfloat y,FXfloat z,FXfloat w,FXfloat h,FXfloat d,const FXMaterial& mtl);
/// Copy constructor
FXGLCube(const FXGLCube& orig);
/// Copy this object
virtual FXGLObject* copy();
/// Change width
void setWidth(FXfloat w){ width=w; }
FXfloat getWidth() const { return width; }
/// Change height
void setHeight(FXfloat h){ height=h; }
FXfloat getHeight() const { return height; }
/// Change depth
void setDepth(FXfloat d){ depth=d; }
FXfloat getDepth() const { return depth; }
/// Save to a stream
virtual void save(FXStream& store) const;
/// Load from a stream
virtual void load(FXStream& store);
/// Destroy
virtual ~FXGLCube();
};
}
#endif
fox-1.6.49/include/FXDirList.h 0000664 0001750 0001750 00000025334 12130340076 012741 0000000 0000000 /********************************************************************************
* *
* D i r e c t o r y L i s t W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXDirList.h,v 1.70 2006/01/22 17:58:00 fox Exp $ *
********************************************************************************/
#ifndef FXDIRLIST_H
#define FXDIRLIST_H
#ifndef FXTREELIST_H
#include "FXTreeList.h"
#endif
namespace FX {
struct FXFileAssoc;
class FXFileDict;
class FXIcon;
class FXDirList;
/// Directory List options
enum {
DIRLIST_SHOWFILES = 0x08000000, /// Show files as well as directories
DIRLIST_SHOWHIDDEN = 0x10000000, /// Show hidden files or directories
DIRLIST_NO_OWN_ASSOC = 0x20000000 /// Do not create associations for files
};
/// Directory item
class FXAPI FXDirItem : public FXTreeItem {
FXDECLARE(FXDirItem)
friend class FXDirList;
protected:
FXFileAssoc *assoc; // File association
FXDirItem *link; // Link to next item
FXDirItem *list; // List of child items
FXlong size; // File size (if a file)
FXTime date; // Time of item
private:
FXDirItem(const FXDirItem&);
FXDirItem& operator=(const FXDirItem&);
protected:
FXDirItem():assoc(NULL),link(NULL),list(NULL),size(0L),date(0){}
public:
enum {
FOLDER = 512, /// Directory item
EXECUTABLE = 1024, /// Executable item
SYMLINK = 2048, /// Symbolic linked item
CHARDEV = 4096, /// Character special item
BLOCKDEV = 8192, /// Block special item
FIFO = 16384, /// FIFO item
SOCK = 32768 /// Socket item
};
public:
/// Constructor
FXDirItem(const FXString& text,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL):FXTreeItem(text,oi,ci,ptr),assoc(NULL),link(NULL),list(NULL),size(0),date(0){state=HASITEMS;}
/// Return true if this is a file item
FXbool isFile() const { return (state&(FOLDER|BLOCKDEV|CHARDEV|FIFO|SOCK))==0; }
/// Return true if this is a directory item
FXbool isDirectory() const { return (state&FOLDER)!=0; }
/// Return true if this is an executable item
FXbool isExecutable() const { return (state&EXECUTABLE)!=0; }
/// Return true if this is a symbolic link item
FXbool isSymlink() const { return (state&SYMLINK)!=0; }
/// Return true if this is a character device item
FXbool isChardev() const { return (state&CHARDEV)!=0; }
/// Return true if this is a block device item
FXbool isBlockdev() const { return (state&BLOCKDEV)!=0; }
/// Return true if this is an FIFO item
FXbool isFifo() const { return (state&FIFO)!=0; }
/// Return true if this is a socket
FXbool isSocket() const { return (state&SOCK)!=0; }
/// Return the file-association object for this item
FXFileAssoc* getAssoc() const { return assoc; }
/// Return the file size for this item
FXlong getSize() const { return size; }
/// Return the date for this item
FXTime getDate() const { return date; }
};
/**
* A Directory List widget provides a tree-structured view of the file system.
* It automatically updates itself periodically by re-scanning the file system
* for any changes. As it scans the displayed directories and files, it automatically
* determines the icons to be displayed by consulting the file-associations registry
* settings. A number of messages can be sent to the Directory List to control the
* filter pattern, sorting order, case sensitivity, and hidden file display mode.
* The Directory list widget supports drags and drops of files.
*/
class FXAPI FXDirList : public FXTreeList {
FXDECLARE(FXDirList)
protected:
FXFileDict *associations; // Association table
FXDirItem *list; // Root item list
FXString dropdirectory; // Drop directory
FXDragAction dropaction; // Drop action
FXString dragfiles; // Dragged files
FXString pattern; // Pattern of file names
FXuint matchmode; // File wildcard match mode
FXuint counter; // Refresh counter
FXIcon *open_folder; // Open folder icon
FXIcon *closed_folder; // Closed folder icon
FXIcon *mini_doc; // Document icon
FXIcon *mini_app; // Application icon
FXIcon *cdromicon;
FXIcon *harddiskicon;
FXIcon *networkicon;
FXIcon *floppyicon;
FXIcon *zipdiskicon;
protected:
FXDirList();
void listRootItems();
void listChildItems(FXDirItem *par);
virtual FXTreeItem* createItem(const FXString& text,FXIcon* oi,FXIcon* ci,void* ptr);
private:
FXDirList(const FXDirList&);
FXDirList &operator=(const FXDirList&);
public:
long onRefreshTimer(FXObject*,FXSelector,void*);
long onBeginDrag(FXObject*,FXSelector,void*);
long onEndDrag(FXObject*,FXSelector,void*);
long onDragged(FXObject*,FXSelector,void*);
long onDNDEnter(FXObject*,FXSelector,void*);
long onDNDLeave(FXObject*,FXSelector,void*);
long onDNDMotion(FXObject*,FXSelector,void*);
long onDNDDrop(FXObject*,FXSelector,void*);
long onDNDRequest(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetStringValue(FXObject*,FXSelector,void*);
long onCmdGetStringValue(FXObject*,FXSelector,void*);
long onCmdToggleHidden(FXObject*,FXSelector,void*);
long onUpdToggleHidden(FXObject*,FXSelector,void*);
long onCmdShowHidden(FXObject*,FXSelector,void*);
long onUpdShowHidden(FXObject*,FXSelector,void*);
long onCmdHideHidden(FXObject*,FXSelector,void*);
long onUpdHideHidden(FXObject*,FXSelector,void*);
long onCmdToggleFiles(FXObject*,FXSelector,void*);
long onUpdToggleFiles(FXObject*,FXSelector,void*);
long onCmdShowFiles(FXObject*,FXSelector,void*);
long onUpdShowFiles(FXObject*,FXSelector,void*);
long onCmdHideFiles(FXObject*,FXSelector,void*);
long onUpdHideFiles(FXObject*,FXSelector,void*);
long onCmdSetPattern(FXObject*,FXSelector,void*);
long onUpdSetPattern(FXObject*,FXSelector,void*);
long onCmdSortReverse(FXObject*,FXSelector,void*);
long onUpdSortReverse(FXObject*,FXSelector,void*);
long onCmdSortCase(FXObject*,FXSelector,void*);
long onUpdSortCase(FXObject*,FXSelector,void*);
long onCmdRefresh(FXObject*,FXSelector,void*);
public:
static FXint ascending(const FXTreeItem* a,const FXTreeItem* b);
static FXint descending(const FXTreeItem* a,const FXTreeItem* b);
static FXint ascendingCase(const FXTreeItem* a,const FXTreeItem* b);
static FXint descendingCase(const FXTreeItem* a,const FXTreeItem* b);
public:
enum {
ID_REFRESHTIMER=FXTreeList::ID_LAST,
ID_SHOW_FILES,
ID_HIDE_FILES,
ID_TOGGLE_FILES,
ID_SHOW_HIDDEN,
ID_HIDE_HIDDEN,
ID_TOGGLE_HIDDEN,
ID_SET_PATTERN,
ID_SORT_REVERSE,
ID_SORT_CASE,
ID_REFRESH,
ID_LAST
};
public:
/// Construct a directory list
FXDirList(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Destroy server-side resources
virtual void destroy();
/// Scan the directories and update the items if needed, or if force is TRUE
void scan(FXbool force=TRUE);
/// Return TRUE if item is a directory
FXbool isItemDirectory(const FXTreeItem* item) const;
/// Return TRUE if item is a file
FXbool isItemFile(const FXTreeItem* item) const;
/// Return TRUE if item is executable
FXbool isItemExecutable(const FXTreeItem* item) const;
/// Collapse tree
virtual FXbool collapseTree(FXTreeItem* tree,FXbool notify=FALSE);
/// Expand tree
virtual FXbool expandTree(FXTreeItem* tree,FXbool notify=FALSE);
/// Set current file
void setCurrentFile(const FXString& file,FXbool notify=FALSE);
/// Return current file
FXString getCurrentFile() const;
/// Set current directory
void setDirectory(const FXString& path,FXbool notify=FALSE);
/// Return current directory
FXString getDirectory() const;
/// Return absolute pathname of item
FXString getItemPathname(const FXTreeItem* item) const;
/// Return the item from the absolute pathname
FXTreeItem* getPathnameItem(const FXString& path);
/// Change wildcard matching pattern
void setPattern(const FXString& ptrn);
/// Return wildcard pattern
FXString getPattern() const { return pattern; }
/// Return wildcard matching mode
FXuint getMatchMode() const { return matchmode; }
/// Change wildcard matching mode
void setMatchMode(FXuint mode);
/// Return TRUE if showing files as well as directories
FXbool showFiles() const;
/// Show or hide normal files
void showFiles(FXbool showing);
/// Return TRUE if showing hidden files and directories
FXbool showHiddenFiles() const;
/// Show or hide hidden files and directories
void showHiddenFiles(FXbool showing);
/// Change file associations
void setAssociations(FXFileDict* assoc);
/// Return file associations
FXFileDict* getAssociations() const { return associations; }
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXDirList();
};
}
#endif
fox-1.6.49/include/FXICOIcon.h 0000664 0001750 0001750 00000006576 12130340076 012621 0000000 0000000 /********************************************************************************
* *
* I C O I c o n O b j e c t *
* *
*********************************************************************************
* Copyright (C) 2001,2006 by Janusz Ganczarski. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXICOIcon.h,v 1.20 2006/01/22 17:58:04 fox Exp $ *
********************************************************************************/
#ifndef FXICOICON_H
#define FXICOICON_H
#ifndef FXICON_H
#include "FXIcon.h"
#endif
namespace FX {
/// ICO (Microsoft icon format) icon
class FXAPI FXICOIcon : public FXIcon {
FXDECLARE(FXICOIcon)
protected:
FXICOIcon(){}
private:
FXICOIcon(const FXICOIcon&);
FXICOIcon &operator=(const FXICOIcon&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct icon from memory stream formatted in Microsoft icon format
FXICOIcon(FXApp* a,const void *pix=NULL,FXColor clr=FXRGB(192,192,192),FXuint opts=0,FXint w=1,FXint h=1);
/// Save pixels into stream in Microsoft icon format format
virtual bool savePixels(FXStream& store) const;
/// Load pixels from stream in Microsoft icon format format
virtual bool loadPixels(FXStream& store);
/// Destroy icon
virtual ~FXICOIcon();
};
#ifndef FXLOADICO
#define FXLOADICO
/**
* Check if stream contains a ICO, return TRUE if so.
*/
extern FXAPI bool fxcheckICO(FXStream& store);
/**
* Load an ICO (Microsoft icon format) file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadICO(FXStream& store,FXColor*& data,FXint& width,FXint& height,FXint& xspot,FXint& yspot);
/**
* Save an ICO (Microsoft icon format) file to a stream.
* If no hot-spot given, save as an ICO instead of a CUR resource.
*/
extern FXAPI bool fxsaveICO(FXStream& store,const FXColor *data,FXint width,FXint height,FXint xspot=-1,FXint yspot=-1);
#endif
}
#endif
fox-1.6.49/include/FXToggleButton.h 0000664 0001750 0001750 00000014041 12130340076 013775 0000000 0000000 /********************************************************************************
* *
* T o g g l e B u t t o n W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXToggleButton.h,v 1.30 2006/01/22 17:58:11 fox Exp $ *
********************************************************************************/
#ifndef FXTOGGLEBUTTON_H
#define FXTOGGLEBUTTON_H
#ifndef FXLABEL_H
#include "FXLabel.h"
#endif
namespace FX {
/// Toggle button flags
enum {
TOGGLEBUTTON_AUTOGRAY = 0x00800000, /// Automatically gray out when not updated
TOGGLEBUTTON_AUTOHIDE = 0x01000000, /// Automatically hide toggle button when not updated
TOGGLEBUTTON_TOOLBAR = 0x02000000, /// Toolbar style toggle button [flat look]
TOGGLEBUTTON_KEEPSTATE= 0x04000000, /// Draw button according to state
TOGGLEBUTTON_NORMAL = FRAME_RAISED|FRAME_THICK|JUSTIFY_NORMAL|ICON_BEFORE_TEXT
};
/**
* The toggle button provides a two-state button, which toggles between the
* on and the off state each time it is pressed. For each state, the toggle
* button has a unique icon and text label.
* When pressed, the button widget sends a SEL_COMMAND to its target, with the
* message data set to the current state of the toggle button, of the type FXbool.
*/
class FXAPI FXToggleButton : public FXLabel {
FXDECLARE(FXToggleButton)
protected:
FXString altlabel;
FXIcon *alticon;
FXHotKey althotkey;
FXint althotoff;
FXString alttip;
FXString althelp;
FXbool state;
FXbool down;
protected:
FXToggleButton();
void press(FXbool dn);
private:
FXToggleButton(const FXToggleButton&);
FXToggleButton& operator=(const FXToggleButton&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onUpdate(FXObject*,FXSelector,void*);
long onEnter(FXObject*,FXSelector,void*);
long onLeave(FXObject*,FXSelector,void*);
long onFocusIn(FXObject*,FXSelector,void*);
long onFocusOut(FXObject*,FXSelector,void*);
long onUngrabbed(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onHotKeyPress(FXObject*,FXSelector,void*);
long onHotKeyRelease(FXObject*,FXSelector,void*);
long onCheck(FXObject*,FXSelector,void*);
long onUncheck(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetIntValue(FXObject*,FXSelector,void*);
long onCmdGetIntValue(FXObject*,FXSelector,void*);
public:
/// Construct toggle button with two text labels, and two icons, one for each state
FXToggleButton(FXComposite* p,const FXString& text1,const FXString& text2,FXIcon* icon1=NULL,FXIcon* icon2=NULL,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=TOGGLEBUTTON_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Returns true because a toggle button can receive focus
virtual bool canFocus() const;
/// Get default width
virtual FXint getDefaultWidth();
/// Get default height
virtual FXint getDefaultHeight();
/// Change alternate text shown when toggled
void setAltText(const FXString& text);
/// Return alternate text
FXString getAltText() const { return altlabel; }
/// Change alternate icon shown when toggled
void setAltIcon(FXIcon* ic);
/// Return alternate icon
FXIcon* getAltIcon() const { return alticon; }
/// Change toggled state
void setState(FXbool s=TRUE,FXbool notify=FALSE);
/// return toggled state
FXbool getState() const { return state; }
/// Change alternate help text shown when toggled
void setAltHelpText(const FXString& text);
/// Return alternate help text
FXString getAltHelpText() const { return althelp; }
/// Change alternate tip text shown when toggled
void setAltTipText(const FXString& text);
/// Return alternate tip text
FXString getAltTipText() const { return alttip; }
/// Set the toggle button style flags
void setToggleStyle(FXuint style);
/// Get the toggle button style flags
FXuint getToggleStyle() const;
/// Save toggle button to a stream
virtual void save(FXStream& store) const;
/// Load toggle button from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXToggleButton();
};
}
#endif
fox-1.6.49/include/FXCP1250Codec.h 0000644 0001750 0001750 00000001106 11637250333 013133 0000000 0000000 #ifndef FXCP1250CODEC_H
#define FXCP1250CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// CP1250 Codec
class FXAPI FXCP1250Codec : public FXTextCodec {
FXDECLARE(FXCP1250Codec)
public:
FXCP1250Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FXCP1250Codec(){}
};
}
#endif
fox-1.6.49/include/FXScrollBar.h 0000664 0001750 0001750 00000020117 12130340076 013244 0000000 0000000 /********************************************************************************
* *
* S c r o l l B a r W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXScrollBar.h,v 1.15 2006/01/22 17:58:09 fox Exp $ *
********************************************************************************/
#ifndef FXSCROLLBAR_H
#define FXSCROLLBAR_H
#ifndef FXWINDOW_H
#include "FXWindow.h"
#endif
namespace FX {
/// ScrollBar styles
enum {
SCROLLBAR_VERTICAL = 0, /// Vertically oriented
SCROLLBAR_HORIZONTAL = 0x00020000, /// Horizontally oriented
SCROLLBAR_WHEELJUMP = 0x00040000 /// Mouse wheel jumps instead of sliding smoothly
};
/**
* The scroll bar is used when a document has a larger content than may be made
* visible. The range is the total size of the document, the page is the part
* of the document which is visible. The size of the scrollbar thumb is adjusted
* to give feedback of the relative sizes of each.
* The scroll bar may be manipulated by the left mouse button (normal scrolling), by the
* middle mouse button (same as the left mouse only the scroll position can jump to the
* place where the click is made), or by the right mouse button (vernier- or fine-scrolling).
* Holding down the control key while scrolling with the left or middle mouse button also
* enables vernier-scrolling mode. The vernier-scrolling mode is very useful for accurate
* positioning in large documents.
* Finally, if the mouse sports a wheel, the scroll bar can be manipulated by means
* of the mouse wheel as well. Holding down the Control-key during wheel motion
* will cause the scrolling to go faster than normal.
* While moving the scroll bar, a message of type SEL_CHANGED will be sent to the
* target, and the message data will reflect the current position of type FXint.
* At the end of the interaction, the scroll bar will send a message of type
* SEL_COMMAND to notify the target of the final position.
*/
class FXAPI FXScrollBar : public FXWindow {
FXDECLARE(FXScrollBar)
protected:
FXint range; // Scrollable range
FXint page; // Page size
FXint line; // Line size
FXint pos; // Position
FXint barsize; // Bar size
FXint thumbsize; // Thumb size
FXint thumbpos; // Thumb position
FXColor hiliteColor; // Hightlight color
FXColor shadowColor; // Shadow color
FXColor borderColor; // Border color
FXColor arrowColor; // Arrow color
FXint dragpoint; // Point where grabbed
FXuchar mode; // Current mode of control
protected:
FXScrollBar();
void drawButton(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h,FXbool down);
void drawLeftArrow(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h,FXbool down);
void drawRightArrow(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h,FXbool down);
void drawUpArrow(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h,FXbool down);
void drawDownArrow(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h,FXbool down);
protected:
enum {
MODE_NONE,
MODE_INC,
MODE_DEC,
MODE_PAGE_INC,
MODE_PAGE_DEC,
MODE_DRAG,
MODE_FINE_DRAG
};
private:
FXScrollBar(const FXScrollBar&);
FXScrollBar &operator=(const FXScrollBar&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onMouseWheel(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onMiddleBtnPress(FXObject*,FXSelector,void*);
long onMiddleBtnRelease(FXObject*,FXSelector,void*);
long onRightBtnPress(FXObject*,FXSelector,void*);
long onRightBtnRelease(FXObject*,FXSelector,void*);
long onUngrabbed(FXObject*,FXSelector,void*);
long onTimeWheel(FXObject*,FXSelector,void*);
long onAutoScroll(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetIntValue(FXObject*,FXSelector,void*);
long onCmdGetIntValue(FXObject*,FXSelector,void*);
long onCmdSetIntRange(FXObject*,FXSelector,void*);
long onCmdGetIntRange(FXObject*,FXSelector,void*);
public:
enum{
ID_TIMEWHEEL=FXWindow::ID_LAST,
ID_AUTOSCROLL,
ID_LAST
};
public:
/// Construct scroll bar
FXScrollBar(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=SCROLLBAR_VERTICAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Perform layout
virtual void layout();
/// Set content size range
void setRange(FXint r);
/// Return content size range
FXint getRange() const { return range; }
/// Set viewport page size
void setPage(FXint p);
/// Return page size
FXint getPage() const { return page; }
/// Set scoll increment for line
void setLine(FXint l);
/// Return line increment
FXint getLine() const { return line; }
/// Change scroll position
void setPosition(FXint p);
/// Return current scroll position
FXint getPosition() const { return pos; }
/// Change highlight color
void setHiliteColor(FXColor clr);
/// Return highlight color
FXColor getHiliteColor() const { return hiliteColor; }
/// Change the shadow color
void setShadowColor(FXColor clr);
/// Return the shadow color
FXColor getShadowColor() const { return shadowColor; }
/// Change the border color
void setBorderColor(FXColor clr);
/// Return the border color
FXColor getBorderColor() const { return borderColor; }
/// Change the arrow color
void setArrowColor(FXColor clr);
/// Return the arrow color
FXColor getArrowColor() const { return arrowColor; }
/// Change the scrollbar style
void setScrollBarStyle(FXuint style);
/// Return the scrollbar style
FXuint getScrollBarStyle() const;
/// Change the bar size
void setBarSize(FXint size);
/// Return the bar size
FXint getBarSize() const { return barsize; }
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXScrollBar();
};
/// Corner between scroll bars
class FXAPI FXScrollCorner : public FXWindow {
FXDECLARE(FXScrollCorner)
protected:
FXScrollCorner();
private:
FXScrollCorner(const FXScrollCorner&);
FXScrollCorner &operator=(const FXScrollCorner&);
public:
long onPaint(FXObject*,FXSelector,void*);
public:
/// Constructor
FXScrollCorner(FXComposite* p);
/// Can not be enabled
virtual void enable();
/// Can not be disabled
virtual void disable();
};
}
#endif
fox-1.6.49/include/FXText.h 0000664 0001750 0001750 00000076050 12130340076 012314 0000000 0000000 /********************************************************************************
* *
* M u l t i - L i ne T e x t W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXText.h,v 1.166 2006/02/06 03:03:40 fox Exp $ *
********************************************************************************/
#ifndef FXTEXT_H
#define FXTEXT_H
#ifndef FXSCROLLAREA_H
#include "FXScrollArea.h"
#endif
namespace FX {
/// Text widget options
enum {
TEXT_READONLY = 0x00100000, /// Text is NOT editable
TEXT_WORDWRAP = 0x00200000, /// Wrap at word breaks
TEXT_OVERSTRIKE = 0x00400000, /// Overstrike mode
TEXT_FIXEDWRAP = 0x00800000, /// Fixed wrap columns
TEXT_NO_TABS = 0x01000000, /// Insert spaces for tabs
TEXT_AUTOINDENT = 0x02000000, /// Autoindent
TEXT_SHOWACTIVE = 0x04000000, /// Show active line
TEXT_AUTOSCROLL = 0x08000000 /// Logging mode, keeping last line visible
};
/// Selection modes
enum FXTextSelectionMode {
SELECT_CHARS,
SELECT_WORDS,
SELECT_LINES
};
/// Highlight style entry
struct FXHiliteStyle {
FXColor normalForeColor; /// Normal text foreground color
FXColor normalBackColor; /// Normal text background color
FXColor selectForeColor; /// Selected text foreground color
FXColor selectBackColor; /// Selected text background color
FXColor hiliteForeColor; /// Highlight text foreground color
FXColor hiliteBackColor; /// Highlight text background color
FXColor activeBackColor; /// Active text background color
FXuint style; /// Highlight text style
};
/**
* Text mutation callback data passed with the SEL_INSERTED,
* SEL_REPLACED, and SEL_DELETED messages; both old and new
* text is available on behalf of the undo system as well as
* syntax highlighting.
*/
struct FXTextChange {
FXint pos; /// Position in buffer
FXint ndel; /// Number characters deleted at position
FXint nins; /// Number characters inserted at position
FXchar *ins; /// Text inserted at position
FXchar *del; /// Text deleted at position
};
/**
* The text widget supports editing of multiple lines of text.
* An optional style table can provide text coloring based on
* the contents of an optional parallel style buffer, which is
* maintained as text is edited. In a typical scenario, the
* contents of the style buffer is either directly written when
* the text is added to the widget, or is continually modified
* by editing the text via syntax-based highlighting engine which
* colors the text based on syntactical patterns.
*/
class FXAPI FXText : public FXScrollArea {
FXDECLARE(FXText)
protected:
FXchar *buffer; // Text buffer being edited
FXchar *sbuffer; // Text style buffer
FXint *visrows; // Starts of rows in buffer
FXint length; // Length of the actual text in the buffer
FXint nvisrows; // Number of visible rows
FXint nrows; // Total number of rows
FXint gapstart; // Start of the insertion point (the gap)
FXint gapend; // End of the insertion point+1
FXint toppos; // Start position of first visible row
FXint keeppos; // Position to keep on top visible row
FXint toprow; // Row number of first visible row
FXint selstartpos; // Start of selection
FXint selendpos; // End of selection
FXint hilitestartpos; // Hightlight start position
FXint hiliteendpos; // Hightlight end position
FXint anchorpos; // Anchor position
FXint cursorpos; // Cursor position
FXint revertpos; // Position of cursor prior to dragging
FXint cursorstart; // Cursor row start pos
FXint cursorend; // Cursor row end pos
FXint cursorrow; // Cursor row
FXint cursorcol; // Cursor column indent (not character offset!)
FXint prefcol; // Preferred cursor column
FXint margintop; // Margins top
FXint marginbottom; // Margin bottom
FXint marginleft; // Margin left
FXint marginright; // Margin right
FXint wrapwidth; // Wrap width in pixels
FXint wrapcolumns; // Wrap columns
FXint tabwidth; // Tab width in pixels
FXint tabcolumns; // Tab columns
FXint barwidth; // Line number width
FXint barcolumns; // Line number columns
FXFont *font; // Text font
FXColor textColor; // Normal text color
FXColor selbackColor; // Select background color
FXColor seltextColor; // Select text color
FXColor hilitebackColor; // Highlight background color
FXColor hilitetextColor; // Highlight text color
FXColor activebackColor; // Background color for active line
FXColor numberColor; // Line number color
FXColor cursorColor; // Cursor color
FXColor barColor; // Bar background color
FXint textWidth; // Total width of all text
FXint textHeight; // Total height of all text
FXString searchstring; // String of last search
FXuint searchflags; // Flags of last search
const FXchar *delimiters; // Delimiters
FXString clipped; // Clipped text
FXint vrows; // Default visible rows
FXint vcols; // Default visible columns
FXString help; // Status line help
FXString tip; // Tooltip
const FXHiliteStyle *hilitestyles; // Style definitions
FXuint matchtime; // Match time (ms)
FXint grabx; // Grab point x
FXint graby; // Grab point y
FXuchar mode; // Mode widget is in
FXbool modified; // User has modified text
protected:
FXText();
void calcVisRows(FXint s,FXint e);
virtual void eraseCursorOverhang();
virtual void drawCursor(FXuint state);
virtual FXuint style(FXint row,FXint beg,FXint end,FXint pos) const;
virtual void drawBufferText(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h,FXint pos,FXint n,FXuint style) const;
virtual void fillBufferRect(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h,FXuint style) const;
virtual void drawTextRow(FXDCWindow& dc,FXint line,FXint left,FXint right) const;
virtual void drawContents(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h) const;
virtual void drawNumbers(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h) const;
FXint posToLine(FXint pos,FXint ln) const;
FXbool posVisible(FXint pos) const;
void updateRange(FXint beg,FXint end) const;
void movegap(FXint pos);
void sizegap(FXint sz);
void squeezegap();
FXint charWidth(FXwchar ch,FXint indent) const;
FXint wrap(FXint start) const;
FXint measureText(FXint start,FXint end,FXint& wmax,FXint& hmax) const;
FXint lineWidth(FXint pos,FXint n) const;
FXint getYOfPos(FXint pos) const;
FXint getXOfPos(FXint pos) const;
FXint changeBeg(FXint pos) const;
FXint changeEnd(FXint pos) const;
FXint indentFromPos(FXint start,FXint pos) const;
FXint posFromIndent(FXint start,FXint indent) const;
void mutation(FXint pos,FXint ncins,FXint ncdel,FXint nrins,FXint nrdel);
virtual void replace(FXint pos,FXint m,const FXchar *text,FXint n,FXint style);
void recompute();
FXint matchForward(FXint pos,FXint end,FXwchar l,FXwchar r,FXint level) const;
FXint matchBackward(FXint pos,FXint beg,FXwchar l,FXwchar r,FXint level) const;
FXint findMatching(FXint pos,FXint beg,FXint end,FXwchar ch,FXint level) const;
void flashMatching();
void moveContents(FXint x,FXint y);
protected:
enum {
STYLE_MASK = 0x00FF, // Mask color table
STYLE_TEXT = 0x0100, // Draw some content
STYLE_SELECTED = 0x0200, // Selected
STYLE_CONTROL = 0x0400, // Control character
STYLE_HILITE = 0x0800, // Highlighted
STYLE_ACTIVE = 0x1000 // Active
};
enum {
MOUSE_NONE, // No mouse operation
MOUSE_CHARS, // Selecting characters
MOUSE_WORDS, // Selecting words
MOUSE_LINES, // Selecting lines
MOUSE_SCROLL, // Scrolling
MOUSE_DRAG, // Dragging text
MOUSE_TRYDRAG // Tentative drag
};
public:
enum {
STYLE_UNDERLINE = 0x0001, /// Underline text
STYLE_STRIKEOUT = 0x0002, /// Strike out text
STYLE_BOLD = 0x0004 /// Bold text
};
private:
FXText(const FXText&);
FXText& operator=(const FXText&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onFocusIn(FXObject*,FXSelector,void*);
long onFocusOut(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onMiddleBtnPress(FXObject*,FXSelector,void*);
long onMiddleBtnRelease(FXObject*,FXSelector,void*);
long onRightBtnPress(FXObject*,FXSelector,void*);
long onRightBtnRelease(FXObject*,FXSelector,void*);
long onUngrabbed(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onBeginDrag(FXObject*,FXSelector,void*);
long onEndDrag(FXObject*,FXSelector,void*);
long onDragged(FXObject*,FXSelector,void*);
long onDNDEnter(FXObject*,FXSelector,void*);
long onDNDLeave(FXObject*,FXSelector,void*);
long onDNDMotion(FXObject*,FXSelector,void*);
long onDNDDrop(FXObject*,FXSelector,void*);
long onDNDRequest(FXObject*,FXSelector,void*);
long onSelectionLost(FXObject*,FXSelector,void*);
long onSelectionGained(FXObject*,FXSelector,void*);
long onSelectionRequest(FXObject*,FXSelector,void* ptr);
long onClipboardLost(FXObject*,FXSelector,void*);
long onClipboardGained(FXObject*,FXSelector,void*);
long onClipboardRequest(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onBlink(FXObject*,FXSelector,void*);
long onFlash(FXObject*,FXSelector,void*);
long onAutoScroll(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
// Control commands
long onCmdToggleEditable(FXObject*,FXSelector,void*);
long onUpdToggleEditable(FXObject*,FXSelector,void*);
long onCmdToggleOverstrike(FXObject*,FXSelector,void*);
long onUpdToggleOverstrike(FXObject*,FXSelector,void*);
long onCmdCursorRow(FXObject*,FXSelector,void*);
long onUpdCursorRow(FXObject*,FXSelector,void*);
long onCmdCursorColumn(FXObject*,FXSelector,void*);
long onUpdCursorColumn(FXObject*,FXSelector,void*);
long onUpdHaveSelection(FXObject*,FXSelector,void*);
long onUpdSelectAll(FXObject*,FXSelector,void*);
long onCmdSetStringValue(FXObject*,FXSelector,void*);
long onCmdGetStringValue(FXObject*,FXSelector,void*);
long onCmdSearch(FXObject*,FXSelector,void*);
long onCmdReplace(FXObject*,FXSelector,void*);
long onCmdSearchNext(FXObject*,FXSelector,void*);
long onCmdSearchSel(FXObject*,FXSelector,void*);
// Cursor movement
long onCmdCursorTop(FXObject*,FXSelector,void*);
long onCmdCursorBottom(FXObject*,FXSelector,void*);
long onCmdCursorHome(FXObject*,FXSelector,void*);
long onCmdCursorEnd(FXObject*,FXSelector,void*);
long onCmdCursorRight(FXObject*,FXSelector,void*);
long onCmdCursorLeft(FXObject*,FXSelector,void*);
long onCmdCursorUp(FXObject*,FXSelector,void*);
long onCmdCursorDown(FXObject*,FXSelector,void*);
long onCmdCursorWordLeft(FXObject*,FXSelector,void*);
long onCmdCursorWordRight(FXObject*,FXSelector,void*);
long onCmdCursorWordStart(FXObject*,FXSelector,void*);
long onCmdCursorWordEnd(FXObject*,FXSelector,void*);
long onCmdCursorPageDown(FXObject*,FXSelector,void*);
long onCmdCursorPageUp(FXObject*,FXSelector,void*);
long onCmdCursorScreenTop(FXObject*,FXSelector,void*);
long onCmdCursorScreenBottom(FXObject*,FXSelector,void*);
long onCmdCursorScreenCenter(FXObject*,FXSelector,void*);
long onCmdCursorParHome(FXObject*,FXSelector,void*);
long onCmdCursorParEnd(FXObject*,FXSelector,void*);
long onCmdBlockBeg(FXObject*,FXSelector,void*);
long onCmdBlockEnd(FXObject*,FXSelector,void*);
long onCmdGotoMatching(FXObject*,FXSelector,void*);
long onCmdGotoSelected(FXObject*,FXSelector,void*);
long onCmdGotoLine(FXObject*,FXSelector,void*);
long onCmdScrollUp(FXObject*,FXSelector,void*);
long onCmdScrollDown(FXObject*,FXSelector,void*);
// Mark and extend
long onCmdMark(FXObject*,FXSelector,void*);
long onCmdExtend(FXObject*,FXSelector,void*);
// Inserting
long onCmdOverstString(FXObject*,FXSelector,void*);
long onCmdInsertString(FXObject*,FXSelector,void*);
long onCmdInsertNewline(FXObject*,FXSelector,void*);
long onCmdInsertTab(FXObject*,FXSelector,void*);
// Manipulation Selection
long onCmdCutSel(FXObject*,FXSelector,void*);
long onCmdCopySel(FXObject*,FXSelector,void*);
long onCmdPasteSel(FXObject*,FXSelector,void*);
long onCmdDeleteSel(FXObject*,FXSelector,void*);
long onCmdChangeCase(FXObject*,FXSelector,void*);
long onCmdShiftText(FXObject*,FXSelector,void*);
long onCmdPasteMiddle(FXObject*,FXSelector,void*);
// Changing Selection
long onCmdSelectChar(FXObject*,FXSelector,void*);
long onCmdSelectWord(FXObject*,FXSelector,void*);
long onCmdSelectLine(FXObject*,FXSelector,void*);
long onCmdSelectAll(FXObject*,FXSelector,void*);
long onCmdSelectMatching(FXObject*,FXSelector,void*);
long onCmdSelectBlock(FXObject*,FXSelector,void*);
long onCmdDeselectAll(FXObject*,FXSelector,void*);
// Deletion
long onCmdBackspace(FXObject*,FXSelector,void*);
long onCmdBackspaceWord(FXObject*,FXSelector,void*);
long onCmdBackspaceBol(FXObject*,FXSelector,void*);
long onCmdDelete(FXObject*,FXSelector,void*);
long onCmdDeleteWord(FXObject*,FXSelector,void*);
long onCmdDeleteEol(FXObject*,FXSelector,void*);
long onCmdDeleteAll(FXObject*,FXSelector,void*);
long onCmdDeleteLine(FXObject*,FXSelector,void*);
public:
static const FXchar textDelimiters[];
public:
enum {
ID_CURSOR_TOP=FXScrollArea::ID_LAST,
ID_CURSOR_BOTTOM,
ID_CURSOR_HOME,
ID_CURSOR_END,
ID_CURSOR_RIGHT,
ID_CURSOR_LEFT,
ID_CURSOR_UP,
ID_CURSOR_DOWN,
ID_CURSOR_WORD_LEFT,
ID_CURSOR_WORD_RIGHT,
ID_CURSOR_WORD_START,
ID_CURSOR_WORD_END,
ID_CURSOR_PAGEDOWN,
ID_CURSOR_PAGEUP,
ID_CURSOR_SCRNTOP,
ID_CURSOR_SCRNBTM,
ID_CURSOR_SCRNCTR,
ID_CURSOR_PAR_HOME,
ID_CURSOR_PAR_END,
ID_SCROLL_UP,
ID_SCROLL_DOWN,
ID_MARK,
ID_EXTEND,
ID_OVERST_STRING,
ID_INSERT_STRING,
ID_INSERT_NEWLINE,
ID_INSERT_TAB,
ID_CUT_SEL,
ID_COPY_SEL,
ID_DELETE_SEL,
ID_PASTE_SEL,
ID_PASTE_MIDDLE,
ID_SELECT_CHAR,
ID_SELECT_WORD,
ID_SELECT_LINE,
ID_SELECT_ALL,
ID_SELECT_MATCHING,
ID_SELECT_BRACE,
ID_SELECT_BRACK,
ID_SELECT_PAREN,
ID_SELECT_ANG,
ID_DESELECT_ALL,
ID_BACKSPACE,
ID_BACKSPACE_WORD,
ID_BACKSPACE_BOL,
ID_DELETE,
ID_DELETE_WORD,
ID_DELETE_EOL,
ID_DELETE_ALL,
ID_DELETE_LINE,
ID_TOGGLE_EDITABLE,
ID_TOGGLE_OVERSTRIKE,
ID_CURSOR_ROW,
ID_CURSOR_COLUMN,
ID_CLEAN_INDENT,
ID_SHIFT_LEFT,
ID_SHIFT_RIGHT,
ID_SHIFT_TABLEFT,
ID_SHIFT_TABRIGHT,
ID_UPPER_CASE,
ID_LOWER_CASE,
ID_GOTO_MATCHING,
ID_GOTO_SELECTED,
ID_GOTO_LINE,
ID_SEARCH_FORW_SEL,
ID_SEARCH_BACK_SEL,
ID_SEARCH_FORW,
ID_SEARCH_BACK,
ID_SEARCH,
ID_REPLACE,
ID_LEFT_BRACE,
ID_LEFT_BRACK,
ID_LEFT_PAREN,
ID_LEFT_ANG,
ID_RIGHT_BRACE,
ID_RIGHT_BRACK,
ID_RIGHT_PAREN,
ID_RIGHT_ANG,
ID_BLINK,
ID_FLASH,
ID_LAST
};
public:
/// Construct multi-line text widget
FXText(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=3,FXint pr=3,FXint pt=2,FXint pb=2);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Perform layout
virtual void layout();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Enable the text widget
virtual void enable();
/// Disable the text widget
virtual void disable();
/// Need to recalculate size
virtual void recalc();
/// Get default width
virtual FXint getContentWidth();
/// Get default height
virtual FXint getContentHeight();
/// Returns true because a text widget can receive focus
virtual bool canFocus() const;
/// Move the focus to this window
virtual void setFocus();
/// Remove the focus from this window
virtual void killFocus();
/// Change top margin
void setMarginTop(FXint pt);
/// Return top margin
FXint getMarginTop() const { return margintop; }
/// Change bottom margin
void setMarginBottom(FXint pb);
/// Return bottom margin
FXint getMarginBottom() const { return marginbottom; }
/// Change left margin
void setMarginLeft(FXint pl);
/// Return left margin
FXint getMarginLeft() const { return marginleft; }
/// Change right margin
void setMarginRight(FXint pr);
/// Return right margin
FXint getMarginRight() const { return marginright; }
/// Return wrap columns
FXint getWrapColumns() const { return wrapcolumns; }
/// Set wrap columns
void setWrapColumns(FXint cols);
/// Return tab columns
FXint getTabColumns() const { return tabcolumns; }
/// Change tab columns
void setTabColumns(FXint cols);
/// Return number of columns used for line numbers
FXint getBarColumns() const { return barcolumns; }
/// Change number of columns used for line numbers
void setBarColumns(FXint cols);
/// Return TRUE if text was modified
FXbool isModified() const { return modified; }
/// Set modified flag
void setModified(FXbool mod=TRUE){ modified=mod; }
/// Set editable mode
void setEditable(FXbool edit=TRUE);
/// Return TRUE if text is editable
FXbool isEditable() const;
/// Set overstrike mode
void setOverstrike(FXbool over=TRUE);
/// Return TRUE if overstrike mode in effect
FXbool isOverstrike() const;
/// Set styled text mode
void setStyled(FXbool styled=TRUE);
/// Return TRUE if style buffer
FXbool isStyled() const { return (sbuffer!=NULL); }
/// Change delimiters of words
void setDelimiters(const FXchar* delims=textDelimiters){ delimiters=delims; }
/// Return word delimiters
const FXchar* getDelimiters() const { return delimiters; }
/// Change text font
void setFont(FXFont* fnt);
/// Return text font
FXFont* getFont() const { return font; }
/// Change text color
void setTextColor(FXColor clr);
/// Return text color
FXColor getTextColor() const { return textColor; }
/// Change selected background color
void setSelBackColor(FXColor clr);
/// Return selected background color
FXColor getSelBackColor() const { return selbackColor; }
/// Change selected text color
void setSelTextColor(FXColor clr);
/// Return selected text color
FXColor getSelTextColor() const { return seltextColor; }
/// Change highlighted text color
void setHiliteTextColor(FXColor clr);
/// Return highlighted text color
FXColor getHiliteTextColor() const { return hilitetextColor; }
/// Change highlighted background color
void setHiliteBackColor(FXColor clr);
/// Return highlighted background color
FXColor getHiliteBackColor() const { return hilitebackColor; }
/// Change active background color
void setActiveBackColor(FXColor clr);
/// Return active background color
FXColor getActiveBackColor() const { return activebackColor; }
/// Change cursor color
void setCursorColor(FXColor clr);
/// Return cursor color
FXColor getCursorColor() const { return cursorColor; }
/// Change line number color
void setNumberColor(FXColor clr);
/// Return line number color
FXColor getNumberColor() const { return numberColor; }
/// Change bar color
void setBarColor(FXColor clr);
/// Return bar color
FXColor getBarColor() const { return barColor; }
/// Set help text
void setHelpText(const FXString& text){ help=text; }
/// Return help text
FXString getHelpText() const { return help; }
/// Set the tool tip message for this text widget
void setTipText(const FXString& text){ tip=text; }
/// Get the tool tip message for this text widget
FXString getTipText() const { return tip; }
/// Get character at position in text buffer
FXint getByte(FXint pos) const;
/// Get wide character at position pos
FXwchar getChar(FXint pos) const;
/// Get length of wide character at position pos
FXint getCharLen(FXint pos) const;
/// Get style at position pos
FXint getStyle(FXint pos) const;
/// Extract n bytes of text from position pos
void extractText(FXchar *text,FXint pos,FXint n) const;
void extractText(FXString& text,FXint pos,FXint n) const;
/// Extract n bytes of style info from position pos
void extractStyle(FXString& text,FXint pos,FXint n) const;
void extractStyle(FXchar *style,FXint pos,FXint n) const;
/// Replace m bytes at pos by n characters
virtual void replaceText(FXint pos,FXint m,const FXchar *text,FXint n,FXbool notify=FALSE);
virtual void replaceText(FXint pos,FXint m,const FXString& text,FXbool notify=FALSE);
/// Replace m bytes at pos by n characters
virtual void replaceStyledText(FXint pos,FXint m,const FXchar *text,FXint n,FXint style=0,FXbool notify=FALSE);
virtual void replaceStyledText(FXint pos,FXint m,const FXString& text,FXint style=0,FXbool notify=FALSE);
/// Append n bytes of text at the end of the buffer
virtual void appendText(const FXchar *text,FXint n,FXbool notify=FALSE);
virtual void appendText(const FXString& text,FXbool notify=FALSE);
/// Append n bytes of text at the end of the buffer
virtual void appendStyledText(const FXchar *text,FXint n,FXint style=0,FXbool notify=FALSE);
virtual void appendStyledText(const FXString& text,FXint style=0,FXbool notify=FALSE);
/// Insert n bytes of text at position pos into the buffer
virtual void insertText(FXint pos,const FXchar *text,FXint n,FXbool notify=FALSE);
virtual void insertText(FXint pos,const FXString& text,FXbool notify=FALSE);
/// Insert n bytes of text at position pos into the buffer
virtual void insertStyledText(FXint pos,const FXchar *text,FXint n,FXint style=0,FXbool notify=FALSE);
virtual void insertStyledText(FXint pos,const FXString& text,FXint style=0,FXbool notify=FALSE);
/// Remove n bytes of text at position pos from the buffer
virtual void removeText(FXint pos,FXint n,FXbool notify=FALSE);
/// Change style of text range
virtual void changeStyle(FXint pos,FXint n,FXint style);
/// Change style of text range from style-array
virtual void changeStyle(FXint pos,const FXchar* style,FXint n);
virtual void changeStyle(FXint pos,const FXString& style);
/// Change the text in the buffer to new text
virtual void setText(const FXchar* text,FXint n,FXbool notify=FALSE);
virtual void setText(const FXString& text,FXbool notify=FALSE);
/// Change the text in the buffer to new text
virtual void setStyledText(const FXchar* text,FXint n,FXint style=0,FXbool notify=FALSE);
virtual void setStyledText(const FXString& text,FXint style=0,FXbool notify=FALSE);
/// Retrieve text into buffer
void getText(FXchar* text,FXint n) const;
void getText(FXString& text) const;
/// Return text in the widget
FXString getText() const;
/// Return length of buffer
FXint getLength() const { return length; }
/// Return number of rows in buffer
FXint getNumRows() const { return nrows; }
/// Shift block of lines from position start up to end by given amount
FXint shiftText(FXint start,FXint end,FXint amount,FXbool notify=FALSE);
/**
* Search for string in text buffer, returning the extent of
* the string in beg and end. The search starts from the given
* starting position, scans forward (SEARCH_FORWARD) or backward
* (SEARCH_BACKWARD), and wraps around if SEARCH_WRAP has been
* specified. The search type is either a plain search (SEARCH_EXACT),
* case insensitive search (SEARCH_IGNORECASE), or regular expression
* search (SEARCH_REGEX).
* For regular expression searches, capturing parentheses are used if
* npar is greater than 1; in this case, the number of entries in the
* beg[], end[] arrays must be npar also. If either beg or end or
* both are NULL, internal arrays are used.
* [This API is still subject to change!!]
*/
FXbool findText(const FXString& string,FXint* beg=NULL,FXint* end=NULL,FXint start=0,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP|SEARCH_EXACT,FXint npar=1);
/// Return TRUE if position pos is selected
FXbool isPosSelected(FXint pos) const;
/// Return TRUE if position is fully visible
FXbool isPosVisible(FXint pos) const;
/// Return text position at given visible x,y coordinate
FXint getPosAt(FXint x,FXint y) const;
/// Count number of rows; start should be on a row start
FXint countRows(FXint start,FXint end) const;
/// Count number of columns; start should be on a row start
FXint countCols(FXint start,FXint end) const;
/// Count number of newlines
FXint countLines(FXint start,FXint end) const;
/// Return position of begin of line containing position pos
FXint lineStart(FXint pos) const;
/// Return position of end of line containing position pos
FXint lineEnd(FXint pos) const;
/// Return start of next line
FXint nextLine(FXint pos,FXint nl=1) const;
/// Return start of previous line
FXint prevLine(FXint pos,FXint nl=1) const;
/// Return row start
FXint rowStart(FXint pos) const;
/// Return row end
FXint rowEnd(FXint pos) const;
/// Return start of next row
FXint nextRow(FXint pos,FXint nr=1) const;
/// Return start of previous row
FXint prevRow(FXint pos,FXint nr=1) const;
/// Return end of previous word
FXint leftWord(FXint pos) const;
/// Return begin of next word
FXint rightWord(FXint pos) const;
/// Return begin of word
FXint wordStart(FXint pos) const;
/// Return end of word
FXint wordEnd(FXint pos) const;
/// Return validated utf8 character start position
FXint validPos(FXint pos) const;
/// Retreat to the previous valid utf8 character start
FXint dec(FXint pos) const;
/// Advance to the next valid utf8 character start
FXint inc(FXint pos) const;
/// Make line containing pos the top line
void setTopLine(FXint pos);
/// Return position of top line
FXint getTopLine() const;
/// Make line containing pos the bottom line
void setBottomLine(FXint pos);
/// Return the position of the bottom line
FXint getBottomLine() const;
/// Make line containing pos the center line
void setCenterLine(FXint pos);
/// Set the anchor position
void setAnchorPos(FXint pos);
/// Return the anchor position
FXint getAnchorPos() const { return anchorpos; }
/// Set the cursor position
virtual void setCursorPos(FXint pos,FXbool notify=FALSE);
/// Set cursor row
void setCursorRow(FXint row,FXbool notify=FALSE);
/// Return cursor row
FXint getCursorRow() const { return cursorrow; }
/// Set cursor column
void setCursorColumn(FXint col,FXbool notify=FALSE);
/// Return cursor row, i.e. indent position
FXint getCursorColumn() const { return cursorcol; }
/// Return the cursor position
FXint getCursorPos() const { return cursorpos; }
/// Return selstartpos
FXint getSelStartPos() const { return selstartpos; }
/// Return selendpos
FXint getSelEndPos() const { return selendpos; }
/// Select all text
FXbool selectAll(FXbool notify=FALSE);
/// Extend the selection from the anchor to the given position
virtual FXbool extendSelection(FXint pos,FXTextSelectionMode select=SELECT_CHARS,FXbool notify=FALSE);
/// Select len characters starting at given position pos
FXbool setSelection(FXint pos,FXint len,FXbool notify=FALSE);
/// Unselect the text
virtual FXbool killSelection(FXbool notify=FALSE);
/// Highlight len characters starting at given position pos
FXbool setHighlight(FXint start,FXint len);
/// Unhighlight the text
FXbool killHighlight();
/// Scroll text to make the given position visible
void makePositionVisible(FXint pos);
/// Change text widget style
void setTextStyle(FXuint style);
/// Return text widget style
FXuint getTextStyle() const;
/// Change number of visible rows
void setVisibleRows(FXint rows);
/// Return number of visible rows
FXint getVisibleRows() const { return vrows; }
/// Change number of visible columns
void setVisibleColumns(FXint cols);
/// Return number of visible columns
FXint getVisibleColumns() const { return vcols; }
/**
* Change brace and parenthesis match highlighting time, in ms.
* A match highlight time of 0 disables brace matching.
*/
void setHiliteMatchTime(FXuint t){ matchtime=t; }
/**
* Return brace and parenthesis match highlighting time, in ms.
*/
FXuint getHiliteMatchTime() const { return matchtime; }
/// Set highlight styles
void setHiliteStyles(const FXHiliteStyle* styles);
/// Get highlight styles
const FXHiliteStyle* getHiliteStyles() const { return hilitestyles; }
/// Save to a stream
virtual void save(FXStream& store) const;
/// Load from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXText();
};
}
#endif
fox-1.6.49/include/FXDial.h 0000664 0001750 0001750 00000016641 12130340076 012241 0000000 0000000 /********************************************************************************
* *
* D i a l W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXDial.h,v 1.35 2006/01/22 17:58:00 fox Exp $ *
********************************************************************************/
#ifndef FXDIAL_H
#define FXDIAL_H
#ifndef FXFRAME_H
#include "FXFrame.h"
#endif
namespace FX {
// Dial style options
enum {
DIAL_VERTICAL = 0, // Vertically oriented
DIAL_HORIZONTAL = 0x00008000, // Horizontal oriented
DIAL_CYCLIC = 0x00010000, // Value wraps around
DIAL_HAS_NOTCH = 0x00020000, // Dial has a Center Notch
DIAL_NORMAL = DIAL_VERTICAL
};
/**
* The Dial widget is a valuator widget which is able to provide a cyclic
* value range when the DIAL_CYCLIC is passed, or a simple linear value range.
* While being turned, the dial sends a SEL_CHANGED message to its target;
* at the end of the interaction, a SEL_COMMAND message is sent.
* The message data represents the current value, of type FXint. The options
* DIAL_VERTICAL and DIAL_HORIZONTAL control the orientation of the dial.
* An optional notch can be used to indicate the zero-position of
* the dial; display of the notch is controlled by the DIAL_HAS_NOTCH option.
*/
class FXAPI FXDial : public FXFrame {
FXDECLARE(FXDial)
protected:
FXint range[2]; // Reported data range
FXColor notchColor; // Main notch color
FXint notchangle; // Angle of main notch
FXint notchspacing; // Angle between notches
FXint notchoffset; // Notch offset
FXint dragpoint; // Place where clicked
FXint dragpos; // Value where clicked
FXint incr; // Rate of change/revolution
FXint pos; // Reported data position
FXString help; // Help string
FXString tip; // Tip string
protected:
FXDial();
private:
FXDial(const FXDial&);
FXDial &operator=(const FXDial&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onMouseWheel(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void* );
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onUngrabbed(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetIntValue(FXObject*,FXSelector,void*);
long onCmdGetIntValue(FXObject*,FXSelector,void*);
long onCmdSetRealValue(FXObject*,FXSelector,void*);
long onCmdGetRealValue(FXObject*,FXSelector,void*);
long onCmdSetIntRange(FXObject*,FXSelector,void*);
long onCmdGetIntRange(FXObject*,FXSelector,void*);
long onCmdSetRealRange(FXObject*,FXSelector,void*);
long onCmdGetRealRange(FXObject*,FXSelector,void*);
long onCmdSetHelp(FXObject*,FXSelector,void*);
long onCmdGetHelp(FXObject*,FXSelector,void*);
long onCmdSetTip(FXObject*,FXSelector,void*);
long onCmdGetTip(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
public:
/// Construct a dial widget
FXDial(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=DIAL_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Returns true because a dial can receive focus
virtual bool canFocus() const;
/// Set the dial value
void setValue(FXint value,FXbool notify=FALSE);
/// Return the dial value
FXint getValue() const { return pos; }
/// Change the dial's range
void setRange(FXint lo,FXint hi,FXbool notify=FALSE);
/// Obtain the current range of the dial
void getRange(FXint& lo,FXint& hi) const { lo=range[0]; hi=range[1]; }
/**
* Set the revolution increment, which is the amount of change
* in the position for revolution of the dial; the dial may go
* through multiple revolutions to go through its whole range;
* by default it takes one 360 degree turn of the dial to go
* from the lower to the upper range.
*/
void setRevolutionIncrement(FXint i);
/// Get the current value of the revolution increment
FXint getRevolutionIncrement() const { return incr; }
/**
* Change the spacing for the small notches; this should be set
* in tenths of degrees in the range [1,3600], and the value should
* be a divisor of 3600, so as to make the notches come out evenly
*/
void setNotchSpacing(FXint spacing);
/// Get the current notch spacing
FXint getNotchSpacing() const { return notchspacing; }
/**
* Change the notch offset, which is the position of the
* center notch; the value should be tenths of degrees
* in the range [-3600,3600]
*/
void setNotchOffset(FXint offset);
/// Get the current center notch offset
FXint getNotchOffset() const { return notchoffset; }
/// Changes the dial style.
void setDialStyle(FXuint opts);
/// Get the current dial style.
FXuint getDialStyle() const;
/// Change the center notch color
void setNotchColor(FXColor clr);
/// Get the current center notch color
FXColor getNotchColor() const { return notchColor; }
/// Set the help text to be displayed on the status line
void setHelpText(const FXString& text);
/// Get the current help text
const FXString& getHelpText() const { return help; }
/// Set the tip text to be displayed in the tooltip
void setTipText(const FXString& text);
/// Get the current tooltip text value
const FXString& getTipText() const { return tip; }
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
};
}
#endif
fox-1.6.49/include/FXListBox.h 0000664 0001750 0001750 00000021474 12130340076 012754 0000000 0000000 /********************************************************************************
* *
* L i s t B o x W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXListBox.h,v 1.43 2006/01/22 17:58:05 fox Exp $ *
********************************************************************************/
#ifndef FXLISTBOX_H
#define FXLISTBOX_H
#ifndef FXPACKER_H
#include "FXPacker.h"
#endif
namespace FX {
/// List Box styles
enum {
LISTBOX_NORMAL = 0 // Normal style
};
class FXButton;
class FXMenuButton;
class FXList;
class FXPopup;
/**
* The List Box is a control to select one of a list of options. It looks
* similar to a Combo Box except that List Box yields integer numbers only.
* When an option is selected, List Box will send an SEL_COMMAND with the
* index of the opton. While manipulating the list, it may send SEL_CHANGED
* messages to indicate which option the cursor is hovering over.
* The List Box is able to receive ID_GETINTVALUE and ID_SETINTVALUE which
* will retrieve the current option or change the selected option.
*/
class FXAPI FXListBox : public FXPacker {
FXDECLARE(FXListBox)
protected:
FXButton *field;
FXMenuButton *button;
FXList *list;
FXPopup *pane;
protected:
FXListBox(){}
private:
FXListBox(const FXListBox&);
FXListBox &operator=(const FXListBox&);
public:
long onFocusUp(FXObject*,FXSelector,void*);
long onFocusDown(FXObject*,FXSelector,void*);
long onFocusSelf(FXObject*,FXSelector,void*);
long onMouseWheel(FXObject*,FXSelector,void*);
long onFieldButton(FXObject*,FXSelector,void*);
long onListUpdate(FXObject*,FXSelector,void*);
long onListClicked(FXObject*,FXSelector,void*);
long onListChanged(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdGetIntValue(FXObject*,FXSelector,void*);
long onCmdSetIntValue(FXObject*,FXSelector,void*);
public:
enum {
ID_LIST=FXPacker::ID_LAST,
ID_FIELD,
ID_LAST
};
public:
/// Constructor
FXListBox(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=FRAME_SUNKEN|FRAME_THICK|LISTBOX_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Destroy server-side resources
virtual void destroy();
/// Perform layout
virtual void layout();
/// Enable drive box
virtual void enable();
/// Disable drive box
virtual void disable();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Return the number of items in the list
FXint getNumItems() const;
/// Return the number of visible items
FXint getNumVisible() const;
/// Set the number of visible items
void setNumVisible(FXint nvis);
/// Return true if current item
FXbool isItemCurrent(FXint index) const;
/// Set the current item (index is zero-based)
virtual void setCurrentItem(FXint index,FXbool notify=FALSE);
/// Get the current item's index
FXint getCurrentItem() const;
/// Return the item at the given index
FXString getItem(FXint index) const;
/// Replace the item at index
FXint setItem(FXint index,const FXString& text,FXIcon* icon=NULL,void* ptr=NULL);
/// Fill list box by appending items from array of strings
FXint fillItems(const FXchar** strings,FXIcon* icon=NULL,void* ptr=NULL);
/// Fill list box by appending items from newline separated strings
FXint fillItems(const FXString& strings,FXIcon* icon=NULL,void* ptr=NULL);
/// Insert a new item at index
FXint insertItem(FXint index,const FXString& text,FXIcon* icon=NULL,void* ptr=NULL);
/// Add an item to the end of the list
FXint appendItem(const FXString& text,FXIcon* icon=NULL,void* ptr=NULL);
/// Prepend an item to the list
FXint prependItem(const FXString& text,FXIcon* icon=NULL,void* ptr=NULL);
/// Move item from oldindex to newindex
FXint moveItem(FXint newindex,FXint oldindex);
/// Extract item from list
FXListItem* extractItem(FXint index);
/// Remove this item from the list
void removeItem(FXint index);
/// Remove all items from the list
void clearItems();
/**
* Search items by name, beginning from item start. If the start
* item is -1 the search will start at the first item in the list.
* Flags may be SEARCH_FORWARD or SEARCH_BACKWARD to control the
* search direction; this can be combined with SEARCH_NOWRAP or SEARCH_WRAP
* to control whether the search wraps at the start or end of the list.
* The option SEARCH_IGNORECASE causes a case-insensitive match. Finally,
* passing SEARCH_PREFIX causes searching for a prefix of the item name.
* Return -1 if no matching item is found.
*/
FXint findItem(const FXString& text,FXint start=-1,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const;
/**
* Search items by associated user data, beginning from item start. If the
* start item is -1 the search will start at the first item in the list.
* Flags may be SEARCH_FORWARD or SEARCH_BACKWARD to control the
* search direction; this can be combined with SEARCH_NOWRAP or SEARCH_WRAP
* to control whether the search wraps at the start or end of the list.
*/
FXint findItemByData(const void *ptr,FXint start=-1,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const;
/// Set text for specified item
void setItemText(FXint index,const FXString& text);
/// Get text for specified item
FXString getItemText(FXint index) const;
/// Change item icon, deleting old one if it was owned
void setItemIcon(FXint index,FXIcon* icon,FXbool owned=FALSE);
/// Return icon of item at index
FXIcon* getItemIcon(FXint index) const;
/// Set data pointer for specified item
void setItemData(FXint index,void* ptr) const;
/// Get data pointer for specified item
void* getItemData(FXint index) const;
/// Is the pane shown
FXbool isPaneShown() const;
/// Sort items using current sort function
void sortItems();
/// Set text font
void setFont(FXFont* fnt);
/// Get text font
FXFont* getFont() const;
/// Set window background color
virtual void setBackColor(FXColor clr);
/// Get background color
FXColor getBackColor() const;
/// Change text color
void setTextColor(FXColor clr);
/// Return text color
FXColor getTextColor() const;
/// Change selected background color
void setSelBackColor(FXColor clr);
/// Return selected background color
FXColor getSelBackColor() const;
/// Change selected text color
void setSelTextColor(FXColor clr);
/// Return selected text color
FXColor getSelTextColor() const;
/// Return sort function
FXListSortFunc getSortFunc() const;
/// Change sort function
void setSortFunc(FXListSortFunc func);
/// Set the combobox help text
void setHelpText(const FXString& txt);
/// Get the combobox help text
const FXString& getHelpText() const;
/// Set the tool tip message for this combobox
void setTipText(const FXString& txt);
/// Get the tool tip message for this combobox
const FXString& getTipText() const;
/// Save combobox to a stream
virtual void save(FXStream& store) const;
/// Load combobox from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXListBox();
};
}
#endif
fox-1.6.49/include/FXMenuCascade.h 0000664 0001750 0001750 00000007750 12130340076 013541 0000000 0000000 /********************************************************************************
* *
* M e n u C a s c a d e W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXMenuCascade.h,v 1.24 2006/01/22 17:58:06 fox Exp $ *
********************************************************************************/
#ifndef FXMENUCASCADE_H
#define FXMENUCASCADE_H
#ifndef FXMENUCAPTION_H
#include "FXMenuCaption.h"
#endif
namespace FX {
class FXPopup;
/**
* The cascade menu widget is used to bring up a sub menu from a
* pull down menu.
*/
class FXAPI FXMenuCascade : public FXMenuCaption {
FXDECLARE(FXMenuCascade)
protected:
FXPopup *pane;
protected:
FXMenuCascade();
void drawTriangle(FXDCWindow& dc,FXint l,FXint t,FXint r,FXint b);
private:
FXMenuCascade(const FXMenuCascade&);
FXMenuCascade &operator=(const FXMenuCascade&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onEnter(FXObject*,FXSelector,void*);
long onLeave(FXObject*,FXSelector,void*);
long onButtonPress(FXObject*,FXSelector,void*);
long onButtonRelease(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onHotKeyPress(FXObject*,FXSelector,void*);
long onHotKeyRelease(FXObject*,FXSelector,void*);
long onCmdPost(FXObject*,FXSelector,void*);
long onCmdUnpost(FXObject*,FXSelector,void*);
public:
enum {
ID_MENUTIMER=FXMenuCaption::ID_LAST,
ID_LAST
};
public:
/// Construct a menu cascade responsible for the given popup menu
FXMenuCascade(FXComposite* p,const FXString& text,FXIcon* ic=NULL,FXPopup* pup=NULL,FXuint opts=0);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Destroy server-side resources
virtual void destroy();
/// Yes it can receive the focus
virtual bool canFocus() const;
/// Move the focus to this window
virtual void setFocus();
/// Remove the focus from this window
virtual void killFocus();
/// Set popup menu to pop up
void setMenu(FXPopup *pup){ pane = pup; }
/// Return popup menu
FXPopup* getMenu() const { return pane; }
/// True if this menu or is popup logically contains the mouse
virtual bool contains(FXint parentx,FXint parenty) const;
/// Save menu to a stream
virtual void save(FXStream& store) const;
/// Load menu from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXMenuCascade();
};
}
#endif
fox-1.6.49/include/FX88596Codec.h 0000644 0001750 0001750 00000001104 11637250333 013022 0000000 0000000 #ifndef FX88596CODEC_H
#define FX88596CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// ISO-8859-6 Codec
class FXAPI FX88596Codec : public FXTextCodec {
FXDECLARE(FX88596Codec)
public:
FX88596Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FX88596Codec(){}
};
}
#endif
fox-1.6.49/include/FXButton.h 0000664 0001750 0001750 00000013427 12130340076 012642 0000000 0000000 /********************************************************************************
* *
* B u t t o n W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXButton.h,v 1.38 2006/01/22 17:57:59 fox Exp $ *
********************************************************************************/
#ifndef FXBUTTON_H
#define FXBUTTON_H
#ifndef FXLABEL_H
#include "FXLabel.h"
#endif
namespace FX {
/// Button state bits
enum {
STATE_UP = 0, /// Button is up
STATE_DOWN = 1, /// Button is down
STATE_ENGAGED = 2, /// Button is engaged
STATE_UNCHECKED = STATE_UP, /// Same as STATE_UP (used for check buttons or radio buttons)
STATE_CHECKED = STATE_ENGAGED /// Same as STATE_ENGAGED (used for check buttons or radio buttons)
};
/// Button flags
enum {
BUTTON_AUTOGRAY = 0x00800000, /// Automatically gray out when not updated
BUTTON_AUTOHIDE = 0x01000000, /// Automatically hide button when not updated
BUTTON_TOOLBAR = 0x02000000, /// Toolbar style button [flat look]
BUTTON_DEFAULT = 0x04000000, /// May become default button when receiving focus
BUTTON_INITIAL = 0x08000000, /// This button is the initial default button
BUTTON_NORMAL = (FRAME_RAISED|FRAME_THICK|JUSTIFY_NORMAL|ICON_BEFORE_TEXT)
};
/**
* A button provides a push button, with optional icon and/or text label.
* When pressed, the button widget sends a SEL_COMMAND to its target.
* Passing the BUTTON_TOOLBAR style option gives buttons a "flat" look, and
* causes the edge of the button to be raised when the cursor moves over it.
* Passing BUTTON_DEFAULT allows the button to become the default button in
* a dialog, when the focus moves to it. The default widget in a dialog
* is the widget which will accept the RETURN key when it is pressed.
* The BUTTON_INITIAL flag makes the button the default widget when the
* focus moves to a widget which can not itself be a default widget.
* There should be only a single button in the dialog which is the
* initial default; typically this is the OK or CLOSE button.
* The option BUTTON_AUTOGRAY (BUTTON_AUTOHIDE) causes the button to be grayed
* out (hidden) if its handler does not respond to the SEL_UPDATE message.
* This is useful when messages are delegated, for example when using a
* multiple document interface, where the ultimaye destination of a message
* can be changed.
*/
class FXAPI FXButton : public FXLabel {
FXDECLARE(FXButton)
protected:
FXuchar state;
protected:
FXButton();
private:
FXButton(const FXButton&);
FXButton& operator=(const FXButton&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onUpdate(FXObject*,FXSelector,void*);
long onEnter(FXObject*,FXSelector,void*);
long onLeave(FXObject*,FXSelector,void*);
long onFocusIn(FXObject*,FXSelector,void*);
long onFocusOut(FXObject*,FXSelector,void*);
long onUngrabbed(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onHotKeyPress(FXObject*,FXSelector,void*);
long onHotKeyRelease(FXObject*,FXSelector,void*);
long onCheck(FXObject*,FXSelector,void*);
long onUncheck(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetIntValue(FXObject*,FXSelector,void*);
long onCmdGetIntValue(FXObject*,FXSelector,void*);
public:
/// Construct button with text and icon
FXButton(FXComposite* p,const FXString& text,FXIcon* ic=NULL,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=BUTTON_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Returns true because a button can receive focus
virtual bool canFocus() const;
/// Move the focus to this window
virtual void setFocus();
/// Remove the focus from this window
virtual void killFocus();
/// Set as default button
virtual void setDefault(FXbool enable=TRUE);
/// Set the button state
void setState(FXuint s);
/// Get the button state
FXuint getState() const { return state; }
/// Set the button style flags
void setButtonStyle(FXuint style);
/// Get the button style flags
FXuint getButtonStyle() const;
};
}
#endif
fox-1.6.49/include/FXString.h 0000664 0001750 0001750 00000067550 12130340076 012643 0000000 0000000 /********************************************************************************
* *
* S t r i n g O b j e c t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXString.h,v 1.120 2006/02/20 03:32:12 fox Exp $ *
********************************************************************************/
#ifndef FXSTRING_H
#define FXSTRING_H
namespace FX {
/**
* FXString provides essential string manipulation capabilities.
*/
class FXAPI FXString {
private:
FXchar* str;
public:
static const FXchar null[];
static const FXchar hex[17];
static const FXchar HEX[17];
public:
static const signed char utfBytes[256];
public:
/// Create empty string
FXString();
/// Copy construct
FXString(const FXString& s);
/// Construct and init from string
FXString(const FXchar* s);
/// Construct and init from wide character string
FXString(const FXwchar* s);
/// Construct and init from narrow character string
FXString(const FXnchar* s);
/// Construct and init with substring
FXString(const FXchar* s,FXint n);
/// Construct and init with wide character substring
FXString(const FXwchar* s,FXint n);
/// Construct and init with narrow character substring
FXString(const FXnchar* s,FXint n);
/// Construct and fill with constant
FXString(FXchar c,FXint n);
/// Length of text in bytes
FXint length() const { return *(((FXint*)str)-1); }
/// Change the length of the string to len
void length(FXint len);
/// Count number of utf8 characters
FXint count() const;
/// Count number of utf8 characters in subrange
FXint count(FXint pos,FXint len) const;
/// Return byte offset of utf8 character at index
FXint offset(FXint indx) const;
/// Return index of utf8 character at byte offset
FXint index(FXint offs) const;
/// Validate position to point to begin of utf8 character
FXint validate(FXint p) const;
/// Return extent of utf8 character at position
FXint extent(FXint p) const { return utfBytes[(FXuchar)str[p]]; }
/// Return start of next utf8 character
FXint inc(FXint p) const;
/// Return start of previous utf8 character
FXint dec(FXint p) const;
/// Get text contents
const FXchar* text() const { return (const FXchar*)str; }
/// See if string is empty
bool empty() const { return (((FXint*)str)[-1]==0); }
/// See if string is empty
bool operator!() const { return (((FXint*)str)[-1]==0); }
/// Return a non-const reference to the ith character
FXchar& operator[](FXint i){ return str[i]; }
/// Return a const reference to the ith character
const FXchar& operator[](FXint i) const { return str[i]; }
/// Return a non-const reference to the ith character
FXchar& at(FXint i){ return str[i]; }
/// Return a const reference to the ith character
const FXchar& at(FXint i) const { return str[i]; }
/// Return wide character starting at offset i
FXwchar wc(FXint i) const;
/// Assign a string to this
FXString& operator=(const FXchar* s);
/// Assign a wide character string to this
FXString& operator=(const FXwchar* s);
/// Assign a narrow character string to this
FXString& operator=(const FXnchar* s);
/// Assign another string to this
FXString& operator=(const FXString& s);
/// Convert to lower case
FXString& lower();
/// Convert to upper case
FXString& upper();
/// Return num partition(s) beginning at start from a string separated by delimiters delim.
FXString section(FXchar delim,FXint start,FXint num=1) const;
/// Return num partition(s) beginning at start from a string separated by set of delimiters from delim of size n
FXString section(const FXchar* delim,FXint n,FXint start,FXint num) const;
/// Return num partition(s) beginning at start from a string separated by set of delimiters from delim.
FXString section(const FXchar* delim,FXint start,FXint num=1) const;
/// Return num partition(s) beginning at start from a string separated by set of delimiters from delim.
FXString section(const FXString& delim,FXint start,FXint num=1) const;
/// Adopt string s, leaving s empty
FXString& adopt(FXString& s);
/// Assign character c to this string
FXString& assign(FXchar c);
/// Assign n characters c to this string
FXString& assign(FXchar c,FXint n);
/// Assign first n characters of string s to this string
FXString& assign(const FXchar *s,FXint n);
/// Assign first n characters of wide character string s to this string
FXString& assign(const FXwchar *s,FXint n);
/// Assign first n characters of narrow character string s to this string
FXString& assign(const FXnchar *s,FXint n);
/// Assign string s to this string
FXString& assign(const FXchar* s);
/// Assign wide character string s to this string
FXString& assign(const FXwchar* s);
/// Assign narrow character string s to this string
FXString& assign(const FXnchar* s);
/// Assign string s to this string
FXString& assign(const FXString& s);
/// Insert character at specified position
FXString& insert(FXint pos,FXchar c);
/// Insert n characters c at specified position
FXString& insert(FXint pos,FXchar c,FXint n);
/// Insert first n characters of string at specified position
FXString& insert(FXint pos,const FXchar* s,FXint n);
/// Insert first n characters of wide character string at specified position
FXString& insert(FXint pos,const FXwchar* s,FXint n);
/// Insert first n characters of narrow character string at specified position
FXString& insert(FXint pos,const FXnchar* s,FXint n);
/// Insert string at specified position
FXString& insert(FXint pos,const FXchar* s);
/// Insert wide character string at specified position
FXString& insert(FXint pos,const FXwchar* s);
/// Insert narrow character string at specified position
FXString& insert(FXint pos,const FXnchar* s);
/// Insert string at specified position
FXString& insert(FXint pos,const FXString& s);
/// Prepend string with input character
FXString& prepend(FXchar c);
/// Prepend string with n characters c
FXString& prepend(FXchar c,FXint n);
/// Prepend first n characters of string s
FXString& prepend(const FXchar* s,FXint n);
/// Prepend first n characters of wide character string s
FXString& prepend(const FXwchar* s,FXint n);
/// Prepend first n characters of narrow character string s
FXString& prepend(const FXnchar* s,FXint n);
/// Prepend string with string s
FXString& prepend(const FXchar* s);
/// Prepend string with wide character string
FXString& prepend(const FXwchar* s);
/// Prepend string with narrow character string
FXString& prepend(const FXnchar* s);
/// Prepend string with string s
FXString& prepend(const FXString& s);
/// Append character c to this string
FXString& append(FXchar c);
/// Append n characters c to this string
FXString& append(FXchar c,FXint n);
/// Append first n characters of string s to this string
FXString& append(const FXchar* s,FXint n);
/// Append first n characters of wide character string s to this string
FXString& append(const FXwchar* s,FXint n);
/// Append first n characters of narrow character string s to this string
FXString& append(const FXnchar* s,FXint n);
/// Append string s to this string
FXString& append(const FXchar* s);
/// Append wide character string s to this string
FXString& append(const FXwchar* s);
/// Append narrow character string s to this string
FXString& append(const FXnchar* s);
/// Append string s to this string
FXString& append(const FXString& s);
/// Replace a single character
FXString& replace(FXint pos,FXchar c);
/// Replace the m characters at pos with n characters c
FXString& replace(FXint pos,FXint m,FXchar c,FXint n);
/// Replaces the m characters at pos with first n characters of string s
FXString& replace(FXint pos,FXint m,const FXchar* s,FXint n);
/// Replaces the m characters at pos with first n characters of wide character string s
FXString& replace(FXint pos,FXint m,const FXwchar* s,FXint n);
/// Replaces the m characters at pos with first n characters of narrow character string s
FXString& replace(FXint pos,FXint m,const FXnchar* s,FXint n);
/// Replace the m characters at pos with string s
FXString& replace(FXint pos,FXint m,const FXchar* s);
/// Replace the m characters at pos with wide character string s
FXString& replace(FXint pos,FXint m,const FXwchar* s);
/// Replace the m characters at pos with narrow character string s
FXString& replace(FXint pos,FXint m,const FXnchar* s);
/// Replace the m characters at pos with string s
FXString& replace(FXint pos,FXint m,const FXString& s);
/// Move range of m characters from src position to dst position
FXString& move(FXint dst,FXint src,FXint n);
/// Remove one character
FXString& erase(FXint pos);
/// Remove substring
FXString& erase(FXint pos,FXint n);
/// Return number of occurrences of ch in string
FXint contains(FXchar ch) const;
/// Return number of occurrences of string sub in string
FXint contains(const FXchar* sub,FXint n) const;
/// Return number of occurrences of string sub in string
FXint contains(const FXchar* sub) const;
/// Return number of occurrences of string sub in string
FXint contains(const FXString& sub) const;
/// Substitute one character by another
FXString& substitute(FXchar org,FXchar sub,bool all=true);
/// Substitute one string by another
FXString& substitute(const FXchar* org,FXint olen,const FXchar *rep,FXint rlen,bool all=true);
/// Substitute one string by another
FXString& substitute(const FXchar* org,const FXchar *rep,bool all=true);
/// Substitute one string by another
FXString& substitute(const FXString& org,const FXString& rep,bool all=true);
/// Simplify whitespace in string
FXString& simplify();
/// Remove leading and trailing whitespace
FXString& trim();
/// Remove leading whitespace
FXString& trimBegin();
/// Remove trailing whitespace
FXString& trimEnd();
/// Truncate string at pos
FXString& trunc(FXint pos);
/// Clear
FXString& clear();
/// Get left most part
FXString left(FXint n) const;
/// Get right most part
FXString right(FXint n) const;
/// Get some part in the middle
FXString mid(FXint pos,FXint n) const;
/**
* Return all characters before the n-th occurrence of ch,
* searching from the beginning of the string. If the character
* is not found, return the entire string. If n<=0, return
* the empty string.
*/
FXString before(FXchar ch,FXint n=1) const;
/**
* Return all characters before the n-th occurrence of ch,
* searching from the end of the string. If the character
* is not found, return the empty string. If n<=0, return
* the entire string.
*/
FXString rbefore(FXchar ch,FXint n=1) const;
/**
* Return all characters after the nth occurrence of ch,
* searching from the beginning of the string. If the character
* is not found, return the empty string. If n<=0, return
* the entire string.
*/
FXString after(FXchar ch,FXint n=1) const;
/**
* Return all characters after the nth occurrence of ch,
* searching from the end of the string. If the character
* is not found, return the entire string. If n<=0, return
* the empty string.
*/
FXString rafter(FXchar ch,FXint n=1) const;
/// Find a character, searching forward; return position or -1
FXint find(FXchar c,FXint pos=0) const;
/// Find a character, searching backward; return position or -1
FXint rfind(FXchar c,FXint pos=2147483647) const;
/// Find n-th occurrence of character, searching forward; return position or -1
FXint find(FXchar c,FXint pos,FXint n) const;
/// Find n-th occurrence of character, searching backward; return position or -1
FXint rfind(FXchar c,FXint pos,FXint n) const;
/// Find a substring of length n, searching forward; return position or -1
FXint find(const FXchar* substr,FXint n,FXint pos) const;
/// Find a substring of length n, searching backward; return position or -1
FXint rfind(const FXchar* substr,FXint n,FXint pos) const;
/// Find a substring, searching forward; return position or -1
FXint find(const FXchar* substr,FXint pos=0) const;
/// Find a substring, searching backward; return position or -1
FXint rfind(const FXchar* substr,FXint pos=2147483647) const;
/// Find a substring, searching forward; return position or -1
FXint find(const FXString& substr,FXint pos=0) const;
/// Find a substring, searching backward; return position or -1
FXint rfind(const FXString& substr,FXint pos=2147483647) const;
/// Find first character in the set of size n, starting from pos; return position or -1
FXint find_first_of(const FXchar* set,FXint n,FXint pos) const;
/// Find first character in the set, starting from pos; return position or -1
FXint find_first_of(const FXchar* set,FXint pos=0) const;
/// Find first character in the set, starting from pos; return position or -1
FXint find_first_of(const FXString& set,FXint pos=0) const;
/// Find first character, starting from pos; return position or -1
FXint find_first_of(FXchar c,FXint pos=0) const;
/// Find last character in the set of size n, starting from pos; return position or -1
FXint find_last_of(const FXchar* set,FXint n,FXint pos) const;
/// Find last character in the set, starting from pos; return position or -1
FXint find_last_of(const FXchar* set,FXint pos=2147483647) const;
/// Find last character in the set, starting from pos; return position or -1
FXint find_last_of(const FXString& set,FXint pos=2147483647) const;
/// Find last character, starting from pos; return position or -1
FXint find_last_of(FXchar c,FXint pos=0) const;
/// Find first character NOT in the set of size n, starting from pos; return position or -1
FXint find_first_not_of(const FXchar* set,FXint n,FXint pos) const;
/// Find first character NOT in the set, starting from pos; return position or -1
FXint find_first_not_of(const FXchar* set,FXint pos=0) const;
/// Find first character NOT in the set, starting from pos; return position or -1
FXint find_first_not_of(const FXString& set,FXint pos=0) const;
/// Find first character NOT equal to c, starting from pos; return position or -1
FXint find_first_not_of(FXchar c,FXint pos=0) const;
/// Find last character NOT in the set of size n, starting from pos; return position or -1
FXint find_last_not_of(const FXchar* set,FXint n,FXint pos) const;
/// Find last character NOT in the set, starting from pos; return position or -1
FXint find_last_not_of(const FXchar* set,FXint pos=2147483647) const;
/// Find last character NOT in the set, starting from pos; return position or -1
FXint find_last_not_of(const FXString& set,FXint pos=2147483647) const;
/// Find last character NOT equal to c, starting from pos; return position or -1
FXint find_last_not_of(FXchar c,FXint pos=0) const;
/// Format a string a-la printf
FXString& format(const FXchar* fmt,...) FX_PRINTF(2,3) ;
FXString& vformat(const FXchar* fmt,va_list args);
/// Scan a string a-la scanf
FXint scan(const FXchar* fmt,...) const FX_SCANF(2,3) ;
FXint vscan(const FXchar* fmt,va_list args) const;
/// Get hash value
FXuint hash() const;
/// Compare
friend FXAPI FXint compare(const FXchar* s1,const FXchar* s2);
friend FXAPI FXint compare(const FXchar* s1,const FXString& s2);
friend FXAPI FXint compare(const FXString& s1,const FXchar* s2);
friend FXAPI FXint compare(const FXString& s1,const FXString& s2);
/// Compare up to n
friend FXAPI FXint compare(const FXchar* s1,const FXchar* s2,FXint n);
friend FXAPI FXint compare(const FXchar* s1,const FXString& s2,FXint n);
friend FXAPI FXint compare(const FXString& s1,const FXchar* s2,FXint n);
friend FXAPI FXint compare(const FXString& s1,const FXString& s2,FXint n);
/// Compare case insensitive
friend FXAPI FXint comparecase(const FXchar* s1,const FXchar* s2);
friend FXAPI FXint comparecase(const FXchar* s1,const FXString& s2);
friend FXAPI FXint comparecase(const FXString& s1,const FXchar* s2);
friend FXAPI FXint comparecase(const FXString& s1,const FXString& s2);
/// Compare case insensitive up to n
friend FXAPI FXint comparecase(const FXchar* s1,const FXchar* s2,FXint n);
friend FXAPI FXint comparecase(const FXchar* s1,const FXString& s2,FXint n);
friend FXAPI FXint comparecase(const FXString& s1,const FXchar* s2,FXint n);
friend FXAPI FXint comparecase(const FXString& s1,const FXString& s2,FXint n);
/// Compare with numeric interpretation
friend FXAPI FXint compareversion(const FXchar* s1,const FXchar* s2);
friend FXAPI FXint compareversion(const FXchar* s1,const FXString& s2);
friend FXAPI FXint compareversion(const FXString& s1,const FXchar* s2);
friend FXAPI FXint compareversion(const FXString& s1,const FXString& s2);
/// Comparison operators
friend FXAPI bool operator==(const FXString& s1,const FXString& s2);
friend FXAPI bool operator==(const FXString& s1,const FXchar* s2);
friend FXAPI bool operator==(const FXchar* s1,const FXString& s2);
friend FXAPI bool operator!=(const FXString& s1,const FXString& s2);
friend FXAPI bool operator!=(const FXString& s1,const FXchar* s2);
friend FXAPI bool operator!=(const FXchar* s1,const FXString& s2);
friend FXAPI bool operator<(const FXString& s1,const FXString& s2);
friend FXAPI bool operator<(const FXString& s1,const FXchar* s2);
friend FXAPI bool operator<(const FXchar* s1,const FXString& s2);
friend FXAPI bool operator<=(const FXString& s1,const FXString& s2);
friend FXAPI bool operator<=(const FXString& s1,const FXchar* s2);
friend FXAPI bool operator<=(const FXchar* s1,const FXString& s2);
friend FXAPI bool operator>(const FXString& s1,const FXString& s2);
friend FXAPI bool operator>(const FXString& s1,const FXchar* s2);
friend FXAPI bool operator>(const FXchar* s1,const FXString& s2);
friend FXAPI bool operator>=(const FXString& s1,const FXString& s2);
friend FXAPI bool operator>=(const FXString& s1,const FXchar* s2);
friend FXAPI bool operator>=(const FXchar* s1,const FXString& s2);
/// Append operators
FXString& operator+=(const FXString& s);
FXString& operator+=(const FXchar* s);
FXString& operator+=(const FXwchar* s);
FXString& operator+=(const FXnchar* s);
FXString& operator+=(FXchar c);
/// Concatenate one FXString with another
friend FXAPI FXString operator+(const FXString& s1,const FXString& s2);
/// Concatenate FXString and a string
friend FXAPI FXString operator+(const FXString& s1,const FXchar* s2);
friend FXAPI FXString operator+(const FXString& s1,const FXwchar* s2);
friend FXAPI FXString operator+(const FXString& s1,const FXnchar* s2);
/// Concatenate string and FXString
friend FXAPI FXString operator+(const FXchar* s1,const FXString& s2);
friend FXAPI FXString operator+(const FXwchar* s1,const FXString& s2);
friend FXAPI FXString operator+(const FXnchar* s1,const FXString& s2);
/// Concatenate string and single character
friend FXAPI FXString operator+(const FXString& s,FXchar c);
friend FXAPI FXString operator+(FXchar c,const FXString& s);
/// Saving to a stream
friend FXAPI FXStream& operator<<(FXStream& store,const FXString& s);
/// Load from a stream
friend FXAPI FXStream& operator>>(FXStream& store,FXString& s);
/// Format a string a-la printf
friend FXAPI FXString FXStringFormat(const FXchar* fmt,...) FX_PRINTF(1,2) ;
friend FXAPI FXString FXStringVFormat(const FXchar* fmt,va_list args);
/**
* Convert integer number to a string, using the given number
* base, which must be between 2 and 16.
*/
friend FXAPI FXString FXStringVal(FXint num,FXint base);
friend FXAPI FXString FXStringVal(FXuint num,FXint base);
/**
* Convert long integer number to a string, using the given number
* base, which must be between 2 and 16.
*/
friend FXAPI FXString FXStringVal(FXlong num,FXint base);
friend FXAPI FXString FXStringVal(FXulong num,FXint base);
/**
* Convert real number to a string, using the given procision and
* exponential notation mode, which may be FALSE (never), TRUE (always), or
* MAYBE (when needed).
*/
friend FXAPI FXString FXStringVal(FXfloat num,FXint prec,FXint exp);
friend FXAPI FXString FXStringVal(FXdouble num,FXint prec,FXint exp);
/// Convert string to a integer number, assuming given number base
friend FXAPI FXint FXIntVal(const FXString& s,FXint base);
friend FXAPI FXuint FXUIntVal(const FXString& s,FXint base);
/// Convert string to long integer number, assuming given number base
friend FXAPI FXlong FXLongVal(const FXString& s,FXint base);
friend FXAPI FXulong FXULongVal(const FXString& s,FXint base);
/// Convert string into real number
friend FXAPI FXfloat FXFloatVal(const FXString& s);
friend FXAPI FXdouble FXDoubleVal(const FXString& s);
/// Return utf8 from ascii containing unicode escapes
friend FXAPI FXString fromAscii(const FXString& s);
/// Return ascii containing unicode escapes from utf8
friend FXAPI FXString toAscii(const FXString& s);
/// Escape special characters in a string
friend FXAPI FXString escape(const FXString& s);
/// Unescape special characters in a string
friend FXAPI FXString unescape(const FXString& s);
/// Return normalized string, i.e. reordering of diacritical marks
friend FXAPI FXString normalize(const FXString& s);
/// Return normalized decomposition of string
friend FXAPI FXString decompose(const FXString& s,FXuint kind);
/// Return normalized composition of string; this first performs normalized decomposition
friend FXAPI FXString compose(const FXString& s,FXuint kind);
/// Swap two strings
friend inline void swap(FXString& a,FXString& b);
/// Convert to and from dos
friend FXAPI FXString& unixToDos(FXString& str);
friend FXAPI FXString& dosToUnix(FXString& str);
/// Delete
~FXString();
};
inline void swap(FXString& a,FXString& b){ FXchar *t=a.str; a.str=b.str; b.str=t; }
extern FXAPI FXint compare(const FXchar* s1,const FXchar* s2);
extern FXAPI FXint compare(const FXchar* s1,const FXString& s2);
extern FXAPI FXint compare(const FXString& s1,const FXchar* s2);
extern FXAPI FXint compare(const FXString& s1,const FXString& s2);
extern FXAPI FXint compare(const FXchar* s1,const FXchar* s2,FXint n);
extern FXAPI FXint compare(const FXchar* s1,const FXString& s2,FXint n);
extern FXAPI FXint compare(const FXString& s1,const FXchar* s2,FXint n);
extern FXAPI FXint compare(const FXString& s1,const FXString& s2,FXint n);
extern FXAPI FXint comparecase(const FXchar* s1,const FXchar* s2);
extern FXAPI FXint comparecase(const FXchar* s1,const FXString& s2);
extern FXAPI FXint comparecase(const FXString& s1,const FXchar* s2);
extern FXAPI FXint comparecase(const FXString& s1,const FXString& s2);
extern FXAPI FXint comparecase(const FXchar* s1,const FXchar* s2,FXint n);
extern FXAPI FXint comparecase(const FXchar* s1,const FXString& s2,FXint n);
extern FXAPI FXint comparecase(const FXString& s1,const FXchar* s2,FXint n);
extern FXAPI FXint comparecase(const FXString& s1,const FXString& s2,FXint n);
extern FXAPI FXint compareversion(const FXchar* s1,const FXchar* s2);
extern FXAPI FXint compareversion(const FXchar* s1,const FXString& s2);
extern FXAPI FXint compareversion(const FXString& s1,const FXchar* s2);
extern FXAPI FXint compareversion(const FXString& s1,const FXString& s2);
extern FXAPI bool operator==(const FXString& s1,const FXString& s2);
extern FXAPI bool operator==(const FXString& s1,const FXchar* s2);
extern FXAPI bool operator==(const FXchar* s1,const FXString& s2);
extern FXAPI bool operator!=(const FXString& s1,const FXString& s2);
extern FXAPI bool operator!=(const FXString& s1,const FXchar* s2);
extern FXAPI bool operator!=(const FXchar* s1,const FXString& s2);
extern FXAPI bool operator<(const FXString& s1,const FXString& s2);
extern FXAPI bool operator<(const FXString& s1,const FXchar* s2);
extern FXAPI bool operator<(const FXchar* s1,const FXString& s2);
extern FXAPI bool operator<=(const FXString& s1,const FXString& s2);
extern FXAPI bool operator<=(const FXString& s1,const FXchar* s2);
extern FXAPI bool operator<=(const FXchar* s1,const FXString& s2);
extern FXAPI bool operator>(const FXString& s1,const FXString& s2);
extern FXAPI bool operator>(const FXString& s1,const FXchar* s2);
extern FXAPI bool operator>(const FXchar* s1,const FXString& s2);
extern FXAPI bool operator>=(const FXString& s1,const FXString& s2);
extern FXAPI bool operator>=(const FXString& s1,const FXchar* s2);
extern FXAPI bool operator>=(const FXchar* s1,const FXString& s2);
extern FXAPI FXString operator+(const FXString& s1,const FXString& s2);
extern FXAPI FXString operator+(const FXString& s1,const FXchar* s2);
extern FXAPI FXString operator+(const FXString& s1,const FXwchar* s2);
extern FXAPI FXString operator+(const FXString& s1,const FXnchar* s2);
extern FXAPI FXString operator+(const FXchar* s1,const FXString& s2);
extern FXAPI FXString operator+(const FXwchar* s1,const FXString& s2);
extern FXAPI FXString operator+(const FXnchar* s1,const FXString& s2);
extern FXAPI FXString operator+(const FXString& s,FXchar c);
extern FXAPI FXString operator+(FXchar c,const FXString& s);
extern FXAPI FXStream& operator<<(FXStream& store,const FXString& s);
extern FXAPI FXStream& operator>>(FXStream& store,FXString& s);
extern FXAPI FXString FXStringFormat(const FXchar* fmt,...) FX_PRINTF(1,2) ;
extern FXAPI FXString FXStringVFormat(const FXchar* fmt,va_list args);
extern FXAPI FXString FXStringVal(FXint num,FXint base=10);
extern FXAPI FXString FXStringVal(FXuint num,FXint base=10);
extern FXAPI FXString FXStringVal(FXlong num,FXint base=10);
extern FXAPI FXString FXStringVal(FXulong num,FXint base=10);
extern FXAPI FXString FXStringVal(FXfloat num,FXint prec=6,FXint exp=MAYBE);
extern FXAPI FXString FXStringVal(FXdouble num,FXint prec=6,FXint exp=MAYBE);
extern FXAPI FXint FXIntVal(const FXString& s,FXint base=10);
extern FXAPI FXuint FXUIntVal(const FXString& s,FXint base=10);
extern FXAPI FXlong FXLongVal(const FXString& s,FXint base=10);
extern FXAPI FXulong FXULongVal(const FXString& s,FXint base=10);
extern FXAPI FXfloat FXFloatVal(const FXString& s);
extern FXAPI FXdouble FXDoubleVal(const FXString& s);
extern FXAPI FXString fromAscii(const FXString& s);
extern FXAPI FXString toAscii(const FXString& s);
extern FXAPI FXString escape(const FXString& s);
extern FXAPI FXString unescape(const FXString& s);
extern FXAPI FXString normalize(const FXString& s);
extern FXAPI FXString decompose(const FXString& s,FXuint kind);
extern FXAPI FXString compose(const FXString& s,FXuint kind);
extern FXAPI FXString& unixToDos(FXString& str);
extern FXAPI FXString& dosToUnix(FXString& str);
}
#endif
fox-1.6.49/include/FXPopup.h 0000664 0001750 0001750 00000015164 12130340076 012472 0000000 0000000 /********************************************************************************
* *
* P o p u p W i n d o w W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXPopup.h,v 1.35 2006/01/22 17:58:07 fox Exp $ *
********************************************************************************/
#ifndef FXPOPUP_H
#define FXPOPUP_H
#ifndef FXSHELL_H
#include "FXShell.h"
#endif
namespace FX {
/// Popup internal orientation
enum {
POPUP_VERTICAL = 0, /// Vertical orientation
POPUP_HORIZONTAL = 0x00020000, /// Horizontal orientation
POPUP_SHRINKWRAP = 0x00040000 /// Shrinkwrap to content
};
/// Popup window
class FXAPI FXPopup : public FXShell {
FXDECLARE(FXPopup)
private:
FXPopup *prevActive; // Popup below this one in stack
FXPopup *nextActive; // Popup above this one in stack
protected:
FXWindow *grabowner; // Window which will get grabbed when outside
FXColor baseColor;
FXColor hiliteColor;
FXColor shadowColor;
FXColor borderColor;
FXint border;
protected:
FXPopup();
virtual bool doesOverrideRedirect() const;
void drawBorderRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawRidgeRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawGrooveRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawDoubleRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawDoubleSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawFrame(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
private:
FXPopup(const FXPopup&);
FXPopup &operator=(const FXPopup&);
#ifdef WIN32
virtual const char* GetClass() const;
#endif
public:
long onPaint(FXObject*,FXSelector,void*);
long onFocusUp(FXObject*,FXSelector,void*);
long onFocusDown(FXObject*,FXSelector,void*);
long onFocusLeft(FXObject*,FXSelector,void*);
long onFocusRight(FXObject*,FXSelector,void*);
long onFocusNext(FXObject*,FXSelector,void*);
long onFocusPrev(FXObject*,FXSelector,void*);
long onEnter(FXObject*,FXSelector,void*);
long onLeave(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onMap(FXObject*,FXSelector,void*);
long onButtonPress(FXObject*,FXSelector,void*);
long onButtonRelease(FXObject*,FXSelector,void*);
long onUngrabbed(FXObject*,FXSelector,void*);
long onCmdUnpost(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onCmdChoice(FXObject*,FXSelector,void*);
public:
enum {
ID_CHOICE=FXShell::ID_LAST,
ID_LAST=ID_CHOICE+1000
};
public:
/// Construct popup pane
FXPopup(FXWindow* owner,FXuint opts=POPUP_VERTICAL|FRAME_RAISED|FRAME_THICK,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Return the default width of this window
virtual FXint getDefaultWidth();
/// Return the default height of this window
virtual FXint getDefaultHeight();
/// Perform layout
virtual void layout();
/// Return a pointer to the prior active popup
FXPopup* getPrevActive() const { return prevActive; }
/// Return a pointer to the next active popup
FXPopup* getNextActive() const { return nextActive; }
/// Move the focus to this window
virtual void setFocus();
/// Remove the focus from this window
virtual void killFocus();
/// Show this window
virtual void show();
/// Hide this window
virtual void hide();
/// Change frame style
void setFrameStyle(FXuint style);
/// Return frame style
FXuint getFrameStyle() const;
/// Return border width
FXint getBorderWidth() const { return border; }
/// Change highlight color
void setHiliteColor(FXColor clr);
/// Return highlight color
FXColor getHiliteColor() const { return hiliteColor; }
/// Change shadow color
void setShadowColor(FXColor clr);
/// Return shadow color
FXColor getShadowColor() const { return shadowColor; }
/// Change border color
void setBorderColor(FXColor clr);
/// Return border color
FXColor getBorderColor() const { return borderColor; }
/// Change base color
void setBaseColor(FXColor clr);
/// Return base color
FXColor getBaseColor() const { return baseColor; }
/// Popup the menu and grab to the given owner
virtual void popup(FXWindow* grabto,FXint x,FXint y,FXint w=0,FXint h=0);
/// Pop down the menu
virtual void popdown();
/// Return current grab owner
FXWindow* getGrabOwner() const;
// /// Popup the menu and grab to the given owner
// virtual FXint popup(FXint x,FXint y,FXint w=0,FXint h=0);
//
// /// Pop down the menu
// virtual void popdown(FXint value);
/// Return popup orientation
FXuint getOrientation() const;
/// Change popup orientation
void setOrientation(FXuint orient);
/// Return shrinkwrap mode
FXbool getShrinkWrap() const;
/// Change shrinkwrap mode
void setShrinkWrap(FXbool sw);
virtual bool doesSaveUnder() const;
/// Destructor
virtual ~FXPopup();
};
}
#endif
fox-1.6.49/include/FXICOImage.h 0000664 0001750 0001750 00000006551 12130340076 012744 0000000 0000000 /********************************************************************************
* *
* I C O I m a g e O b j e c t *
* *
*********************************************************************************
* Copyright (C) 2001,2006 by Janusz Ganczarski. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXICOImage.h,v 1.20 2006/01/22 17:58:04 fox Exp $ *
********************************************************************************/
#ifndef FXICOIMAGE_H
#define FXICOIMAGE_H
#ifndef FXIMAGE_H
#include "FXImage.h"
#endif
namespace FX {
/// ICO (Microsoft icon format) graphics file
class FXAPI FXICOImage : public FXImage {
FXDECLARE(FXICOImage)
protected:
FXICOImage(){}
private:
FXICOImage(const FXICOImage&);
FXICOImage &operator=(const FXICOImage&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct image from memory stream formatted in Microsoft icon format
FXICOImage(FXApp* a,const void *pix=NULL,FXuint opts=0,FXint w=1,FXint h=1);
/// Save pixels into stream in Microsoft icon format
virtual bool savePixels(FXStream& store) const;
/// Load pixels from stream in Microsoft icon format
virtual bool loadPixels(FXStream& store);
/// Destroy image
virtual ~FXICOImage();
};
#ifndef FXLOADICO
#define FXLOADICO
/**
* Check if stream contains a ICO, return TRUE if so.
*/
extern FXAPI bool fxcheckICO(FXStream& store);
/**
* Load an ICO (Microsoft icon format) file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadICO(FXStream& store,FXColor*& data,FXint& width,FXint& height,FXint& xspot,FXint& yspot);
/**
* Save an ICO (Microsoft icon format) file to a stream.
* If no hot-spot given, save as an ICO instead of a CUR resource.
*/
extern FXAPI bool fxsaveICO(FXStream& store,const FXColor *data,FXint width,FXint height,FXint xspot=-1,FXint yspot=-1);
#endif
}
#endif
fox-1.6.49/include/FXColorRing.h 0000664 0001750 0001750 00000014261 12130340076 013262 0000000 0000000 /********************************************************************************
* *
* C o l o r R i n g W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2005,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXColorRing.h,v 1.11 2006/01/22 17:57:59 fox Exp $ *
********************************************************************************/
#ifndef FXCOLORRING_H
#define FXCOLORRING_H
#ifndef FXFRAME_H
#include "FXFrame.h"
#endif
namespace FX {
class FXImage;
/**
* A Color Ring widget provides an intuitive way to specify a color.
* The outer ring of the widget is rotated to control the hue of the color
* being specified, while the inner triangle varies the color saturation
* and the brightness of the color. The color saturation axis of the
* triangle goes from a fully saturated "pure" color to "pastel" color;
* the brightness goes from black to a bright color.
*/
class FXAPI FXColorRing : public FXFrame {
FXDECLARE(FXColorRing)
protected:
FXImage *dial; // HSV dial image
FXfloat hsv[3]; // Hue, saturation, value
FXint ringwidth; // Width of hue ring
FXint ringouter; // Outer radius
FXint ringinner; // Inner radius
FXint dialx; // Dial x location
FXint dialy; // Dial y location
FXint satvalx; // Saturation value x
FXint satvaly; // Saturation value y
FXint huex; // Hue x
FXint huey; // Hue y
FXint clrx; // Color corner of triangle
FXint clry;
FXint blkx; // Black corner of triangle
FXint blky;
FXint whtx; // White corner of triangle
FXint whty;
FXString tip; // Tooltip value
FXString help; // Help value
FXuchar mode; // Mode widget is in
protected:
FXColorRing();
void updatering();
FXfloat hueFromXY(FXint x,FXint y) const;
void hueToXY(FXint& x,FXint& y,FXfloat hue) const;
void satValToXY(FXint& x,FXint& y,FXfloat s,FXfloat v) const;
void satValFromXY(FXfloat& s,FXfloat& v,FXint x,FXint y) const;
FXbool inCorner(FXint x,FXint y) const;
FXbool inHueRing(FXint x,FXint y) const;
FXbool inTriangle(FXint x,FXint y) const;
protected:
enum {
MOUSE_NONE, // No mouse operation
MOUSE_HUE, // Moving in hue-ring
MOUSE_SATVAL // Moving in saturation/value triangle
};
private:
FXColorRing(const FXColorRing&);
FXColorRing &operator=(const FXColorRing&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onMouseWheel(FXObject*,FXSelector,void*);
long onCmdSetHelp(FXObject*,FXSelector,void*);
long onCmdGetHelp(FXObject*,FXSelector,void*);
long onCmdSetTip(FXObject*,FXSelector,void*);
long onCmdGetTip(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
public:
/// Construct color ring with initial color clr
FXColorRing(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=FRAME_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Perform layout
virtual void layout();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Change hue
void setHue(FXfloat h);
/// Return hue
FXfloat getHue() const { return hsv[0]; }
/// Change saturation
void setSat(FXfloat s);
/// Return saturation
FXfloat getSat() const { return hsv[1]; }
/// Change value
void setVal(FXfloat v);
/// Return value
FXfloat getVal() const { return hsv[2]; }
/// Set hue, saturation, value
void setHueSatVal(FXfloat h,FXfloat s,FXfloat v);
/// Change width of hue ring
void setRingWidth(FXint rw);
/// Return width of hue ring
FXint getRingWidth() const { return ringwidth; }
/// Set status line help text for this color well
void setHelpText(const FXString& text){ help=text; }
/// Get status line help text for this color well
const FXString& getHelpText() const { return help; }
/// Set tool tip message for this color well
void setTipText(const FXString& text){ tip=text; }
/// Get tool tip message for this color well
const FXString& getTipText() const { return tip; }
/// Save color well to a stream
virtual void save(FXStream& store) const;
/// Load color well from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXColorRing();
};
}
#endif
fox-1.6.49/include/Makefile.in 0000664 0001750 0001750 00000045515 12130340141 013021 0000000 0000000 # Makefile.in generated by automake 1.11.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
# Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = include
DIST_COMMON = $(foxinclude_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/fxver.h.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES = fxver.h
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(foxincludedir)"
HEADERS = $(foxinclude_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FOX_BYTEORDER = @FOX_BYTEORDER@
FOX_MAJOR_VERSION = @FOX_MAJOR_VERSION@
FOX_MINOR_VERSION = @FOX_MINOR_VERSION@
FOX_PATCH_LEVEL = @FOX_PATCH_LEVEL@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_AGE = @LT_AGE@
LT_CURRENT = @LT_CURRENT@
LT_RELEASE = @LT_RELEASE@
LT_REVISION = @LT_REVISION@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
XMKMF = @XMKMF@
X_BASE_LIBS = @X_BASE_LIBS@
X_CFLAGS = @X_CFLAGS@
X_EXTRA_LIBS = @X_EXTRA_LIBS@
X_LIBS = @X_LIBS@
X_PRE_LIBS = @X_PRE_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
foxincludedir = $(includedir)/fox-1.6
CODECS = \
FX88591Codec.h \
FX88592Codec.h \
FX88593Codec.h \
FX88594Codec.h \
FX88595Codec.h \
FX88596Codec.h \
FX88597Codec.h \
FX88598Codec.h \
FX88599Codec.h \
FX885910Codec.h \
FX885911Codec.h \
FX885913Codec.h \
FX885914Codec.h \
FX885915Codec.h \
FX885916Codec.h \
FXCP437Codec.h \
FXCP850Codec.h \
FXCP852Codec.h \
FXCP855Codec.h \
FXCP856Codec.h \
FXCP857Codec.h \
FXCP860Codec.h \
FXCP861Codec.h \
FXCP862Codec.h \
FXCP863Codec.h \
FXCP864Codec.h \
FXCP865Codec.h \
FXCP866Codec.h \
FXCP869Codec.h \
FXCP874Codec.h \
FXCP1250Codec.h \
FXCP1251Codec.h \
FXCP1252Codec.h \
FXCP1253Codec.h \
FXCP1254Codec.h \
FXCP1255Codec.h \
FXCP1256Codec.h \
FXCP1257Codec.h \
FXCP1258Codec.h \
FXKOI8RCodec.h \
FXUTF8Codec.h \
FXUTF16Codec.h \
FXUTF32Codec.h
foxinclude_HEADERS = \
$(CODECS) \
FX4Splitter.h \
FX7Segment.h \
FXAccelTable.h \
FXApp.h \
FXArray.h \
FXArrowButton.h \
FXBMPIcon.h \
FXBMPImage.h \
FXBitmap.h \
FXBitmapFrame.h \
FXBitmapView.h \
FXButton.h \
FXBZFileStream.h \
FXCURCursor.h \
FXCanvas.h \
FXCheckButton.h \
FXChoiceBox.h \
FXColorBar.h \
FXColorDialog.h \
FXColorList.h \
FXColorRing.h \
FXColorSelector.h \
FXColorWell.h \
FXColorWheel.h \
FXComboBox.h \
FXComposeContext.h \
FXComposite.h \
FXCursor.h \
FXDate.h \
FXDC.h \
FXDCPrint.h \
FXDCWindow.h \
FXDLL.h \
FXDataTarget.h \
FXDebugTarget.h \
FXDelegator.h \
FXDial.h \
FXDialogBox.h \
FXDict.h \
FXDir.h \
FXDirBox.h \
FXDirDialog.h \
FXDirList.h \
FXDirSelector.h \
FXDockBar.h \
FXDockHandler.h \
FXDockSite.h \
FXDockTitle.h \
FXDocument.h \
FXDragCorner.h \
FXDrawable.h \
FXDriveBox.h \
FXElement.h \
FXException.h \
FXExpression.h \
FXExtentd.h \
FXExtentf.h \
FXFile.h \
FXFileDialog.h \
FXFileDict.h \
FXFileList.h \
FXFileSelector.h \
FXFileStream.h \
FXFoldingList.h \
FXFont.h \
FXFontDialog.h \
FXFontSelector.h \
FXFrame.h \
FXGIFCursor.h \
FXGIFIcon.h \
FXGIFImage.h \
FXGLCanvas.h \
FXGLCone.h \
FXGLContext.h \
FXGLCube.h \
FXGLCylinder.h \
FXGLObject.h \
FXGLShape.h \
FXGLSphere.h \
FXGLTriangleMesh.h \
FXGLViewer.h \
FXGLVisual.h \
FXGroupBox.h \
FXGradientBar.h \
FXGUISignal.h \
FXGZFileStream.h \
FXHash.h \
FXHeader.h \
FXHorizontalFrame.h \
FXICOIcon.h \
FXICOImage.h \
FXIFFImage.h \
FXIFFIcon.h \
FXIO.h \
FXIcon.h \
FXIconDict.h \
FXIconList.h \
FXIconSource.h \
FXId.h \
FXImage.h \
FXImageFrame.h \
FXImageView.h \
FXInputDialog.h \
FXJPGIcon.h \
FXJPGImage.h \
FXKnob.h \
FXLabel.h \
FXList.h \
FXListBox.h \
FXMDIButton.h \
FXMDIChild.h \
FXMDIClient.h \
FXMainWindow.h \
FXMat3d.h \
FXMat4d.h \
FXMat3f.h \
FXMat4f.h \
FXMatrix.h \
FXMemoryStream.h \
FXMemMap.h \
FXMenuBar.h \
FXMenuButton.h \
FXMenuCaption.h \
FXMenuCascade.h \
FXMenuCheck.h \
FXMenuRadio.h \
FXMenuCommand.h \
FXMenuPane.h \
FXMenuSeparator.h \
FXMenuTitle.h \
FXMessageBox.h \
FXObject.h \
FXObjectList.h \
FXOptionMenu.h \
FXPCXIcon.h \
FXPCXImage.h \
FXPNGIcon.h \
FXPNGImage.h \
FXPPMIcon.h \
FXPPMImage.h \
FXPacker.h \
FXPath.h \
FXPicker.h \
FXPipe.h \
FXPoint.h \
FXPopup.h \
FXPrintDialog.h \
FXProgressBar.h \
FXProgressDialog.h \
FXQuatd.h \
FXQuatf.h \
FXRASIcon.h \
FXRASImage.h \
FXRGBIcon.h \
FXRGBImage.h \
FXRadioButton.h \
FXRangef.h \
FXRanged.h \
FXRealSlider.h \
FXRealSpinner.h \
FXRecentFiles.h \
FXRectangle.h \
FXRegion.h \
FXRegistry.h \
FXReplaceDialog.h \
FXRex.h \
FXRootWindow.h \
FXRuler.h \
FXRulerView.h \
FXScrollArea.h \
FXScrollBar.h \
FXScrollPane.h \
FXScrollWindow.h \
FXSearchDialog.h \
FXSeparator.h \
FXSettings.h \
FXShell.h \
FXShutter.h \
FXSize.h \
FXSlider.h \
FXSocket.h \
FXSpinner.h \
FXSpheref.h \
FXSphered.h \
FXSplashWindow.h \
FXSplitter.h \
FXSpring.h \
FXStat.h \
FXStatusBar.h \
FXStatusLine.h \
FXStream.h \
FXString.h \
FXStringDict.h \
FXSwitcher.h \
FXSystem.h \
FXTGAIcon.h \
FXTGAImage.h \
FXTIFIcon.h \
FXTIFImage.h \
FXTabBar.h \
FXTabBook.h \
FXTabItem.h \
FXTable.h \
FXText.h \
FXTextCodec.h \
FXTextField.h \
FXThread.h \
FXToggleButton.h \
FXToolBar.h \
FXToolBarGrip.h \
FXToolBarShell.h \
FXToolBarTab.h \
FXToolTip.h \
FXTopWindow.h \
FXTranslator.h \
FXTreeList.h \
FXTreeListBox.h \
FXTriStateButton.h \
FXUndoList.h \
FXURL.h \
FXVec2d.h \
FXVec2f.h \
FXVec3d.h \
FXVec3f.h \
FXVec4d.h \
FXVec4f.h \
FXVerticalFrame.h \
FXVisual.h \
FXWindow.h \
FXWizard.h \
FXXBMIcon.h \
FXXBMImage.h \
FXXPMIcon.h \
FXXPMImage.h \
fx.h \
fx3d.h \
fxascii.h \
fxdefs.h \
fxkeys.h \
fxunicode.h \
fxver.h \
xincs.h
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign include/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
fxver.h: $(top_builddir)/config.status $(srcdir)/fxver.h.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-foxincludeHEADERS: $(foxinclude_HEADERS)
@$(NORMAL_INSTALL)
@list='$(foxinclude_HEADERS)'; test -n "$(foxincludedir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(foxincludedir)'"; \
$(MKDIR_P) "$(DESTDIR)$(foxincludedir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(foxincludedir)'"; \
$(INSTALL_HEADER) $$files "$(DESTDIR)$(foxincludedir)" || exit $$?; \
done
uninstall-foxincludeHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(foxinclude_HEADERS)'; test -n "$(foxincludedir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(foxincludedir)'; $(am__uninstall_files_from_dir)
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(foxincludedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-foxincludeHEADERS
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-foxincludeHEADERS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libtool ctags distclean distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-foxincludeHEADERS install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-foxincludeHEADERS
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
fox-1.6.49/include/FXMemoryStream.h 0000664 0001750 0001750 00000014711 12130340076 014010 0000000 0000000 /********************************************************************************
* *
* M e m o r y S t r e a m C l a s s e s *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXMemoryStream.h,v 1.11 2006/01/22 17:58:06 fox Exp $ *
********************************************************************************/
#ifndef FXMEMORYSTREAM_H
#define FXMEMORYSTREAM_H
#ifndef FXSTREAM_H
#include "FXStream.h"
#endif
namespace FX {
/// Memory Store Definition
class FXAPI FXMemoryStream : public FXStream {
protected:
virtual FXuval writeBuffer(FXuval count);
virtual FXuval readBuffer(FXuval count);
public:
/// Create memory store
FXMemoryStream(const FXObject* cont=NULL);
/// Open file store
bool open(FXStreamDirection save_or_load,FXuchar* data);
/// Open memory store
bool open(FXStreamDirection save_or_load,FXuval size,FXuchar* data);
/// Take buffer away from stream
void takeBuffer(FXuchar*& data,FXuval& size);
/// Give buffer to stream
void giveBuffer(FXuchar *data,FXuval size);
/// Close memory store
virtual bool close();
/// Get position
FXlong position() const { return FXStream::position(); }
/// Move to position
virtual bool position(FXlong offset,FXWhence whence=FXFromStart);
/// Save single items to stream
FXMemoryStream& operator<<(const FXuchar& v){ FXStream::operator<<(v); return *this; }
FXMemoryStream& operator<<(const FXchar& v){ FXStream::operator<<(v); return *this; }
FXMemoryStream& operator<<(const FXushort& v){ FXStream::operator<<(v); return *this; }
FXMemoryStream& operator<<(const FXshort& v){ FXStream::operator<<(v); return *this; }
FXMemoryStream& operator<<(const FXuint& v){ FXStream::operator<<(v); return *this; }
FXMemoryStream& operator<<(const FXint& v){ FXStream::operator<<(v); return *this; }
FXMemoryStream& operator<<(const FXfloat& v){ FXStream::operator<<(v); return *this; }
FXMemoryStream& operator<<(const FXdouble& v){ FXStream::operator<<(v); return *this; }
FXMemoryStream& operator<<(const FXlong& v){ FXStream::operator<<(v); return *this; }
FXMemoryStream& operator<<(const FXulong& v){ FXStream::operator<<(v); return *this; }
/// Save arrays of items to stream
FXMemoryStream& save(const FXuchar* p,FXuval n){ FXStream::save(p,n); return *this; }
FXMemoryStream& save(const FXchar* p,FXuval n){ FXStream::save(p,n); return *this; }
FXMemoryStream& save(const FXushort* p,FXuval n){ FXStream::save(p,n); return *this; }
FXMemoryStream& save(const FXshort* p,FXuval n){ FXStream::save(p,n); return *this; }
FXMemoryStream& save(const FXuint* p,FXuval n){ FXStream::save(p,n); return *this; }
FXMemoryStream& save(const FXint* p,FXuval n){ FXStream::save(p,n); return *this; }
FXMemoryStream& save(const FXfloat* p,FXuval n){ FXStream::save(p,n); return *this; }
FXMemoryStream& save(const FXdouble* p,FXuval n){ FXStream::save(p,n); return *this; }
FXMemoryStream& save(const FXlong* p,FXuval n){ FXStream::save(p,n); return *this; }
FXMemoryStream& save(const FXulong* p,FXuval n){ FXStream::save(p,n); return *this; }
/// Load single items from stream
FXMemoryStream& operator>>(FXuchar& v){ FXStream::operator>>(v); return *this; }
FXMemoryStream& operator>>(FXchar& v){ FXStream::operator>>(v); return *this; }
FXMemoryStream& operator>>(FXushort& v){ FXStream::operator>>(v); return *this; }
FXMemoryStream& operator>>(FXshort& v){ FXStream::operator>>(v); return *this; }
FXMemoryStream& operator>>(FXuint& v){ FXStream::operator>>(v); return *this; }
FXMemoryStream& operator>>(FXint& v){ FXStream::operator>>(v); return *this; }
FXMemoryStream& operator>>(FXfloat& v){ FXStream::operator>>(v); return *this; }
FXMemoryStream& operator>>(FXdouble& v){ FXStream::operator>>(v); return *this; }
FXMemoryStream& operator>>(FXlong& v){ FXStream::operator>>(v); return *this; }
FXMemoryStream& operator>>(FXulong& v){ FXStream::operator>>(v); return *this; }
/// Load arrays of items from stream
FXMemoryStream& load(FXuchar* p,FXuval n){ FXStream::load(p,n); return *this; }
FXMemoryStream& load(FXchar* p,FXuval n){ FXStream::load(p,n); return *this; }
FXMemoryStream& load(FXushort* p,FXuval n){ FXStream::load(p,n); return *this; }
FXMemoryStream& load(FXshort* p,FXuval n){ FXStream::load(p,n); return *this; }
FXMemoryStream& load(FXuint* p,FXuval n){ FXStream::load(p,n); return *this; }
FXMemoryStream& load(FXint* p,FXuval n){ FXStream::load(p,n); return *this; }
FXMemoryStream& load(FXfloat* p,FXuval n){ FXStream::load(p,n); return *this; }
FXMemoryStream& load(FXdouble* p,FXuval n){ FXStream::load(p,n); return *this; }
FXMemoryStream& load(FXlong* p,FXuval n){ FXStream::load(p,n); return *this; }
FXMemoryStream& load(FXulong* p,FXuval n){ FXStream::load(p,n); return *this; }
/// Save object
FXMemoryStream& saveObject(const FXObject* v){ FXStream::saveObject(v); return *this; }
/// Load object
FXMemoryStream& loadObject(FXObject*& v){ FXStream::loadObject(v); return *this; }
};
}
#endif
fox-1.6.49/include/FXImage.h 0000664 0001750 0001750 00000024240 12130340076 012404 0000000 0000000 /********************************************************************************
* *
* I m a g e O b j e c t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXImage.h,v 1.64 2006/01/22 17:58:05 fox Exp $ *
********************************************************************************/
#ifndef FXIMAGE_H
#define FXIMAGE_H
#ifndef FXDRAWABLE_H
#include "FXDrawable.h"
#endif
namespace FX {
/// Image rendering hints
enum {
IMAGE_KEEP = 0x00000001, /// Keep pixel data in client
IMAGE_OWNED = 0x00000002, /// Pixel data is owned by image
IMAGE_DITHER = 0, /// Dither image to look better
IMAGE_NEAREST = 0x00000004, /// Turn off dithering and map to nearest color
IMAGE_OPAQUE = 0x00000008, /// Force opaque background
IMAGE_ALPHACOLOR = 0x00000010, /// Override transparancy color
IMAGE_SHMI = 0x00000020, /// Using shared memory image
IMAGE_SHMP = 0x00000040, /// Using shared memory pixmap
IMAGE_ALPHAGUESS = 0x00000080 /// Guess transparency color from corners
};
class FXDC;
class FXDCWindow;
/**
* An Image is a rectangular array of pixels. It supports two representations
* of these pixels: a client-side pixel buffer which is stored as an array of
* FXColor, and a server-side pixmap which is stored in an organization directly
* compatible with the screen, for fast drawing onto the device.
* The server-side representation is not directly accessible from the current
* process as it lives in the process of the X Server or GDI.
*/
class FXAPI FXImage : public FXDrawable {
FXDECLARE(FXImage)
friend class FXDC;
friend class FXDCWindow;
protected:
FXColor *data; // Pixel data
FXuint options; // Options
private:
#ifdef WIN32
virtual FXID GetDC() const;
virtual int ReleaseDC(FXID) const;
#endif
#ifndef WIN32
void render_true_32(void *xim,FXuchar *img);
void render_true_24(void *xim,FXuchar *img);
void render_true_16_fast(void *xim,FXuchar *img);
void render_true_16_dither(void *xim,FXuchar *img);
void render_true_8_fast(void *xim,FXuchar *img);
void render_true_8_dither(void *xim,FXuchar *img);
void render_true_N_fast(void *xim,FXuchar *img);
void render_true_N_dither(void *xim,FXuchar *img);
void render_index_4_fast(void *xim,FXuchar *img);
void render_index_4_dither(void *xim,FXuchar *img);
void render_index_8_fast(void *xim,FXuchar *img);
void render_index_8_dither(void *xim,FXuchar *img);
void render_index_N_fast(void *xim,FXuchar *img);
void render_index_N_dither(void *xim,FXuchar *img);
void render_gray_8_fast(void *xim,FXuchar *img);
void render_gray_8_dither(void *xim,FXuchar *img);
void render_gray_N_fast(void *xim,FXuchar *img);
void render_gray_N_dither(void *xim,FXuchar *img);
void render_mono_1_fast(void *xim,FXuchar *img);
void render_mono_1_dither(void *xim,FXuchar *img);
#endif
protected:
FXImage();
private:
FXImage(const FXImage&);
FXImage &operator=(const FXImage&);
public:
/**
* Create an image. If a client-side pixel buffer has been specified,
* the image does not own the pixel buffer unless the IMAGE_OWNED flag is
* set. If the IMAGE_OWNED flag is set but a NULL pixel buffer is
* passed, a pixel buffer will be automatically created and will be owned
* by the image. The flags IMAGE_SHMI and IMAGE_SHMP may be specified for
* large images to instruct render() to use shared memory to communicate
* with the server.
*/
FXImage(FXApp* a,const FXColor *pix=NULL,FXuint opts=0,FXint w=1,FXint h=1);
/// Change options
void setOptions(FXuint opts);
/// To get to the option flags
FXuint getOptions() const { return options; }
/**
* Populate the image with new pixel data of the same size; it will assume
* ownership of the pixel data if image IMAGE_OWNED option is passed.
* The server-side representation of the image, if it exists, is not updated.
* This can be done by calling render().
*/
virtual void setData(FXColor *pix,FXuint opts=0);
/**
* Populate the image with new pixel data of a new size; it will assume ownership
* of the pixel data if image IMAGE_OWNED option is passed. The size of the server-
* side representation of the image, if it exists, is adjusted but the contents are
* not updated yet. This can be done by calling render().
*/
virtual void setData(FXColor *pix,FXuint opts,FXint w,FXint h);
/// Return pointer to the pixel data of the image
FXColor* getData() const { return data; }
/// Get pixel at x,y
FXColor getPixel(FXint x,FXint y) const { return data[y*width+x]; }
/// Change pixel at x,y
void setPixel(FXint x,FXint y,FXColor color){ data[y*width+x]=color; }
/// Scan the image and return false if fully opaque
bool hasAlpha() const;
/**
* Create the server side pixmap, then call render() to fill it with the
* pixel data from the client-side buffer. After the server-side image has
* been created, the client-side pixel buffer will be deleted unless
* IMAGE_KEEP has been specified. If the pixel buffer is not owned, i.e.
* the flag IMAGE_OWNED is not set, the pixel buffer will not be deleted,
* however the pixel buffer will be set to NULL.
*/
virtual void create();
/**
* Detach the server side pixmap from the Image.
* Afterwards, the Image is left as if it never had a server-side resources.
*/
virtual void detach();
/**
* Destroy the server-side pixmap.
* The client-side pixel buffer is not affected.
*/
virtual void destroy();
/**
* Retrieves pixels from the server-side image. For example, to make
* screen snapshots, or to retrieve an image after it has been drawn
* into by various means.
*/
virtual void restore();
/**
* Render the server-side representation of the image from client-side
* pixels. Normally, IMAGE_DITHER is used which causes the server-side
* representation to be rendered using a 16x16 ordered dither if necessary;
* however if IMAGE_NEAREST is used a faster (but uglier-looking), nearest
* neighbor algorithm is used.
*/
virtual void render();
/**
* Release the client-side pixels buffer, free it if it was owned.
* If it is not owned, the image just forgets about the buffer.
*/
virtual void release();
/**
* Resize both client-side and server-side representations (if any) to the
* given width and height. The new representations typically contain garbage
* after this operation and need to be re-filled.
*/
virtual void resize(FXint w,FXint h);
/**
* Rescale pixels image to the specified width and height; this calls
* resize() to adjust the client and server side representations.
*/
virtual void scale(FXint w,FXint h,FXint quality=0);
/// Mirror image horizontally and/or vertically
virtual void mirror(bool horizontal,bool vertical);
/**
* Rotate image by degrees ccw; this calls resize() to adjust the client
* and server side representations if necessary.
*/
virtual void rotate(FXint degrees);
/**
* Crop image to given rectangle; this calls resize() to adjust the client
* and server side representations. The new image may be smaller or larger
* than the old one; blank areas are filled with color. There must be at
* least one pixel of overlap between the old and the new image.
*/
virtual void crop(FXint x,FXint y,FXint w,FXint h,FXColor color=0);
/// Fill image with uniform color
virtual void fill(FXColor color);
/// Fade image to uniform color
virtual void fade(FXColor color,FXint factor=255);
/**
* Shear image horizontally; the number of pixels is equal to the
* shear parameter times 256. The area outside the image is filled
* with transparent black, unless another color is specified.
*/
virtual void xshear(FXint shear,FXColor clr=0);
/**
* Shear image vertically; the number of pixels is equal to the
* shear parameter times 256. The area outside the image is filled
* with transparent black, unless another color is specified.
*/
virtual void yshear(FXint shear,FXColor clr=0);
/// Fill horizontal gradient
virtual void hgradient(FXColor left,FXColor right);
/// Fill vertical gradient
virtual void vgradient(FXColor top,FXColor bottom);
/// Fill with gradient
virtual void gradient(FXColor topleft,FXColor topright,FXColor bottomleft,FXColor bottomright);
/// Blend image over uniform color
virtual void blend(FXColor color);
/// Save object to stream
virtual void save(FXStream& store) const;
/// Load object from stream
virtual void load(FXStream& store);
/// Save pixel data only
virtual bool savePixels(FXStream& store) const;
/// Load pixel data only
virtual bool loadPixels(FXStream& store);
/// Destructor
virtual ~FXImage();
};
}
#endif
fox-1.6.49/include/FXPNGIcon.h 0000664 0001750 0001750 00000006372 12130340076 012625 0000000 0000000 /********************************************************************************
* *
* P N G I m a g e O b j e c t *
* *
*********************************************************************************
* Copyright (C) 1999,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXPNGIcon.h,v 1.22 2006/01/22 17:58:06 fox Exp $ *
********************************************************************************/
#ifndef FXPNGICON_H
#define FXPNGICON_H
#ifndef FXICON_H
#include "FXIcon.h"
#endif
namespace FX {
/// Portable Network Graphics (PNG) Icon class
class FXAPI FXPNGIcon : public FXIcon {
FXDECLARE(FXPNGIcon)
protected:
FXPNGIcon(){}
private:
FXPNGIcon(const FXPNGIcon&);
FXPNGIcon &operator=(const FXPNGIcon&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct an icon from memory stream formatted in PNG format
FXPNGIcon(FXApp *a,const void *pix=NULL,FXColor clr=FXRGB(192,192,192),FXuint opts=0,FXint w=1,FXint h=1);
/// True if format is supported
static const bool supported;
/// Save pixels into stream in PNG format
virtual bool savePixels(FXStream& store) const;
/// Load pixels from stream in PNG format
virtual bool loadPixels(FXStream& store);
/// Destroy
virtual ~FXPNGIcon();
};
/**
* Check if stream contains a PNG, return TRUE if so.
*/
extern FXAPI bool fxcheckPNG(FXStream& store);
/**
* Load an PNG (Portable Network Graphics) file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadPNG(FXStream& store,FXColor*& data,FXint& width,FXint& height);
/**
* Save an PNG (Portable Network Graphics) file to a stream.
*/
extern FXAPI bool fxsavePNG(FXStream& store,const FXColor* data,FXint width,FXint height);
}
#endif
fox-1.6.49/include/FXDrawable.h 0000664 0001750 0001750 00000006267 12130340076 013114 0000000 0000000 /********************************************************************************
* *
* D r a w a b l e A r e a *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXDrawable.h,v 1.25 2006/01/22 17:58:01 fox Exp $ *
********************************************************************************/
#ifndef FXDRAWABLE_H
#define FXDRAWABLE_H
#ifndef FXID_H
#include "FXId.h"
#endif
namespace FX {
class FXVisual;
/**
* Drawable is an abstract base class for any surface that can be
* drawn upon, such as a FXWindow, or FXImage.
*/
class FXAPI FXDrawable : public FXId {
FXDECLARE_ABSTRACT(FXDrawable)
friend class FXDC;
friend class FXDCWindow;
protected:
FXVisual *visual; // Visual for this window
FXint width; // Width
FXint height; // Height
protected:
FXDrawable();
FXDrawable(FXApp* a,FXint w,FXint h);
private:
FXDrawable(const FXDrawable&);
FXDrawable &operator=(const FXDrawable&);
#ifdef WIN32
virtual FXID GetDC() const { return NULL; }
virtual int ReleaseDC(FXID) const { return 0; }
#endif
public:
/// Width of drawable
FXint getWidth() const { return width; }
/// Height of drawable
FXint getHeight() const { return height; }
/// Get the visual
FXVisual* getVisual() const { return visual; }
/// Change visual
void setVisual(FXVisual* vis);
/// Resize drawable to the specified width and height
virtual void resize(FXint w,FXint h);
/// Save object to stream
virtual void save(FXStream& store) const;
/// Load object from stream
virtual void load(FXStream& store);
/// Cleanup
virtual ~FXDrawable();
};
}
#endif
fox-1.6.49/include/FXIconDict.h 0000664 0001750 0001750 00000010335 12130340076 013056 0000000 0000000 /********************************************************************************
* *
* I c o n D i c t i o n a r y *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXIconDict.h,v 1.6 2006/02/03 00:33:15 fox Exp $ *
********************************************************************************/
#ifndef FXICONDICT_H
#define FXICONDICT_H
#ifndef FXDICT_H
#include "FXDict.h"
#endif
namespace FX {
class FXIconSource;
/**
* The Icon Dictionary manages a collection of icons. The icons are referenced
* by their file name. When first encountering a new file name, the icon is
* located by searching the icon search path for the icon file. If found, the
* services of the icon source object are used to load the icon from the file.
* A custom icon source may be installed to furnish support for additonal
* image file formats.
* Once the icon is loaded, an association between the icon name and the icon
* is entered into the icon dictionary. Subsequent searches for an icon with
* this name will be satisfied from the cached value.
* The lifetype of the icons is managed by the icon dictionary, and thus all
* icons will be deleted when the dictionary is deleted.
*/
class FXAPI FXIconDict : public FXDict {
FXDECLARE(FXIconDict)
private:
FXIconSource *source; // Icon source
FXString path; // Where to search icons
protected:
FXIconDict():source(NULL){}
virtual void *createData(const void*);
virtual void deleteData(void*);
private:
FXIconDict(const FXIconDict&);
FXIconDict &operator=(const FXIconDict&);
public:
/// Default icon search path
static const FXchar defaultIconPath[];
public:
/**
* Construct icon dictionary, and set initial search path; also
* creates a default icon source object.
*/
FXIconDict(FXApp* app,const FXString& p=defaultIconPath);
/// Change icon source
void setIconSource(FXIconSource *src){ source=src; }
/// Return icon source
FXIconSource* getIconSource() const { return source; }
/// Set icon search path
void setIconPath(const FXString& p){ path=p; }
/// Return current icon search path
const FXString& getIconPath() const { return path; }
/// Insert unique icon loaded from filename into dictionary
FXIcon* insert(const FXchar* name){ return (FXIcon*)FXDict::insert(name,name); }
/// Remove icon from dictionary
FXIcon* remove(const FXchar* name){ return (FXIcon*)FXDict::remove(name); }
/// Find icon by name
FXIcon* find(const FXchar* name){ return (FXIcon*)FXDict::find(name); }
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
/// Destroy the icon dict as well as the icon source
virtual ~FXIconDict();
};
}
#endif
fox-1.6.49/include/FXArray.h 0000664 0001750 0001750 00000016077 12130340076 012451 0000000 0000000 /********************************************************************************
* *
* G e n e r i c A r r a y *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXArray.h,v 1.24.2.1 2008/03/25 20:18:43 fox Exp $ *
********************************************************************************/
#ifndef FXARRAY_H
#define FXARRAY_H
#ifndef FXELEMENT_H
#include "FXElement.h"
#endif
namespace FX {
/// Array of some generic type
template
class FXArray {
protected:
TYPE *ptr; // Data array
FXint num; // Number in array
public:
/// Create as empty
FXArray():ptr(NULL),num(0){
}
/// Create with given size n
FXArray(FXint n):ptr(NULL),num(0){
if(allocElms(ptr,n)){ constructElms(ptr,n); num=n; }
}
/// Create initialized from another array
FXArray(const FXArray& src):ptr(NULL),num(0){
if(allocElms(ptr,src.num)){ constructElms(ptr,src.num); copyElms(ptr,src.ptr,src.num); num=src.num; }
}
/// Create initialized with n copies of object
FXArray(const TYPE& src,FXint n):ptr(NULL),num(0){
if(allocElms(ptr,n)){ constructElms(ptr,n); fillElms(ptr,src,n); num=n; }
}
/// Create initialized with array of n objects
FXArray(const TYPE* src,FXint n):ptr(NULL),num(0){
if(allocElms(ptr,n)){ constructElms(ptr,n); copyElms(ptr,src,n); num=n; }
}
/// Return number of elements
FXint no() const { return num; }
/// Change number of elements to n
bool no(FXint n){
if(n!=num){
if(0& operator=(const FXArray& src){
if(ptr!=src.ptr){ no(src.num); copyElms(ptr,src.ptr,src.num); }
return *this;
}
/// Index into array
TYPE& operator[](FXint i){ return ptr[i]; }
const TYPE& operator[](FXint i) const { return ptr[i]; }
/// Index into list
TYPE& at(FXint i){ return ptr[i]; }
const TYPE& at(FXint i) const { return ptr[i]; }
/// Return pointer to list
TYPE* data() const { return ptr; }
/// Adopt array from source
FXArray& adopt(FXArray& src){
no(0);
ptr=src.ptr; src.ptr=NULL;
num=src.num; src.num=0;
return *this;
}
/// Assign object p to list
FXArray& assign(const TYPE& src){
if(no(1)){ ptr[0]=src; }
return *this;
}
/// Assign n copies of object to list
FXArray& assign(const TYPE& src,FXint n){
if(no(n)){ fillElms(ptr,src,n); }
return *this;
}
/// Assign n objects to list
FXArray& assign(const TYPE* src,FXint n){
if(no(n)){ copyElms(ptr,src,n); }
return *this;
}
/// Assign n objects to list
FXArray& assign(const FXArray& src){
if(no(src.num)){ copyElms(ptr,src.ptr,src.num); }
return *this;
}
/// Insert an object
FXArray& insert(FXint pos,const TYPE& src){
if(no(num+1)){ moveElms(ptr+pos+1,ptr+pos,num-pos-1); ptr[pos]=src; }
return *this;
}
/// Insert n copies of object at specified position
FXArray& insert(FXint pos,const TYPE& src,FXint n){
if(no(num+n)){ moveElms(ptr+pos+n,ptr+pos,num-pos-n); fillElms(ptr+pos,src,n); }
return *this;
}
/// Insert n objects at specified position
FXArray& insert(FXint pos,const TYPE* src,FXint n){
if(no(num+n)){ moveElms(ptr+pos+n,ptr+pos,num-pos-n); copyElms(ptr+pos,src,n); }
return *this;
}
/// Insert n objects at specified position
FXArray& insert(FXint pos,const FXArray& src){
if(no(num+src.num)){ moveElms(ptr+pos+src.num,ptr+pos,num-pos-src.num); copyElms(ptr+pos,src.ptr,src.num); }
return *this;
}
/// Prepend object
FXArray& prepend(const TYPE& src){
if(no(num+1)){ moveElms(ptr+1,ptr,num-1); ptr[0]=src; }
return *this;
}
/// Prepend n copies of object
FXArray& prepend(const TYPE& src,FXint n){
if(no(num+n)){ moveElms(ptr+n,ptr,num-n); fillElms(ptr,src,n); }
return *this;
}
/// Prepend n objects
FXArray& prepend(const TYPE* src,FXint n){
if(no(num+n)){ moveElms(ptr+n,ptr,num-n); copyElms(ptr,src,n); }
return *this;
}
/// Prepend n objects
FXArray& prepend(const FXArray& src){
if(no(num+src.num)){ moveElms(ptr+src.num,ptr,num-src.num); copyElms(ptr,src.ptr,src.num); }
return *this;
}
/// Append object
FXArray& append(const TYPE& src){
if(no(num+1)){ ptr[num-1]=src; }
return *this;
}
/// Append n copies of object
FXArray& append(const TYPE& src,FXint n){
if(no(num+n)){ fillElms(ptr+num-n,src,n); }
return *this;
}
/// Append n objects
FXArray& append(const TYPE* src,FXint n){
if(no(num+n)){ copyElms(ptr+num-n,src,n); }
return *this;
}
/// Append n objects
FXArray& append(const FXArray& src){
if(no(num+src.num)){ copyElms(ptr+num-src.num,src.ptr,src.num); }
return *this;
}
/// Remove object at pos
FXArray& erase(FXint pos){
moveElms(ptr+pos,ptr+pos+1,num-pos-1); no(num-1);
return *this;
}
/// Remove n objects starting at pos
FXArray& erase(FXint pos,FXint n){
moveElms(ptr+pos,ptr+pos+n,num-n-pos); no(num-n);
return *this;
}
/// Remove all objects
FXArray& clear(){
destructElms(ptr,num); freeElms(ptr); num=0;
return *this;
}
/// Delete data
~FXArray(){
destructElms(ptr,num); freeElms(ptr);
}
};
}
#endif
fox-1.6.49/include/FXRegion.h 0000664 0001750 0001750 00000007457 12130340076 012620 0000000 0000000 /********************************************************************************
* *
* C l i p p i n g R e g i o n *
* *
*********************************************************************************
* Copyright (C) 2000,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXRegion.h,v 1.20 2006/01/22 17:58:08 fox Exp $ *
********************************************************************************/
#ifndef FXREGION_H
#define FXREGION_H
namespace FX {
/// Region
class FXAPI FXRegion {
friend class FXDC;
friend class FXDCWindow;
friend class FXWindow;
private:
void *region;
public:
/// Construct new empty region
FXRegion();
/// Construct new region copied from region r
FXRegion(const FXRegion& r);
/// Construct new region from rectangle rect
FXRegion(const FXRectangle& rect);
/// Construct rectangle region
FXRegion(FXint x,FXint y,FXint w,FXint h);
/// Construct polygon region
FXRegion(const FXPoint* points,FXuint npoints,bool winding=false);
/// Assign region r to this one
FXRegion &operator=(const FXRegion& r);
/// Return true if region is empty
bool empty() const;
/// Return true if region contains point
bool contains(FXint x,FXint y) const;
/// Return true if region contains rectangle
bool contains(FXint x,FXint y,FXint w,FXint h) const;
/// Return bounding box
FXRectangle bounds() const;
/// Offset region by dx,dy
FXRegion& offset(FXint dx,FXint dy);
/// Return true if region equal to this one
bool operator==(const FXRegion& r) const;
/// Return true if region not equal to this one
bool operator!=(const FXRegion& r) const;
/// Union region r with this one
FXRegion& operator+=(const FXRegion& r);
/// Intersect region r with this one
FXRegion& operator*=(const FXRegion& r);
/// Subtract region r from this one
FXRegion& operator-=(const FXRegion& r);
/// Xor region r with this one
FXRegion& operator^=(const FXRegion& r);
/// Union of this region and region r
FXRegion operator+(const FXRegion& r) const;
/// Intersection of this region and region r
FXRegion operator*(const FXRegion& r) const;
/// Subtract region r from this region
FXRegion operator-(const FXRegion& r) const;
/// Xor of this region and region r
FXRegion operator^(const FXRegion& r) const;
/// Reset region to empty
void reset();
/// Destroy region
~FXRegion();
};
}
#endif
fox-1.6.49/include/FXRegistry.h 0000664 0001750 0001750 00000011142 12130340076 013167 0000000 0000000 /********************************************************************************
* *
* R e g i s t r y C l a s s *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXRegistry.h,v 1.31 2006/01/22 17:58:08 fox Exp $ *
********************************************************************************/
#ifndef FXREGISTRY_H
#define FXREGISTRY_H
#ifndef FXSETTINGS_H
#include "FXSettings.h"
#endif
namespace FX {
/**
* The registry maintains a database of persistent settings for an application.
* The settings database is organized in two groups of three layers each. The
* system-wide settings group contains settings information pertaining to all
* users on a system. The per-user settings group contains settings affecting
* that user only.
* Each settings group contains a desktop layer, which comprises the settings
* which affect all FOX programs, a vendor layer which holds settings that
* affect all applications from that vendor (e.g. a application-suite), and
* an application layer which holds settings only for a single application.
* The vendor-key and application-key determine which files these layers come
* from, while the "Desktop" key is used for all FOX applications.
* Settings in the system-wide group are overwritten by the per-user group,
* and settings from the "Desktop" layer are overwritten by the vendor-layer;
* vendor-layer settings are overwritten by the application-layer settings.
* Only the per-user, per-application settings ever gets written; the layers
* in the system-group only get written during installation and configuration
* of the application.
* The registry is read when FXApp::init() is called, and written back to the
* system when FXApp::exit() is called.
*/
class FXAPI FXRegistry : public FXSettings {
FXDECLARE(FXRegistry)
protected:
FXString applicationkey; // Application key
FXString vendorkey; // Vendor key
bool ascii; // ASCII file-based registry
protected:
bool readFromDir(const FXString& dirname,bool mark);
#ifdef WIN32
bool readFromRegistry(void* hRootKey,bool mark);
bool writeToRegistry(void* hRootKey);
bool readFromRegistryGroup(void* org,const char* groupname,bool mark=false);
bool writeToRegistryGroup(void* org,const char* groupname);
#endif
private:
FXRegistry(const FXRegistry&);
FXRegistry &operator=(const FXRegistry&);
public:
/**
* Construct registry object; akey and vkey must be string constants.
* Regular applications SHOULD set a vendor key!
*/
FXRegistry(const FXString& akey=FXString::null,const FXString& vkey=FXString::null);
/// Read registry
bool read();
/// Write registry
bool write();
/// Return application key
const FXString& getAppKey() const { return applicationkey; }
/// Return vendor key
const FXString& getVendorKey() const { return vendorkey; }
/**
* Set ASCII mode; under MS-Windows, this will switch the system to a
* file-based registry system, instead of using the System Registry API.
*/
void setAsciiMode(bool asciiMode){ ascii=asciiMode; }
/// Get ASCII mode
bool getAsciiMode() const { return ascii; }
};
}
#endif
fox-1.6.49/include/FXRootWindow.h 0000664 0001750 0001750 00000006261 12130340076 013500 0000000 0000000 /********************************************************************************
* *
* R o o t W i n d o w W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXRootWindow.h,v 1.23 2006/01/22 17:58:09 fox Exp $ *
********************************************************************************/
#ifndef FXROOTWINDOW_H
#define FXROOTWINDOW_H
#ifndef FXCOMPOSITE_H
#include "FXComposite.h"
#endif
namespace FX {
/// Root window
class FXAPI FXRootWindow : public FXComposite {
FXDECLARE(FXRootWindow)
protected:
FXRootWindow(){}
#ifdef WIN32
virtual FXID GetDC() const;
virtual int ReleaseDC(FXID) const;
#endif
private:
FXRootWindow(const FXRootWindow&);
FXRootWindow &operator=(const FXRootWindow&);
public:
/// Construct root window
FXRootWindow(FXApp* a,FXVisual *vis);
/// Root window need not be created
virtual void create();
/// Root window may not be detached
virtual void detach();
/// Root window can not be destroyed
virtual void destroy();
/// Perform layout
virtual void layout();
/// Return width of the root window
virtual FXint getDefaultWidth();
/// Return height of the root window
virtual FXint getDefaultHeight();
/// No op
virtual void recalc();
/// Root window can not be moved
virtual void move(FXint x,FXint y);
/// Root window can not be resized
virtual void resize(FXint w,FXint h);
/// Root window can not be positioned
virtual void position(FXint x,FXint y,FXint w,FXint h);
/// Root window can not get focus
virtual void setFocus();
/// Root window can not loose
virtual void killFocus();
/// Destructor
virtual ~FXRootWindow();
};
}
#endif
fox-1.6.49/include/FX885911Codec.h 0000644 0001750 0001750 00000001113 11637250333 013076 0000000 0000000 #ifndef FX885911CODEC_H
#define FX885911CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// ISO-8859-11 Codec
class FXAPI FX885911Codec : public FXTextCodec {
FXDECLARE(FX885911Codec)
public:
FX885911Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FX885911Codec(){}
};
}
#endif
fox-1.6.49/include/FXCP856Codec.h 0000644 0001750 0001750 00000001077 11637250333 013075 0000000 0000000 #ifndef FXCP856CODEC_H
#define FXCP856CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// CP856 Codec
class FXAPI FXCP856Codec : public FXTextCodec {
FXDECLARE(FXCP856Codec)
public:
FXCP856Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FXCP856Codec(){}
};
}
#endif
fox-1.6.49/include/FXUTF16Codec.h 0000664 0001750 0001750 00000007147 12130340076 013134 0000000 0000000 /********************************************************************************
* *
* U T F - 1 6 T e x t C o d e c *
* *
*********************************************************************************
* Copyright (C) 2002,2006 by L.Johnson & J.van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXUTF16Codec.h,v 1.10 2006/01/22 17:58:12 fox Exp $ *
********************************************************************************/
#ifndef FXUTF16CODEC_H
#define FXUTF16CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// Codec for UTF-16BE
class FXAPI FXUTF16BECodec : public FXTextCodec {
FXDECLARE(FXUTF16BECodec)
public:
FXUTF16BECodec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual FXint mibEnum() const;
virtual const FXchar* const* aliases() const;
virtual ~FXUTF16BECodec(){}
};
/// Codec for UTF-16LE
class FXAPI FXUTF16LECodec : public FXTextCodec {
FXDECLARE(FXUTF16LECodec)
public:
FXUTF16LECodec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual FXint mibEnum() const;
virtual const FXchar* const* aliases() const;
virtual ~FXUTF16LECodec(){}
};
/// Codec for UTF-16
class FXAPI FXUTF16Codec : public FXTextCodec {
FXDECLARE(FXUTF16Codec)
public:
FXUTF16Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint mb2utflen(const FXchar* src,FXint nsrc) const;
virtual FXint mb2utf(FXchar* dst,FXint ndst,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint utf2mblen(const FXchar* src,FXint nsrc) const;
virtual FXint utf2mb(FXchar* dst,FXint ndst,const FXchar* src,FXint nsrc) const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual FXint mibEnum() const;
virtual const FXchar* const* aliases() const;
virtual ~FXUTF16Codec(){}
};
}
#endif
fox-1.6.49/include/FXObject.h 0000664 0001750 0001750 00000016622 12130340076 012575 0000000 0000000 /********************************************************************************
* *
* T o p l e v el O b j e c t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXObject.h,v 1.35.2.1 2006/08/05 00:58:29 fox Exp $ *
********************************************************************************/
#ifndef FXOBJECT_H
#define FXOBJECT_H
namespace FX {
/// Minimum and maximum message id
enum {
MINKEY = 0,
MAXKEY = 65535
};
/// Minimum and maximum message type
enum {
MINTYPE = 0,
MAXTYPE = 65535
};
/// Association key
typedef FXuint FXSelector;
class FXObject;
/// Describes a FOX object
class FXAPI FXMetaClass {
private:
const FXchar *className;
FXObject* (*manufacture)();
const FXMetaClass *baseClass;
const void *assoc;
FXuint nassocs;
FXuint assocsz;
private:
static const FXMetaClass **metaClassTable;
static FXuint nmetaClassTable;
static FXuint nmetaClasses;
private:
static void resize(FXuint n);
public:
FXMetaClass(const FXchar* name,FXObject *(fac)(),const FXMetaClass* base,const void* ass,FXuint nass,FXuint assz);
/// Check if metaclass is subclass of some other metaclass
bool isSubClassOf(const FXMetaClass* metaclass) const;
/// Make instance of some object
FXObject* makeInstance() const;
/// Ask class name
const FXchar* getClassName() const { return className; }
/// Ask base class
const FXMetaClass* getBaseClass() const { return baseClass; }
/// Find metaclass object
static const FXMetaClass* getMetaClassFromName(const FXchar* name);
/// Search message map
const void* search(FXSelector key) const;
~FXMetaClass();
};
/// Macro to set up class declaration
#define FXDECLARE(classname) \
public: \
struct FXMapEntry { FX::FXSelector keylo; FX::FXSelector keyhi; long (classname::* func)(FX::FXObject*,FX::FXSelector,void*); }; \
static const FX::FXMetaClass metaClass; \
static FX::FXObject* manufacture(); \
virtual long handle(FX::FXObject* sender,FX::FXSelector sel,void* ptr); \
virtual const FX::FXMetaClass* getMetaClass() const { return &metaClass; } \
friend FX::FXStream& operator<<(FX::FXStream& store,const classname* obj){return store.saveObject((FX::FXObjectPtr)(obj));} \
friend FX::FXStream& operator>>(FX::FXStream& store,classname*& obj){return store.loadObject((FX::FXObjectPtr&)(obj));} \
private:
/// Macro to set up class implementation
#define FXIMPLEMENT(classname,baseclassname,mapping,nmappings) \
FX::FXObject* classname::manufacture(){return new classname;} \
const FX::FXMetaClass classname::metaClass(#classname,classname::manufacture,&baseclassname::metaClass,mapping,nmappings,sizeof(classname::FXMapEntry)); \
long classname::handle(FX::FXObject* sender,FX::FXSelector sel,void* ptr){ \
const FXMapEntry* me=(const FXMapEntry*)metaClass.search(sel); \
return me ? (this->* me->func)(sender,sel,ptr) : baseclassname::handle(sender,sel,ptr); \
}
/// Macro to set up abstract class declaration
#define FXDECLARE_ABSTRACT(classname) \
public: \
struct FXMapEntry { FX::FXSelector keylo; FX::FXSelector keyhi; long (classname::* func)(FX::FXObject*,FX::FXSelector,void*); }; \
static const FX::FXMetaClass metaClass; \
virtual long handle(FX::FXObject* sender,FX::FXSelector sel,void* ptr); \
virtual const FX::FXMetaClass* getMetaClass() const { return &metaClass; } \
friend FX::FXStream& operator<<(FX::FXStream& store,const classname* obj){return store.saveObject((FX::FXObjectPtr)(obj));} \
friend FX::FXStream& operator>>(FX::FXStream& store,classname*& obj){return store.loadObject((FX::FXObjectPtr&)(obj));} \
private:
/// Macro to set up abstract class implementation
#define FXIMPLEMENT_ABSTRACT(classname,baseclassname,mapping,nmappings) \
const FX::FXMetaClass classname::metaClass(#classname,NULL,&baseclassname::metaClass,mapping,nmappings,sizeof(classname::FXMapEntry)); \
long classname::handle(FX::FXObject* sender,FX::FXSelector sel,void* ptr){ \
const FXMapEntry* me=(const FXMapEntry*)metaClass.search(sel); \
return me ? (this->* me->func)(sender,sel,ptr) : baseclassname::handle(sender,sel,ptr); \
}
/// MetaClass of a class
#define FXMETACLASS(classname) (&classname::metaClass)
/// Set up map type
#define FXDEFMAP(classname) static const classname::FXMapEntry
/// Define range of function types
#define FXMAPTYPES(typelo,typehi,func) {FXSEL(typelo,FX::MINKEY),FXSEL(typehi,FX::MAXKEY),&func}
/// Define range of function types
#define FXMAPTYPE(type,func) {FXSEL(type,FX::MINKEY),FXSEL(type,FX::MAXKEY),&func}
/// Define range of functions
#define FXMAPFUNCS(type,keylo,keyhi,func) {FXSEL(type,keylo),FXSEL(type,keyhi),&func}
/// Define one function
#define FXMAPFUNC(type,key,func) {FXSEL(type,key),FXSEL(type,key),&func}
/**
* Object is the base class for all objects in FOX; in order to receive
* messages from the user interface, your class must derive from Object.
* The Object class also provides serialization facilities, with which
* you can save and restore the object's state. If you've subclassed
* from Object, you can save your subclasses' state by overloading the
* save() and load() functions and use the stream API to serialize its
* member data.
*/
class FXAPI FXObject {
FXDECLARE(FXObject)
public:
/// Called for unhandled messages
virtual long onDefault(FXObject*,FXSelector,void*);
public:
/// Get class name of some object
const FXchar* getClassName() const;
/// Check if object is member of metaclass
bool isMemberOf(const FXMetaClass* metaclass) const;
/// Try handle message safely
virtual long tryHandle(FXObject* sender,FXSelector sel,void* ptr);
/// Save object to stream
virtual void save(FXStream& store) const;
/// Load object from stream
virtual void load(FXStream& store);
/// Virtual destructor
virtual ~FXObject();
};
}
#endif
fox-1.6.49/include/FXFrame.h 0000664 0001750 0001750 00000014312 12130340076 012413 0000000 0000000 /********************************************************************************
* *
* F r a m e W i n d o w W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXFrame.h,v 1.24 2006/01/22 17:58:02 fox Exp $ *
********************************************************************************/
#ifndef FXFRAME_H
#define FXFRAME_H
#ifndef FXWINDOW_H
#include "FXWindow.h"
#endif
namespace FX {
/// Justification modes used by certain subclasses
enum {
JUSTIFY_NORMAL = 0, /// Default justification is centered text
JUSTIFY_CENTER_X = 0, /// Contents centered horizontally
JUSTIFY_LEFT = 0x00008000, /// Contents left-justified
JUSTIFY_RIGHT = 0x00010000, /// Contents right-justified
JUSTIFY_HZ_APART = JUSTIFY_LEFT|JUSTIFY_RIGHT, /// Combination of JUSTIFY_LEFT & JUSTIFY_RIGHT
JUSTIFY_CENTER_Y = 0, /// Contents centered vertically
JUSTIFY_TOP = 0x00020000, /// Contents aligned with label top
JUSTIFY_BOTTOM = 0x00040000, /// Contents aligned with label bottom
JUSTIFY_VT_APART = JUSTIFY_TOP|JUSTIFY_BOTTOM /// Combination of JUSTIFY_TOP & JUSTIFY_BOTTOM
};
/// Default padding
enum { DEFAULT_PAD = 2 };
/**
* The Frame widget provides borders around some contents. Borders may be raised, sunken,
* thick, ridged or etched. They can also be turned off completely.
* In addition, a certain amount of padding may be specified between the contents of
* the widget and the borders. The contents may be justified inside the widget using the
* justification options.
* The Frame widget is sometimes used by itself as a place holder, but most often is used
* as a convenient base class for simple controls.
*/
class FXAPI FXFrame : public FXWindow {
FXDECLARE(FXFrame)
protected:
FXColor baseColor; // Base color
FXColor hiliteColor; // Highlight color
FXColor shadowColor; // Shadow color
FXColor borderColor; // Border color
FXint padtop; // Top padding
FXint padbottom; // Bottom padding
FXint padleft; // Left padding
FXint padright; // right padding
FXint border; // Border size
protected:
FXFrame();
void drawBorderRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawRidgeRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawGrooveRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawDoubleRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawDoubleSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawFrame(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
private:
FXFrame(const FXFrame&);
FXFrame &operator=(const FXFrame&);
public:
long onPaint(FXObject*,FXSelector,void*);
public:
/// Construct frame window
FXFrame(FXComposite* p,FXuint opts=FRAME_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Change frame style
void setFrameStyle(FXuint style);
/// Get current frame style
FXuint getFrameStyle() const;
/// Get border width
FXint getBorderWidth() const { return border; }
/// Change top padding
void setPadTop(FXint pt);
/// Get top interior padding
FXint getPadTop() const { return padtop; }
/// Change bottom padding
void setPadBottom(FXint pb);
/// Get bottom interior padding
FXint getPadBottom() const { return padbottom; }
/// Change left padding
void setPadLeft(FXint pl);
/// Get left interior padding
FXint getPadLeft() const { return padleft; }
/// Change right padding
void setPadRight(FXint pr);
/// Get right interior padding
FXint getPadRight() const { return padright; }
/// Change highlight color
void setHiliteColor(FXColor clr);
/// Get highlight color
FXColor getHiliteColor() const { return hiliteColor; }
/// Change shadow color
void setShadowColor(FXColor clr);
/// Get shadow color
FXColor getShadowColor() const { return shadowColor; }
/// Change border color
void setBorderColor(FXColor clr);
/// Get border color
FXColor getBorderColor() const { return borderColor; }
/// Change base gui color
void setBaseColor(FXColor clr);
/// Get base gui color
FXColor getBaseColor() const { return baseColor; }
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
};
}
#endif
fox-1.6.49/include/FXMenuBar.h 0000664 0001750 0001750 00000006562 12130340076 012722 0000000 0000000 /********************************************************************************
* *
* M e n u B a r W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXMenuBar.h,v 1.15 2006/01/22 17:58:06 fox Exp $ *
********************************************************************************/
#ifndef FXMENUBAR_H
#define FXMENUBAR_H
#ifndef FXTOOLBAR_H
#include "FXToolBar.h"
#endif
namespace FX {
/// Menu bar
class FXAPI FXMenuBar : public FXToolBar {
FXDECLARE(FXMenuBar)
protected:
FXMenuBar(){}
private:
FXMenuBar(const FXMenuBar&);
FXMenuBar &operator=(const FXMenuBar&);
public:
long onFocusLeft(FXObject*,FXSelector,void*);
long onFocusRight(FXObject*,FXSelector,void*);
long onEnter(FXObject*,FXSelector,void*);
long onLeave(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onButtonPress(FXObject*,FXSelector,void*);
long onButtonRelease(FXObject*,FXSelector,void*);
long onCmdUnpost(FXObject*,FXSelector,void*);
public:
/**
* Construct a floatable menubar
* Normally, the menubar is docked under window p.
* When floated, the menubar can be docked under window q, which is
* typically an FXToolbarShell window.
*/
FXMenuBar(FXComposite* p,FXComposite* q,FXuint opts=LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=3,FXint pr=3,FXint pt=2,FXint pb=2,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING);
/**
* Construct a non-floatable menubar.
* The menubar can not be undocked.
*/
FXMenuBar(FXComposite* p,FXuint opts,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=3,FXint pr=3,FXint pt=2,FXint pb=2,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING);
/// Returns true if specified coordinate (in parent's coordinate system) is in menubar
virtual bool contains(FXint parentx,FXint parenty) const;
};
}
#endif
fox-1.6.49/include/FXCP857Codec.h 0000644 0001750 0001750 00000001077 11637250333 013076 0000000 0000000 #ifndef FXCP857CODEC_H
#define FXCP857CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// CP857 Codec
class FXAPI FXCP857Codec : public FXTextCodec {
FXDECLARE(FXCP857Codec)
public:
FXCP857Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FXCP857Codec(){}
};
}
#endif
fox-1.6.49/include/FX88594Codec.h 0000644 0001750 0001750 00000001104 11637250333 013020 0000000 0000000 #ifndef FX88594CODEC_H
#define FX88594CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// ISO-8859-4 Codec
class FXAPI FX88594Codec : public FXTextCodec {
FXDECLARE(FX88594Codec)
public:
FX88594Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FX88594Codec(){}
};
}
#endif
fox-1.6.49/include/FXVisual.h 0000664 0001750 0001750 00000015022 12130340076 012623 0000000 0000000 /********************************************************************************
* *
* V i s u a l C l a s s *
* *
*********************************************************************************
* Copyright (C) 1999,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXVisual.h,v 1.41 2006/01/22 17:58:12 fox Exp $ *
********************************************************************************/
#ifndef FXVISUAL_H
#define FXVISUAL_H
#ifndef FXID_H
#include "FXId.h"
#endif
namespace FX {
/// Construction options for FXVisual class
enum FXVisualOptions {
VISUAL_DEFAULT = 0, /// Default visual
VISUAL_MONOCHROME = 1, /// Must be monochrome visual
VISUAL_BEST = 2, /// Best (deepest) visual
VISUAL_INDEXCOLOR = 4, /// Palette visual
VISUAL_GRAYSCALE = 8, /// Gray scale visual
VISUAL_TRUECOLOR = 16, /// Must be true color visual
VISUAL_OWNCOLORMAP = 32, /// Allocate private colormap
VISUAL_DOUBLEBUFFER = 64, /// Double-buffered [FXGLVisual]
VISUAL_STEREO = 128, /// Stereo [FXGLVisual]
VISUAL_NOACCEL = 256, /// No hardware acceleration [for broken h/w]
VISUAL_SWAP_COPY = 512 /// Buffer swap by copying [FXGLVisual]
};
/// Visual type
enum FXVisualType {
VISUALTYPE_UNKNOWN, /// Undetermined visual type
VISUALTYPE_MONO, /// Visual for drawing into 1-bpp surfaces
VISUALTYPE_TRUE, /// True color
VISUALTYPE_INDEX, /// Index [palette] color
VISUALTYPE_GRAY /// Gray scale
};
class FXApp;
class FXWindow;
class FXGLContext;
class FXGLCanvas;
class FXImage;
class FXIcon;
class FXBitmap;
class FXDCWindow;
/// Visual describes pixel format of a drawable
class FXAPI FXVisual : public FXId {
FXDECLARE(FXVisual)
friend class FXApp;
friend class FXWindow;
friend class FXImage;
friend class FXIcon;
friend class FXBitmap;
friend class FXDCWindow;
friend class FXGLCanvas;
friend class FXGLContext;
protected:
FXuint flags; // Visual flags
FXuint hint; // Depth Hint
FXuint depth; // Visual depth, significant bits/pixel
FXuint numred; // Number of reds
FXuint numgreen; // Number of greens
FXuint numblue; // Number of blues
FXuint numcolors; // Total number of colors
FXuint maxcolors; // Maximum number of colors
FXVisualType type; // Visual type
void *info; // Opaque data
void *visual; // Application visual/pixel format
FXID colormap; // Color map, if any
FXbool freemap; // We allocated the map
#ifndef WIN32
protected:
void *gc; // Drawing GC
void *scrollgc; // Scrolling GC
FXPixel rpix[16][256]; // Mapping from red -> pixel
FXPixel gpix[16][256]; // Mapping from green -> pixel
FXPixel bpix[16][256]; // Mapping from blue -> pixel
FXPixel lut[256]; // Color lookup table
protected:
void* setupgc(FXbool);
void setuptruecolor();
void setupdirectcolor();
void setuppseudocolor();
void setupstaticcolor();
void setupgrayscale();
void setupstaticgray();
void setuppixmapmono();
void setupcolormap();
#endif
protected:
FXVisual();
private:
FXVisual(const FXVisual&);
FXVisual &operator=(const FXVisual&);
public:
/// Construct default visual
FXVisual(FXApp* a,FXuint flgs,FXuint d=32);
/// Get visual type
FXVisualType getType() const { return type; }
/// Get visual info
void* getInfo() const { return info; }
/// Get visual or pixel format
void* getVisual() const { return visual; }
/// Create visual
virtual void create();
/// Detach visual
virtual void detach();
/// Destroy visual
virtual void destroy();
/// Get flags (see FXVisualOptions)
FXuint getFlags() const { return flags; }
/// Get depth, i.e. number of significant bits in color representation
FXuint getDepth() const { return depth; }
/// Get number of colors
FXuint getNumColors() const { return numcolors; }
/// Get number of reds
FXuint getNumRed() const { return numred; }
/// Get number of greens
FXuint getNumGreen() const { return numgreen; }
/// Get number of blues
FXuint getNumBlue() const { return numblue; }
/// Get device pixel value for color
FXPixel getPixel(FXColor clr);
/// Get color value for device pixel value
FXColor getColor(FXPixel pix);
/// Set maximum number of colors to allocate
void setMaxColors(FXuint maxcols);
/// Get maximum number of colors
FXuint getMaxColors() const { return maxcolors; }
/// Save visual information to a stream
virtual void save(FXStream& store) const;
/// Load visual information from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXVisual();
};
}
#endif
fox-1.6.49/include/FXStatusLine.h 0000664 0001750 0001750 00000011336 12130340076 013457 0000000 0000000 /********************************************************************************
* *
* S t a t u s L i n e W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1999,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXStatusLine.h,v 1.8 2006/01/22 17:58:10 fox Exp $ *
********************************************************************************/
#ifndef FXSTATUSLINE_H
#define FXSTATUSLINE_H
#ifndef FXFRAME_H
#include "FXFrame.h"
#endif
namespace FX {
/**
* The status line normally shows its permanent message; when
* moving the mouse over a Widget which has status-line help, the status line
* temporarily replaces its normal message with the help information; the status
* line obtains the help message by sending the Widget a ID_QUERY_HELP message
* with type SEL_UPDATE.
* If this query does not result in a new status string, the target of
* the status line is tried via an ordinary SEL_UPDATE message.
* If none of the above work then the status line will display the normal text,
* i.e. the string set via setNormalText().
* If the message contains a newline (\n), then the part before the newline
* will be displayed in the highlight color, while the part after the newline
* is shown using the normal text color.
*/
class FXAPI FXStatusLine : public FXFrame {
FXDECLARE(FXStatusLine)
protected:
FXString status; // Current status message
FXString normal; // Normally displayed message
FXFont *font; // Font
FXColor textColor; // Status text color
FXColor textHighlightColor; // Status text highlight color
protected:
FXStatusLine();
private:
FXStatusLine(const FXStatusLine&);
FXStatusLine& operator=(const FXStatusLine&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onUpdate(FXObject*,FXSelector,void*);
long onCmdGetStringValue(FXObject*,FXSelector,void*);
long onCmdSetStringValue(FXObject*,FXSelector,void*);
public:
/// Constructor
FXStatusLine(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Change the temporary status message
void setText(const FXString& text);
/// Return the temporary status message
FXString getText() const { return status; }
/// Change the permanent status message
void setNormalText(const FXString& text);
/// Return the permanent status message
FXString getNormalText() const { return normal; }
/// Change the font
void setFont(FXFont* fnt);
/// Return the current font
FXFont* getFont() const { return font; }
/// Return the text color
FXColor getTextColor() const { return textColor; }
/// Change the text color
void setTextColor(FXColor clr);
/// Return the highlight text color
FXColor getTextHighlightColor() const { return textHighlightColor; }
/// Change the highlight text color
void setTextHighlightColor(FXColor clr);
/// Save status line to stream
virtual void save(FXStream& store) const;
/// Load status line from stream
virtual void load(FXStream& store);
/// Destroy
virtual ~FXStatusLine();
};
}
#endif
fox-1.6.49/include/FXRex.h 0000664 0001750 0001750 00000017510 12130340076 012122 0000000 0000000 /********************************************************************************
* *
* R e g u l a r E x p r e s s i o n C l a s s *
* *
*********************************************************************************
* Copyright (C) 1999,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXRex.h,v 1.53 2006/01/22 17:58:09 fox Exp $ *
********************************************************************************/
#ifndef FXREX_H
#define FXREX_H
namespace FX {
/// Regular expression error codes
enum FXRexError {
REGERR_OK,
REGERR_EMPTY, /// Empty pattern
REGERR_PAREN, /// Unmatched parenthesis
REGERR_BRACK, /// Unmatched bracket
REGERR_BRACE, /// Unmatched brace
REGERR_RANGE, /// Bad character range
REGERR_ESC, /// Bad escape sequence
REGERR_COUNT, /// Bad counted repeat
REGERR_NOATOM, /// No atom preceding repetition
REGERR_REPEAT, /// Repeat following repeat
REGERR_BACKREF, /// Bad backward reference
REGERR_CLASS, /// Bad character class
REGERR_COMPLEX, /// Expression too complex
REGERR_MEMORY, /// Out of memory
REGERR_TOKEN /// Illegal token
};
/// Regular expression parse flags
enum {
REX_NORMAL = 0, /// Normal mode
REX_CAPTURE = 1, /// Perform capturing parentheses
REX_ICASE = 2, /// Case independent matching
REX_NEWLINE = 4, /// Match-any operators match newline too
REX_VERBATIM = 8, /// Disable interpretation of magic characters
REX_SYNTAX = 16 /// Perform syntax check only
};
/// Regular expression match flags
enum {
REX_FORWARD = 0, /// Match scanning forward from offset
REX_BACKWARD = 32, /// Match scanning backward from offset
REX_NOT_BOL = 64, /// Start of string is NOT begin of line
REX_NOT_EOL = 128, /// End of string is NOT end of line
REX_NOT_EMPTY = 256 /// Do not match empty
};
/**
* FXRex is a regular expression class implementing a NFA matcher.
* It supports capturing parentheses, non-capturing parentheses,
* positive or negative lookahead, backreferences, case-insensitive
* matching, counted repetitions, lazy or greedy matches, and
* PERL-like matching operators.
* The subject string may be scanned forwards or backwards, and may
* contain any of 256 possible character values.
*
* When parsing a regular expression pattern, the mode parameter is
* the bitwise OR of a set of flags and affects the match algorithm.
* Passing the flag REX_CAPTURE enables capturing parentheses
* and back references. The flag REX_ICASE enables case-insensitive
* matching. When the flag REX_NEWLINE is passed, newlines are treated
* like normal characters; otherwise, newline is NOT matched
* except when explicitly part of a character class. The flag
* REX_VERBATIM disables all special character interpretation.
*
* When matching a compiled pattern, the mode parameter is the
* bitwise OR of a set of flags that affects how the match is
* performed. Passing the flag REX_BACKWARD causes the match
* to proceed backwards through the subject string. Passing the
* flags REX_NOT_BOL and/or REX_NOT_EOL causes the begin and
* end of the subject string NOT to be considered a line start
* or line end. The flag REX_NOT_EMPTY causes a match to fail if
* the empty string was matched.
*/
class FXAPI FXRex {
private:
FXint *code;
private:
static const FXchar *const errors[];
static const FXint fallback[];
public:
/// Construct empty regular expression object
FXRex():code((FXint*)fallback){}
/// Copy regular expression object
FXRex(const FXRex& orig);
/// Compile expression from pattern; if error is not NULL, error code is returned
FXRex(const FXchar* pattern,FXint mode=REX_NORMAL,FXRexError* error=NULL);
/// Compile expression from pattern; if error is not NULL, error code is returned
FXRex(const FXString& pattern,FXint mode=REX_NORMAL,FXRexError* error=NULL);
/// Assign another regular expression to this one
FXRex& operator=(const FXRex& orig);
/**
* See if regular expression is empty; the regular expression
* will be empty when it is unable to parse a pattern due to
* a syntax error.
*/
bool empty() const { return (code==fallback); }
/// Parse pattern, return error code if syntax error is found
FXRexError parse(const FXchar* pattern,FXint mode=REX_NORMAL);
/// Parse pattern, return error code if syntax error is found
FXRexError parse(const FXString& pattern,FXint mode=REX_NORMAL);
/**
* Match a subject string of length len, returning TRUE if a match is found
* and FALSE otherwise. The entire pattern is captured in beg[0] and end[0],
* where beg[0] refers to the position of the first matched character and end[0]
* refers to the position after the last matched character.
* Sub expressions from capturing parenthesis i are returned in beg[i] and end[i].
*/
bool match(const FXchar* string,FXint len,FXint* beg=NULL,FXint* end=NULL,FXint mode=REX_FORWARD,FXint npar=1,FXint fm=0,FXint to=2147483647) const;
/// Search for match in a string
bool match(const FXString& string,FXint* beg=NULL,FXint* end=NULL,FXint mode=REX_FORWARD,FXint npar=1,FXint fm=0,FXint to=2147483647) const;
/**
* After performing a regular expression match with capturing parentheses,
* a substitution string is build from the replace string, where where "&"
* is replaced by the entire matched pattern, and "\1" through "\9" are
* replaced by captured expressions. The original source string and its
* length, and the match arrays beg and end must be passed.
*/
static FXString substitute(const FXchar* string,FXint len,FXint* beg,FXint* end,const FXString& replace,FXint npar=1);
/// Return substitution string
static FXString substitute(const FXString& string,FXint* beg,FXint* end,const FXString& replace,FXint npar=1);
/// Returns error code for given error
static const FXchar* getError(FXRexError err){ return errors[err]; }
/// Comparison operators
bool operator==(const FXRex& rex) const;
bool operator!=(const FXRex& rex) const;
/// Saving and loading
friend FXAPI FXStream& operator<<(FXStream& store,const FXRex& s);
friend FXAPI FXStream& operator>>(FXStream& store,FXRex& s);
/// Delete
~FXRex();
};
extern FXAPI FXStream& operator<<(FXStream& store,const FXRex& s);
extern FXAPI FXStream& operator>>(FXStream& store,FXRex& s);
}
#endif
fox-1.6.49/include/FXKOI8RCodec.h 0000644 0001750 0001750 00000001103 11637250333 013152 0000000 0000000 #ifndef FXKOI8RCODEC_H
#define FXKOI8RCODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// KOI8-R Codec
class FXAPI FXKOI8RCodec : public FXTextCodec {
FXDECLARE(FXKOI8RCodec)
public:
FXKOI8RCodec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FXKOI8RCodec(){}
};
}
#endif
fox-1.6.49/include/FXTranslator.h 0000664 0001750 0001750 00000006205 12130340076 013514 0000000 0000000 /********************************************************************************
* *
* M e s s a g e T r a n s l a t o r *
* *
*********************************************************************************
* Copyright (C) 2005,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXTranslator.h,v 1.6 2006/01/22 17:58:11 fox Exp $ *
********************************************************************************/
#ifndef FXTRANSLATOR_H
#define FXTRANSLATOR_H
#ifndef FXOBJECT_H
#include "FXObject.h"
#endif
//////////////////////////// UNDER DEVELOPMENT ////////////////////////////////
namespace FX {
class FXApp;
class FXTextCodec;
/**
* The translator class translates a message to another language.
*/
class FXAPI FXTranslator : public FXObject {
FXDECLARE(FXTranslator)
private:
FXApp *app; // Back link to application object
FXTextCodec *codec; // Text codec used for source text
private:
FXTranslator(const FXTranslator&);
FXTranslator &operator=(const FXTranslator&);
protected:
FXTranslator():app((FXApp*)-1L){}
public:
/// Construct translator
FXTranslator(FXApp* a);
/// Get application
FXApp* getApp() const { return app; }
/// Translate a string
virtual const FXchar* tr(const FXchar* context,const FXchar* message,const FXchar* hint=NULL) const;
/// Change text codec used to decode the messages embedded in the source
void setTextCodec(FXTextCodec *cdc){ codec=cdc; }
/// Return text codec
FXTextCodec *getTextCodec() const { return codec; }
/// Save translator to a stream
virtual void save(FXStream& store) const;
/// Load translator from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXTranslator();
};
}
#endif
fox-1.6.49/include/FXUndoList.h 0000664 0001750 0001750 00000023714 12130340076 013130 0000000 0000000 /********************************************************************************
* *
* U n d o / R e d o - a b l e C o m m a n d *
* *
*********************************************************************************
* Copyright (C) 2000,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXUndoList.h,v 1.38 2006/01/22 17:58:12 fox Exp $ *
********************************************************************************/
#ifndef FXUNDOLIST_H
#define FXUNDOLIST_H
#ifndef FXOBJECT_H
#include "FXObject.h"
#endif
namespace FX {
class FXUndoList;
class FXCommandGroup;
/**
* Base class for undoable commands. Each undo records all the
* information necessary to undo as well as redo a given operation.
* Since commands are derived from FXObject, subclassed commands can
* both send and receive messages (like ID_GETINTVALUE, for example).
*/
class FXAPI FXCommand : public FXObject {
FXDECLARE_ABSTRACT(FXCommand)
friend class FXUndoList;
friend class FXCommandGroup;
private:
FXCommand *next;
private:
FXCommand(const FXCommand&);
FXCommand &operator=(const FXCommand&);
protected:
FXCommand():next(NULL){}
public:
/**
* Undo this command; this should save the
* information for a subsequent redo.
*/
virtual void undo() = 0;
/**
* Redo this command; this should save the
* information for a subsequent undo.
*/
virtual void redo() = 0;
/**
* Return the size of the information in the undo record.
* The undo list may be trimmed to limit memory usage to
* a certain limit. The value returned should include
* the size of the command record itself as well as any
* data linked from it.
*/
virtual FXuint size() const;
/**
* Name of the undo command to be shown on a button;
* for example, "Undo Delete".
*/
virtual FXString undoName() const;
/**
* Name of the redo command to be shown on a button;
* for example, "Redo Delete".
*/
virtual FXString redoName() const;
/**
* Return TRUE if this command can be merged with previous undo
* commands. This is useful to combine e.g. multiple consecutive
* single-character text changes into a single block change.
* The default implementation returns FALSE.
*/
virtual bool canMerge() const;
/**
* Called by the undo system to try and merge the new incoming command
* with this command; should return TRUE if merging was possible.
* The default implementation returns FALSE.
*/
virtual bool mergeWith(FXCommand* command);
/// Delete undo command
virtual ~FXCommand(){}
};
/**
* Group of undoable commands. A group may comprise multiple
* individual actions which together undo (or redo) a larger
* operation. Even larger operations may be built by nesting
* multiple undo groups.
*/
class FXAPI FXCommandGroup : public FXCommand {
FXDECLARE(FXCommandGroup)
friend class FXUndoList;
private:
FXCommand *undolist;
FXCommand *redolist;
FXCommandGroup *group;
private:
FXCommandGroup(const FXCommandGroup&);
FXCommandGroup &operator=(const FXCommandGroup&);
public:
/// Construct initially empty undo command group
FXCommandGroup():undolist(NULL),redolist(NULL),group(NULL){}
/// Return TRUE if empty
bool empty(){ return !undolist; }
/// Undo whole command group
virtual void undo();
/// Redo whole command group
virtual void redo();
/// Return the size of the command group
virtual FXuint size() const;
/// Delete undo command and sub-commands
virtual ~FXCommandGroup();
};
/**
* The Undo List class manages a list of undoable commands.
*/
class FXAPI FXUndoList : public FXCommandGroup {
FXDECLARE(FXUndoList)
private:
FXint undocount; // Number of undo records
FXint redocount; // Number of redo records
FXint marker; // Marker value
FXuint space; // Space taken up by all the undo records
bool working; // Currently busy with undo or redo
private:
FXUndoList(const FXUndoList&);
FXUndoList &operator=(const FXUndoList&);
public:
long onCmdUndo(FXObject*,FXSelector,void*);
long onUpdUndo(FXObject*,FXSelector,void*);
long onCmdRedo(FXObject*,FXSelector,void*);
long onUpdRedo(FXObject*,FXSelector,void*);
long onCmdClear(FXObject*,FXSelector,void*);
long onUpdClear(FXObject*,FXSelector,void*);
long onCmdRevert(FXObject*,FXSelector,void*);
long onUpdRevert(FXObject*,FXSelector,void*);
long onCmdUndoAll(FXObject*,FXSelector,void*);
long onCmdRedoAll(FXObject*,FXSelector,void*);
long onUpdUndoCount(FXObject*,FXSelector,void*);
long onUpdRedoCount(FXObject*,FXSelector,void*);
public:
enum{
ID_CLEAR=FXWindow::ID_LAST,
ID_REVERT,
ID_UNDO,
ID_REDO,
ID_UNDO_ALL,
ID_REDO_ALL,
ID_UNDO_COUNT,
ID_REDO_COUNT,
ID_LAST
};
public:
/**
* Make new empty undo list, initially unmarked.
*/
FXUndoList();
/**
* Cut the redo list.
* This is automatically invoked when a new undo command is added.
*/
void cut();
/**
* Add new command, executing it if desired. The new command will be merged
* with the previous command if merge is TRUE and we're not at a marked position
* and the commands are mergeable. Otherwise the new command will be appended
* after the last undo command in the currently active undo group.
* If the new command is successfully merged, it will be deleted. Furthermore,
* all redo commands will be deleted since it is no longer possible to redo
* from this point.
*/
void add(FXCommand* command,bool doit=false,bool merge=true);
/**
* Begin undo command sub-group. This begins a new group of commands that
* are treated as a single command. Must eventually be followed by a
* matching end() after recording the sub-commands. The new sub-group
* will be appended to its parent group's undo list when end() is called.
*/
void begin(FXCommandGroup *command);
/**
* End undo command sub-group. If the sub-group is still empty, it will
* be deleted; otherwise, the sub-group will be added as a new command
* into parent group.
* A matching begin() must have been called previously.
*/
void end();
/**
* Abort the current command sub-group being compiled. All commands
* already added to the sub-groups undo list will be discarded.
* Intermediate command groups will be left intact.
*/
void abort();
/**
* Undo last command. This will move the command to the redo list.
*/
virtual void undo();
/**
* Redo next command. This will move the command back to the undo list.
*/
virtual void redo();
/// Undo all commands
void undoAll();
/// Redo all commands
void redoAll();
/// Revert to marked
void revert();
/// Can we undo more commands
bool canUndo() const;
/// Can we redo more commands
bool canRedo() const;
/// Can revert to marked
bool canRevert() const;
/**
* Return TRUE if currently inside undo or redo operation; this
* is useful to avoid generating another undo command while inside
* an undo operation.
*/
bool busy() const { return working; }
/// Current top level undo command
FXCommand* current() const { return undolist; }
/**
* Return name of the first undo command available; if no
* undo command available this will return the empty string.
*/
virtual FXString undoName() const;
/**
* Return name of the first redo command available; if no
* Redo command available this will return the empty string.
*/
virtual FXString redoName() const;
/// Number of undo records
FXint undoCount() const { return undocount; }
/// Number of redo records
FXint redoCount() const { return redocount; }
/// Size of undo information
virtual FXuint size() const;
/**
* Clear list, and unmark all states.
* All undo and redo information will be destroyed.
*/
void clear();
/**
* Trim undo list down to at most nc commands.
* Call this periodically to prevent the undo-list from growing
* beyond a certain number of records.
*/
void trimCount(FXint nc);
/**
* Trim undo list down to at most size sz.
* Call this periodically to prevent the undo-list from growing
* beyond a certain amount of memory.
*/
void trimSize(FXuint sz);
/**
* Mark the current state of the undo list, which is initially unmarked.
* There can be only one active mark at any time. Call mark() at any
* time when you know the document to be "clean"; for example when you
* save the document to disk.
*/
void mark();
/**
* Unmark all states in the undo list.
*/
void unmark();
/**
* Check if the current state was marked, if the application has returned
* to the previously marked state.
*/
bool marked() const;
};
}
#endif
fox-1.6.49/include/FXMDIChild.h 0000664 0001750 0001750 00000026561 12130340076 012747 0000000 0000000 /********************************************************************************
* *
* M u l t i p l e D o c u m e n t C h i l d W i n d o w *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXMDIChild.h,v 1.42 2006/01/22 17:58:05 fox Exp $ *
********************************************************************************/
#ifndef FXMDICHILD_H
#define FXMDICHILD_H
#ifndef FXCOMPOSITE_H
#include "FXComposite.h"
#endif
namespace FX {
class FXMDIClient;
class FXMenuButton;
class FXButton;
class FXFont;
/// MDI Child Window styles
enum {
MDI_NORMAL = 0, /// Normal display mode
MDI_MAXIMIZED = 0x00001000, /// Window appears maximized
MDI_MINIMIZED = 0x00002000, /// Window is iconified or minimized
MDI_TRACKING = 0x00004000 /// Track continuously during dragging
};
/**
* The MDI child window contains the application work area in a Multiple Document
* Interface application. GUI Controls are connected to the MDI child via delegation
* through the MDI client, which forwards messages it receives to the active MDI child.
* The MDI child itself tries to further delegate messages to its single content window,
* and if not handled there, to its target object.
* When the MDI child is maximized, it sends a SEL_MAXIMIZE message; when the MDI
* child is minimized, it sends a SEL_MINIMIZE message. When it is restored, it
* sends a SEL_RESTORE message to its target. The MDI child also notifies its
* target when it becomes the active MDI child, via the SEL_SELECTED message.
* The void* in the SEL_SELECTED message refers to the previously active MDI child,
* if any. When an MDI child ceases to be the active one, a SEL_DESELECTED message
* is sent. The void* in the SEL_DESELECTED message refers to the newly activated
* MDI child, if any. Thus, interception of SEL_SELECTED and SEL_DESELECTED allows
* the target object to determine whether the user switched between MDI windows of
* the same document (target) or between MDI windows belonging to the same document.
* When the MDI child is closed, it sends a SEL_CLOSE message to its target.
* The target has an opportunity to object to the closing; if the MDI child should
* not be closed, it should return 1 (objection). If the MDI child should be closed,
* the target can either just return 0 or simply not handle the SEL_CLOSE message.
* The SEL_UPDATE message can be used to modify the MDI child's title (via
* ID_SETSTRINGVALUE), and window icon (via ID_SETICONVALUE).
*/
class FXAPI FXMDIChild : public FXComposite {
FXDECLARE(FXMDIChild)
protected:
FXString title; // Window title
FXMenuButton *windowbtn; // Window button
FXButton *minimizebtn; // Minimize button
FXButton *restorebtn; // Restore button
FXButton *maximizebtn; // Maximize buton
FXButton *deletebtn; // Close button
FXFont *font; // Title font
FXColor baseColor; // Colors
FXColor hiliteColor;
FXColor shadowColor;
FXColor borderColor;
FXColor titleColor;
FXColor titleBackColor;
FXint iconPosX; // Saved icon position
FXint iconPosY;
FXint iconWidth;
FXint iconHeight;
FXint normalPosX; // Saved normal position
FXint normalPosY;
FXint normalWidth;
FXint normalHeight;
FXint spotx; // Grab-spot of mouse on window
FXint spoty;
FXint xoff; // Mouse offset to add
FXint yoff;
FXint newx; // New location of window
FXint newy;
FXint neww;
FXint newh;
FXuchar mode; // Dragging mode
protected:
FXMDIChild();
void drawRubberBox(FXint x,FXint y,FXint w,FXint h);
void animateRectangles(FXint ox,FXint oy,FXint ow,FXint oh,FXint nx,FXint ny,FXint nw,FXint nh);
FXuchar where(FXint x,FXint y);
void changeCursor(FXint x,FXint y);
void revertCursor();
protected:
enum {
DRAG_NONE = 0,
DRAG_TOP = 1,
DRAG_BOTTOM = 2,
DRAG_LEFT = 4,
DRAG_RIGHT = 8,
DRAG_TOPLEFT = (DRAG_TOP|DRAG_LEFT),
DRAG_TOPRIGHT = (DRAG_TOP|DRAG_RIGHT),
DRAG_BOTTOMLEFT = (DRAG_BOTTOM|DRAG_LEFT),
DRAG_BOTTOMRIGHT = (DRAG_BOTTOM|DRAG_RIGHT),
DRAG_INVERTED = 16,
DRAG_TITLE = 32
};
private:
FXMDIChild(const FXMDIChild&);
FXMDIChild &operator=(const FXMDIChild&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onFocusSelf(FXObject*,FXSelector,void*);
long onFocusIn(FXObject*,FXSelector,void*);
long onFocusOut(FXObject*,FXSelector,void*);
long onRightBtnPress(FXObject*,FXSelector,void*);
long onRightBtnRelease(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onMiddleBtnPress(FXObject*,FXSelector,void*);
long onMiddleBtnRelease(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onSelected(FXObject*,FXSelector,void*);
long onDeselected(FXObject*,FXSelector,void*);
long onCmdClose(FXObject*,FXSelector,void*);
long onUpdClose(FXObject*,FXSelector,void*);
long onCmdRestore(FXObject*,FXSelector,void*);
long onUpdRestore(FXObject*,FXSelector,void*);
long onUpdMaximize(FXObject*,FXSelector,void*);
long onUpdMinimize(FXObject*,FXSelector,void*);
long onCmdMaximize(FXObject*,FXSelector,void*);
long onCmdMinimize(FXObject*,FXSelector,void*);
long onUpdWindow(FXObject*,FXSelector,void*);
long onUpdMenuRestore(FXObject*,FXSelector,void*);
long onUpdMenuMinimize(FXObject*,FXSelector,void*);
long onUpdMenuClose(FXObject*,FXSelector,void*);
long onUpdMenuWindow(FXObject*,FXSelector,void*);
long onCmdSetStringValue(FXObject*,FXSelector,void*);
long onCmdGetStringValue(FXObject*,FXSelector,void*);
long onCmdSetIconValue(FXObject*,FXSelector,void*);
long onCmdGetIconValue(FXObject*,FXSelector,void*);
virtual long onDefault(FXObject*,FXSelector,void*);
public:
/// Construct MDI Child window with given name and icon
FXMDIChild(FXMDIClient* p,const FXString& name,FXIcon* ic=NULL,FXPopup* pup=NULL,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Create window
virtual void create();
/// Detach window
virtual void detach();
/// Perform layout
virtual void layout();
/// Return the default width of this window
virtual FXint getDefaultWidth();
/// Return the default height of this window
virtual FXint getDefaultHeight();
/// Move the focus to this window
virtual void setFocus();
/// MDI Child can receive focus
virtual bool canFocus() const;
/// Move this window to the specified position in the parent's coordinates
virtual void move(FXint x,FXint y);
/// Resize this window to the specified width and height
virtual void resize(FXint w,FXint h);
/// Move and resize this window in the parent's coordinates
virtual void position(FXint x,FXint y,FXint w,FXint h);
/// Change normal (restored) position
void setNormalX(FXint x){ normalPosX=x; }
void setNormalY(FXint y){ normalPosY=y; }
void setNormalWidth(FXint w){ normalWidth=w; }
void setNormalHeight(FXint h){ normalHeight=h; }
/// Return normal (restored) position
FXint getNormalX() const { return normalPosX; }
FXint getNormalY() const { return normalPosY; }
FXint getNormalWidth() const { return normalWidth; }
FXint getNormalHeight() const { return normalHeight; }
/// Change iconified position
void setIconX(FXint x){ iconPosX=x; }
void setIconY(FXint y){ iconPosY=y; }
void setIconWidth(FXint w){ iconWidth=w; }
void setIconHeight(FXint h){ iconHeight=h; }
/// Return iconified position
FXint getIconX() const { return iconPosX; }
FXint getIconY() const { return iconPosY; }
FXint getIconWidth() const { return iconWidth; }
FXint getIconHeight() const { return iconHeight; }
/// Return content window
FXWindow *contentWindow() const;
/// Change MDI Child's title
void setTitle(const FXString& name);
/// Get current title
FXString getTitle() const { return title; }
/// Get colors
FXColor getHiliteColor() const { return hiliteColor; }
FXColor getShadowColor() const { return shadowColor; }
FXColor getBaseColor() const { return baseColor; }
FXColor getBorderColor() const { return borderColor; }
FXColor getTitleColor () const { return titleColor; }
FXColor getTitleBackColor() const { return titleBackColor; }
/// Change colors
void setHiliteColor(FXColor clr);
void setShadowColor(FXColor clr);
void setBaseColor(FXColor clr);
void setBorderColor(FXColor clr);
void setTitleColor(FXColor clr);
void setTitleBackColor(FXColor clr);
/// Maximize MDI window, return TRUE if maximized
virtual FXbool maximize(FXbool notify=FALSE);
/// Minimize/iconify MDI window, return TRUE if minimized
virtual FXbool minimize(FXbool notify=FALSE);
/// Restore MDI window to normal, return TRUE if restored
virtual FXbool restore(FXbool notify=FALSE);
/// Close MDI window, return TRUE if actually closed
virtual FXbool close(FXbool notify=FALSE);
/// Return TRUE if maximized
FXbool isMaximized() const;
/// Return TRUE if minimized
FXbool isMinimized() const;
/// Get window icon
FXIcon *getIcon() const;
/// Set window icon
void setIcon(FXIcon* icon);
/// Get window menu
FXPopup* getMenu() const;
/// Set window menu
void setMenu(FXPopup* menu);
/// Set tracking instead of just outline
void setTracking(FXbool tracking=TRUE);
/// Return true if tracking
FXbool getTracking() const;
/// Set title font
void setFont(FXFont *fnt);
/// Get title font
FXFont* getFont() const { return font; }
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
/// Destroy
virtual ~FXMDIChild();
};
}
#endif
fox-1.6.49/include/FXGLTriangleMesh.h 0000664 0001750 0001750 00000010171 12130340076 014165 0000000 0000000 /********************************************************************************
* *
* O p e n G L T r i a n g l e M e s h O b j e c t *
* *
*********************************************************************************
* Copyright (C) 1999,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXGLTriangleMesh.h,v 1.15 2006/01/22 17:58:04 fox Exp $ *
********************************************************************************/
#ifndef FXGLTRIANGLEMESH_H
#define FXGLTRIANGLEMESH_H
#ifndef FXGLSHAPE_H
#include "FXGLShape.h"
#endif
namespace FX {
/*
* Arrays Formats
*
* vertex: x,y,z
* normal: x,y,z
* Color: r,g.b,a
* texture: u,v
*/
/// OpenGL Triangle Mesh Object
class FXAPI FXGLTriangleMesh : public FXGLShape {
FXDECLARE(FXGLTriangleMesh)
private:
FXfloat *vertexBuffer;
FXfloat *colorBuffer;
FXfloat *normalBuffer;
FXfloat *textureBuffer;
FXint vertexNumber;
protected:
FXGLTriangleMesh();
virtual void drawshape(FXGLViewer* viewer);
virtual void recomputerange();
virtual void generatenormals();
public:
/// Construct triangle mesh with nv vertices, and optional normals, colors, and texture coordinates
FXGLTriangleMesh(FXfloat x,FXfloat y,FXfloat z,FXint nv,FXfloat *v,FXfloat *n=NULL,FXfloat *c=NULL,FXfloat *t=NULL);
/// Construct triangle mesh with nv vertices, and optional normals, colors, and texture coordinates, and surface material
FXGLTriangleMesh(FXfloat x,FXfloat y,FXfloat z,FXint nv,FXfloat *v,FXfloat *n,FXfloat *c,FXfloat *t,const FXMaterial& mtl);
/// Copy constructor
FXGLTriangleMesh(const FXGLTriangleMesh& orig);
/// Copy this object
virtual FXGLObject* copy();
/// Change number of vertices
void setVertexNumber(FXint nvertices){ vertexNumber=nvertices; }
/// Get number of vertices
FXint getVertexNumber() const { return vertexNumber; }
/// Set vertex buffer
void setVertexBuffer(FXfloat *vertices);
/// Get vertex buffer
FXfloat* getVertexBuffer() const { return vertexBuffer; }
/// Set color buffer
void setColorBuffer(FXfloat *colors){ colorBuffer=colors; }
/// Get color buffer
FXfloat* getColorBuffer() const { return colorBuffer; }
/// Set normals buffer
void setNormalBuffer(FXfloat *normals){ normalBuffer=normals; }
/// Get normals buffer
FXfloat* getNormalBuffer() const { return normalBuffer; }
/// Set texture coordinate buffer
void setTextureCoordBuffer(FXfloat *textures){ textureBuffer=textures; }
/// Get texture coordinate buffer
FXfloat* getTextureCoordBuffer() const { return textureBuffer; }
/// Save to a stream
virtual void save(FXStream& store) const;
/// Load from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXGLTriangleMesh();
};
}
#endif
fox-1.6.49/include/FX885910Codec.h 0000644 0001750 0001750 00000001113 11637250333 013075 0000000 0000000 #ifndef FX885910CODEC_H
#define FX885910CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// ISO-8859-10 Codec
class FXAPI FX885910Codec : public FXTextCodec {
FXDECLARE(FX885910Codec)
public:
FX885910Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FX885910Codec(){}
};
}
#endif
fox-1.6.49/include/FXFile.h 0000664 0001750 0001750 00000011661 12130340076 012244 0000000 0000000 /********************************************************************************
* *
* F i l e C l a s s *
* *
*********************************************************************************
* Copyright (C) 2000,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXFile.h,v 1.100 2006/01/22 17:58:01 fox Exp $ *
********************************************************************************/
#ifndef FXFILE_H
#define FXFILE_H
#ifndef FXIO_H
#include "FXIO.h"
#endif
namespace FX {
/**
* Low level file access.
*/
class FXAPI FXFile : public FXIO {
private:
FXFile(const FXFile&);
FXFile &operator=(const FXFile&);
public:
/// Construct file
FXFile(){ }
/// Construct file and attach existing handle h
FXFile(FXInputHandle handle,FXuint mode);
/// Construct and open a file
FXFile(const FXString& file,FXuint mode=FXIO::Reading,FXuint perm=FXIO::OwnerReadWrite|FXIO::GroupReadWrite|FXIO::OtherReadWrite);
/// Open file
virtual bool open(const FXString& file,FXuint mode=FXIO::Reading,FXuint perm=FXIO::OwnerReadWrite|FXIO::GroupReadWrite|FXIO::OtherReadWrite);
/// Open device with access mode and handle
virtual bool open(FXInputHandle handle,FXuint mode);
/// Get current file position
virtual FXlong position() const;
/// Change file position, returning new position from start
virtual FXlong position(FXlong offset,FXuint from=FXIO::Begin);
/// Read block of bytes, returning number of bytes read
virtual FXival readBlock(void* data,FXival count);
/// Write block of bytes, returning number of bytes written
virtual FXival writeBlock(const void* data,FXival count);
/// Truncate file
virtual FXlong truncate(FXlong size);
/// Flush to disk
virtual bool flush();
/// Return file size
virtual FXlong size();
/// Test if we're at the end
virtual bool eof();
/// Close file
virtual bool close();
/// Create new (empty) file
static bool create(const FXString& file,FXuint perm=FXIO::OwnerReadWrite|FXIO::GroupReadWrite|FXIO::OtherReadWrite);
/// Remove file
static bool remove(const FXString& file);
/// Rename or move srcfile to dstfile, replacing dstfile if it exists
static bool rename(const FXString& srcfile,const FXString& dstfile);
/// Link file
static bool link(const FXString& srcfile,const FXString& dstfile);
/// Read symbolic link
static FXString symlink(const FXString& file);
/// Symbolic link file
static bool symlink(const FXString& srcfile,const FXString& dstfile);
/// Return true if files are identical
static bool identical(const FXString& file1,const FXString& file2);
/// Copy srcfile to dstfile, overwriting dstfile if allowed
static bool copy(const FXString& srcfile,const FXString& dstfile,bool overwrite=false);
/// Concatenate srcfile1 and srcfile2 to dstfile, overwriting dstfile if allowed
static bool concat(const FXString& srcfile1,const FXString& srcfile2,const FXString& dstfile,bool overwrite=false);
/// Recursively copy files or directories from srcfile to dstfile, overwriting dstfile if allowed
static bool copyFiles(const FXString& srcfile,const FXString& dstfile,bool overwrite=false);
/// Recursively copy or move files or directories from srcfile to dstfile, overwriting dstfile if allowed
static bool moveFiles(const FXString& srcfile,const FXString& dstfile,bool overwrite=false);
/// Recursively remove file or directory, recurse if allowed
static bool removeFiles(const FXString& path,bool recursive=false);
/// Destroy
virtual ~FXFile();
};
}
#endif
fox-1.6.49/include/FXCP862Codec.h 0000644 0001750 0001750 00000001077 11637250333 013072 0000000 0000000 #ifndef FXCP862CODEC_H
#define FXCP862CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// CP862 Codec
class FXAPI FXCP862Codec : public FXTextCodec {
FXDECLARE(FXCP862Codec)
public:
FXCP862Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FXCP862Codec(){}
};
}
#endif
fox-1.6.49/include/FXPPMIcon.h 0000664 0001750 0001750 00000006302 12130340076 012626 0000000 0000000 /********************************************************************************
* *
* P P M I c o n O b j e c t *
* *
*********************************************************************************
* Copyright (C) 2003,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXPPMIcon.h,v 1.9 2006/01/22 17:58:06 fox Exp $ *
********************************************************************************/
#ifndef FXPPMICON_H
#define FXPPMICON_H
#ifndef FXICON_H
#include "FXIcon.h"
#endif
namespace FX {
/// Portable Pixmap icon
class FXAPI FXPPMIcon : public FXIcon {
FXDECLARE(FXPPMIcon)
protected:
FXPPMIcon(){}
private:
FXPPMIcon(const FXPPMIcon&);
FXPPMIcon &operator=(const FXPPMIcon&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct icon from memory stream formatted in Portable Pixmap format
FXPPMIcon(FXApp* a,const void *pix=NULL,FXColor clr=FXRGB(192,192,192),FXuint opts=0,FXint w=1,FXint h=1);
/// Save pixels into stream in Portable Pixmap format
virtual bool savePixels(FXStream& store) const;
/// Load pixels from stream in Portable Pixmap format
virtual bool loadPixels(FXStream& store);
/// Destroy icon
virtual ~FXPPMIcon();
};
/**
* Check if stream contains a PPM, return TRUE if so.
*/
extern FXAPI bool fxcheckPPM(FXStream& store);
/**
* Load an PPM (Portable Pixmap Format) file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadPPM(FXStream& store,FXColor*& data,FXint& width,FXint& height);
/**
* Save an PPM (Portable Pixmap Format) file to a stream.
*/
extern FXAPI bool fxsavePPM(FXStream& store,const FXColor *data,FXint width,FXint height);
}
#endif
fox-1.6.49/include/FXFileList.h 0000664 0001750 0001750 00000033154 12130340076 013101 0000000 0000000 /********************************************************************************
* *
* F i l e L i s t W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXFileList.h,v 1.57 2006/01/22 17:58:01 fox Exp $ *
********************************************************************************/
#ifndef FXFILELIST_H
#define FXFILELIST_H
#ifndef FXICONLIST_H
#include "FXIconList.h"
#endif
namespace FX {
struct FXFileAssoc;
class FXFileDict;
class FXFileList;
class FXIcon;
class FXIconSource;
class FXIconDict;
/// File List options
enum {
FILELIST_SHOWHIDDEN = 0x04000000, /// Show hidden files or directories
FILELIST_SHOWDIRS = 0x08000000, /// Show only directories
FILELIST_SHOWFILES = 0x10000000, /// Show only files
FILELIST_SHOWIMAGES = 0x20000000, /// Show preview of images
FILELIST_NO_OWN_ASSOC = 0x40000000, /// Do not create associations for files
FILELIST_NO_PARENT = 0x80000000 /// Suppress display of '.' and '..'
};
/// File item
class FXAPI FXFileItem : public FXIconItem {
FXDECLARE(FXFileItem)
friend class FXFileList;
protected:
FXFileAssoc *assoc; // File association record
FXFileItem *link; // Link to next item
FXlong size; // File size
FXTime date; // File time
private:
FXFileItem(const FXFileItem&);
FXFileItem& operator=(const FXFileItem&);
protected:
FXFileItem():assoc(NULL),link(NULL),size(0),date(0){}
protected:
enum{
FOLDER = 64, // Directory item
EXECUTABLE = 128, // Executable item
SYMLINK = 256, // Symbolic linked item
CHARDEV = 512, // Character special item
BLOCKDEV = 1024, // Block special item
FIFO = 2048, // FIFO item
SOCK = 4096, // Socket item
SHARE = 8192 // Share
};
public:
/// Constructor
FXFileItem(const FXString& text,FXIcon* bi=NULL,FXIcon* mi=NULL,void* ptr=NULL):FXIconItem(text,bi,mi,ptr),assoc(NULL),link(NULL),size(0L),date(0){}
/// Return true if this is a file item
FXbool isFile() const { return (state&(FOLDER|BLOCKDEV|CHARDEV|FIFO|SOCK|SHARE))==0; }
/// Return true if this is a directory item
FXbool isDirectory() const { return (state&FOLDER)!=0; }
/// Return true if this is a share item
FXbool isShare() const { return (state&SHARE)!=0; }
/// Return true if this is an executable item
FXbool isExecutable() const { return (state&EXECUTABLE)!=0; }
/// Return true if this is a symbolic link item
FXbool isSymlink() const { return (state&SYMLINK)!=0; }
/// Return true if this is a character device item
FXbool isChardev() const { return (state&CHARDEV)!=0; }
/// Return true if this is a block device item
FXbool isBlockdev() const { return (state&BLOCKDEV)!=0; }
/// Return true if this is an FIFO item
FXbool isFifo() const { return (state&FIFO)!=0; }
/// Return true if this is a socket
FXbool isSocket() const { return (state&SOCK)!=0; }
/// Return the file-association object for this item
FXFileAssoc* getAssoc() const { return assoc; }
/// Return the file size for this item
FXlong getSize() const { return size; }
/// Return the date for this item
FXTime getDate() const { return date; }
};
/**
* A File List widget provides an icon rich view of the file system.
* It automatically updates itself periodically by re-scanning the file system
* for any changes. As it scans the displayed directory, it automatically
* determines the icons to be displayed by consulting the file associations registry
* settings. A number of messages can be sent to the File List to control the
* filter pattern, sort category, sorting order, case sensitivity, and hidden file
* display mode.
* The File list widget supports drags and drops of files.
*/
class FXAPI FXFileList : public FXIconList {
FXDECLARE(FXFileList)
protected:
FXString directory; // Current directory
FXString orgdirectory; // Original directory
FXString dropdirectory; // Drop directory
FXDragAction dropaction; // Drop action
FXString dragfiles; // Dragged files
FXFileDict *associations; // Association table
FXFileItem *list; // File item list
FXString pattern; // Pattern of file names
FXuint matchmode; // File wildcard match mode
FXuint counter; // Refresh counter
FXint imagesize; // Image size
FXTime timestamp; // Time when last refreshed
FXIcon *big_folder; // Big folder icon
FXIcon *mini_folder; // Mini folder icon
FXIcon *big_doc; // Big document icon
FXIcon *mini_doc; // Mini document icon
FXIcon *big_app; // Big application icon
FXIcon *mini_app; // Mini application icon
protected:
FXFileList();
virtual FXIconItem *createItem(const FXString& text,FXIcon *big,FXIcon* mini,void* ptr);
void listItems(FXbool force);
private:
FXFileList(const FXFileList&);
FXFileList &operator=(const FXFileList&);
public:
long onOpenTimer(FXObject*,FXSelector,void*);
long onRefreshTimer(FXObject*,FXSelector,void*);
long onDNDEnter(FXObject*,FXSelector,void*);
long onDNDLeave(FXObject*,FXSelector,void*);
long onDNDMotion(FXObject*,FXSelector,void*);
long onDNDDrop(FXObject*,FXSelector,void*);
long onDNDRequest(FXObject*,FXSelector,void*);
long onBeginDrag(FXObject*,FXSelector,void*);
long onEndDrag(FXObject*,FXSelector,void*);
long onDragged(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdGetStringValue(FXObject*,FXSelector,void*);
long onCmdSetStringValue(FXObject*,FXSelector,void*);
long onCmdDirectoryUp(FXObject*,FXSelector,void*);
long onUpdDirectoryUp(FXObject*,FXSelector,void*);
long onCmdSortByName(FXObject*,FXSelector,void*);
long onUpdSortByName(FXObject*,FXSelector,void*);
long onCmdSortByType(FXObject*,FXSelector,void*);
long onUpdSortByType(FXObject*,FXSelector,void*);
long onCmdSortBySize(FXObject*,FXSelector,void*);
long onUpdSortBySize(FXObject*,FXSelector,void*);
long onCmdSortByTime(FXObject*,FXSelector,void*);
long onUpdSortByTime(FXObject*,FXSelector,void*);
long onCmdSortByUser(FXObject*,FXSelector,void*);
long onUpdSortByUser(FXObject*,FXSelector,void*);
long onCmdSortByGroup(FXObject*,FXSelector,void*);
long onUpdSortByGroup(FXObject*,FXSelector,void*);
long onCmdSortReverse(FXObject*,FXSelector,void*);
long onUpdSortReverse(FXObject*,FXSelector,void*);
long onCmdSortCase(FXObject*,FXSelector,void*);
long onUpdSortCase(FXObject*,FXSelector,void*);
long onCmdSetPattern(FXObject*,FXSelector,void*);
long onUpdSetPattern(FXObject*,FXSelector,void*);
long onCmdSetDirectory(FXObject*,FXSelector,void*);
long onUpdSetDirectory(FXObject*,FXSelector,void*);
long onCmdToggleHidden(FXObject*,FXSelector,void*);
long onUpdToggleHidden(FXObject*,FXSelector,void*);
long onCmdShowHidden(FXObject*,FXSelector,void*);
long onUpdShowHidden(FXObject*,FXSelector,void*);
long onCmdHideHidden(FXObject*,FXSelector,void*);
long onUpdHideHidden(FXObject*,FXSelector,void*);
long onCmdToggleImages(FXObject*,FXSelector,void*);
long onUpdToggleImages(FXObject*,FXSelector,void*);
long onCmdHeader(FXObject*,FXSelector,void*);
long onUpdHeader(FXObject*,FXSelector,void*);
long onCmdRefresh(FXObject*,FXSelector,void*);
public:
static FXint ascending(const FXIconItem* a,const FXIconItem* b);
static FXint descending(const FXIconItem* a,const FXIconItem* b);
static FXint ascendingCase(const FXIconItem* a,const FXIconItem* b);
static FXint descendingCase(const FXIconItem* a,const FXIconItem* b);
static FXint ascendingType(const FXIconItem* a,const FXIconItem* b);
static FXint descendingType(const FXIconItem* a,const FXIconItem* b);
static FXint ascendingSize(const FXIconItem* a,const FXIconItem* b);
static FXint descendingSize(const FXIconItem* a,const FXIconItem* b);
static FXint ascendingTime(const FXIconItem* a,const FXIconItem* b);
static FXint descendingTime(const FXIconItem* a,const FXIconItem* b);
static FXint ascendingUser(const FXIconItem* a,const FXIconItem* b);
static FXint descendingUser(const FXIconItem* a,const FXIconItem* b);
static FXint ascendingGroup(const FXIconItem* a,const FXIconItem* b);
static FXint descendingGroup(const FXIconItem* a,const FXIconItem* b);
public:
enum {
ID_REFRESHTIMER=FXIconList::ID_LAST,
ID_OPENTIMER,
ID_SORT_BY_NAME, /// Sort by name
ID_SORT_BY_TYPE, /// Sort by type
ID_SORT_BY_SIZE, /// Sort by size
ID_SORT_BY_TIME, /// Sort by access time
ID_SORT_BY_USER, /// Sort by owner name
ID_SORT_BY_GROUP, /// Sort by group name
ID_SORT_REVERSE, /// Reverse sort order
ID_SORT_CASE, /// Toggle sort case sensitivity
ID_DIRECTORY_UP, /// Move up one directory
ID_SET_PATTERN, /// Set match pattern
ID_SET_DIRECTORY, /// Set directory
ID_SHOW_HIDDEN, /// Show hidden files
ID_HIDE_HIDDEN, /// Hide hidden files
ID_TOGGLE_HIDDEN, /// Toggle display of hidden files
ID_TOGGLE_IMAGES, /// Toggle display of images
ID_REFRESH, /// Refresh immediately
ID_LAST
};
public:
/// Construct a file list
FXFileList(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Destroy server-side resources
virtual void destroy();
/// Scan the current directory and update the items if needed, or if force is TRUE
void scan(FXbool force=TRUE);
/// Set current file
void setCurrentFile(const FXString& file,FXbool notify=FALSE);
/// Return current file
FXString getCurrentFile() const;
/// Set current directory
void setDirectory(const FXString& path);
/// Return current directory
FXString getDirectory() const { return directory; }
/// Change wildcard matching pattern
void setPattern(const FXString& ptrn);
/// Return wildcard pattern
FXString getPattern() const { return pattern; }
/// Return TRUE if item is a directory
FXbool isItemDirectory(FXint index) const;
/// Return TRUE if item is a directory
FXbool isItemShare(FXint index) const;
/// Return TRUE if item is a file
FXbool isItemFile(FXint index) const;
/// Return TRUE if item is executable
FXbool isItemExecutable(FXint index) const;
/// Return name of item at index
FXString getItemFilename(FXint index) const;
/// Return full pathname of item at index
FXString getItemPathname(FXint index) const;
/// Return file association of item
FXFileAssoc* getItemAssoc(FXint index) const;
/// Return wildcard matching mode
FXuint getMatchMode() const { return matchmode; }
/// Change wildcard matching mode
void setMatchMode(FXuint mode);
/// Return TRUE if showing hidden files
FXbool showHiddenFiles() const;
/// Show or hide hidden files
void showHiddenFiles(FXbool showing);
/// Return TRUE if showing directories only
FXbool showOnlyDirectories() const;
/// Show directories only
void showOnlyDirectories(FXbool shown);
/// Return TRUE if showing files only
FXbool showOnlyFiles() const;
/// Show files only
void showOnlyFiles(FXbool shown);
/// Return TRUE if image preview on
FXbool showImages() const;
/// Show or hide preview images
void showImages(FXbool showing);
/// Return images preview size
FXint getImageSize() const { return imagesize; }
/// Change images preview size
void setImageSize(FXint size);
/// Return TRUE if showing parent directories
FXbool showParents() const;
/// Show parent directories
void showParents(FXbool shown);
/// Change file associations
void setAssociations(FXFileDict* assoc);
/// Return file associations
FXFileDict* getAssociations() const { return associations; }
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXFileList();
};
}
#endif
fox-1.6.49/include/FXGLViewer.h 0000664 0001750 0001750 00000047126 12130340076 013056 0000000 0000000 /********************************************************************************
* *
* O p e n G L V i e w e r W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXGLViewer.h,v 1.74 2006/01/22 17:58:04 fox Exp $ *
********************************************************************************/
#ifndef FXGLVIEWER_H
#define FXGLVIEWER_H
#ifndef FXGLCANVAS_H
#include "FXGLCanvas.h"
#endif
namespace FX {
class FXDCPrint;
class FXGLObject;
class FXGLVisual;
// GL Viewer options
enum {
VIEWER_LIGHTING = 0x00008000, /// Lighting is on
VIEWER_FOG = 0x00010000, /// Fog mode on
VIEWER_DITHER = 0x00020000 /// Dithering
};
/******************************* Viewer Structs *****************************/
/// OpenGL Viewer Viewport
struct FXViewport {
FXint w,h; // Viewport dimensions
FXdouble left,right; // World box
FXdouble bottom,top;
FXdouble hither,yon;
};
// OpenGL Light Source
struct FXAPI FXLight {
FXVec4f ambient; // Ambient light color
FXVec4f diffuse; // Diffuse light color
FXVec4f specular; // Specular light color
FXVec4f position; // Light position
FXVec3f direction; // Spot direction
FXfloat exponent; // Spotlight exponent
FXfloat cutoff; // Spotlight cutoff angle
FXfloat c_attn; // Constant attenuation factor
FXfloat l_attn; // Linear attenuation factor
FXfloat q_attn; // Quadratic attenuation factor
};
// OpenGL Material Description
struct FXAPI FXMaterial {
FXVec4f ambient; // Ambient material color
FXVec4f diffuse; // Diffuse material color
FXVec4f specular; // Specular material color
FXVec4f emission; // Emissive material color
FXfloat shininess; // Specular shininess
};
// Feedback buffer sort routine
typedef FXbool (*FXZSortFunc)(FXfloat*& buffer,FXint& used,FXint& size);
/******************************** Viewer Class ******************************/
/// OpenGL viewer widget
class FXAPI FXGLViewer : public FXGLCanvas {
FXDECLARE(FXGLViewer)
friend class FXGLObject;
protected:
FXViewport wvt; // Window viewport transform
FXMat4f transform; // Current transformation matrix
FXMat4f itransform; // Inverse of current transformation matrix
FXuint projection; // Projection mode
FXQuatf rotation; // Viewer orientation
FXdouble fov; // Field of view
FXdouble zoom; // Zoom factor
FXVec3f center; // Model center
FXVec3f scale; // Model scale
FXdouble worldpx; // Pixel size in world
FXdouble modelpx; // Pixel size in model
FXint maxhits; // Maximum number of hits
FXdouble ax,ay; // Quick view->world coordinate mapping
FXdouble diameter; // Size of model diameter ( always > 0)
FXdouble distance; // Distance of PRP to target
FXVec4f background[2]; // Background colors
FXVec4f ambient; // Global ambient light
FXLight light; // Light source
FXMaterial material; // Base material properties
FXint dial[3]; // Dial positions
FXString help; // Status help
FXString tip; // Tooltip for background
FXGLObject *dropped; // Object being dropped on
FXGLObject *selection; // Current object
FXZSortFunc zsortfunc; // Routine to sort feedback buffer
FXGLObject *scene; // What we're looking at
FXbool doesturbo; // Doing turbo mode
FXbool turbomode; // Turbo mode
FXuchar mode; // Mode the widget is in
public:
// Common DND types
static FXDragType objectType; // GL Object type
protected:
// Mouse actions when in viewing window
enum {
HOVERING, // Hovering mouse w/o doing anything
PICKING, // Pick mode
ROTATING, // Rotating camera around target
POSTING, // Posting right-mouse menu
TRANSLATING, // Translating camera
ZOOMING, // Zooming
FOVING, // Change field-of-view
DRAGGING, // Dragging objects
TRUCKING, // Trucking camera
GYRATING, // Rotation of camera around eye
DO_LASSOSELECT, // Lasso select when mouse pressed
LASSOSELECT, // Anchor of lasso rectangle
DO_LASSOZOOM, // Zoom when mouse pressed
LASSOZOOM // Zoom rectangle
};
protected:
FXGLViewer();
void glsetup();
virtual void updateProjection();
virtual void updateTransform();
FXVec3f spherePoint(FXint px,FXint py);
FXQuatf turn(FXint fx,FXint fy,FXint tx,FXint ty);
void drawWorld(FXViewport& wv);
void drawAnti(FXViewport& wv);
void drawLasso(FXint x0,FXint y0,FXint x1,FXint y1);
FXint selectHits(FXuint*& hits,FXint& nhits,FXint x,FXint y,FXint w,FXint h);
FXint renderFeedback(FXfloat *buffer,FXint x,FXint y,FXint w,FXint h,FXint maxbuffer);
void drawFeedback(FXDCPrint& pdc,const FXfloat* buffer,FXint used);
virtual FXGLObject* processHits(FXuint *pickbuffer,FXint nhits);
void setOp(FXuint o);
private:
FXGLViewer(const FXGLViewer&);
FXGLViewer &operator=(const FXGLViewer&);
void initialize();
public:
// Events
long onPaint(FXObject*,FXSelector,void*);
long onEnter(FXObject*,FXSelector,void*);
long onLeave(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onMouseWheel(FXObject*,FXSelector,void*);
long onChanged(FXObject*,FXSelector,void*);
long onPick(FXObject*,FXSelector,void*);
long onClicked(FXObject*,FXSelector,void*);
long onDoubleClicked(FXObject*,FXSelector,void*);
long onTripleClicked(FXObject*,FXSelector,void*);
long onLassoed(FXObject*,FXSelector,void*);
long onSelected(FXObject*,FXSelector,void*);
long onDeselected(FXObject*,FXSelector,void*);
long onInserted(FXObject*,FXSelector,void*);
long onDeleted(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onMiddleBtnPress(FXObject*,FXSelector,void*);
long onMiddleBtnRelease(FXObject*,FXSelector,void*);
long onRightBtnPress(FXObject*,FXSelector,void*);
long onRightBtnRelease(FXObject*,FXSelector,void*);
long onUngrabbed(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onFocusIn(FXObject*,FXSelector,void*);
long onFocusOut(FXObject*,FXSelector,void*);
long onClipboardLost(FXObject*,FXSelector,void*);
long onClipboardGained(FXObject*,FXSelector,void*);
long onClipboardRequest(FXObject*,FXSelector,void*);
// Commands
long onCmdPerspective(FXObject*,FXSelector,void*);
long onUpdPerspective(FXObject*,FXSelector,void*);
long onCmdParallel(FXObject*,FXSelector,void*);
long onUpdParallel(FXObject*,FXSelector,void*);
long onCmdFront(FXObject*,FXSelector,void*);
long onUpdFront(FXObject*,FXSelector,void*);
long onCmdBack(FXObject*,FXSelector,void*);
long onUpdBack(FXObject*,FXSelector,void*);
long onCmdLeft(FXObject*,FXSelector,void*);
long onUpdLeft(FXObject*,FXSelector,void*);
long onCmdRight(FXObject*,FXSelector,void*);
long onUpdRight(FXObject*,FXSelector,void*);
long onCmdTop(FXObject*,FXSelector,void*);
long onUpdTop(FXObject*,FXSelector,void*);
long onCmdBottom(FXObject*,FXSelector,void*);
long onUpdBottom(FXObject*,FXSelector,void*);
long onCmdResetView(FXObject*,FXSelector,void*);
long onCmdFitView(FXObject*,FXSelector,void*);
long onDNDEnter(FXObject*,FXSelector,void*);
long onDNDLeave(FXObject*,FXSelector,void*);
long onDNDMotion(FXObject*,FXSelector,void*);
long onDNDDrop(FXObject*,FXSelector,void*);
long onTipTimer(FXObject*,FXSelector,void*);
long onCmdXYZDial(FXObject*,FXSelector,void*);
long onUpdXYZDial(FXObject*,FXSelector,void*);
long onCmdRollPitchYaw(FXObject*,FXSelector,void*);
long onUpdRollPitchYaw(FXObject*,FXSelector,void*);
long onCmdXYZScale(FXObject*,FXSelector,void*);
long onUpdXYZScale(FXObject*,FXSelector,void*);
long onUpdCurrent(FXObject*,FXSelector,void*);
long onCmdCutSel(FXObject*,FXSelector,void*);
long onCmdCopySel(FXObject*,FXSelector,void*);
long onCmdPasteSel(FXObject*,FXSelector,void*);
long onCmdDeleteSel(FXObject*,FXSelector,void*);
long onUpdDeleteSel(FXObject*,FXSelector,void*);
long onCmdBackColor(FXObject*,FXSelector,void*);
long onUpdBackColor(FXObject*,FXSelector,void*);
long onCmdGradientBackColor(FXObject*,FXSelector,void*);
long onUpdGradientBackColor(FXObject*,FXSelector,void*);
long onCmdAmbientColor(FXObject*,FXSelector,void*);
long onUpdAmbientColor(FXObject*,FXSelector,void*);
long onCmdLighting(FXObject*,FXSelector,void*);
long onUpdLighting(FXObject*,FXSelector,void*);
long onCmdFog(FXObject*,FXSelector,void*);
long onUpdFog(FXObject*,FXSelector,void*);
long onCmdDither(FXObject*,FXSelector,void*);
long onUpdDither(FXObject*,FXSelector,void*);
long onCmdFov(FXObject*,FXSelector,void*);
long onUpdFov(FXObject*,FXSelector,void*);
long onCmdZoom(FXObject*,FXSelector,void*);
long onUpdZoom(FXObject*,FXSelector,void*);
long onCmdLightAmbient(FXObject*,FXSelector,void*);
long onUpdLightAmbient(FXObject*,FXSelector,void*);
long onCmdLightDiffuse(FXObject*,FXSelector,void*);
long onUpdLightDiffuse(FXObject*,FXSelector,void*);
long onCmdLightSpecular(FXObject*,FXSelector,void*);
long onUpdLightSpecular(FXObject*,FXSelector,void*);
long onCmdTurbo(FXObject*,FXSelector,void*);
long onUpdTurbo(FXObject*,FXSelector,void*);
long onCmdPrintImage(FXObject*,FXSelector,void*);
long onCmdPrintVector(FXObject*,FXSelector,void*);
long onCmdLassoZoom(FXObject*,FXSelector,void*);
long onCmdLassoSelect(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
virtual long onDefault(FXObject*,FXSelector,void*);
public:
// Projection modes
enum {
PARALLEL, // Parallel projection
PERSPECTIVE // Perspective projection
};
// Messages
enum {
ID_PERSPECTIVE=FXGLCanvas::ID_LAST,
ID_PARALLEL,
ID_FRONT,
ID_BACK,
ID_LEFT,
ID_RIGHT,
ID_TOP,
ID_BOTTOM,
ID_RESETVIEW,
ID_FITVIEW,
ID_TOP_COLOR,
ID_BOTTOM_COLOR,
ID_BACK_COLOR,
ID_AMBIENT_COLOR,
ID_LIGHT_AMBIENT,
ID_LIGHT_DIFFUSE,
ID_LIGHT_SPECULAR,
ID_LIGHTING,
ID_TURBO,
ID_FOG,
ID_DITHER,
ID_SCALE_X,
ID_SCALE_Y,
ID_SCALE_Z,
ID_DIAL_X,
ID_DIAL_Y,
ID_DIAL_Z,
ID_ROLL,
ID_PITCH,
ID_YAW,
ID_FOV,
ID_ZOOM,
ID_CUT_SEL,
ID_COPY_SEL,
ID_PASTE_SEL,
ID_DELETE_SEL,
ID_PRINT_IMAGE,
ID_PRINT_VECTOR,
ID_LASSO_ZOOM,
ID_LASSO_SELECT,
ID_LAST
};
public:
// Common DND type names
static const FXchar objectTypeName[];
public:
/// Construct GL viewer widget
FXGLViewer(FXComposite* p,FXGLVisual *vis,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Construct GL viewer widget sharing display list with another GL viewer
FXGLViewer(FXComposite* p,FXGLVisual *vis,FXGLViewer* sharegroup,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Create all of the server-side resources for this window
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Perform layout
virtual void layout();
/// Return size of pixel in world coordinates
FXdouble worldPix() const { return worldpx; }
/// Return size of pixel in model coordinates
FXdouble modelPix() const { return modelpx; }
/// Return a NULL-terminated list of all objects in the given rectangle, or NULL
FXGLObject** lasso(FXint x1,FXint y1,FXint x2,FXint y2);
/// Return a NULL-terminated list of all objects in the given rectangle, or NULL
virtual FXGLObject** select(FXint x,FXint y,FXint w,FXint h);
/// Perform a pick operation, returning the object at the given x,y position, or NULL
virtual FXGLObject* pick(FXint x,FXint y);
/// Change the model bounding box; this adjusts the viewer
virtual FXbool setBounds(const FXRangef& box);
/// Fit viewer to the given bounding box
FXbool fitToBounds(const FXRangef& box);
/// Return the viewer's viewport
void getViewport(FXViewport& v) const;
/// Translate eye-coordinate to screen coordinate
void eyeToScreen(FXint& sx,FXint& sy,FXVec3f e);
/// Translate screen coordinate to eye coordinate at the given depth
FXVec3f screenToEye(FXint sx,FXint sy,FXfloat eyez=0.0);
/// Translate screen coordinate to eye coordinate at the target point depth
FXVec3f screenToTarget(FXint sx,FXint sy);
/// Translate world coordinate to eye coordinate
FXVec3f worldToEye(FXVec3f w);
/// Translate world coordinate to eye coordinate depth
FXfloat worldToEyeZ(FXVec3f w);
/// Translate eye coordinate to eye coordinate
FXVec3f eyeToWorld(FXVec3f e);
/// Calculate world coordinate vector from screen movement
FXVec3f worldVector(FXint fx,FXint fy,FXint tx,FXint ty);
/// Change default object material setting
void setMaterial(const FXMaterial &mtl);
/// Return default object material setting
void getMaterial(FXMaterial &mtl) const;
/// Change camera field of view angle (in degrees)
void setFieldOfView(FXdouble fv);
/// Return camera field of view angle
FXdouble getFieldOfView() const { return fov; }
/// Change camera zoom factor
void setZoom(FXdouble zm);
/// Return camera zoom factor
FXdouble getZoom() const { return zoom; }
/// Change target point distance
void setDistance(FXdouble ed);
/// Return target point distance
FXdouble getDistance() const { return distance; }
/// Change unequal model scaling factors
void setScale(FXVec3f s);
/// Return current scaling factors
const FXVec3f& getScale() const { return scale; }
/// Change camera orientation from quaternion
void setOrientation(FXQuatf rot);
/// Return current camera orientation quaternion
const FXQuatf& getOrientation() const { return rotation; }
/// Change object center (tranlation)
void setCenter(FXVec3f cntr);
/// Return object center
const FXVec3f& getCenter() const { return center; }
/// Translate object center
void translate(FXVec3f vec);
/// Return boresight vector
FXbool getBoreVector(FXint sx,FXint sy,FXVec3f& point,FXVec3f& dir);
/// Return eyesight vector
FXVec3f getEyeVector() const;
/// Return eye position
FXVec3f getEyePosition() const;
/// Change help text
void setHelpText(const FXString& text);
/// Return help text
const FXString& getHelpText() const { return help; }
/// Change tip text
void setTipText(const FXString& text);
/// Return tip text
const FXString& getTipText() const { return tip; }
/// Return the current transformation matrix
const FXMat4f& getTransform() const { return transform; }
/// Return the inverse of the current transformation matrix
const FXMat4f& getInvTransform() const { return itransform; }
/// Change the scene, i.e. the object being displayed.
void setScene(FXGLObject* sc);
/// Return the current scene object
FXGLObject* getScene() const { return scene; }
/// Change selection
void setSelection(FXGLObject* sel);
/// Return selection
FXGLObject* getSelection() const { return selection; }
/// Change the projection mode, PERSPECTIVE or PARALLEL
void setProjection(FXuint proj);
/// Return the projection mode
FXuint getProjection() const { return projection; }
/// Change top or bottom or both background colors
void setBackgroundColor(const FXVec4f& clr,FXbool bottom=MAYBE);
/// Return top or bottom window background color.
const FXVec4f& getBackgroundColor(FXbool bottom=FALSE) const { return background[bottom]; }
/// Change global ambient light color
void setAmbientColor(const FXVec4f& clr);
/// Return global ambient light color
const FXVec4f& getAmbientColor() const { return ambient; }
/**
* Read the pixels off the screen as array of FXColor;
* this array can be directly passed to fxsaveBMP and other image
* output routines.
*/
FXbool readPixels(FXColor*& buffer,FXint x,FXint y,FXint w,FXint h);
/**
* Read the feedback buffer containing the current scene, returning used
* and allocated size.
*/
FXbool readFeedback(FXfloat*& buffer,FXint& used,FXint& size,FXint x,FXint y,FXint w,FXint h);
/**
* Change hidden-surface feedback buffer sorting algorithm.
* This can be used for move/draw printed output depth sorting.
*/
void setZSortFunc(FXZSortFunc func){ zsortfunc=func; }
/// Return hidden surface sorting function.
FXZSortFunc getZSortFunc() const { return zsortfunc; }
/**
* Change the maximum hits, i.e. the maximum size of the pick buffer.
* When set to less than or equal to zero, picking is essentially turned off.
*/
void setMaxHits(FXint maxh) { maxhits=maxh; }
/// Return maximum pickbuffer size
FXint getMaxHits() const { return maxhits; }
/**
* When drawing a GL object, if doesTurbo() is true, the object
* may choose to perform a reduced complexity drawing as the user is
* interactively manipulating; another update will be done later when
* the full complexity drawing can be performed again.
*/
FXbool doesTurbo() const { return doesturbo; }
/// Return turbo mode setting
FXbool getTurboMode() const { return turbomode; }
/// Set turbo mode
void setTurboMode(FXbool turbo=TRUE);
/// Return light source settings
void getLight(FXLight& lite) const;
/// Change light source settings
void setLight(const FXLight& lite);
/// Save viewer to a stream
virtual void save(FXStream& store) const;
/// Load viewer from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXGLViewer();
};
}
#endif
fox-1.6.49/include/FXGroupBox.h 0000664 0001750 0001750 00000010430 12130340076 013123 0000000 0000000 /********************************************************************************
* *
* G r o u p B o x W i n d o w W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXGroupBox.h,v 1.23 2006/01/22 17:58:04 fox Exp $ *
********************************************************************************/
#ifndef FXGROUPBOX_H
#define FXGROUPBOX_H
#ifndef FXPACKER_H
#include "FXPacker.h"
#endif
namespace FX {
// Group box options
enum {
GROUPBOX_TITLE_LEFT = 0, /// Title is left-justified
GROUPBOX_TITLE_CENTER = 0x00020000, /// Title is centered
GROUPBOX_TITLE_RIGHT = 0x00040000, /// Title is right-justified
GROUPBOX_NORMAL = GROUPBOX_TITLE_LEFT
};
/**
* A group box widget provides a nice raised or sunken border
* around a group of widgets, providing a visual delineation.
* Typically, a title is placed over the border to provide some
* clarification.
*/
class FXAPI FXGroupBox : public FXPacker {
FXDECLARE(FXGroupBox)
protected:
FXString label;
FXFont *font;
FXColor textColor;
protected:
FXGroupBox();
private:
FXGroupBox(const FXGroupBox&);
FXGroupBox &operator=(const FXGroupBox&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetStringValue(FXObject*,FXSelector,void*);
long onCmdGetStringValue(FXObject*,FXSelector,void*);
public:
/// Construct group box layout manager
FXGroupBox(FXComposite* p,const FXString& text,FXuint opts=GROUPBOX_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_SPACING,FXint pr=DEFAULT_SPACING,FXint pt=DEFAULT_SPACING,FXint pb=DEFAULT_SPACING,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Perform layout
virtual void layout();
/// Enable the window
virtual void enable();
/// Disable the window
virtual void disable();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Change group box title text
void setText(const FXString& text);
/// Return current groupbox title text
FXString getText() const { return label; }
/// Change group box style
void setGroupBoxStyle(FXuint style);
/// Return current group box style
FXuint getGroupBoxStyle() const;
/// Change title font
void setFont(FXFont* fnt);
/// Return title font
FXFont* getFont() const { return font; }
/// Change title text color
void setTextColor(FXColor clr);
/// Return text color
FXColor getTextColor() const { return textColor; }
/// Save to a stream
virtual void save(FXStream& store) const;
/// Load from a stream
virtual void load(FXStream& store);
};
}
#endif
fox-1.6.49/include/FXIFFIcon.h 0000664 0001750 0001750 00000006137 12130340076 012604 0000000 0000000 /********************************************************************************
* *
* I F F I c o n O b j e c t *
* *
*********************************************************************************
* Copyright (C) 2004,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXIFFIcon.h,v 1.10 2006/01/22 17:58:04 fox Exp $ *
********************************************************************************/
#ifndef FXIFFICON_H
#define FXIFFICON_H
#ifndef FXICON_H
#include "FXIcon.h"
#endif
namespace FX {
/**
* The IFF Icon provides support for the EA/Amiga Image File Format.
*/
class FXAPI FXIFFIcon : public FXIcon {
FXDECLARE(FXIFFIcon)
protected:
FXIFFIcon(){}
private:
FXIFFIcon(const FXIFFIcon&);
FXIFFIcon &operator=(const FXIFFIcon&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct an icon from memory stream formatted as IFF format
FXIFFIcon(FXApp* a,const void *pix=NULL,FXColor clr=FXRGB(192,192,192),FXuint opts=0,FXint w=1,FXint h=1);
/// Save pixels into stream in IFF format
virtual bool savePixels(FXStream& store) const;
/// Load pixels from stream in IFF format
virtual bool loadPixels(FXStream& store);
/// Destroy
virtual ~FXIFFIcon();
};
#ifndef FXLOADIFF
#define FXLOADIFF
/**
* Check if stream contains a IFF, return TRUE if so.
*/
extern FXAPI bool fxcheckIFF(FXStream& store);
/**
* Load an IFF (EA Image File Format) file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadIFF(FXStream& store,FXColor*& data,FXint& width,FXint& height);
#endif
}
#endif
fox-1.6.49/include/FXOptionMenu.h 0000664 0001750 0001750 00000014552 12130340076 013464 0000000 0000000 /********************************************************************************
* *
* O p t i o n M e n u *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXOptionMenu.h,v 1.28 2006/02/06 02:03:38 fox Exp $ *
********************************************************************************/
#ifndef FXOPTIONMENU_H
#define FXOPTIONMENU_H
#ifndef FXLABEL_H
#include "FXLabel.h"
#endif
namespace FX {
class FXPopup;
/// Option Menu Button
class FXAPI FXOption : public FXLabel {
FXDECLARE(FXOption)
protected:
FXColor selbackColor;
FXColor seltextColor;
protected:
FXOption();
private:
FXOption(const FXOption&);
FXOption &operator=(const FXOption&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onEnter(FXObject*,FXSelector,void*);
long onLeave(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onHotKeyPress(FXObject*,FXSelector,void*);
long onHotKeyRelease(FXObject*,FXSelector,void*);
public:
/// Constructor
FXOption(FXComposite* p,const FXString& text,FXIcon* ic=NULL,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=JUSTIFY_NORMAL|ICON_BEFORE_TEXT,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Returns true because a menu button can receive focus
virtual bool canFocus() const;
/// Set focus to this window
virtual void setFocus();
/// Remove the focus from this window
virtual void killFocus();
/// Return the selection background color
void setSelBackColor(FXColor clr);
/// Return the selection background color
FXColor getSelBackColor() const { return selbackColor; }
/// Return the selection text color
void setSelTextColor(FXColor clr);
/// Return the selection text color
FXColor getSelTextColor() const { return seltextColor; }
/// Destructor
virtual ~FXOption();
};
/// Option Menu
class FXAPI FXOptionMenu : public FXLabel {
FXDECLARE(FXOptionMenu)
protected:
FXPopup *pane;
FXOption *current;
protected:
FXOptionMenu(){}
private:
FXOptionMenu(const FXOptionMenu&);
FXOptionMenu &operator=(const FXOptionMenu&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onFocusIn(FXObject*,FXSelector,void*);
long onFocusOut(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onCmdPost(FXObject*,FXSelector,void*);
long onCmdUnpost(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetIntValue(FXObject*,FXSelector,void*);
long onCmdGetIntValue(FXObject*,FXSelector,void*);
long onMouseWheel(FXObject*,FXSelector,void*);
public:
/// Constructor
FXOptionMenu(FXComposite* p,FXPopup* pup=NULL,FXuint opts=JUSTIFY_NORMAL|ICON_BEFORE_TEXT,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Delete server-side resources
virtual void destroy();
/// Perform layout
virtual void layout();
/// Remove the focus from this window
virtual void killFocus();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Return TRUE if the position is logically in the pane
virtual bool contains(FXint parentx,FXint parenty) const;
/// Set the current option
void setCurrent(FXOption *win,FXbool notify=FALSE);
/// Return the current option
FXOption* getCurrent() const { return current; }
/// Set the current option number
void setCurrentNo(FXint no,FXbool notify=FALSE);
/// Get the current option number
FXint getCurrentNo() const;
/// Get number of options
FXint getNumOptions() const;
/// Set the pane which will be popped up
void setMenu(FXPopup *pup);
/// Return the pane which is poppup up
FXPopup* getMenu() const { return pane; }
/// Returns true because a option menu can receive focus
virtual bool canFocus() const;
/// Return TRUE if popped up
FXbool isPopped() const;
/// Save option menu to a stream
virtual void save(FXStream& store) const;
/// Load option menu from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXOptionMenu();
};
}
#endif
fox-1.6.49/include/FXDockTitle.h 0000664 0001750 0001750 00000007703 12130340076 013251 0000000 0000000 /********************************************************************************
* *
* D o c k T i t l e W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2005,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXDockTitle.h,v 1.3 2006/01/22 17:58:01 fox Exp $ *
********************************************************************************/
#ifndef FXDOCKTITLE_H
#define FXDOCKTITLE_H
#ifndef FXDOCKHANDLER_H
#include "FXDockHandler.h"
#endif
namespace FX {
/**
* A dock title is used to move its container, a dock bar.
* The dock title is also used simultaneously to provide a
* caption above the dock bar.
*/
class FXAPI FXDockTitle : public FXDockHandler {
FXDECLARE(FXDockTitle)
protected:
FXString caption; // Caption text
FXFont *font; // Caption font
FXColor captionColor; // Caption color
protected:
FXDockTitle();
private:
FXDockTitle(const FXDockTitle&);
FXDockTitle& operator=(const FXDockTitle&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetStringValue(FXObject*,FXSelector,void*);
long onCmdGetStringValue(FXObject*,FXSelector,void*);
public:
/// Construct dock bar title widget
FXDockTitle(FXComposite* p,const FXString& text,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=FRAME_NORMAL|JUSTIFY_CENTER_X|JUSTIFY_CENTER_Y,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=0,FXint pr=0,FXint pt=0,FXint pb=0);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Set the caption for the grip
void setCaption(const FXString& text);
/// Get the caption for the grip
FXString getCaption() const { return caption; }
/// Set caption font
void setFont(FXFont *fnt);
/// Get caption font
FXFont* getFont() const { return font; }
/// Get the current caption color
FXColor getCaptionColor() const { return captionColor; }
/// Set the current caption color
void setCaptionColor(FXColor clr);
/// Set the current justification mode.
void setJustify(FXuint mode);
/// Get the current justification mode.
FXuint getJustify() const;
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
/// Destroy
virtual ~FXDockTitle();
};
}
#endif
fox-1.6.49/include/FXMenuRadio.h 0000664 0001750 0001750 00000010244 12130340076 013244 0000000 0000000 /********************************************************************************
* *
* M e n u R a d i o W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2002,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXMenuRadio.h,v 1.13 2006/01/22 17:58:06 fox Exp $ *
********************************************************************************/
#ifndef FXMENURADIO_H
#define FXMENURADIO_H
#ifndef FXMENUCOMMAND_H
#include "FXMenuCommand.h"
#endif
namespace FX {
/**
* The menu radio widget is used to invoke a command in the
* application from a menu. Menu commands may reflect
* the state of the application by graying out, becoming hidden,
* or by a bullit.
* When activated, a menu radio sends a SEL_COMMAND to its target;
* the void* argument of the message contains the new state.
* A collection of menu radio widgets which belong to each other
* is supposed to be updated by a common SEL_UPDATE handler to
* properly maintain the state between them.
*/
class FXAPI FXMenuRadio : public FXMenuCommand {
FXDECLARE(FXMenuRadio)
protected:
FXuchar check; // State of menu
FXColor radioColor; // Color of the radio
protected:
FXMenuRadio();
private:
FXMenuRadio(const FXMenuRadio&);
FXMenuRadio &operator=(const FXMenuRadio&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onButtonPress(FXObject*,FXSelector,void*);
long onButtonRelease(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onHotKeyPress(FXObject*,FXSelector,void*);
long onHotKeyRelease(FXObject*,FXSelector,void*);
long onCheck(FXObject*,FXSelector,void*);
long onUncheck(FXObject*,FXSelector,void*);
long onUnknown(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetIntValue(FXObject*,FXSelector,void*);
long onCmdGetIntValue(FXObject*,FXSelector,void*);
long onCmdAccel(FXObject*,FXSelector,void*);
public:
/// Construct a menu radio
FXMenuRadio(FXComposite* p,const FXString& text,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0);
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Set radio button state (TRUE, FALSE or MAYBE)
void setCheck(FXbool s=TRUE);
/// Get radio button state (TRUE, FALSE or MAYBE)
FXbool getCheck() const { return check; }
/// Get the radio background color
FXColor getRadioColor() const { return radioColor; }
/// Set the radio background color
void setRadioColor(FXColor clr);
/// Save menu to a stream
virtual void save(FXStream& store) const;
/// Load menu from a stream
virtual void load(FXStream& store);
};
}
#endif
fox-1.6.49/include/FXTabBar.h 0000664 0001750 0001750 00000012350 12130340076 012514 0000000 0000000 /********************************************************************************
* *
* T a b B a r W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXTabBar.h,v 1.15 2006/01/22 17:58:10 fox Exp $ *
********************************************************************************/
#ifndef FXTABBAR_H
#define FXTABBAR_H
#ifndef FXPACKER_H
#include "FXPacker.h"
#endif
namespace FX {
/// Tab Book options
enum {
TABBOOK_TOPTABS = 0, /// Tabs on top (default)
TABBOOK_BOTTOMTABS = 0x00020000, /// Tabs on bottom
TABBOOK_SIDEWAYS = 0x00040000, /// Tabs on left
TABBOOK_LEFTTABS = TABBOOK_SIDEWAYS|TABBOOK_TOPTABS, /// Tabs on left
TABBOOK_RIGHTTABS = TABBOOK_SIDEWAYS|TABBOOK_BOTTOMTABS, /// Tabs on right
TABBOOK_NORMAL = TABBOOK_TOPTABS /// Normal tabs
};
/**
* The tab bar layout manager arranges tab items side by side,
* and raises the active tab item above the neighboring tab items.
* In a the horizontal arrangement, the tab bar can have the tab
* items on the top or on the bottom. In the vertical arrangement,
* the tabs can be on the left or on the right.
* When one of the tab items is pressed, the tab bar's setCurrent()
* is called with notify=TRUE. Thus causes the tab bar to send a
* SEL_COMMAND message to its target.
*/
class FXAPI FXTabBar : public FXPacker {
FXDECLARE(FXTabBar)
protected:
FXint current; // Current tab index
FXint shift; // Shift amount
protected:
FXTabBar(){}
private:
FXTabBar(const FXTabBar&);
FXTabBar& operator=(const FXTabBar&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onFocusNext(FXObject*,FXSelector,void*);
long onFocusPrev(FXObject*,FXSelector,void*);
long onFocusUp(FXObject*,FXSelector,void*);
long onFocusDown(FXObject*,FXSelector,void*);
long onFocusLeft(FXObject*,FXSelector,void*);
long onFocusRight(FXObject*,FXSelector,void*);
long onCmdOpenItem(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetIntValue(FXObject*,FXSelector,void*);
long onCmdGetIntValue(FXObject*,FXSelector,void*);
long onCmdOpen(FXObject*,FXSelector,void*);
long onUpdOpen(FXObject*,FXSelector,void*);
public:
enum {
ID_OPEN_ITEM=FXPacker::ID_LAST, /// Sent from one of the FXTabItems
ID_OPEN_FIRST, /// Switch to panel ID_OPEN_FIRST+i
ID_OPEN_SECOND,
ID_OPEN_THIRD,
ID_OPEN_FOURTH,
ID_OPEN_FIFTH,
ID_OPEN_SIXTH,
ID_OPEN_SEVENTH,
ID_OPEN_EIGHTH,
ID_OPEN_NINETH,
ID_OPEN_TENTH,
ID_OPEN_LAST=ID_OPEN_FIRST+100,
ID_LAST
};
public:
/// Construct a tab bar
FXTabBar(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=TABBOOK_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_SPACING,FXint pr=DEFAULT_SPACING,FXint pt=DEFAULT_SPACING,FXint pb=DEFAULT_SPACING);
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Perform layout
virtual void layout();
/**
* Change currently active tab item; this raises the active tab item
* slightly above the neighboring tab items. If notify=TRUE then the
* tab bar will also send a SEL_COMMAND message to its target.
*/
virtual void setCurrent(FXint panel,FXbool notify=FALSE);
/// Return the currently active tab item
FXint getCurrent() const { return current; }
/// Return tab bar style
FXuint getTabStyle() const;
/// Change tab tab style
void setTabStyle(FXuint style);
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
};
}
#endif
fox-1.6.49/include/FXThread.h 0000664 0001750 0001750 00000020502 12130340076 012566 0000000 0000000 /********************************************************************************
* *
* M u l i t h r e a d i n g S u p p o r t *
* *
*********************************************************************************
* Copyright (C) 2004,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXThread.h,v 1.40.2.2 2006/07/26 15:25:53 fox Exp $ *
********************************************************************************/
#ifndef FXTHREAD_H
#define FXTHREAD_H
namespace FX {
// Thread ID type
#ifndef WIN32
typedef unsigned long FXThreadID;
#else
typedef void* FXThreadID;
#endif
class FXCondition;
/**
* FXMutex provides a mutex which can be used to enforce critical
* sections around updates of data shared by multiple threads.
*/
class FXAPI FXMutex {
friend class FXCondition;
private:
FXuval data[24];
private:
FXMutex(const FXMutex&);
FXMutex &operator=(const FXMutex&);
public:
/// Initialize the mutex
FXMutex(FXbool recursive=FALSE);
/// Lock the mutex
void lock();
/// Return TRUE if succeeded locking the mutex
FXbool trylock();
/// Return TRUE if mutex is already locked
FXbool locked();
/// Unlock mutex
void unlock();
/// Delete the mutex
~FXMutex();
};
/**
* An easy way to establish a correspondence between a C++ scope
* and a critical section is to simply declare an FXMutexLock
* at the beginning of the scope.
* The mutex will be automatically released when the scope is
* left (either by natural means or by means of an exception.
*/
class FXAPI FXMutexLock {
private:
FXMutex& mtx;
private:
FXMutexLock();
FXMutexLock(const FXMutexLock&);
FXMutexLock& operator=(const FXMutexLock&);
public:
/// Construct & lock associated mutex
FXMutexLock(FXMutex& m):mtx(m){ lock(); }
/// Return reference to associated mutex
FXMutex& mutex(){ return mtx; }
/// Lock mutex
void lock(){ mtx.lock(); }
/// Return TRUE if succeeded locking the mutex
FXbool trylock(){ return mtx.trylock(); }
/// Return TRUE if mutex is already locked
FXbool locked(){ return mtx.locked(); }
/// Unlock mutex
void unlock(){ mtx.unlock(); }
/// Destroy and unlock associated mutex
~FXMutexLock(){ unlock(); }
};
/**
* A condition allows one or more threads to synchronize
* to an event. When a thread calls wait, the associated
* mutex is unlocked while the thread is blocked. When the
* condition becomes signaled, the associated mutex is
* locked and the thread(s) are reawakened.
*/
class FXAPI FXCondition {
private:
FXuval data[12];
private:
FXCondition(const FXCondition&);
FXCondition& operator=(const FXCondition&);
public:
/// Initialize the condition
FXCondition();
/**
* Wait until condition becomes signalled, using given mutex,
* which must already have been locked prior to this call.
*/
void wait(FXMutex& mtx);
/**
* Wait until condition becomes signalled, using given mutex,
* which must already have been locked prior to this call.
* Returns TRUE if successful, FALSE if timeout occurred.
* Note that the wait-time is specified in nanoseconds
* since the Epoch (Jan 1, 1970).
*/
FXbool wait(FXMutex& mtx,FXlong nsec);
/**
* Wake or unblock a single blocked thread
*/
void signal();
/**
* Wake or unblock all blocked threads
*/
void broadcast();
/// Delete the condition
~FXCondition();
};
/**
* A semaphore allows for protection of a resource that can
* be accessed by a fixed number of simultaneous threads.
*/
class FXAPI FXSemaphore {
private:
FXuval data[16];
private:
FXSemaphore(const FXSemaphore&);
FXSemaphore& operator=(const FXSemaphore&);
public:
/// Initialize semaphore with given count
FXSemaphore(FXint initial=1);
/// Decrement semaphore
void wait();
/// Non-blocking semaphore decrement; return true if locked
FXbool trywait();
/// Increment semaphore
void post();
/// Delete semaphore
~FXSemaphore();
};
/**
* FXThread provides system-independent support for threads.
* Subclasses must implement the run() function do implement
* the desired functionality of the thread.
* The storage of the FXThread object is to be managed by the
* calling thread, not by the thread itself.
*/
class FXAPI FXThread {
private:
volatile FXThreadID tid;
private:
FXThread(const FXThread&);
FXThread &operator=(const FXThread&);
#ifdef WIN32
static unsigned int CALLBACK execute(void*);
#else
static void* execute(void*);
#endif
protected:
/**
* All threads execute by deriving the run method of FXThread.
* If an uncaught exception was thrown, this function returns -1.
*/
virtual FXint run() = 0;
public:
/// Initialize thread object.
FXThread();
/**
* Return handle of this thread object.
* This handle is valid in the context of the thread which
* called start().
*/
FXThreadID id() const;
/**
* Return TRUE if this thread is running.
*/
FXbool running() const;
/**
* Start thread; the thread is started as attached.
* The thread is given stacksize for its stack; a value of
* zero for stacksize will give it the default stack size.
*/
FXbool start(unsigned long stacksize=0);
/**
* Suspend calling thread until thread is done.
*/
FXbool join();
/**
* Suspend calling thread until thread is done, and set code to the
* return value of run() or the argument passed into exit().
* If an exception happened in the thread, return -1.
*/
FXbool join(FXint& code);
/**
* Cancel the thread, stopping it immediately, running or not.
* If the calling thread is this thread, nothing happens.
* It is probably better to wait until it is finished, in case the
* thread currently holds mutexes.
*/
FXbool cancel();
/**
* Detach thread, so that a no join() is necessary to harvest the
* resources of this thread.
*/
FXbool detach();
/**
* Exit the calling thread.
* No destructors are invoked for objects on thread's stack;
* to invoke destructors, throw an exception instead.
*/
static void exit(FXint code=0);
/**
* Make the thread yield its time quantum.
*/
static void yield();
/**
* Return time in nanoseconds since Epoch (Jan 1, 1970).
*/
static FXlong time();
/**
* Make the calling thread sleep for a number of nanoseconds.
*/
static void sleep(FXlong nsec);
/**
* Wake at appointed time specified in nanoseconds since Epoch.
*/
static void wakeat(FXlong nsec);
/**
* Return pointer to the FXThread instance associated
* with the calling thread; it returns NULL for the main
* thread and all threads not created by FOX.
*/
static FXThread* self();
/**
* Return thread id of calling thread.
*/
static FXThreadID current();
/**
* Set thread priority.
*/
void priority(FXint prio);
/**
* Return thread priority.
*/
FXint priority();
/**
* Destroy the thread immediately, running or not.
* It is probably better to wait until it is finished, in case
* the thread currently holds mutexes.
*/
virtual ~FXThread();
};
}
#endif
fox-1.6.49/include/FXColorList.h 0000664 0001750 0001750 00000010257 12130340076 013277 0000000 0000000 /********************************************************************************
* *
* C o l o r L i s t W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2005,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXColorList.h,v 1.4.2.1 2006/07/27 02:18:50 fox Exp $ *
********************************************************************************/
#ifndef FXCOLORLIST_H
#define FXCOLORLIST_H
#ifndef FXLIST_H
#include "FXList.h"
#endif
namespace FX {
/// Color item
class FXAPI FXColorItem : public FXListItem {
FXDECLARE(FXColorItem)
protected:
FXColor color;
private:
FXColorItem(const FXColorItem&);
FXColorItem& operator=(const FXColorItem&);
protected:
FXColorItem():color(0){}
virtual void draw(const FXList* list,FXDC& dc,FXint x,FXint y,FXint w,FXint h);
virtual FXint hitItem(const FXList* list,FXint x,FXint y) const;
public:
/// Construct new item with given text, color, and user-data
FXColorItem(const FXString& text,FXColor clr,void* ptr=NULL):FXListItem(text,NULL,ptr),color(clr){}
/// Change item's color
void setColor(FXColor clr){ color=clr; }
/// Return item's color
FXColor getColor() const { return color; }
/// Return width of item as drawn in list
virtual FXint getWidth(const FXList* list) const;
/// Return height of item as drawn in list
virtual FXint getHeight(const FXList* list) const;
};
/**
* A ColorList Widget displays a list of colors.
*/
class FXAPI FXColorList : public FXList {
FXDECLARE(FXColorList)
protected:
FXColorList(){}
virtual FXListItem *createItem(const FXString& text,FXIcon* icon,void* ptr);
private:
FXColorList(const FXColorList&);
FXColorList &operator=(const FXColorList&);
public:
/// Construct a list with initially no items in it
FXColorList(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=LIST_BROWSESELECT,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Fill list by appending color items from array of strings and array of colors
FXint fillItems(const FXchar** strings,FXColor *colors=NULL,void* ptr=NULL,FXbool notify=FALSE);
/// Insert item at index with given text, color, and user-data pointer
FXint insertItem(FXint index,const FXString& text,FXColor color=0,void* ptr=NULL,FXbool notify=FALSE);
/// Append new item with given text, color, and user-data pointer
FXint appendItem(const FXString& text,FXColor color=0,void* ptr=NULL,FXbool notify=FALSE);
/// Prepend new item with given text, color, and user-data pointer
FXint prependItem(const FXString& text,FXColor color=0,void* ptr=NULL,FXbool notify=FALSE);
/// Change item color
void setItemColor(FXint index,FXColor color);
/// Return item color
FXColor getItemColor(FXint index) const;
};
}
#endif
fox-1.6.49/include/FXGIFIcon.h 0000664 0001750 0001750 00000006535 12130340076 012607 0000000 0000000 /********************************************************************************
* *
* G I F I c o n O b j e c t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXGIFIcon.h,v 1.24 2006/01/22 17:58:02 fox Exp $ *
********************************************************************************/
#ifndef FXGIFICON_H
#define FXGIFICON_H
#ifndef FXICON_H
#include "FXIcon.h"
#endif
namespace FX {
/// GIF Icon class
class FXAPI FXGIFIcon : public FXIcon {
FXDECLARE(FXGIFIcon)
protected:
FXGIFIcon(){}
private:
FXGIFIcon(const FXGIFIcon&);
FXGIFIcon &operator=(const FXGIFIcon&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct an icon from memory stream formatted as GIF format
FXGIFIcon(FXApp* a,const void *pix=NULL,FXColor clr=FXRGB(192,192,192),FXuint opts=0,FXint w=1,FXint h=1);
/// Save pixels into stream in GIF format
virtual bool savePixels(FXStream& store) const;
/// Load pixels from stream in GIF format
virtual bool loadPixels(FXStream& store);
/// Destroy
virtual ~FXGIFIcon();
};
#ifndef FXLOADGIF
#define FXLOADGIF
/**
* Check if stream contains a GIF, return TRUE if so.
*/
extern FXAPI bool fxcheckGIF(FXStream& store);
/**
* Load an GIF (Graphics Interchange Format) file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadGIF(FXStream& store,FXColor*& data,FXint& width,FXint& height);
/**
* Save an GIF (Graphics Interchange Format) file to a stream. The flag
* "fast" is used to select the faster Floyd-Steinberg dither method instead
* of the slower Wu quantization algorithm.
*/
extern FXAPI bool fxsaveGIF(FXStream& store,const FXColor *data,FXint width,FXint height,bool fast=true);
#endif
}
#endif
fox-1.6.49/include/FXTreeListBox.h 0000664 0001750 0001750 00000022745 12130340076 013576 0000000 0000000 /********************************************************************************
* *
* T r e e L i s t B o x W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1999,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXTreeListBox.h,v 1.41 2006/01/22 17:58:11 fox Exp $ *
********************************************************************************/
#ifndef FXTREELISTBOX_H
#define FXTREELISTBOX_H
#ifndef FXPACKER_H
#include "FXPacker.h"
#endif
namespace FX {
/// Tree List Box styles
enum {
TREELISTBOX_NORMAL = 0 /// Normal style
};
class FXButton;
class FXMenuButton;
class FXTreeList;
class FXPopup;
/**
* The Tree List Box behaves very much like a List Box, except that
* it supports a hierarchical, tree structured display of the items.
* When an item is selected it issues a SEL_COMMAND message with the
* pointer to the item. While manipulating the tree list, it may send
* SEL_CHANGED messages to indicate which item the cursor is hovering over.
*/
class FXAPI FXTreeListBox : public FXPacker {
FXDECLARE(FXTreeListBox)
protected:
FXButton *field;
FXMenuButton *button;
FXTreeList *tree;
FXPopup *pane;
protected:
FXTreeListBox(){}
private:
FXTreeListBox(const FXTreeListBox&);
FXTreeListBox& operator=(const FXTreeListBox&);
public:
long onFocusUp(FXObject*,FXSelector,void*);
long onFocusDown(FXObject*,FXSelector,void*);
long onFocusSelf(FXObject*,FXSelector,void*);
long onMouseWheel(FXObject*,FXSelector,void*);
long onFieldButton(FXObject*,FXSelector,void*);
long onTreeUpdate(FXObject*,FXSelector,void*);
long onTreeChanged(FXObject*,FXSelector,void*);
long onTreeClicked(FXObject*,FXSelector,void*);
public:
enum{
ID_TREE=FXPacker::ID_LAST,
ID_FIELD,
ID_LAST
};
public:
/// Construct tree list box
FXTreeListBox(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=FRAME_SUNKEN|FRAME_THICK|TREELISTBOX_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Destroy server-side resources
virtual void destroy();
/// Perform layout
virtual void layout();
/// Enable widget
virtual void enable();
/// Disable widget
virtual void disable();
/// Return default with
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Return number of items
FXint getNumItems() const;
/// Return number of visible items
FXint getNumVisible() const;
/// Set number of visible items to determine default height
void setNumVisible(FXint nvis);
/// Return first top-level item
FXTreeItem* getFirstItem() const;
/// Return last top-level item
FXTreeItem* getLastItem() const;
/// Fill tree list box by appending items from array of strings
FXint fillItems(FXTreeItem* father,const FXchar** strings,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL);
/// Fill tree list box by appending items from newline separated strings
FXint fillItems(FXTreeItem* father,const FXString& strings,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL);
/// Insert [possibly subclassed] item under father before other item
FXTreeItem* insertItem(FXTreeItem* other,FXTreeItem* father,FXTreeItem* item);
/// Insert item with given text and optional icons, and user-data pointer under father before other item
FXTreeItem* insertItem(FXTreeItem* other,FXTreeItem* father,const FXString& text,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL);
/// Append [possibly subclassed] item as last child of father
FXTreeItem* appendItem(FXTreeItem* father,FXTreeItem* item);
/// Append item with given text and optional icons, and user-data pointer as last child of father
FXTreeItem* appendItem(FXTreeItem* father,const FXString& text,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL);
/// Prepend [possibly subclassed] item as first child of father
FXTreeItem* prependItem(FXTreeItem* father,FXTreeItem* item);
/// Prepend item with given text and optional icons, and user-data pointer as first child of father
FXTreeItem* prependItem(FXTreeItem* father,const FXString& text,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL);
/// Move item under father before other item
FXTreeItem *moveItem(FXTreeItem* other,FXTreeItem* father,FXTreeItem* item);
/// Extract item
FXTreeItem* extractItem(FXTreeItem* item);
/// Remove item
void removeItem(FXTreeItem* item);
/// Remove all items in range [fm...to]
void removeItems(FXTreeItem* fm,FXTreeItem* to);
/// Remove all items from list
void clearItems();
/**
* Search items by name, beginning from item start. If the
* start item is NULL the search will start at the first, top-most item
* in the list. Flags may be SEARCH_FORWARD or SEARCH_BACKWARD to control
* the search direction; this can be combined with SEARCH_NOWRAP or SEARCH_WRAP
* to control whether the search wraps at the start or end of the list.
* The option SEARCH_IGNORECASE causes a case-insensitive match. Finally,
* passing SEARCH_PREFIX causes searching for a prefix of the item name.
* Return NULL if no matching item is found.
*/
FXTreeItem* findItem(const FXString& text,FXTreeItem* start=NULL,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const;
/**
* Search items by associated user data, beginning from item start. If the
* start item is NULL the search will start at the first, top-most item
* in the list. Flags may be SEARCH_FORWARD or SEARCH_BACKWARD to control
* the search direction; this can be combined with SEARCH_NOWRAP or SEARCH_WRAP
* to control whether the search wraps at the start or end of the list.
*/
FXTreeItem* findItemByData(const void *ptr,FXTreeItem* start=NULL,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const;
/// Return TRUE if item is the current item
FXbool isItemCurrent(const FXTreeItem* item) const;
/// Return TRUE if item is leaf-item, i.e. has no children
FXbool isItemLeaf(const FXTreeItem* item) const;
/// Sort the toplevel items with the sort function
void sortRootItems();
/// Sort all items recursively
void sortItems();
/// Sort child items of item
void sortChildItems(FXTreeItem* item);
/// Change current item
virtual void setCurrentItem(FXTreeItem* item,FXbool notify=FALSE);
/// Return current item
FXTreeItem* getCurrentItem() const;
/// Change item label
void setItemText(FXTreeItem* item,const FXString& text);
/// Return item label
FXString getItemText(const FXTreeItem* item) const;
/// Change item's open icon, delete old one if it was owned
void setItemOpenIcon(FXTreeItem* item,FXIcon* icon,FXbool owned=FALSE);
/// Return item's open icon
FXIcon* getItemOpenIcon(const FXTreeItem* item) const;
/// Change item's closed icon, delete old one if it was owned
void setItemClosedIcon(FXTreeItem* item,FXIcon* icon,FXbool owned=FALSE);
/// Return item's closed icon
FXIcon* getItemClosedIcon(const FXTreeItem* item) const;
/// Change item's user data
void setItemData(FXTreeItem* item,void* ptr) const;
/// Return item's user data
void* getItemData(const FXTreeItem* item) const;
/// Return item sort function
FXTreeListSortFunc getSortFunc() const;
/// Change item sort function
void setSortFunc(FXTreeListSortFunc func);
/// Is the pane shown
FXbool isPaneShown() const;
/// Change font
void setFont(FXFont* fnt);
/// Return font
FXFont* getFont() const;
/// Return list style
FXuint getListStyle() const;
/// Change list style
void setListStyle(FXuint style);
/// Change help text
void setHelpText(const FXString& txt);
/// Return help text
const FXString& getHelpText() const;
/// Change tip text
void setTipText(const FXString& txt);
/// Return tip text
const FXString& getTipText() const;
/// Save object to a stream
virtual void save(FXStream& store) const;
/// Load object from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXTreeListBox();
};
}
#endif
fox-1.6.49/include/FXColorWheel.h 0000664 0001750 0001750 00000011752 12130340076 013431 0000000 0000000 /********************************************************************************
* *
* C o l o r W h e e l W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2001,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXColorWheel.h,v 1.31 2006/01/22 17:57:59 fox Exp $ *
********************************************************************************/
#ifndef FXCOLORWHEEL_H
#define FXCOLORWHEEL_H
#ifndef FXFRAME_H
#include "FXFrame.h"
#endif
namespace FX {
class FXImage;
/**
* A ColorWheel is a widget which controls the hue and saturation values of a
* color. It is most often used together with a Color Bar which controls the
* brighness.
*/
class FXAPI FXColorWheel : public FXFrame {
FXDECLARE(FXColorWheel)
protected:
FXImage *dial; // HSV dial image
FXfloat hsv[3]; // Hue, saturation, value
FXint dialx; // Dial x location
FXint dialy; // Dial Y location
FXint spotx; // Spot x location
FXint spoty; // Spot Y location
FXString tip; // Tooltip value
FXString help; // Help value
protected:
FXColorWheel();
void updatedial();
void movespot(FXint x,FXint y);
FXbool hstoxy(FXint& x,FXint& y,FXfloat h,FXfloat s) const;
FXbool xytohs(FXfloat& h,FXfloat& s,FXint x,FXint y) const;
private:
FXColorWheel(const FXColorWheel&);
FXColorWheel &operator=(const FXColorWheel&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onMouseWheel(FXObject*,FXSelector,void*);
long onCmdSetHelp(FXObject*,FXSelector,void*);
long onCmdGetHelp(FXObject*,FXSelector,void*);
long onCmdSetTip(FXObject*,FXSelector,void*);
long onCmdGetTip(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
public:
/// Construct color wheel with initial color clr
FXColorWheel(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=FRAME_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Perform layout
virtual void layout();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Change hue
void setHue(FXfloat h);
/// Return hue
FXfloat getHue() const { return hsv[0]; }
/// Change saturation
void setSat(FXfloat s);
/// Return saturation
FXfloat getSat() const { return hsv[1]; }
/// Change value
void setVal(FXfloat v);
/// Return value
FXfloat getVal() const { return hsv[2]; }
/// Set hue, saturation, value
void setHueSatVal(FXfloat h,FXfloat s,FXfloat v);
/// Set status line help text for this color well
void setHelpText(const FXString& text){ help=text; }
/// Get status line help text for this color well
const FXString& getHelpText() const { return help; }
/// Set tool tip message for this color well
void setTipText(const FXString& text){ tip=text; }
/// Get tool tip message for this color well
const FXString& getTipText() const { return tip; }
/// Save color well to a stream
virtual void save(FXStream& store) const;
/// Load color well from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXColorWheel();
};
}
#endif
fox-1.6.49/include/FXGLSphere.h 0000664 0001750 0001750 00000006247 12130340076 013042 0000000 0000000 /********************************************************************************
* *
* O p e n G L S p h e r e O b j e c t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXGLSphere.h,v 1.18 2006/01/22 17:58:03 fox Exp $ *
********************************************************************************/
#ifndef FXGLSPHERE_H
#define FXGLSPHERE_H
#ifndef FXGLSHAPE_H
#include "FXGLShape.h"
#endif
namespace FX {
/// OpenGL Sphere Object
class FXAPI FXGLSphere : public FXGLShape {
FXDECLARE(FXGLSphere)
public:
FXfloat radius; // Radius of sphere
FXint slices; // Longitudinal subdivision
FXint stacks; // Latitudinal subdivision
protected:
FXGLSphere();
virtual void drawshape(FXGLViewer* viewer);
public:
enum {
ID_LAST=FXGLShape::ID_LAST
};
public:
/// Construct with specified origin and radius
FXGLSphere(FXfloat x,FXfloat y,FXfloat z,FXfloat r=1.0f);
/// Construct with specified origin, radius and material
FXGLSphere(FXfloat x,FXfloat y,FXfloat z,FXfloat r,const FXMaterial& mtl);
/// Copy constructor
FXGLSphere(const FXGLSphere& orig);
/// Copy this object
virtual FXGLObject* copy();
/// Change radius
void setRadius(FXfloat r){ radius=r; }
FXfloat getRadius() const { return radius; }
/// Change slices
void setSlices(FXint s){ slices=s; }
FXint getSlices() const { return slices; }
/// Change stacks
void setStacks(FXint s){ stacks=s; }
FXint getStacks() const { return stacks; }
/// Save to a stream
virtual void save(FXStream& store) const;
/// Load from a stream
virtual void load(FXStream& store);
/// Destroy
virtual ~FXGLSphere();
};
}
#endif
fox-1.6.49/include/FXUTF8Codec.h 0000664 0001750 0001750 00000004604 12130340076 013050 0000000 0000000 /********************************************************************************
* *
* U T F - 8 T e x t C o d e c *
* *
*********************************************************************************
* Copyright (C) 2002,2006 by L.Johnson & J.van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXUTF8Codec.h,v 1.13 2006/01/22 17:58:12 fox Exp $ *
********************************************************************************/
#ifndef FXUTF8CODEC_H
#define FXUTF8CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// Codec for UTF-8
class FXAPI FXUTF8Codec : public FXTextCodec {
public:
FXUTF8Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual FXint mibEnum() const;
virtual const FXchar* const* aliases() const;
virtual ~FXUTF8Codec(){}
};
}
#endif
fox-1.6.49/include/FXInputDialog.h 0000664 0001750 0001750 00000013125 12130340076 013601 0000000 0000000 /********************************************************************************
* *
* I n p u t D i a l o g B o x *
* *
*********************************************************************************
* Copyright (C) 2000,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXInputDialog.h,v 1.17 2006/01/22 17:58:05 fox Exp $ *
********************************************************************************/
#ifndef FXINPUTDIALOG_H
#define FXINPUTDIALOG_H
#ifndef FXDIALOGBOX_H
#include "FXDialogBox.h"
#endif
namespace FX {
/// Input dialog options
enum {
INPUTDIALOG_STRING = 0, /// Ask for a string
INPUTDIALOG_INTEGER = 0x01000000, /// Ask for an integer number
INPUTDIALOG_REAL = 0x02000000, /// Ask for a real number
INPUTDIALOG_PASSWORD = 0x04000000 /// Do not reveal key-in
};
class FXTextField;
/**
* An Input Dialog is a simple dialog which is used
* to obtain a text string, integer, or real number from the user.
* A password mode allows the key-in to remain hidden.
*/
class FXAPI FXInputDialog : public FXDialogBox {
FXDECLARE(FXInputDialog)
protected:
FXTextField *input; // Text field widget
FXdouble limlo; // Lower limit
FXdouble limhi; // Upper limit
protected:
FXInputDialog(){}
private:
FXInputDialog(const FXInputDialog&);
FXInputDialog &operator=(const FXInputDialog&);
void initialize(const FXString& text,FXIcon* icon);
public:
long onCmdAccept(FXObject*,FXSelector,void*);
public:
/// Construct input dialog box with given caption, icon, and prompt text
FXInputDialog(FXWindow* owner,const FXString& caption,const FXString& label,FXIcon* icon=NULL,FXuint opts=INPUTDIALOG_STRING,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Construct free floating input dialog box with given caption, icon, and prompt text
FXInputDialog(FXApp* app,const FXString& caption,const FXString& label,FXIcon* icon=NULL,FXuint opts=INPUTDIALOG_STRING,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Get input string
FXString getText() const;
/// Set input string
void setText(const FXString& text);
/// Change number of visible columns of text
void setNumColumns(FXint num);
/// Return number of visible columns of text
FXint getNumColumns() const;
/// Change limits
void setLimits(FXdouble lo,FXdouble hi){ limlo=lo; limhi=hi; }
/// Return limits
void getLimits(FXdouble& lo,FXdouble& hi){ lo=limlo; hi=limhi; }
/// Run modal invocation of the dialog
virtual FXuint execute(FXuint placement=PLACEMENT_CURSOR);
/**
* Prompt for a string, start with the initial value.
* Return TRUE if the new value is accepted, and false otherwise.
*/
static FXbool getString(FXString& result,FXWindow* owner,const FXString& caption,const FXString& label,FXIcon* icon=NULL);
/**
* Prompt for a string, in free floating window.
*/
static FXbool getString(FXString& result,FXApp* app,const FXString& caption,const FXString& label,FXIcon* icon=NULL);
/**
* Prompt for an integer number, start with the given initial value.
* Return TRUE if the new value is accepted, and false otherwise.
* The input is constrained between lo and hi.
*/
static FXbool getInteger(FXint& result,FXWindow* owner,const FXString& caption,const FXString& label,FXIcon* icon=NULL,FXint lo=-2147483647,FXint hi=2147483647);
/**
* Prompt for a integer number, in free floating window.
*/
static FXbool getInteger(FXint& result,FXApp* app,const FXString& caption,const FXString& label,FXIcon* icon=NULL,FXint lo=-2147483647,FXint hi=2147483647);
/**
* Prompt for an real number, start with the given initial value.
* Return TRUE if the new value is accepted, and false otherwise.
* The input is constrained between lo and hi.
*/
static FXbool getReal(FXdouble& result,FXWindow* owner,const FXString& caption,const FXString& label,FXIcon* icon=NULL,FXdouble lo=-1.797693134862315e+308,FXdouble hi=1.797693134862315e+308);
/**
* Prompt for a real number, in free floating window.
*/
static FXbool getReal(FXdouble& result,FXApp* app,const FXString& caption,const FXString& label,FXIcon* icon=NULL,FXdouble lo=-1.797693134862315e+308,FXdouble hi=1.797693134862315e+308);
};
}
#endif
fox-1.6.49/include/FXDebugTarget.h 0000664 0001750 0001750 00000005046 12130340076 013562 0000000 0000000 /********************************************************************************
* *
* D e b u g T a r g e t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXDebugTarget.h,v 1.15 2006/01/22 17:58:00 fox Exp $ *
********************************************************************************/
#ifndef FXDEBUGTARGET_H
#define FXDEBUGTARGET_H
#ifndef FXOBJECT_H
#include "FXObject.h"
#endif
namespace FX {
/**
* A DebugTarget prints out every message it receives.
* To use it, simply make the DebugTarget a target of the widget
* whose messages you want to see,
*/
class FXAPI FXDebugTarget : public FXObject {
FXDECLARE(FXDebugTarget)
protected:
FXObject *lastsender;
FXSelector lastsel;
FXuint count;
public:
static const FXchar *const messageTypeName[];
private:
FXDebugTarget(const FXDebugTarget&);
FXDebugTarget &operator=(const FXDebugTarget&);
public:
long onMessage(FXObject*,FXSelector,void*);
public:
/// Construct a debug target
FXDebugTarget();
};
}
#endif
fox-1.6.49/include/FXShutter.h 0000664 0001750 0001750 00000013333 12130340076 013021 0000000 0000000 /********************************************************************************
* *
* S h u t t e r C o n t a i n e r W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Charles W. Warren. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXShutter.h,v 1.26 2006/01/22 17:58:09 fox Exp $ *
********************************************************************************/
#ifndef FXSHUTTER_H
#define FXSHUTTER_H
#ifndef FXVERTICALFRAME_H
#include "FXVerticalFrame.h"
#endif
namespace FX {
class FXShutter;
class FXButton;
class FXScrollWindow;
class FXShutterItem;
/**
* A Shutter Item is a panel which is embedded inside a Shutter Widget.
* It can contain other user interface widgets which can be added under
* the content widget. The content widget is itself embedded in a scroll
* window to allow unlimited room for all the contents.
*/
class FXAPI FXShutterItem : public FXVerticalFrame {
FXDECLARE(FXShutterItem)
friend class FXShutter;
protected:
FXButton *button;
FXScrollWindow *scrollWindow;
FXVerticalFrame *content;
protected:
FXShutterItem(){}
private:
FXShutterItem(const FXShutterItem&);
FXShutterItem &operator=(const FXShutterItem&);
public:
long onFocusUp(FXObject*,FXSelector,void*);
long onFocusDown(FXObject*,FXSelector,void*);
long onCmdButton(FXObject*,FXSelector,void*);
public:
enum{
ID_SHUTTERITEM_BUTTON=FXVerticalFrame::ID_LAST,
ID_LAST
};
public:
/// Constructor
FXShutterItem(FXShutter *p,const FXString& text=FXString::null,FXIcon* icon=NULL,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_SPACING,FXint pr=DEFAULT_SPACING,FXint pt=DEFAULT_SPACING,FXint pb=DEFAULT_SPACING,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING);
/// Return a pointer to the button for this item
FXButton* getButton() const { return button; }
/// Return a pointer to the contents for this item
FXVerticalFrame* getContent() const { return content; }
/// Set the status line help text for this item
void setHelpText(const FXString& text);
/// Get the status line help text for this item
FXString getHelpText() const;
/// Set the tool tip message for this item
void setTipText(const FXString& text);
/// Get the tool tip message for this item
FXString getTipText() const;
/// Destructor
virtual ~FXShutterItem();
};
/**
* The Shutter widget provides a set of foldable sub panels. Each subpanel
* consists of a Shutter Item which contains a button and some contents.
* A sub panel can be unfolded by pressing on that panel's button.
*/
class FXAPI FXShutter : public FXVerticalFrame {
FXDECLARE(FXShutter)
friend class FXShutterItem;
protected:
FXint current; // Item currently open
FXint closing; // Item closing down
FXint heightIncrement; // Height delta
FXint closingHeight; // Closing items current height
FXbool closingHadScrollbar; // Closing item had a scroll bar
protected:
FXShutter(){}
private:
FXShutter(const FXShutter&);
FXShutter &operator=(const FXShutter&);
public:
long onFocusUp(FXObject*,FXSelector,void*);
long onFocusDown(FXObject*,FXSelector,void*);
long onTimeout(FXObject*,FXSelector,void*);
long onOpenItem(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetIntValue(FXObject*,FXSelector,void*);
long onCmdGetIntValue(FXObject*,FXSelector,void*);
long onCmdOpen(FXObject*,FXSelector,void*);
long onUpdOpen(FXObject*,FXSelector,void*);
public:
enum{
ID_SHUTTER_TIMEOUT=FXVerticalFrame::ID_LAST,
ID_OPEN_SHUTTERITEM,
ID_OPEN_FIRST,
ID_OPEN_LAST=ID_OPEN_FIRST+1000,
ID_LAST
};
public:
/// Constructor
FXShutter(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_SPACING,FXint pr=DEFAULT_SPACING,FXint pt=DEFAULT_SPACING,FXint pb=DEFAULT_SPACING,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING);
/// Perform layout
virtual void layout();
/// Set the currently displayed item (panel = 0, 1, 2, ..., npanels-1)
virtual void setCurrent(FXint panel);
/// Return the index of the currently displayed item
FXint getCurrent() const { return current; }
/// Destructor
virtual ~FXShutter();
};
}
#endif
fox-1.6.49/include/FXGIFCursor.h 0000664 0001750 0001750 00000006522 12130340076 013170 0000000 0000000 /********************************************************************************
* *
* G I F C u r so r O b j e c t *
* *
*********************************************************************************
* Copyright (C) 2000,2006 by Daniel Gehriger. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXGIFCursor.h,v 1.22 2006/01/22 17:58:02 fox Exp $ *
********************************************************************************/
#ifndef FXGIFCURSOR_H
#define FXGIFCURSOR_H
#ifndef FXCURSOR_H
#include "FXCursor.h"
#endif
namespace FX {
/// GIF Cursor class
class FXAPI FXGIFCursor : public FXCursor {
FXDECLARE(FXGIFCursor)
protected:
FXGIFCursor(){}
private:
FXGIFCursor(const FXGIFCursor&);
FXGIFCursor &operator=(const FXGIFCursor&);
public:
static const FXchar fileExt[];
public:
/**
* Construct a cursor from memory stream in Compuserve GIF format.
* Hot spot may be specified using hx and hy parameters, since the GIF
* format does not specify a hot spot. The image must be smaller than
* 32x32 pixels.
*/
FXGIFCursor(FXApp* a,const void* pix,FXint hx=0,FXint hy=0);
/// Save pixel data only, in GIF format
virtual bool savePixels(FXStream& store) const;
/// Load pixel data only, in GIF format
virtual bool loadPixels(FXStream& store);
/// Destroy
virtual ~FXGIFCursor(){}
};
#ifndef FXLOADGIF
#define FXLOADGIF
/**
* Check if stream contains a GIF, return TRUE if so.
*/
extern FXAPI bool fxcheckGIF(FXStream& store);
/**
* Load an GIF (Graphics Interchange Format) file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadGIF(FXStream& store,FXColor*& data,FXint& width,FXint& height);
/**
* Save an GIF (Graphics Interchange Format) file to a stream.
*/
extern FXAPI bool fxsaveGIF(FXStream& store,const FXColor *data,FXint width,FXint height,bool fast=true);
#endif
}
#endif
fox-1.6.49/include/FXPPMImage.h 0000664 0001750 0001750 00000006263 12130340076 012766 0000000 0000000 /********************************************************************************
* *
* P P M I m a g e O b j e c t *
* *
*********************************************************************************
* Copyright (C) 2003,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXPPMImage.h,v 1.10 2006/01/22 17:58:07 fox Exp $ *
********************************************************************************/
#ifndef FXPPMIMAGE_H
#define FXPPMIMAGE_H
#ifndef FXIMAGE_H
#include "FXImage.h"
#endif
namespace FX {
/// Portable Pixmap Image
class FXAPI FXPPMImage : public FXImage {
FXDECLARE(FXPPMImage)
protected:
FXPPMImage(){}
private:
FXPPMImage(const FXPPMImage&);
FXPPMImage &operator=(const FXPPMImage&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct icon from memory stream formatted in Portable Pixmap format
FXPPMImage(FXApp* a,const void *pix=NULL,FXuint opts=0,FXint w=1,FXint h=1);
/// Save pixels into stream in Portable Pixmap format
virtual bool savePixels(FXStream& store) const;
/// Load pixels from stream in Portable Pixmap format
virtual bool loadPixels(FXStream& store);
/// Destroy icon
virtual ~FXPPMImage();
};
/**
* Check if stream contains a PPM, return TRUE if so.
*/
extern FXAPI bool fxcheckPPM(FXStream& store);
/**
* Load an PPM (Portable Pixmap Format) file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadPPM(FXStream& store,FXColor*& data,FXint& width,FXint& height);
/**
* Save an PPM (Portable Pixmap Format) file to a stream.
*/
extern FXAPI bool fxsavePPM(FXStream& store,const FXColor *data,FXint width,FXint height);
}
#endif
fox-1.6.49/include/FXVerticalFrame.h 0000664 0001750 0001750 00000005522 12130340076 014110 0000000 0000000 /********************************************************************************
* *
* V e r t i c a l C o n t a i n e r W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXVerticalFrame.h,v 1.15 2006/01/22 17:58:12 fox Exp $ *
********************************************************************************/
#ifndef FXVERTICALFRAME_H
#define FXVERTICALFRAME_H
#ifndef FXPACKER_H
#include "FXPacker.h"
#endif
namespace FX {
/**
* Vertical frame layout manager widget is used to automatically
* place child-windows vertically from top-to-bottom, or bottom-to-top,
* depending on the child window's layout hints.
*/
class FXAPI FXVerticalFrame : public FXPacker {
FXDECLARE(FXVerticalFrame)
protected:
FXVerticalFrame(){}
private:
FXVerticalFrame(const FXVerticalFrame&);
FXVerticalFrame& operator=(const FXVerticalFrame&);
public:
/// Construct a vertical frame layout manager
FXVerticalFrame(FXComposite *p,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_SPACING,FXint pr=DEFAULT_SPACING,FXint pt=DEFAULT_SPACING,FXint pb=DEFAULT_SPACING,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING);
/// Perform layout
virtual void layout();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
};
}
#endif
fox-1.6.49/include/FXComposite.h 0000664 0001750 0001750 00000006443 12130340076 013331 0000000 0000000 /********************************************************************************
* *
* C o m p o s i t e W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXComposite.h,v 1.24 2006/01/22 17:57:59 fox Exp $ *
********************************************************************************/
#ifndef FXCOMPOSITE_H
#define FXCOMPOSITE_H
#ifndef FXWINDOW_H
#include "FXWindow.h"
#endif
namespace FX {
/// Base composite
class FXAPI FXComposite : public FXWindow {
FXDECLARE(FXComposite)
protected:
FXComposite(){}
FXComposite(FXApp* a,FXVisual *vis);
FXComposite(FXApp* a,FXWindow* own,FXuint opts,FXint x,FXint y,FXint w,FXint h);
private:
FXComposite(const FXComposite&);
FXComposite &operator=(const FXComposite&);
public:
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onFocusNext(FXObject*,FXSelector,void*);
long onFocusPrev(FXObject*,FXSelector,void*);
long onCmdUpdate(FXObject*,FXSelector,void*);
public:
/// Constructor
FXComposite(FXComposite* p,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Destroy server-side resources
virtual void destroy();
/// Perform layout
virtual void layout();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Return the width of the widest child window
FXint maxChildWidth() const;
/// Return the height of the tallest child window
FXint maxChildHeight() const;
/// Overrides this virtual function to return TRUE
virtual bool isComposite() const;
/// Destructor
virtual ~FXComposite();
};
}
#endif
fox-1.6.49/include/FXCP855Codec.h 0000644 0001750 0001750 00000001077 11637250333 013074 0000000 0000000 #ifndef FXCP855CODEC_H
#define FXCP855CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// CP855 Codec
class FXAPI FXCP855Codec : public FXTextCodec {
FXDECLARE(FXCP855Codec)
public:
FXCP855Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FXCP855Codec(){}
};
}
#endif
fox-1.6.49/include/FXComboBox.h 0000664 0001750 0001750 00000024177 12130340076 013103 0000000 0000000 /********************************************************************************
* *
* C o m b o B o x W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXComboBox.h,v 1.46 2006/01/27 02:07:44 fox Exp $ *
********************************************************************************/
#ifndef FXCOMBOBOX_H
#define FXCOMBOBOX_H
#ifndef FXPACKER_H
#include "FXPacker.h"
#endif
namespace FX {
/// ComboBox styles
enum {
COMBOBOX_NO_REPLACE = 0, /// Leave the list the same
COMBOBOX_REPLACE = 0x00020000, /// Replace current item with typed text
COMBOBOX_INSERT_BEFORE = 0x00040000, /// Typed text inserted before current
COMBOBOX_INSERT_AFTER = 0x00060000, /// Typed text inserted after current
COMBOBOX_INSERT_FIRST = 0x00080000, /// Typed text inserted at begin of list
COMBOBOX_INSERT_LAST = 0x000A0000, /// Typed text inserted at end of list
COMBOBOX_STATIC = 0x00100000, /// Unchangable text box
COMBOBOX_NORMAL = 0 /// Can type text but list is not changed
};
class FXTextField;
class FXMenuButton;
class FXList;
class FXPopup;
/**
* A Combo Box provides a way to select a string from a list of strings.
* Unless COMBOBOX_STATIC is passed, it also allows the user to enter a new
* string into the text field, for example if the desired entry is not in the
* list of strings. Passing COMBOBOX_REPLACE, COMBOBOX_INSERT_BEFORE, COMBOBOX_INSERT_AFTER,
* COMBOBOX_INSERT_FIRST, or COMBOBOX_INSERT_LAST causes a newly entered text to replace the
* current one in the list, or be added before or after the current entry, or to be added at
* the beginning or end of the list.
* Combo Box is intended to enter text; if you need to enter a choice from a list of
* options, it is recommended that the List Box widget is used instead.
* When the text in the field is changed, a SEL_COMMAND will be send to the target.
* The Combo Box can also receive ID_GETSTRINGVALUE and ID_SETSTRINGVALUE and so
* on, which will behave similar to Text Field in that they will retrieve or update
* the value of the field.
*/
class FXAPI FXComboBox : public FXPacker {
FXDECLARE(FXComboBox)
protected:
FXTextField *field;
FXMenuButton *button;
FXList *list;
FXPopup *pane;
protected:
FXComboBox(){}
private:
FXComboBox(const FXComboBox&);
FXComboBox &operator=(const FXComboBox&);
public:
long onFocusUp(FXObject*,FXSelector,void*);
long onFocusDown(FXObject*,FXSelector,void*);
long onFocusSelf(FXObject*,FXSelector,void*);
long onMouseWheel(FXObject*,FXSelector,void*);
long onTextButton(FXObject*,FXSelector,void*);
long onTextChanged(FXObject*,FXSelector,void*);
long onTextCommand(FXObject*,FXSelector,void*);
long onListClicked(FXObject*,FXSelector,void*);
long onFwdToText(FXObject*,FXSelector,void*);
long onUpdFmText(FXObject*,FXSelector,void*);
public:
enum {
ID_LIST=FXPacker::ID_LAST,
ID_TEXT,
ID_LAST
};
public:
/// Construct a Combo Box widget with room to display cols columns of text
FXComboBox(FXComposite *p,FXint cols,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=COMBOBOX_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Destroy server-side resources
virtual void destroy();
/// Enable combo box
virtual void enable();
/// Disable combo box
virtual void disable();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Perform layout
virtual void layout();
/// Return true if combobox is editable
FXbool isEditable() const;
/// Set editable state
void setEditable(FXbool edit=TRUE);
/// Set the text
void setText(const FXString& text);
/// Get the text
FXString getText() const;
/// Set the number of columns
void setNumColumns(FXint cols);
/// Get the number of columns
FXint getNumColumns() const;
/// Change text justification mode; default is JUSTIFY_LEFT
void setJustify(FXuint mode);
/// Return text justification mode
FXuint getJustify() const;
/// Return the number of items in the list
FXint getNumItems() const;
/// Return the number of visible items
FXint getNumVisible() const;
/// Set the number of visible items in the drop down list
void setNumVisible(FXint nvis);
/// Return true if current item
FXbool isItemCurrent(FXint index) const;
/// Set the current item (index is zero-based)
void setCurrentItem(FXint index,FXbool notify=FALSE);
/// Get the current item's index
FXint getCurrentItem() const;
/// Return the item at the given index
FXString getItem(FXint index) const;
/// Replace the item at index
FXint setItem(FXint index,const FXString& text,void* ptr=NULL);
/// Fill combo box by appending items from array of strings
FXint fillItems(const FXchar** strings);
/// Fill combo box by appending items from newline separated strings
FXint fillItems(const FXString& strings);
/// Insert a new item at index
FXint insertItem(FXint index,const FXString& text,void* ptr=NULL);
/// Append an item to the list
FXint appendItem(const FXString& text,void* ptr=NULL);
/// Prepend an item to the list
FXint prependItem(const FXString& text,void* ptr=NULL);
/// Move item from oldindex to newindex
FXint moveItem(FXint newindex,FXint oldindex);
/// Remove this item from the list
void removeItem(FXint index);
/// Remove all items from the list
void clearItems();
/**
* Search items by name, beginning from item start. If the start item
* is -1 the search will start at the first item in the list. Flags
* may be SEARCH_FORWARD or SEARCH_BACKWARD to control the search
* direction; this can be combined with SEARCH_NOWRAP or SEARCH_WRAP
* to control whether the search wraps at the start or end of the list.
* The option SEARCH_IGNORECASE causes a case-insensitive match. Finally,
* passing SEARCH_PREFIX causes searching for a prefix of the item name.
* Return -1 if no matching item is found.
*/
FXint findItem(const FXString& text,FXint start=-1,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const;
/**
* Search items by associated user data, beginning from item start. If the
* start item is -1 the search will start at the first item in the list.
* Flags may be SEARCH_FORWARD or SEARCH_BACKWARD to control the
* search direction; this can be combined with SEARCH_NOWRAP or SEARCH_WRAP
* to control whether the search wraps at the start or end of the list.
*/
FXint findItemByData(const void *ptr,FXint start=-1,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const;
/// Set text for specified item
void setItemText(FXint index,const FXString& text);
/// Get text for specified item
FXString getItemText(FXint index) const;
/// Set data pointer for specified item
void setItemData(FXint index,void* ptr) const;
/// Get data pointer for specified item
void* getItemData(FXint index) const;
/// Is the pane shown
FXbool isPaneShown() const;
/// Sort items using current sort function
void sortItems();
/// Set text font
void setFont(FXFont* fnt);
/// Get text font
FXFont* getFont() const;
/// Set the combobox style.
void setComboStyle(FXuint mode);
/// Get the combobox style.
FXuint getComboStyle() const;
/// Set window background color
virtual void setBackColor(FXColor clr);
/// Get background color
FXColor getBackColor() const;
/// Change text color
void setTextColor(FXColor clr);
/// Return text color
FXColor getTextColor() const;
/// Change selected background color
void setSelBackColor(FXColor clr);
/// Return selected background color
FXColor getSelBackColor() const;
/// Change selected text color
void setSelTextColor(FXColor clr);
/// Return selected text color
FXColor getSelTextColor() const;
/// Return sort function
FXListSortFunc getSortFunc() const;
/// Change sort function
void setSortFunc(FXListSortFunc func);
/// Set the combobox help text
void setHelpText(const FXString& txt);
/// Get the combobox help text
const FXString& getHelpText() const;
/// Set the tool tip message for this combobox
void setTipText(const FXString& txt);
/// Get the tool tip message for this combobox
const FXString& getTipText() const;
/// Save combobox to a stream
virtual void save(FXStream& store) const;
/// Load combobox from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXComboBox();
};
}
#endif
fox-1.6.49/include/FXCURCursor.h 0000664 0001750 0001750 00000006444 12130340076 013217 0000000 0000000 /********************************************************************************
* *
* C U R C u r s o r O b j e c t *
* *
*********************************************************************************
* Copyright (C) 2001,2006 by Sander Jansen. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXCURCursor.h,v 1.18 2006/01/22 17:57:59 fox Exp $ *
********************************************************************************/
#ifndef FXCURCURSOR_H
#define FXCURCURSOR_H
#ifndef FXCURSOR_H
#include "FXCursor.h"
#endif
namespace FX {
/// CUR Cursor class
class FXAPI FXCURCursor : public FXCursor {
FXDECLARE(FXCURCursor)
protected:
FXCURCursor(){}
private:
FXCURCursor(const FXCURCursor&);
FXCURCursor &operator=(const FXCURCursor&);
public:
static const FXchar fileExt[];
public:
/**
* Construct a cursor from memory stream in Microsoft CUR format.
* The image is limited to 32x32 pixels.
*/
FXCURCursor(FXApp* a,const void* pix);
/// Save pixel data only, in CUR format
virtual bool savePixels(FXStream& store) const;
/// Load pixel data only, in CUR format
virtual bool loadPixels(FXStream& store);
/// Destructor
virtual ~FXCURCursor();
};
#ifndef FXLOADICO
#define FXLOADICO
/**
* Check if stream contains a ICO, return TRUE if so.
*/
extern FXAPI bool fxcheckICO(FXStream& store);
/**
* Load an ICO (Microsoft icon format) file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadICO(FXStream& store,FXColor*& data,FXint& width,FXint& height,FXint& xspot,FXint& yspot);
/**
* Save an ICO (Microsoft icon format) file to a stream.
* If no hot-spot given, save as an ICO instead of a CUR resource.
*/
extern FXAPI bool fxsaveICO(FXStream& store,const FXColor *data,FXint width,FXint height,FXint xspot=-1,FXint yspot=-1);
#endif
}
#endif
fox-1.6.49/include/FXTextCodec.h 0000664 0001750 0001750 00000013104 12130340076 013241 0000000 0000000 /********************************************************************************
* *
* U n i c o d e T e x t C o d e c *
* *
*********************************************************************************
* Copyright (C) 2002,2006 by L.Johnson & J.van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXTextCodec.h,v 1.30 2006/01/22 17:58:11 fox Exp $ *
********************************************************************************/
#ifndef FXTEXTCODEC_H
#define FXTEXTCODEC_H
#ifndef FXOBJECT_H
#include "FXObject.h"
#endif
namespace FX {
/**
* Abstract base class for a stateless coder/decoder.
*/
class FXAPI FXTextCodec : public FXObject {
FXDECLARE_ABSTRACT(FXTextCodec)
public:
/// Construct text codec
FXTextCodec(){}
/// Convert utf8 to single wide character
static FXint utf2wc(FXwchar& wc,const FXchar* src,FXint nsrc);
/// Convert utf16 to single wide character
static FXint utf2wc(FXwchar& wc,const FXnchar* src,FXint nsrc);
/// Convert utf32 to single wide character
static FXint utf2wc(FXwchar& wc,const FXwchar* src,FXint nsrc);
/// Convert single wide character to utf8
static FXint wc2utf(FXchar* dst,FXint ndst,FXwchar wc);
/// Convert single wide character to utf16
static FXint wc2utf(FXnchar* dst,FXint ndst,FXwchar wc);
/// Convert single wide character to utf32
static FXint wc2utf(FXwchar* dst,FXint ndst,FXwchar wc);
/// Count utf8 bytes needed to convert multi-byte characters from src
virtual FXint mb2utflen(const FXchar* src,FXint nsrc) const;
/// Count utf8 bytes needed to convert multi-byte characters from src
FXint mb2utflen(const FXString& src) const;
/// Convert multi-byte characters from src to utf8 characters at dst
virtual FXint mb2utf(FXchar* dst,FXint ndst,const FXchar* src,FXint nsrc) const;
/// Convert multi-byte characters from src to utf8 characters at dst
FXint mb2utf(FXchar* dst,FXint ndst,const FXchar* src) const;
/// Convert multi-byte characters from src to utf8 characters at dst
FXint mb2utf(FXchar* dst,FXint ndst,const FXString& src) const;
/// Convert multi-byte characters from src to utf8 string
FXString mb2utf(const FXchar* src,FXint nsrc) const;
/// Convert multi-byte characters from src to utf8 string
FXString mb2utf(const FXchar* src) const;
/// Convert multi-byte string to utf8 string
FXString mb2utf(const FXString& src) const;
/// Convert multi-byte characters from src to single wide character
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
/// Count multi-byte characters characters needed to convert utf8 from src
virtual FXint utf2mblen(const FXchar* src,FXint nsrc) const;
/// Count multi-byte characters characters needed to convert utf8 from src
virtual FXint utf2mblen(const FXString& src) const;
/// Convert utf8 characters at src to multi-byte characters at dst
virtual FXint utf2mb(FXchar* dst,FXint ndst,const FXchar* src,FXint nsrc) const;
/// Convert utf8 characters at src to multi-byte characters at dst
FXint utf2mb(FXchar* dst,FXint ndst,const FXchar* src) const;
/// Convert utf8 characters at src to multi-byte characters at dst
FXint utf2mb(FXchar* dst,FXint ndst,const FXString& src) const;
/// Convert utf8 characters at src to multi-byte string
FXString utf2mb(const FXchar* src,FXint nsrc) const;
/// Convert utf8 characters at src to multi-byte string
FXString utf2mb(const FXchar* src) const;
/// Convert utf8 string to multi-byte string
FXString utf2mb(const FXString& src) const;
/// Convert single wide character to multi-byte characters at dst
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
/**
* Return the Management Information Base (MIBenum) for the character set.
*/
virtual FXint mibEnum() const = 0;
/**
* Return name of the codec.
*/
virtual const FXchar* name() const = 0;
/**
* Return the IANA mime name for this codec; this is used for example
* as "text/utf-8" in drag and drop protocols.
*/
virtual const FXchar* mimeName() const = 0;
/**
* Return NULL-terminated list of aliases for this codec.
*/
virtual const FXchar* const* aliases() const = 0;
/// Destruct codec
virtual ~FXTextCodec(){}
};
}
#endif
fox-1.6.49/include/FXSystem.h 0000664 0001750 0001750 00000007557 12130340076 012662 0000000 0000000 /********************************************************************************
* *
* M i s c e l l a n e o u s S y s t e m F u n c t i o n s *
* *
*********************************************************************************
* Copyright (C) 2005,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXSystem.h,v 1.6 2006/01/22 17:58:10 fox Exp $ *
********************************************************************************/
#ifndef FXSYSTEM_H
#define FXSYSTEM_H
namespace FX {
namespace FXSystem {
/// Return current time
FXTime FXAPI now();
/// Convert time value to date-string
FXString FXAPI time(FXTime value);
/**
* Convert time value to date-string as per strftime.
* Format characters supported by most systems are:
*
* %a %A %b %B %c %d %H %I %j %m %M %p %S %U %w %W %x %X %y %Y %Z %%
*
* Some systems support additional conversions.
*/
FXString FXAPI time(const FXchar *format,FXTime value);
/// Get effective user id
FXuint FXAPI user();
/// Get effective group id
FXuint FXAPI group();
/// Return owner name from uid if available
FXString FXAPI userName(FXuint uid);
/// Return group name from gid if available
FXString FXAPI groupName(FXuint gid);
/// Get current effective user name
FXString FXAPI currentUserName();
/// Get current effective group name
FXString FXAPI currentGroupName();
/// Get permissions string
FXString FXAPI modeString(FXuint mode);
/// Return value of environment variable name
FXString FXAPI getEnvironment(const FXString& name);
/// Change value of environment variable name, return true if success
bool FXAPI setEnvironment(const FXString& name,const FXString& value);
/// Get the current working directory
FXString FXAPI getCurrentDirectory();
/// Set the current working directory
FXbool FXAPI setCurrentDirectory(const FXString& path);
/// Return the current drive (for Win32 systems)
FXString FXAPI getCurrentDrive();
/// Set the current drive (for Win32 systems)
FXbool FXAPI setCurrentDrive(const FXString& prefix);
/// Get executable path
FXString FXAPI getExecPath();
/// Return the home directory for the current user
FXString FXAPI getHomeDirectory();
/// Return the home directory for a given user
FXString FXAPI getUserDirectory(const FXString& user);
/// Return temporary directory
FXString FXAPI getTempDirectory();
/**
* Get DLL name for given base name; for example "png"
* becomes "libpng.so" on Linux, and "png.dll" on Windows.
*/
FXString FXAPI dllName(const FXString& name);
}
}
#endif
fox-1.6.49/include/FXPCXImage.h 0000664 0001750 0001750 00000006171 12130340076 012762 0000000 0000000 /********************************************************************************
* *
* P C X I m a g e O b j e c t *
* *
*********************************************************************************
* Copyright (C) 2001,2006 by Janusz Ganczarski. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXPCXImage.h,v 1.18 2006/01/22 17:58:06 fox Exp $ *
********************************************************************************/
#ifndef FXPCXIMAGE_H
#define FXPCXIMAGE_H
#ifndef FXIMAGE_H
#include "FXImage.h"
#endif
namespace FX {
/// PCX graphics file
class FXAPI FXPCXImage : public FXImage {
FXDECLARE(FXPCXImage)
protected:
FXPCXImage(){}
private:
FXPCXImage(const FXPCXImage&);
FXPCXImage &operator=(const FXPCXImage&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct image from memory stream formatted in PCX file
FXPCXImage(FXApp* a,const void *pix=NULL,FXuint opts=0,FXint w=1,FXint h=1);
/// Save pixels into stream in PCX file
virtual bool savePixels(FXStream& store) const;
/// Load pixels from stream in bitmap format
virtual bool loadPixels(FXStream& store);
/// Destroy icon
virtual ~FXPCXImage();
};
/**
* Check if stream contains a PCX, return TRUE if so.
*/
extern FXAPI bool fxcheckPCX(FXStream& store);
/**
* Load an PCX (PC Paintbrush) file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadPCX(FXStream& store,FXColor*& data,FXint& width,FXint& height);
/**
* Save an PCX (PC Paintbrush) file to a stream.
*/
extern FXAPI bool fxsavePCX(FXStream& store,const FXColor *data,FXint width,FXint height);
}
#endif
fox-1.6.49/include/FXCP1258Codec.h 0000644 0001750 0001750 00000001106 11637250333 013143 0000000 0000000 #ifndef FXCP1258CODEC_H
#define FXCP1258CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// CP1258 Codec
class FXAPI FXCP1258Codec : public FXTextCodec {
FXDECLARE(FXCP1258Codec)
public:
FXCP1258Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FXCP1258Codec(){}
};
}
#endif
fox-1.6.49/include/FXPicker.h 0000664 0001750 0001750 00000005315 12130340076 012601 0000000 0000000 /********************************************************************************
* *
* P i c k e r B u t t o n *
* *
*********************************************************************************
* Copyright (C) 2001,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXPicker.h,v 1.10 2006/01/22 17:58:07 fox Exp $ *
********************************************************************************/
#ifndef FXPICKER_H
#define FXPICKER_H
#ifndef FXBUTTON_H
#include "FXButton.h"
#endif
namespace FX {
/**
* A picker button allows you to identify an arbitrary
* location on the screen.
*/
class FXAPI FXPicker : public FXButton {
FXDECLARE(FXPicker)
protected:
FXPicker(){}
private:
FXPicker(const FXPicker&);
FXPicker& operator=(const FXPicker&);
public:
long onMotion(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onEnter(FXObject*,FXSelector,void*);
long onLeave(FXObject*,FXSelector,void*);
public:
FXPicker(FXComposite* p,const FXString& text,FXIcon* ic=NULL,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=BUTTON_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
};
}
#endif
fox-1.6.49/include/FXJPGIcon.h 0000664 0001750 0001750 00000006730 12130340076 012617 0000000 0000000 /********************************************************************************
* *
* J P E G I c o n O b j e c t *
* *
*********************************************************************************
* Copyright (C) 2000,2006 by David Tyree. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXJPGIcon.h,v 1.20 2006/01/24 13:53:11 fox Exp $ *
********************************************************************************/
#ifndef FXJPGICON_H
#define FXJPGICON_H
#ifndef FXICON_H
#include "FXIcon.h"
#endif
namespace FX {
/// JPEG Icon class
class FXAPI FXJPGIcon : public FXIcon {
FXDECLARE(FXJPGIcon)
protected:
FXint quality;
protected:
FXJPGIcon(){}
private:
FXJPGIcon(const FXJPGIcon&);
FXJPGIcon &operator=(const FXJPGIcon&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct an icon from memory stream formatted in JPEG format
FXJPGIcon(FXApp *a,const void *pix=NULL,FXColor clr=FXRGB(192,192,192),FXuint opts=0,FXint w=1,FXint h=1,FXint q=75);
/// True if format is supported
static const bool supported;
/// Set image quality to save with
void setQuality(FXint q){ quality=q; }
/// Get image quality setting
FXint getQuality() const { return quality; }
/// Save pixels into stream in JPEG format
virtual bool savePixels(FXStream& store) const;
/// Load pixels from stream in JPEG format
virtual bool loadPixels(FXStream& store);
/// Destroy
virtual ~FXJPGIcon();
};
/**
* Check if stream contains a JPG, return TRUE if so.
*/
extern FXAPI bool fxcheckJPG(FXStream& store);
/**
* Load an JPEG (Joint Photographics Experts Group) file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadJPG(FXStream& store,FXColor*& data,FXint& width,FXint& height,FXint& quality);
/**
* Save an JPEG (Joint Photographics Experts Group) file to a stream.
*/
extern FXAPI bool fxsaveJPG(FXStream& store,const FXColor* data,FXint width,FXint height,FXint quality);
}
#endif
fox-1.6.49/include/FXElement.h 0000664 0001750 0001750 00000022012 12130340076 012746 0000000 0000000 /********************************************************************************
* *
* Generic Element Handling *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXElement.h,v 1.19 2006/01/22 17:58:01 fox Exp $ *
********************************************************************************/
#ifndef FXELEMENT_H
#define FXELEMENT_H
namespace FX {
/**************************** D e f i n i t i o n ****************************/
// Generic implementations for generic objects
/// Construct some elements at a location
template
inline void constructElms(TYPE* ptr,unsigned long n){
while(n--){ ::new ((void*)ptr) TYPE; ptr++; }
}
/// Destruct some elements at a location
template
inline void destructElms(TYPE* ptr,unsigned long n){
while(n--){ ptr->~TYPE(); ptr++; }
}
/// Copy some elements from one place to another
template
inline void copyElms(TYPE* dst,const TYPE* src,unsigned long n){
while(n--){ *dst++ = *src++; }
}
/// Move some elements from overlapping place to another
template
inline void moveElms(TYPE* dst,const TYPE* src,unsigned long n){
if(src>dst){
while(n--){ *dst++ = *src++; }
}
else if(dst>src){
dst+=n;
src+=n;
while(n--){ *--dst = *--src; }
}
}
/// Fill array of elements with given element
template
inline void fillElms(TYPE* dst,const TYPE& src,unsigned long n){
while(n--){ *dst++ = src; }
}
/// Zero out array of elements
template
inline void clearElms(TYPE* dst,unsigned long n){
memset(dst,0,sizeof(TYPE)*n);
}
/// Save some elements to persistent store
template
inline void saveElms(FXStream& store,const TYPE* ptr,unsigned long n){
while(n--){ store << *ptr; ptr++; }
}
/// Load some elements from persistent store
template
inline void loadElms(FXStream& store,TYPE* ptr,unsigned long n){
while(n--){ store >> *ptr; ptr++; }
}
/// Allocate array of elements, uninitialized
template
inline FXint allocElms(TYPE*& ptr,unsigned long n){
return fxmalloc((void**)&ptr,sizeof(TYPE)*n);
}
/// Allocate array of elements, initialized with zero
template
inline FXint callocElms(TYPE*& ptr,unsigned long n){
return fxcalloc((void**)&ptr,sizeof(TYPE)*n);
}
/// Allocate array of elements, initialized with bit-wise copy of src array
template
inline FXint dupElms(TYPE*& ptr,const TYPE* src,unsigned long n){
return fxmemdup((void**)&ptr,src,sizeof(TYPE)*n);
}
/// Resize array of elements, without constructor or destructor
template
inline FXint resizeElms(TYPE*& ptr,unsigned long n){
return fxresize((void**)&ptr,sizeof(TYPE)*n);
}
/// Free array of elements, without destruction
template
inline void freeElms(TYPE*& ptr){
fxfree((void**)&ptr);
}
/********************** I m p l e m e n t a t i o n ************************/
// Specific implementations for built-in types
// No-op constructors for array of basic type
inline void constructElms(FXuchar*,unsigned long){ }
inline void constructElms(FXchar*,unsigned long){ }
inline void constructElms(FXushort*,unsigned long){ }
inline void constructElms(FXshort*,unsigned long){ }
inline void constructElms(FXuint*,unsigned long){ }
inline void constructElms(FXint*,unsigned long){ }
inline void constructElms(FXfloat*,unsigned long){ }
inline void constructElms(FXdouble*,unsigned long){ }
// No-op destructors for array of basic type
inline void destructElms(FXuchar*,unsigned long){ }
inline void destructElms(FXchar*,unsigned long){ }
inline void destructElms(FXushort*,unsigned long){ }
inline void destructElms(FXshort*,unsigned long){ }
inline void destructElms(FXuint*,unsigned long){ }
inline void destructElms(FXint*,unsigned long){ }
inline void destructElms(FXfloat*,unsigned long){ }
inline void destructElms(FXdouble*,unsigned long){ }
// Simple bit-wise copy for array of basic type
inline void copyElms(FXuchar* dst,const FXuchar* src,unsigned long n){ memcpy(dst,src,n); }
inline void copyElms(FXchar* dst,const FXchar* src,unsigned long n){ memcpy(dst,src,n); }
inline void copyElms(FXushort* dst,const FXushort* src,unsigned long n){ memcpy(dst,src,n<<1); }
inline void copyElms(FXshort* dst,const FXshort* src,unsigned long n){ memcpy(dst,src,n<<1); }
inline void copyElms(FXuint* dst,const FXuint* src,unsigned long n){ memcpy(dst,src,n<<2); }
inline void copyElms(FXint* dst,const FXint* src,unsigned long n){ memcpy(dst,src,n<<2); }
inline void copyElms(FXfloat* dst,const FXfloat* src,unsigned long n){ memcpy(dst,src,n<<2); }
inline void copyElms(FXdouble* dst,const FXdouble* src,unsigned long n){ memcpy(dst,src,n<<3); }
// Simple bit-wise copy for array of pointers to any type
template inline void copyElms(TYPE** dst,const TYPE** src,unsigned long n){ memcpy(dst,src,n*sizeof(void*)); }
// Simple bit-wise move for array of basic type
inline void moveElms(FXuchar* dst,const FXuchar* src,unsigned long n){ memmove(dst,src,n); }
inline void moveElms(FXchar* dst,const FXchar* src,unsigned long n){ memmove(dst,src,n); }
inline void moveElms(FXushort* dst,const FXushort* src,unsigned long n){ memmove(dst,src,n<<1); }
inline void moveElms(FXshort* dst,const FXshort* src,unsigned long n){ memmove(dst,src,n<<1); }
inline void moveElms(FXuint* dst,const FXuint* src,unsigned long n){ memmove(dst,src,n<<2); }
inline void moveElms(FXint* dst,const FXint* src,unsigned long n){ memmove(dst,src,n<<2); }
inline void moveElms(FXfloat* dst,const FXfloat* src,unsigned long n){ memmove(dst,src,n<<2); }
inline void moveElms(FXdouble* dst,const FXdouble* src,unsigned long n){ memmove(dst,src,n<<3); }
// Simple bit-wise move for array of pointers to any type
template inline void moveElms(TYPE** dst,const TYPE** src,unsigned long n){ memmove(dst,src,n*sizeof(void*)); }
// Fill byte arrays with constant
inline void fillElms(FXuchar* dst,const FXuchar& src,unsigned long n){ memset(dst,src,n); }
inline void fillElms(FXchar* dst,const FXchar& src,unsigned long n){ memset(dst,src,n); }
// Type-safe save for basic types
inline void saveElms(FXStream& store,const FXuchar* ptr,unsigned long n){ store.save(ptr,n); }
inline void saveElms(FXStream& store,const FXchar* ptr,unsigned long n){ store.save(ptr,n); }
inline void saveElms(FXStream& store,const FXushort* ptr,unsigned long n){ store.save(ptr,n); }
inline void saveElms(FXStream& store,const FXshort* ptr,unsigned long n){ store.save(ptr,n); }
inline void saveElms(FXStream& store,const FXuint* ptr,unsigned long n){ store.save(ptr,n); }
inline void saveElms(FXStream& store,const FXint* ptr,unsigned long n){ store.save(ptr,n); }
inline void saveElms(FXStream& store,const FXfloat* ptr,unsigned long n){ store.save(ptr,n); }
inline void saveElms(FXStream& store,const FXdouble* ptr,unsigned long n){ store.save(ptr,n); }
// Type-safe load for basic types
inline void loadElms(FXStream& store,FXuchar* ptr,unsigned long n){ store.load(ptr,n); }
inline void loadElms(FXStream& store,FXchar* ptr,unsigned long n){ store.load(ptr,n); }
inline void loadElms(FXStream& store,FXushort* ptr,unsigned long n){ store.load(ptr,n); }
inline void loadElms(FXStream& store,FXshort* ptr,unsigned long n){ store.load(ptr,n); }
inline void loadElms(FXStream& store,FXuint* ptr,unsigned long n){ store.load(ptr,n); }
inline void loadElms(FXStream& store,FXint* ptr,unsigned long n){ store.load(ptr,n); }
inline void loadElms(FXStream& store,FXfloat* ptr,unsigned long n){ store.load(ptr,n); }
inline void loadElms(FXStream& store,FXdouble* ptr,unsigned long n){ store.load(ptr,n); }
}
#endif
fox-1.6.49/include/FXToolTip.h 0000664 0001750 0001750 00000010443 12130340076 012754 0000000 0000000 /********************************************************************************
* *
* T o o l T i p W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXToolTip.h,v 1.13 2006/01/22 17:58:11 fox Exp $ *
********************************************************************************/
#ifndef FXTOOLTIP_H
#define FXTOOLTIP_H
#ifndef FXSHELL_H
#include "FXShell.h"
#endif
namespace FX {
class FXFont;
/// Tooltip styles
enum {
TOOLTIP_PERMANENT = 0x00020000, /// Tooltip stays up indefinitely
TOOLTIP_VARIABLE = 0x00040000, /// Tooltip stays up variable time, depending on the length of the string
TOOLTIP_NORMAL = 0 /// Normal tooltip
};
/// Hopefully Helpful Hint message
class FXAPI FXToolTip : public FXShell {
FXDECLARE(FXToolTip)
protected:
FXString label; // Text in the tip
FXFont *font; // Font of the tip
FXColor textColor; // Text color
FXbool popped; // Is currently popped up
protected:
FXToolTip();
virtual bool doesOverrideRedirect() const;
void place(FXint x,FXint y);
void autoplace();
private:
FXToolTip(const FXToolTip&);
FXToolTip& operator=(const FXToolTip&);
#ifdef WIN32
virtual const char* GetClass() const;
#endif
public:
long onPaint(FXObject*,FXSelector,void*);
long onUpdate(FXObject*,FXSelector,void*);
long onTipShow(FXObject*,FXSelector,void*);
long onTipHide(FXObject*,FXSelector,void*);
long onCmdGetStringValue(FXObject*,FXSelector,void*);
long onCmdSetStringValue(FXObject*,FXSelector,void*);
public:
enum {
ID_TIP_SHOW=FXShell::ID_LAST,
ID_TIP_HIDE,
ID_LAST
};
public:
/// Construct a tool tip
FXToolTip(FXApp* a,FXuint opts=TOOLTIP_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Display the tip
virtual void show();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Set the text for this tip
void setText(const FXString& text);
/// Get the text for this tip
FXString getText() const { return label; }
/// Set the tip text font
void setFont(FXFont *fnt);
/// Get the tip text font
FXFont* getFont() const { return font; }
/// Get the current tip text color
FXColor getTextColor() const { return textColor; }
/// Set the current tip text color
void setTextColor(FXColor clr);
virtual bool doesSaveUnder() const;
/// Save tip to a stream
virtual void save(FXStream& store) const;
/// Load tip from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXToolTip();
};
}
#endif
fox-1.6.49/include/FXRGBImage.h 0000664 0001750 0001750 00000006203 12130340076 012736 0000000 0000000 /********************************************************************************
* *
* I R I S R G B I m a g e O b j e c t *
* *
*********************************************************************************
* Copyright (C) 2002,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXRGBImage.h,v 1.14 2006/01/22 17:58:07 fox Exp $ *
********************************************************************************/
#ifndef FXRGBIMAGE_H
#define FXRGBIMAGE_H
#ifndef FXIMAGE_H
#include "FXImage.h"
#endif
namespace FX {
/// IRIS RGB image
class FXAPI FXRGBImage : public FXImage {
FXDECLARE(FXRGBImage)
protected:
FXRGBImage(){}
private:
FXRGBImage(const FXRGBImage&);
FXRGBImage &operator=(const FXRGBImage&);
public:
static const FXchar fileExt[];
static const FXchar mimeType[];
public:
/// Construct image from memory stream formatted in IRIS-RGB format
FXRGBImage(FXApp* a,const void *pix=NULL,FXuint opts=0,FXint w=1,FXint h=1);
/// Save pixels into stream in IRIS-RGB format
virtual bool savePixels(FXStream& store) const;
/// Load pixels from stream in IRIS-RGB format
virtual bool loadPixels(FXStream& store);
/// Destroy icon
virtual ~FXRGBImage();
};
/**
* Check if stream contains a RGB, return TRUE if so.
*/
extern FXAPI bool fxcheckRGB(FXStream& store);
/**
* Load an RGB (SGI IRIS RGB) file from a stream.
* Upon successful return, the pixel array and size are returned.
* If an error occurred, the pixel array is set to NULL.
*/
extern FXAPI bool fxloadRGB(FXStream& store,FXColor*& data,FXint& width,FXint& height);
/**
* Save an RGB (SGI IRIS RGB) file to a stream.
*/
extern FXAPI bool fxsaveRGB(FXStream& store,const FXColor *data,FXint width,FXint height);
}
#endif
fox-1.6.49/include/FXDirDialog.h 0000664 0001750 0001750 00000007662 12130340076 013231 0000000 0000000 /********************************************************************************
* *
* D i r e c t o r y S e l e c t i o n D i a l o g *
* *
*********************************************************************************
* Copyright (C) 2000,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXDirDialog.h,v 1.17 2006/01/22 17:58:00 fox Exp $ *
********************************************************************************/
#ifndef FXDIRDIALOG_H
#define FXDIRDIALOG_H
#ifndef FXDIALOGBOX_H
#include "FXDialogBox.h"
#endif
namespace FX {
class FXDirSelector;
/**
* A Directory Dialog provides a way to select a directory. In function,
* the directory selection dialog is very similar to the file dialog, except that
* the Directory Dialog displays a tree-structured view of the file system, and
* thereby makes up and down navigation through the file system significantly easier.
*/
class FXAPI FXDirDialog : public FXDialogBox {
FXDECLARE(FXDirDialog)
protected:
FXDirSelector *dirbox; // Directory selection widget
protected:
FXDirDialog(){}
void initdialog();
private:
FXDirDialog(const FXDirDialog&);
FXDirDialog &operator=(const FXDirDialog&);
public:
/// Construct Directory Dialog box
FXDirDialog(FXWindow* owner,const FXString& name,FXuint opts=0,FXint x=0,FXint y=0,FXint w=400,FXint h=300);
/// Construct free-floating Directory Dialog box
FXDirDialog(FXApp* a,const FXString& name,FXuint opts=0,FXint x=0,FXint y=0,FXint w=400,FXint h=300);
/// Hide this window
virtual void hide();
/// Change directory
void setDirectory(const FXString& path);
/// Return directory
FXString getDirectory() const;
/// Return TRUE if showing files as well as directories
FXbool showFiles() const;
/// Show or hide normal files
void showFiles(FXbool showing);
/// Return TRUE if showing hidden files
FXbool showHiddenFiles() const;
/// Show or hide hidden files
void showHiddenFiles(FXbool showing);
/// Return wildcard matching mode
FXuint getMatchMode() const;
/// Change wildcard matching mode
void setMatchMode(FXuint mode);
/// Change directory list style
void setDirBoxStyle(FXuint style);
/// Return directory list style
FXuint getDirBoxStyle() const;
/// Open directory name
static FXString getOpenDirectory(FXWindow* owner,const FXString& caption,const FXString& path);
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXDirDialog();
};
}
#endif
fox-1.6.49/include/FXCP852Codec.h 0000644 0001750 0001750 00000001077 11637250333 013071 0000000 0000000 #ifndef FXCP852CODEC_H
#define FXCP852CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// CP852 Codec
class FXAPI FXCP852Codec : public FXTextCodec {
FXDECLARE(FXCP852Codec)
public:
FXCP852Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FXCP852Codec(){}
};
}
#endif
fox-1.6.49/include/FX885916Codec.h 0000644 0001750 0001750 00000001113 11637250333 013103 0000000 0000000 #ifndef FX885916CODEC_H
#define FX885916CODEC_H
#ifndef FXTEXTCODEC_H
#include "FXTextCodec.h"
#endif
namespace FX {
/// ISO-8859-16 Codec
class FXAPI FX885916Codec : public FXTextCodec {
FXDECLARE(FX885916Codec)
public:
FX885916Codec(){}
virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const;
virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const;
virtual FXint mibEnum() const;
virtual const FXchar* name() const;
virtual const FXchar* mimeName() const;
virtual const FXchar* const* aliases() const;
virtual ~FX885916Codec(){}
};
}
#endif
fox-1.6.49/include/FXFoldingList.h 0000664 0001750 0001750 00000056243 12130340076 013610 0000000 0000000 /********************************************************************************
* *
* F o l d i n g L i s t W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXFoldingList.h,v 1.34 2006/01/22 17:58:02 fox Exp $ *
********************************************************************************/
#ifndef FXFOLDINGLIST_H
#define FXFOLDINGLIST_H
#ifndef FXSCROLLAREA_H
#include "FXScrollArea.h"
#endif
namespace FX {
class FXIcon;
class FXFont;
class FXHeader;
class FXFoldingList;
/// Folding list styles
enum {
FOLDINGLIST_EXTENDEDSELECT = 0, /// Extended selection mode allows for drag-selection of ranges of items
FOLDINGLIST_SINGLESELECT = 0x00100000, /// Single selection mode allows up to one item to be selected
FOLDINGLIST_BROWSESELECT = 0x00200000, /// Browse selection mode enforces one single item to be selected at all times
FOLDINGLIST_MULTIPLESELECT = 0x00300000, /// Multiple selection mode is used for selection of individual items
FOLDINGLIST_AUTOSELECT = 0x00400000, /// Automatically select under cursor
FOLDINGLIST_SHOWS_LINES = 0x00800000, /// Lines shown
FOLDINGLIST_SHOWS_BOXES = 0x01000000, /// Boxes to expand shown
FOLDINGLIST_ROOT_BOXES = 0x02000000, /// Display root boxes also
FOLDINGLIST_NORMAL = FOLDINGLIST_EXTENDEDSELECT
};
/// Tree list Item
class FXAPI FXFoldingItem : public FXObject {
FXDECLARE(FXFoldingItem)
friend class FXFoldingList;
friend class FXDirList;
protected:
FXFoldingItem *parent;
FXFoldingItem *prev;
FXFoldingItem *next;
FXFoldingItem *first;
FXFoldingItem *last;
FXString label;
FXIcon *openIcon;
FXIcon *closedIcon;
void *data;
FXuint state;
FXint x,y;
private:
FXFoldingItem(const FXFoldingItem&);
FXFoldingItem& operator=(const FXFoldingItem&);
protected:
FXFoldingItem():parent(NULL),prev(NULL),next(NULL),first(NULL),last(NULL),openIcon(NULL),closedIcon(NULL),data(NULL),state(0),x(0),y(0){}
virtual void draw(const FXFoldingList* list,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const;
virtual FXint hitItem(const FXFoldingList* list,FXint x,FXint y) const;
public:
enum{
SELECTED = 1, /// Selected
FOCUS = 2, /// Focus
DISABLED = 4, /// Disabled
OPENED = 8, /// Opened
EXPANDED = 16, /// Expanded
HASITEMS = 32, /// Has virtual subitems
DRAGGABLE = 64, /// Draggable
OPENICONOWNED = 128, /// Open icon owned by item
CLOSEDICONOWNED = 256 /// Close icon owned by item
};
public:
/// Constructor
FXFoldingItem(const FXString& text,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL):parent(NULL),prev(NULL),next(NULL),first(NULL),last(NULL),label(text),openIcon(oi),closedIcon(ci),data(ptr),state(0),x(0),y(0){}
/// Get parent item
FXFoldingItem* getParent() const { return parent; }
/// Get next sibling item
FXFoldingItem* getNext() const { return next; }
/// Get previous sibling item
FXFoldingItem* getPrev() const { return prev; }
/// Get first child item
FXFoldingItem* getFirst() const { return first; }
/// Get las child item
FXFoldingItem* getLast() const { return last; }
/// Get item below this one in list
FXFoldingItem* getBelow() const;
/// Get item above this one in list
FXFoldingItem* getAbove() const;
/// Get number of children of item
FXint getNumChildren() const;
/// Change item label
virtual void setText(const FXString& txt);
/// Get item label
const FXString& getText() const { return label; }
/// Change open icon, deleting old icon if it was owned
virtual void setOpenIcon(FXIcon* icn,FXbool owned=FALSE);
/// Get open icon
FXIcon* getOpenIcon() const { return openIcon; }
/// Change closed icon, deleting old icon if it was owned
virtual void setClosedIcon(FXIcon* icn,FXbool owned=FALSE);
/// Get closed icon
FXIcon* getClosedIcon() const { return closedIcon; }
/// Change item user data
void setData(void* ptr){ data=ptr; }
/// Get item user data
void* getData() const { return data; }
/// Make item draw as focused
virtual void setFocus(FXbool focus);
/// Return true if item has focus
FXbool hasFocus() const { return (state&FOCUS)!=0; }
/// Select item
virtual void setSelected(FXbool selected);
/// Return true if this item is selected
FXbool isSelected() const { return (state&SELECTED)!=0; }
/// Make item show as open
virtual void setOpened(FXbool opened);
/// Return true if this item is open
FXbool isOpened() const { return (state&OPENED)!=0; }
/// Expand or collapse item
virtual void setExpanded(FXbool expanded);
/// Return true if this item is expanded into sub items
FXbool isExpanded() const { return (state&EXPANDED)!=0; }
/// Enable or disable item
virtual void setEnabled(FXbool enabled);
/// Return true if this item is enabled
FXbool isEnabled() const { return (state&DISABLED)==0; }
/// Make item draggable
virtual void setDraggable(FXbool draggable);
/// Return true if this item is draggable
FXbool isDraggable() const { return (state&DRAGGABLE)!=0; }
/// Return TRUE if subitems, real or imagined
FXbool hasItems() const { return (state&HASITEMS)!=0; }
/// Change has items flag
void setHasItems(FXbool flag);
/// Return true if descendent of parent item
FXbool isChildOf(const FXFoldingItem* item) const;
/// Return true if ancestor of child item
FXbool isParentOf(const FXFoldingItem* item) const;
/// Return width of item as drawn in list
virtual FXint getWidth(const FXFoldingList* list) const;
/// Return height of item as drawn in list
virtual FXint getHeight(const FXFoldingList* list) const;
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Destroy server-side resources
virtual void destroy();
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
/// Destroy item and free icons if owned
virtual ~FXFoldingItem();
};
/// Folding item collate function
typedef FXint (*FXFoldingListSortFunc)(const FXFoldingItem*,const FXFoldingItem*);
/**
* A Folding List Widget resembles a Tree list except that it supports a
* header control to provide each item with multiple columns of text.
* Subtrees can be collapsed or expanded by double-clicking on an item
* or by clicking on the optional plus button in front of the item.
* Each item may have a text and optional open-icon as well as a closed-icon.
* The items may be connected by optional lines to show the hierarchical
* relationship.
* When an item's selected state changes, the folding list emits a SEL_SELECTED
* or SEL_DESELECTED message. If an item is opened or closed, a message
* of type SEL_OPENED or SEL_CLOSED is sent. When the subtree under an
* item is expanded, a SEL_EXPANDED or SEL_COLLAPSED message is issued.
* A change of the current item is signified by the SEL_CHANGED message.
* In addition, the folding list sends SEL_COMMAND messages when the user
* clicks on an item, and SEL_CLICKED, SEL_DOUBLECLICKED, and SEL_TRIPLECLICKED
* when the user clicks once, twice, or thrice, respectively.
* When items are added or removed, the folding list sends messages of the
* type SEL_INSERTED or SEL_DELETED.
* In each of these cases, a pointer to the item, if any, is passed in the
* 3rd argument of the message.
*/
class FXAPI FXFoldingList : public FXScrollArea {
FXDECLARE(FXFoldingList)
protected:
FXHeader *header; // Tree header
FXFoldingItem *firstitem; // First root item
FXFoldingItem *lastitem; // Last root item
FXFoldingItem *anchoritem; // Selection anchor item
FXFoldingItem *currentitem; // Current item
FXFoldingItem *extentitem; // Selection extent
FXFoldingItem *cursoritem; // Item under cursor
FXFoldingItem *viewableitem; // Viewable item
FXFont *font; // Font
FXFoldingListSortFunc sortfunc; // Item sort function
FXColor textColor; // Text color
FXColor selbackColor; // Selected background color
FXColor seltextColor; // Selected text color
FXColor lineColor; // Line color
FXint treeWidth; // Tree width
FXint treeHeight; // Tree height
FXint visible; // Number of visible items
FXint indent; // Parent to child indentation
FXint grabx; // Grab point x
FXint graby; // Grab point y
FXString lookup; // Lookup string
FXString help; // Help string
FXbool state; // State of item
protected:
FXFoldingList();
void recompute();
void mergesort(FXFoldingItem*& list);
void sort(FXFoldingItem*& f1,FXFoldingItem*& t1,FXFoldingItem*& f2,FXFoldingItem*& t2,int n);
virtual void moveContents(FXint x,FXint y);
virtual FXFoldingItem* createItem(const FXString& text,FXIcon* oi,FXIcon* ci,void* ptr);
static FXint compareSection(const FXchar *p,const FXchar* q,FXint s);
static FXint compareSectionCase(const FXchar *p,const FXchar* q,FXint s);
private:
FXFoldingList(const FXFoldingList&);
FXFoldingList& operator=(const FXFoldingList&);
public:
long onPaint(FXObject*,FXSelector,void*);
long onEnter(FXObject*,FXSelector,void*);
long onLeave(FXObject*,FXSelector,void*);
long onUngrabbed(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onKeyPress(FXObject*,FXSelector,void*);
long onKeyRelease(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onRightBtnPress(FXObject*,FXSelector,void*);
long onRightBtnRelease(FXObject*,FXSelector,void*);
long onHeaderChanged(FXObject*,FXSelector,void*);
long onQueryTip(FXObject*,FXSelector,void*);
long onQueryHelp(FXObject*,FXSelector,void*);
long onTipTimer(FXObject*,FXSelector,void*);
long onFocusIn(FXObject*,FXSelector,void*);
long onFocusOut(FXObject*,FXSelector,void*);
long onAutoScroll(FXObject*,FXSelector,void*);
long onClicked(FXObject*,FXSelector,void*);
long onDoubleClicked(FXObject*,FXSelector,void*);
long onTripleClicked(FXObject*,FXSelector,void*);
long onCommand(FXObject*,FXSelector,void*);
long onLookupTimer(FXObject*,FXSelector,void*);
public:
static FXint ascending(const FXFoldingItem*,const FXFoldingItem*);
static FXint descending(const FXFoldingItem*,const FXFoldingItem*);
static FXint ascendingCase(const FXFoldingItem*,const FXFoldingItem*);
static FXint descendingCase(const FXFoldingItem*,const FXFoldingItem*);
public:
enum {
ID_LOOKUPTIMER=FXScrollArea::ID_LAST,
ID_HEADER_CHANGE,
ID_LAST
};
public:
/// Construct a folding list; the folding list is initially empty
FXFoldingList(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=FOLDINGLIST_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Perform layout
virtual void layout();
/// Return default width
virtual FXint getDefaultWidth();
/// Return default height
virtual FXint getDefaultHeight();
/// Compute and return content width
virtual FXint getContentWidth();
/// Return content height
virtual FXint getContentHeight();
/// Recalculate layout
virtual void recalc();
/// Tree list can receive focus
virtual bool canFocus() const;
/// Move the focus to this window
virtual void setFocus();
/// Remove the focus from this window
virtual void killFocus();
/// Return header control
FXHeader* getHeader() const { return header; }
/// Set headers from array of strings
void setHeaders(const FXchar** strings,FXint size=1);
/// Set headers from newline separated strings
void setHeaders(const FXString& strings,FXint size=1);
/// Append header with given text and optional icon
void appendHeader(const FXString& text,FXIcon *icon=NULL,FXint size=1);
/// Remove header at index
void removeHeader(FXint index);
/// Change text of header at index
void setHeaderText(FXint index,const FXString& text);
/// Return text of header at index
FXString getHeaderText(FXint index) const;
/// Change icon of header at index
void setHeaderIcon(FXint index,FXIcon *icon);
/// Return icon of header at index
FXIcon* getHeaderIcon(FXint index) const;
/// Change size of header at index
void setHeaderSize(FXint index,FXint size);
/// Return width of header at index
FXint getHeaderSize(FXint index) const;
/// Return number of headers
FXint getNumHeaders() const;
/// Return number of items
FXint getNumItems() const;
/// Return number of visible items
FXint getNumVisible() const { return visible; }
/// Change number of visible items
void setNumVisible(FXint nvis);
/// Return first root item
FXFoldingItem* getFirstItem() const { return firstitem; }
/// Return last root item
FXFoldingItem* getLastItem() const { return lastitem; }
/// Fill list by appending items from array of strings
FXint fillItems(FXFoldingItem* father,const FXchar** strings,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL,FXbool notify=FALSE);
/// Fill list by appending items from newline separated strings
FXint fillItems(FXFoldingItem* father,const FXString& strings,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL,FXbool notify=FALSE);
/// Insert [possibly subclassed] item under father before other item
FXFoldingItem* insertItem(FXFoldingItem* other,FXFoldingItem* father,FXFoldingItem* item,FXbool notify=FALSE);
/// Insert item with given text and optional icons, and user-data pointer under father before other item
FXFoldingItem* insertItem(FXFoldingItem* other,FXFoldingItem* father,const FXString& text,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL,FXbool notify=FALSE);
/// Append [possibly subclassed] item as last child of father
FXFoldingItem* appendItem(FXFoldingItem* father,FXFoldingItem* item,FXbool notify=FALSE);
/// Append item with given text and optional icons, and user-data pointer as last child of father
FXFoldingItem* appendItem(FXFoldingItem* father,const FXString& text,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL,FXbool notify=FALSE);
/// Prepend [possibly subclassed] item as first child of father
FXFoldingItem* prependItem(FXFoldingItem* father,FXFoldingItem* item,FXbool notify=FALSE);
/// Prepend item with given text and optional icons, and user-data pointer as first child of father
FXFoldingItem* prependItem(FXFoldingItem* father,const FXString& text,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL,FXbool notify=FALSE);
/// Move item under father before other item
FXFoldingItem *moveItem(FXFoldingItem* other,FXFoldingItem* father,FXFoldingItem* item);
/// Extract item
FXFoldingItem* extractItem(FXFoldingItem* item,FXbool notify=FALSE);
/// Remove item
void removeItem(FXFoldingItem* item,FXbool notify=FALSE);
/// Remove items in range [fm, to] inclusively
void removeItems(FXFoldingItem* fm,FXFoldingItem* to,FXbool notify=FALSE);
/// Remove all items from list
void clearItems(FXbool notify=FALSE);
/// Return item width
FXint getItemWidth(const FXFoldingItem* item) const { return item->getWidth(this); }
/// Return item height
FXint getItemHeight(const FXFoldingItem* item) const { return item->getHeight(this); }
/// Get item at x,y, if any
virtual FXFoldingItem* getItemAt(FXint x,FXint y) const;
/**
* Search items by name, beginning from item start. If the start item
* is NULL the search will start at the first, top-most item in the list.
* Flags may be SEARCH_FORWARD or SEARCH_BACKWARD to control the search
* direction; this can be combined with SEARCH_NOWRAP or SEARCH_WRAP
* to control whether the search wraps at the start or end of the list.
* The option SEARCH_IGNORECASE causes a case-insensitive match. Finally,
* passing SEARCH_PREFIX causes searching for a prefix of the item name.
* Return NULL if no matching item is found.
*/
FXFoldingItem* findItem(const FXString& text,FXFoldingItem* start=NULL,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const;
/**
* Search items by associated user data, beginning from item start. If the
* start item is NULL the search will start at the first, top-most item
* in the list. Flags may be SEARCH_FORWARD or SEARCH_BACKWARD to control
* the search direction; this can be combined with SEARCH_NOWRAP or SEARCH_WRAP
* to control whether the search wraps at the start or end of the list.
*/
FXFoldingItem* findItemByData(const void *ptr,FXFoldingItem* start=NULL,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const;
/// Scroll to make item visible
virtual void makeItemVisible(FXFoldingItem* item);
/// Change item's text
void setItemText(FXFoldingItem* item,const FXString& text);
/// Return item's text
FXString getItemText(const FXFoldingItem* item) const;
/// Change item's open icon, deleting old icon if it was owned
void setItemOpenIcon(FXFoldingItem* item,FXIcon* icon,FXbool owned=FALSE);
/// Return item's open icon
FXIcon* getItemOpenIcon(const FXFoldingItem* item) const;
/// Chance item's closed icon, deleting old icon if it was owned
void setItemClosedIcon(FXFoldingItem* item,FXIcon* icon,FXbool owned=FALSE);
/// Return item's closed icon
FXIcon* getItemClosedIcon(const FXFoldingItem* item) const;
/// Change item user-data pointer
void setItemData(FXFoldingItem* item,void* ptr) const;
/// Return item user-data pointer
void* getItemData(const FXFoldingItem* item) const;
/// Return TRUE if item is selected
FXbool isItemSelected(const FXFoldingItem* item) const;
/// Return TRUE if item is current
FXbool isItemCurrent(const FXFoldingItem* item) const;
/// Return TRUE if item is visible
FXbool isItemVisible(const FXFoldingItem* item) const;
/// Return TRUE if item opened
FXbool isItemOpened(const FXFoldingItem* item) const;
/// Return TRUE if item expanded
FXbool isItemExpanded(const FXFoldingItem* item) const;
/// Return TRUE if item is a leaf-item, i.e. has no children
FXbool isItemLeaf(const FXFoldingItem* item) const;
/// Return TRUE if item is enabled
FXbool isItemEnabled(const FXFoldingItem* item) const;
/// Return item hit code: 0 outside, 1 icon, 2 text, 3 box
FXint hitItem(const FXFoldingItem* item,FXint x,FXint y) const;
/// Repaint item
void updateItem(FXFoldingItem* item);
/// Enable item
virtual FXbool enableItem(FXFoldingItem* item);
/// Disable item
virtual FXbool disableItem(FXFoldingItem* item);
/// Select item
virtual FXbool selectItem(FXFoldingItem* item,FXbool notify=FALSE);
/// Deselect item
virtual FXbool deselectItem(FXFoldingItem* item,FXbool notify=FALSE);
/// Toggle item selection
virtual FXbool toggleItem(FXFoldingItem* item,FXbool notify=FALSE);
/// Extend selection from anchor item to item
virtual FXbool extendSelection(FXFoldingItem* item,FXbool notify=FALSE);
/// Deselect all items
virtual FXbool killSelection(FXbool notify=FALSE);
/// Open item
virtual FXbool openItem(FXFoldingItem* item,FXbool notify=FALSE);
/// Close item
virtual FXbool closeItem(FXFoldingItem* item,FXbool notify=FALSE);
/// Collapse tree
virtual FXbool collapseTree(FXFoldingItem* tree,FXbool notify=FALSE);
/// Expand tree
virtual FXbool expandTree(FXFoldingItem* tree,FXbool notify=FALSE);
/// Change current item
virtual void setCurrentItem(FXFoldingItem* item,FXbool notify=FALSE);
/// Return current item, if any
FXFoldingItem* getCurrentItem() const { return currentitem; }
/// Change anchor item
void setAnchorItem(FXFoldingItem* item);
/// Return anchor item, if any
FXFoldingItem* getAnchorItem() const { return anchoritem; }
/// Return item under cursor, if any
FXFoldingItem* getCursorItem() const { return cursoritem; }
/// Sort all items recursively
void sortItems();
/// Sort root items
void sortRootItems();
/// Sort children of item
void sortChildItems(FXFoldingItem* item);
/// Return sort function
FXFoldingListSortFunc getSortFunc() const { return sortfunc; }
/// Change sort function
void setSortFunc(FXFoldingListSortFunc func){ sortfunc=func; }
/// Change text font
void setFont(FXFont* fnt);
/// Return text font
FXFont* getFont() const { return font; }
/// Change parent-child indent amount
void setIndent(FXint in);
/// Return parent-child indent amount
FXint getIndent() const { return indent; }
/// Return normal text color
FXColor getTextColor() const { return textColor; }
/// Change normal text color
void setTextColor(FXColor clr);
/// Return selected text background
FXColor getSelBackColor() const { return selbackColor; }
/// Change selected text background
void setSelBackColor(FXColor clr);
/// Return selected text color
FXColor getSelTextColor() const { return seltextColor; }
/// Change selected text color
void setSelTextColor(FXColor clr);
/// Return line color
FXColor getLineColor() const { return lineColor; }
/// Change line color
void setLineColor(FXColor clr);
/// Return list style
FXuint getListStyle() const;
/// Change list style
void setListStyle(FXuint style);
/// Set the status line help text for this list
void setHelpText(const FXString& text);
/// Get the status line help text for this list
const FXString& getHelpText() const { return help; }
/// Save object to a stream
virtual void save(FXStream& store) const;
/// Load object from a stream
virtual void load(FXStream& store);
/// Destructor
virtual ~FXFoldingList();
};
}
#endif
fox-1.6.49/include/FXDirBox.h 0000664 0001750 0001750 00000011005 12130340076 012544 0000000 0000000 /********************************************************************************
* *
* D i r e c t o r y B o x W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1999,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXDirBox.h,v 1.25 2006/01/22 17:58:00 fox Exp $ *
********************************************************************************/
#ifndef FXDIRBOX_H
#define FXDIRBOX_H
#ifndef FXTREELISTBOX_H
#include "FXTreeListBox.h"
#endif
namespace FX {
class FXIcon;
class FXFileDict;
/// Directory Box options
enum {
DIRBOX_NO_OWN_ASSOC = 0x00020000 /// Do not create associations for files
};
/**
* A Directory Box widget allows the user to select parts of a file path.
* First, it is filled with a string comprising a file path, like "/a/b/c".
* Then, the user can select "/a/b/c", "/a/b", "/a", and "/" from the drop-down
* list. The entries in the drop-down list are automatically provided with icons
* by consulting the file-associations registry settings.
* The Directory Box sends SEL_CHANGED and SEL_COMMAND messages, with the string
* containing the full path to the selected item.
*/
class FXAPI FXDirBox : public FXTreeListBox {
FXDECLARE(FXDirBox)
protected:
FXFileDict *associations; // Association table
FXIcon *foldericon; // Folder icons
FXIcon *cdromicon; // CDROM icon
FXIcon *harddiskicon; // Hard disk icon
FXIcon *netdriveicon; // Networked drive icon
FXIcon *floppyicon; // Floppy icon
FXIcon *nethoodicon; // Network neighborhood icon
FXIcon *zipdiskicon; // Zip drive icon
protected:
FXDirBox(){}
FXString getItemPathname(FXTreeItem *item) const;
FXTreeItem* getPathnameItem(const FXString& path);
private:
FXDirBox(const FXDirBox&);
FXDirBox &operator=(const FXDirBox&);
public:
long onTreeChanged(FXObject*,FXSelector,void*);
long onTreeClicked(FXObject*,FXSelector,void*);
long onCmdSetValue(FXObject*,FXSelector,void*);
long onCmdSetStringValue(FXObject*,FXSelector,void*);
long onCmdGetStringValue(FXObject*,FXSelector,void*);
public:
/// Construct a Directory Box
FXDirBox(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=FRAME_SUNKEN|FRAME_THICK|TREELISTBOX_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
/// Create server-side resources
virtual void create();
/// Detach server-side resources
virtual void detach();
/// Destroy server-side resources
virtual void destroy();
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
/// Set current directory
void setDirectory(const FXString& pathname);
/// Return current directory
FXString getDirectory() const;
/// Change file associations used to look up icons
void setAssociations(FXFileDict* assoc);
/// Return file associations
FXFileDict* getAssociations() const { return associations; }
/// Destructor
virtual ~FXDirBox();
};
}
#endif
fox-1.6.49/AUTHORS 0000664 0001750 0001750 00000004073 12130340076 010402 0000000 0000000
List of contributors, in alphabetical order:
============================================
Johnathan Bush:
Progress Bar Widget contributor.
Pierre Cyr
Contributions to FXTable widget.
Janusz Ganczarski :
PCX, ICO, TGA Image/Icon format contributor.
Daniel Gehriger :
FXGIFCursor, Multi-lingual keyboard support, and much more.
Eric Gillet :
TIFF Image support.
Freddy Golos:
Freddy [Fyodor] was one of the first adopters of FOX, back
when everybody still had to take my word for it how nice it was;
Freddy made it clear there was real potential here.
Angel-Ventura Mendo Gomez :
OpenGL Shape Objects.
Sean Hubbell:
Initial version of FXFile API's.
Sander Jansen :
New web pages, new web layout, many useful suggestions and code.
Code for the round progress dial, and lots of Windows specific nitty-gritties.
CUR cursor.
Lyle Johnson :
Windows Port of FOX, Python, Ruby bindings; FXSpinner widget.
The Spinner Widget. Lyle is also largely responsible for the
Window NT port of FOX.
Torsten Landschoff
FOX automake, and reswrap man page files.
René van Paassen :
FOX RPM spec file.
Guoqing Tian:
Dial Widget contributor.
David Tyree :
JPEG Image support.
Charles W. Warren charles@moontown.org:
Shutter Widgets contributor. The concept of the Data Targets.
Charles has also been my principal sounding board for exploring the
philosophical underpinnings of the FOX Library.
David Tyree:
JPEG Image and JPEG Icon support.
Jeroen van der Zijp :
Main FOX Library author.
The true list should probably be much larger; if you feel I have inadvertantly omitted
you, please email me jeroen@fox-toolkit.org and I'll add you immediately.
fox-1.6.49/install-sh 0000755 0001750 0001750 00000033256 12025761077 011354 0000000 0000000 #!/bin/sh
# install - install a program, script, or datafile
scriptversion=2011-01-19.21; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
no_target_directory=
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
# Protect names problematic for `test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
# Protect names problematic for `test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names problematic for `test' and other utilities.
case $src in
-* | [=\(\)!]) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
fox-1.6.49/doc/ 0000775 0001750 0001750 00000000000 12130343076 010156 5 0000000 0000000 fox-1.6.49/doc/filter.pl 0000755 0001750 0001750 00000005312 11637250333 011726 0000000 0000000 #!/usr/bin/perl
$file = $ARGV[0];
if ($file =~ /\.cpp/) {
while (<>) {
print $_;
}
}
else {
@lines = <>;
chomp(@lines);
$brace = 0;
for ($i = 0; $i < scalar @lines; ++$i) {
$_ = $lines[$i];
# adjust brace level
$stm = $_;
if ($$incmt) {
if (m#^([^*]|\*+[^/*])*\*+/(.*)$#) {
$stm = $1;
$$incmt = 0;
}
else {
$stm = "";
}
}
$stm =~ s#//.*##;
$stm =~ s#/\*([^*]|\*+[^/*])*\*+/##g;
if ($stm =~ m#^(([^/]|/[^*])*)/\*#) {
$$incmt = 1;
$stm = $1;
}
++$brace if $stm =~ /\{/;
--$brace, $enum = 0 if $stm =~ /}/;
# skip message handlers
if ($lines[$i] =~ /^\s*long\s+on\w+\(\s*FXObject\s*\*\s*\w*\s*,\s*FXSelector\s*\w*\s*,\s*void\s*\*\s*\w*\s*\);/) {
#splice @lines, $i, 0, (" /** \@name Message Handlers */", " //\@{ ");
#$j = $i+2;
#while ($lines[$j] =~ /^\s*long\s+on\w+\(\s*FXObject\s*\*\s*\w*\s*,\s*FXSelector\s*\w*\s*,\s*void\s*\*\s*\w*\s*\);/) {
# ++$j;
#}
#splice @lines, $j, 0, (" //\@} ");
#$i = $j;
$lines[$i]="";
}
$skip = 0 if $brace <= 1;
$skip = 1 if $stm =~ /^\s*public\s*:\s*$/;
$skip = 2 if $stm =~ /^\s*protected\s*:\s*$/;
$skip = 3 if $stm =~ /^\s*private\s*:\s*$/;
$enum = 1 if $stm =~ /^\s*enum\s+\w*\s*\{[^}]*$/;
if ($skip > 1) {
splice @lines, $i, 1, ();
--$i;
next;
}
if (($lines[$i] =~ /^\*\// || @lines[$i] =~ m#///#)&& $lines[$i+1] =~ /^class/ && scalar @tags > 0 ) {
if (@lines[$i] =~ m#///\s*(.*)$#) {
@lines[$i] = "/** $1";
splice @lines, $i+1, 0, ("*/");
++$i;
}
splice @lines, $i, 0, ("* ", "* See also: ", @tags);
$i += scalar @tags + 2;
}
if ($enum == 1 && m#///?\s*.*$#) {
$lines[$i] =~ s#///?#///<#;
}
if ($skip <= 1) {
if ($brace == 1 && $lines[$i] =~ m|^\s*///?| && $lines[$i+1] =~ m|^\s*enum|) {
$lines[$i] =~ m|^\s*///?\s*(.+)|;
$cmt = $1;
($tag) = $file =~ /(\w+)\.\w+$/;
$tag .= "_" . $group++;
$tag =~ s#[ .:\\/]#_#g;
push @tags, "* \\li \\ref $tag \"$cmt\".";
splice @lines, $i, 0, ("/** \\addtogroup $tag $cmt", " * \@{", " */");
$i += 3;
$j = $i;
while (!($lines[$j] =~ /\};/)) { ++$j; }
splice @lines, $j+1, 0, ("/** @} */");
}
if ($brace == 3 && $lines[$i] =~ m#^\s*enum\s+\{#) {
$j = $i;
$delete = 1;
while (!($lines[$j] =~ m#\}\s*;#)) {
$delete = 0 if $lines[$j] =~ m#///?#;
++$j;
}
if ($delete) {
splice @lines, $i, $j-$i+1;
$enum = 0;
}
}
}
}
foreach (@lines) {
print $_ . "\n";
}
} fox-1.6.49/doc/messages.html 0000664 0001750 0001750 00000043331 12130340076 012574 0000000 0000000
Documentation: Messages
There are many methods to connect Graphical User Interface elements
to an application code; the most common methods being used today are callback
functions. However, in C++, callback functions are not an
obvious choice, as the technique does not easily allow a certain object
to be specified.
Another method being used in C++ is the signal-slot technique. In its typical
implementation, connector objects are created that connect a signal to a slot.
However, in order to provide the necessary isolation between caller and callee,
template instantiations are involved; this limits its use to compile-time
connectivity.
The approach taken by FOX is a Target/Message System.
Each Widget sends its message to a certain object called the target.
As there may be multiple Widgets sending messages to one specific target,
a message id is used to tell them apart.
Moreover, a single Widget may be able to send several kinds of messages; this problem
is solved by typing the messages by a message type.
Using the message type and message id, the source and type of a GUI event or
action can be uniquely identified.
Messages can be sent to any object that is derived (directly or indirectly)
from FXObject. Of course, all FOX Widgets are derived from FXObject, and so is the
FXApp application object.
Thus pretty much every object in FOX is able to receive messages.
An advantage of the fact that an explicit object is the target
of a message (as opposed to lets say an implicit message routing
scheme), is the fact that message id's don't have to be globally
unique within an application; all that is required is that it is unique
for a certain class and its base classes.
This is a particularly important consideration when one considers making
component oriented software, where components are perhaps written by
different people, or even different organizations.
With FOX, they do not have to coordinate message id's with each other in order
for components to interact properly.
Another important benefit of the target/message system is the fact that
the message a Widget sends, and the target to whom it sends it, may be
changed at run time.
This is an significant benefit for building programs such as GUI Builders
and other component oriented software.
Finally, since all FOX Widgets derive from FXObject, they are
capable of receiving messages, as well as sending
them.
This allows FOX Widgets to implement a number of typical commands
that are common in GUI systems; for example, consider the following code ragment:
new FXHorizontalFrame(main,LAYOUT_SIDE_TOP|LAYOUT_FILL_X);
....
....
....
new FXMenuCommand(windowmenu,"&Toolbar",NULL,toolbar,FXWindow::ID_TOGGLESHOWN);
In the above example, the toolbar Widget is a direct target
of the MenuCommand Widget. Each time the Toolbar
command is invoked, it will toggle the toolbar Widget on or off.
Moreover, when the GUI Update process takes place during idle time, the
MenuCommand will also send an update message to the toolbar Widget; in
response to this update, the toolbar examines its current state, and either
checks or unchecks the MenuCommand by sending it back a ID_CHECK or ID_UNCHECK
message.
Note that the toolbar can not assume that the sender of the update
message is a MenuCommand; but it does know its an FXObject!
So it needs to send a ID_CHECK (ID_UNCHECK) message to this object instead
of trying to call the check() or uncheck() member function of MenuCommand
directly.
The above code fragment shows the flexibility of the target/message
system, especially when combined with the GUI Update idle processing capability.
The mechanism is used extensively inside FOX itself as well.
Message Maps
The messages an object receives are mapped to a specific member function
of the object by means of a message map. A message
map is nothing but a static, compile-time defined table which associates
one or more messages with a certain member function. Complicated
Widgets may have several dozen messages that are being mapped this way.
Message maps are un unfortunate necessity in C++ as the exact binding of
a message to a member function is performed at run time; C++ does not natively
support such dynamic binding very well.Fortunately, FOX makes it fairly easy to define those message maps by
providing a number of macros to set them up. The following code fragment
illustrates the process:
The FXDEFMAP macro takes as the argument the name of the class.
It is used to define the entries into the message map table. The
FXMAPFUNC
macro takes three arguments:- first, the type of the message, second, the
id of the message, and last the member function to which this message is
being mapped. A similar macro called FXMAPFUNCS is used to
define a range of message id's instead of just one.
You can use this macro to map a many messages to one and the same member
function.
For example, in a calculator program you may have one button for '0',
'1', and so on till '9'. Instead of defining ten very similar member
functions, you can define just one of them. The member function can
use the macro FXSELID(sel) to acquire the id of the message that called
it, and FXSELTYPE(sel) to find the messsage type of the message.
The last macro FXIMPLEMENT has four arguments: the name of the
class, the name of the immediate base class, a pointer to the message map,
and the number of entries in the message map. If an object does not
implement any message handlers, you may pass NULL and 0 for these last
two arguments instead. The corresponding macro in the header file
is called FXDECLARE.
Every FOX object should always
use FXDECLARE in its header file or class declaration, and FXIMPLEMENT
in its implementation file!
Besides FXMAPFUNC and FXMAPFUNCS, there are two (rarely used) macros
that key on the message type only; FXMAPTYPE takes just two arguments,
the message type and the member function, and FXMAPTYPES takes three,
the first and last message id, and the member function. FXMAPTYPE
and FXMAPTYPES will completely disregard the message id, and map any message
of the appropriate type to the indicated member function.
All message id's should be in the range MINKEY to MAXKEY,
and all message types in the range MINTYPE to MAXTYPE.
In addition, the special message id of zero(0) is reserved
for system-originated messages.
Messages are resolved to the message handler functions from the
derived
class upward to the base class. This allows developers
to catch messages in their derived class, before it gets handled in the
base class. Thus, you can easily redefine behavior of FOX built-in
Widgets.
As the message association is performed at run time, it is common practice
to place the most-often occurring messages first in the map; this way,
the least amount of searching takes place to find them; thus, the SEL_PAINT
message is often placed first.
Keeping Track of Message Numbering
FOX does not require that all message id's be globally unique.
However, it does require that they are unique for a specific target.
The messages understood by a target are the union of the messages understood
by the target's class, and all of its base classes.
An easy way to keep the numbering straight is to use enums.
FOX itself uses the technique illustrated below:
class FXWindow : public FXDrawable {
...
public:
enum {
ID_SHOW=1,
ID_HIDE,
...
ID_LAST
};
public:
...
};
class MyWindow : public FXWindow {
...
public:
enum {
ID_MYMESSAGE=FXWindow::ID_LAST,
ID_MYOTHERMESSAGE,
...
ID_LAST
};
public:
...
};
This way, the compiler will automatically arrange to make sure
the numbering is correct. It is also easy to add more messages in
before ID_LAST, a recompile will adjust the message id's automatically.
Of course, you're welcome to use any other scheme if so desired; just make
sure your messages do not clash with those of the base-classes of your
object.
Message Targets should Outlive Message Sources
It is obvious that when a Widget sends a message to some object, the
receiving object should of course still exist. A potential pitfall
would rear its ugly head if this were not true. Fortunately, in most
cases, Control widgets will send messages to their containing Dialog Box,
or the Application Object, or other long-lived objects. In rare cases,
you may want to make sure that as a Widget or Object is deleted, all references
to it are cleaned up as well.FOX provides two member functions:
FXWindow::setTarget(FXObject* tgt)
and
FXWindow::setSelector(FXSelector sel)
that allow you to change the target, as well
as the message that a Widget will send. Setting the
target of a Widget to NULL will stop it from sending any future messages
to anybody.
In order to catch the possibility that messages would be sent to an
object that has been destructed, FOX willutterlythrasheach
object in thedestructor. Thus, if such a bug exists in an
application, it is likely to surface quickly, leading to more reliable
programs.
Sending Your Own Messages
In many cases, you will want to send messages to Widgets yourself.
For example, in an GUI update handler you may want to send a message to
the sender of the update message:
....
FXMAPFUNC(SEL_COMMAND,FXWindow::ID_TOGGLESHOWN,FXWindow::onCmdToggleShown),
// Command
FXMAPFUNC(SEL_UPDATE,FXWindow::ID_TOGGLESHOWN,FXWindow::onUpdToggleShown),
// Update
....
// Hide or show window<
long FXWindow::onCmdToggleShown(FXObject*,FXSelector,void*){
....
return 1;
}
// Update hide or show window
long FXWindow::onUpdToggleShown(FXObject* sender,FXSelector,void*){
sender->handle(this,shown()?FXSEL(SEL_COMMAND,ID_CHECK)
:FXSEL(SEL_COMMAND,ID_UNCHECK),NULL);
return 1;
}
What happens here? During GUI Updating, the Menu Command connected to
the Toolbar sends a SEL_UPDATE message [instead of the SEL_COMMAND
it sends when the command is invoked by the user].
The onUpdToggleShown function above determines whether
the Toolbar is currently shown, then sends a ID_CHECK or ID_UNCHECK back
to the sender.
Upon getting the ID_CHECK or ID_UNCHECK, a Menu Command object will
subsequently place or remove a little check mark in front of its label.
If the sender of the SEL_UPDATE message were some other Widget, e.g.
a Check Button, it would still work properly, although the Check Button's
implementation of the ID_CHECK and ID_UNCHECK handlers is of course completely
different.
If the sender of the SEL_UPDATE message were some completely different
Widget, it would simply ignore the return message.
By sending messages instead of calling a member function directly, the
function above does not need to know what type
of Widget sent the SEL_UPDATE message; it just sends a message back; if
the sender of the message does not understand the message, nothing happens.
Note that it is guaranteed that the sender of a message is always an object
derived from FXObject.
The FXSEL macro composes to 16 bit unsigned short numbers into one
32 bit unsigned int. Composing the message types and message id's
this way allows for more efficient matching of messages.
Message Handler Return Values
You may have noticed that some message handlers return 1, and
some return 0. The general convention is, that if the message
can be considered handled, i.e. it is normally processed,
the handler should return 1. Otherwise, it should
return 0. Properly returning the correct return value will allow for intelligent
message routing through your application. For messages directly resulting
from a user-input event, such as button presses etc., FOX will use the
return value of the message handler to determine if the GUI needs to be
refreshed.
For example, if the system sent a SEL_LEFTBUTTONPRESS to your Widget,
and your Widget's handler returned 1, it is considered handled;
next time the system goes into idle processing, all the GUI Widgets in
the application will be updated again as it is assumed that by handling
the button message, something may have changed. If your handler
had returned 0, the message would have been considered unhandled,
and nothing further would happen.
Message Routing and Delegation
Messages may be forwarded from one object to another. For example,
upon receipt of a message, a target may first try to handle the message
itself; then, if no match is found, it may try its luck by forwarding the
message to some other object. Here's how you would code this up:
We use here the fact that we can overload the so-called default message
handler, onDefault(). The default message handler is called when
no message binding has been found for a message.
In the above code fragment, delegateObject is assumed to be some
type of object derived from FXObject. You can use these delegation
techniques very creatively.
Note that you probably want to start the message id's of the delegateObject
from where the delegator MyWidget left off, i.e. make sure there is no
overlap unless its intended.
In a few cases, some message which would be handled by MyWidget's base class
needs to be forwarded to the delegateObject. You can easily do this by simply
mapping that message to onDefault() in MyWidget's message map: