Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef XAP_UNIXFRAMEIMPL_H
00024 #define XAP_UNIXFRAMEIMPL_H
00025
00026 #ifdef HAVE_CONFIG_H
00027 #include "config.h"
00028 #endif
00029
00030 #include <gtk/gtkwidget.h>
00031 #include <gtk/gtkadjustment.h>
00032 #include <gdk/gdktypes.h>
00033 #include <gtk/gtk.h>
00034 #include "xap_FrameImpl.h"
00035 #include "ut_vector.h"
00036 #include "xap_UnixDialogFactory.h"
00037 #include "xap_UnixApp.h"
00038
00039 class EV_UnixMenuBar;
00040 class EV_UnixMenuPopup;
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 class XAP_UnixFrameImpl : public XAP_FrameImpl
00052 {
00053 public:
00054 XAP_UnixFrameImpl(XAP_Frame *pFrame);
00055 friend class XAP_Frame;
00056
00057 virtual ~XAP_UnixFrameImpl();
00058
00059 GtkWidget * getTopLevelWindow() const;
00060 void setTopLevelWindow(GtkWidget * window) { m_wTopLevelWindow = window; }
00061 GtkWidget * getVBoxWidget() const;
00062 gint getNewX(void)
00063 { return m_iNewX;}
00064 gint getNewY(void)
00065 { return m_iNewY;}
00066 void focusIMIn ();
00067 void focusIMOut ();
00068 void queueIMReset () {
00069 need_im_reset = true;
00070 }
00071 void resetIMContext ();
00072
00073 private:
00074 void _setGeometry ();
00075
00076 protected:
00077 GtkIMContext * m_imContext;
00078 GtkWidget * m_wVBox;
00079
00080 GtkWidget * m_wSunkenBox;
00081 GtkWidget * m_wStatusBar;
00082
00083 GtkWidget * m_wTopLevelWindow;
00084 EV_UnixMenuBar * m_pUnixMenu;
00085
00086 bool need_im_reset;
00087
00088 GtkIMContext * getIMContext();
00089
00090 virtual bool _close();
00091 virtual bool _raise();
00092 virtual bool _show();
00093
00094 virtual GtkWidget * _createInternalWindow (void);
00095
00096 virtual void _nullUpdate () const;
00097 virtual void _initialize();
00098
00099 virtual void _setWindowIcon() = 0;
00100
00101 virtual GtkWidget * _createDocumentWindow() = 0;
00102 virtual GtkWidget * _createStatusBarWindow() = 0;
00103
00104 void _createTopLevelWindow(void);
00105 bool _updateTitle();
00106 void _createIMContext(GdkWindow* w);
00107 UT_sint32 _setInputMode(const char * szName);
00108 virtual void _setCursor(GR_Graphics::Cursor cursor);
00109
00110 virtual XAP_DialogFactory * _getDialogFactory();
00111 virtual EV_Menu * _getMainMenu();
00112 virtual EV_Toolbar * _newToolbar(XAP_Frame *pFrame,
00113 const char *szLayout,
00114 const char *szLanguage);
00115
00116 virtual bool _runModalContextMenu(AV_View * pView, const char * szMenuName,
00117 UT_sint32 x, UT_sint32 y);
00118 void setTimeOfLastEvent(guint32 eventTime);
00119
00120 virtual void _queue_resize();
00121 virtual void _rebuildMenus(void);
00122 virtual void _rebuildToolbar(UT_uint32 ibar);
00123 GtkWidget * _getSunkenBox(void) {return m_wSunkenBox;}
00124
00125 virtual void _setFullScreen(bool changeToFullScreen);
00126
00127 void _imCommit (GtkIMContext * imc, const gchar * text);
00128
00129 virtual void dragText();
00130
00131 #if defined(EMBEDDED_TARGET) && EMBEDDED_TARGET == EMBEDDED_TARGET_HILDON
00132
00133 public:
00134 #endif
00135 static void _imCommit_cb(GtkIMContext *imc, const gchar* text, gpointer data);
00136 static void _imPreeditStart_cb (GtkIMContext *context, gpointer data);
00137 static void _imPreeditChanged_cb (GtkIMContext *context, gpointer data);
00138 static void _imPreeditEnd_cb (GtkIMContext *context, gpointer data);
00139 static gint _imRetrieveSurrounding_cb (GtkIMContext *context, gpointer data);
00140 static gint _imDeleteSurrounding_cb (GtkIMContext *slave, gint offset, gint n_chars, gpointer data);
00141
00142
00143 class _fe
00144 {
00145 friend class XAP_Frame;
00146 public:
00147 static gint button_press_event(GtkWidget * w, GdkEventButton * e);
00148 static gint button_release_event(GtkWidget * w, GdkEventButton * e);
00149 static gint configure_event(GtkWidget* w, GdkEventConfigure *e);
00150 static gint motion_notify_event(GtkWidget* w, GdkEventMotion* e);
00151 static gint scroll_notify_event(GtkWidget* w, GdkEventScroll* e);
00152 static gint key_press_event(GtkWidget* w, GdkEventKey* e);
00153 static gint key_release_event(GtkWidget* w, GdkEventKey* e);
00154 static gint delete_event(GtkWidget * w, GdkEvent * , gpointer );
00155 static gint expose(GtkWidget * w, GdkEventExpose* pExposeEvent);
00156 static gint do_ZoomUpdate( gpointer p);
00157 static void vScrollChanged(GtkAdjustment * w, gpointer );
00158 static void hScrollChanged(GtkAdjustment * w, gpointer );
00159 static void destroy (GtkWidget * , gpointer );
00160 static gboolean focus_in_event(GtkWidget *w,GdkEvent *event,gpointer user_data);
00161 static gboolean focus_out_event(GtkWidget *w,GdkEvent *event,gpointer user_data);
00162
00163 static void realize(GtkWidget * widget, GdkEvent *,gpointer );
00164 static void unrealize(GtkWidget * widget, GdkEvent *,gpointer );
00165 static void sizeAllocate(GtkWidget * widget, GdkEvent *,gpointer );
00166 static gint focusIn(GtkWidget * widget, GdkEvent *,gpointer );
00167 static gint focusOut(GtkWidget * , GdkEvent *,gpointer );
00168 };
00169 friend class _fe;
00170
00171 private:
00172 bool m_bDoZoomUpdate;
00173 UT_sint32 m_iNewX;
00174 UT_sint32 m_iNewY;
00175 UT_sint32 m_iNewWidth;
00176 UT_sint32 m_iNewHeight;
00177 guint m_iZoomUpdateID;
00178 guint m_iAbiRepaintID;
00179
00180
00181 EV_UnixMenuPopup * m_pUnixPopup;
00182 AP_UnixDialogFactory m_dialogFactory;
00183
00184 UT_uint32 m_iPreeditLen;
00185 UT_uint32 m_iPreeditStart;
00186 };
00187 #endif
00188
00189
00190