| 1 |
/* AbiWord |
| 2 |
* Copyright (C) 2001-2002 Dom Lachowicz |
| 3 |
* |
| 4 |
* This program is free software; you can redistribute it and/or |
| 5 |
* modify it under the terms of the GNU General Public License |
| 6 |
* as published by the Free Software Foundation; either version 2 |
| 7 |
* of the License, or (at your option) any later version. |
| 8 |
* |
| 9 |
* This program is distributed in the hope that it will be useful, |
| 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
* GNU General Public License for more details. |
| 13 |
* |
| 14 |
* You should have received a copy of the GNU General Public License |
| 15 |
* along with this program; if not, write to the Free Software |
| 16 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
| 17 |
* 02110-1301 USA. |
| 18 |
*/ |
| 19 |
|
| 20 |
#ifndef XAP_UNIXDIALOG_IMAGE_H |
| 21 |
#define XAP_UNIXDIALOG_IMAGE_H |
| 22 |
|
| 23 |
#include "xap_Dlg_Image.h" |
| 24 |
|
| 25 |
class XAP_Frame; |
| 26 |
|
| 27 |
/*****************************************************************/ |
| 28 |
|
| 29 |
class XAP_UnixDialog_Image: public XAP_Dialog_Image |
| 30 |
{ |
| 31 |
public: |
| 32 |
XAP_UnixDialog_Image(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); |
| 33 |
virtual ~XAP_UnixDialog_Image(void); |
| 34 |
|
| 35 |
virtual void runModal(XAP_Frame * pFrame); |
| 36 |
|
| 37 |
static XAP_Dialog * static_constructor(XAP_DialogFactory *, XAP_Dialog_Id id); |
| 38 |
void setPositionToGUI(void); |
| 39 |
void setWrappingGUI(void); |
| 40 |
protected: |
| 41 |
void _constructWindowContents (GtkWidget * container); |
| 42 |
virtual GtkWidget * _constructWindow (); |
| 43 |
void _connectSignals (); |
| 44 |
|
| 45 |
private: |
| 46 |
|
| 47 |
typedef enum |
| 48 |
{ |
| 49 |
BUTTON_OK = GTK_RESPONSE_OK, |
| 50 |
BUTTON_CANCEL = GTK_RESPONSE_CANCEL |
| 51 |
} ResponseId ; |
| 52 |
|
| 53 |
void event_Ok (); |
| 54 |
void event_Cancel (); |
| 55 |
void doHeightSpin(void); |
| 56 |
void doWidthSpin(void); |
| 57 |
void doHeightEntry(void); |
| 58 |
void doWidthEntry(void); |
| 59 |
void setHeightEntry(void); |
| 60 |
void setWidthEntry(void); |
| 61 |
void adjustHeightForAspect(void); |
| 62 |
void adjustWidthForAspect(void); |
| 63 |
void aspectCheckbox(); |
| 64 |
void wrappingChanged(void); |
| 65 |
void wrapTypeChanged(void); |
| 66 |
|
| 67 |
static void s_HeightSpin_changed(GtkWidget * widget, XAP_UnixDialog_Image *dlg) ; |
| 68 |
|
| 69 |
static void s_WidthSpin_changed(GtkWidget * widget, XAP_UnixDialog_Image *dlg) ; |
| 70 |
|
| 71 |
static void s_HeightEntry_changed(GtkWidget * widget, XAP_UnixDialog_Image *dlg) ; |
| 72 |
static gboolean s_HeightEntry_FocusOut(GtkWidget * widget, GdkEvent *event, XAP_UnixDialog_Image *dlg); |
| 73 |
static gboolean s_WidthEntry_FocusOut(GtkWidget * widget, GdkEvent *event, XAP_UnixDialog_Image *dlg); |
| 74 |
|
| 75 |
static void s_WidthEntry_changed(GtkWidget * widget, XAP_UnixDialog_Image *dlg) ; |
| 76 |
|
| 77 |
static void s_aspect_clicked(GtkWidget * widget, XAP_UnixDialog_Image * dlg) ; |
| 78 |
static void s_wrapping_changed(GtkWidget * widget, XAP_UnixDialog_Image * dlg) ; |
| 79 |
static void s_wrapType_changed(GtkWidget * widget, XAP_UnixDialog_Image * dlg) ; |
| 80 |
|
| 81 |
GtkWidget * mMainWindow; |
| 82 |
GtkWidget * m_wAspectCheck; |
| 83 |
GtkWidget * m_wHeightSpin; |
| 84 |
GtkWidget * m_wHeightEntry; |
| 85 |
GtkWidget * m_wWidthSpin; |
| 86 |
GtkWidget * m_wWidthEntry; |
| 87 |
GtkWidget * m_wTitleEntry; |
| 88 |
GtkWidget * m_wDescriptionEntry; |
| 89 |
GtkWidget * m_wPlaceTable; |
| 90 |
GtkWidget * m_wrbInLine; |
| 91 |
GtkWidget * m_wrbNone; |
| 92 |
GtkWidget * m_wrbWrappedRight; |
| 93 |
GtkWidget * m_wrbWrappedLeft; |
| 94 |
GtkWidget * m_wrbWrappedBoth; |
| 95 |
GtkWidget * m_wrbPlaceParagraph; |
| 96 |
GtkWidget * m_wrbPlaceColumn; |
| 97 |
GtkWidget * m_wrbPlacePage; |
| 98 |
GtkWidget * m_wrbSquareWrap; |
| 99 |
GtkWidget * m_wrbTightWrap; |
| 100 |
GtkWidget * m_wWrapTable; |
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
GtkAdjustment * m_oHeightSpin_adj; |
| 105 |
GtkAdjustment * m_oWidthSpin_adj; |
| 106 |
guint m_iHeightID; |
| 107 |
guint m_iWidthID; |
| 108 |
UT_sint32 m_iHeight; |
| 109 |
UT_sint32 m_iWidth; |
| 110 |
bool m_bAspect; |
| 111 |
double m_dHeightWidth; |
| 112 |
}; |
| 113 |
|
| 114 |
#endif /* XAP_UNIXDIALOG_IMAGE_H */ |