• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

xap_UnixFrameImpl.h

Go to the documentation of this file.
00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */
00002 /* AbiSource Application Framework
00003  * Copyright (C) 1998 AbiSource, Inc.
00004  * Copyright (C) 2002 William Lachance
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00019  * 02110-1301 USA.
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/gtk.h>
00031 #include "xap_FrameImpl.h"
00032 #include "ut_vector.h"
00033 #include "xap_UnixDialogFactory.h"
00034 #include "xap_UnixApp.h"
00035 
00036 class EV_UnixMenuBar;
00037 class EV_UnixMenuPopup;
00038 
00039 /********************************************************************
00040 *********************************************************************
00041 ** This file defines the unix-platform-specific class for the
00042 ** cross-platform application frame helper.  This is used to hold all
00043 ** unix-specific data.  One of these is created for each top-level
00044 ** document window.
00045 *********************************************************************
00046 ********************************************************************/
00047 
00048 class XAP_UnixFrameImpl : public XAP_FrameImpl
00049 {
00050  public:
00051     XAP_UnixFrameImpl(XAP_Frame *pFrame);
00052     friend class XAP_Frame;
00053 
00054     virtual ~XAP_UnixFrameImpl();
00055 
00056     GtkWidget * getTopLevelWindow() const;
00057     void setTopLevelWindow(GtkWidget * window) { m_wTopLevelWindow = window; }
00058     GtkWidget * getVBoxWidget() const;
00059     gint getNewX(void)
00060     { return m_iNewX;}
00061     gint getNewY(void)
00062     { return m_iNewY;}
00063     void focusIMIn ();
00064     void focusIMOut ();
00065     void queueIMReset () {
00066       need_im_reset = true;
00067     }
00068     void resetIMContext ();
00069 
00070     virtual GtkWidget * getViewWidget (void) const = 0;
00071 
00072 private:
00073     void _setGeometry ();
00074 
00075 protected:
00076     GtkIMContext *          m_imContext;
00077     GtkWidget *         m_wVBox;
00078 
00079     GtkWidget *             m_wSunkenBox;
00080     GtkWidget *         m_wStatusBar;
00081 
00082     GtkWidget *         m_wTopLevelWindow;
00083     EV_UnixMenuBar *        m_pUnixMenu;
00084 
00085     bool need_im_reset;
00086 
00087     GtkIMContext * getIMContext();
00088 
00089     virtual bool _close();
00090     virtual bool _raise();
00091     virtual bool _show();
00092 
00093     virtual GtkWidget *  _createInternalWindow (void);
00094 
00095     virtual void _nullUpdate () const; // a virtual member function in xap_Frame
00096     virtual void _initialize();
00097 
00098     virtual void _setWindowIcon() = 0; // should eventually be handled be the inherited helper
00099 
00100     virtual GtkWidget * _createDocumentWindow() = 0;
00101     virtual GtkWidget * _createStatusBarWindow() = 0;
00102 
00103     void _createTopLevelWindow(void);
00104     bool _updateTitle();
00105     void _createIMContext(GdkWindow* w);
00106     UT_sint32 _setInputMode(const char * szName);
00107     virtual void _setCursor(GR_Graphics::Cursor cursor);
00108 
00109     virtual XAP_DialogFactory * _getDialogFactory();
00110     virtual EV_Menu * _getMainMenu();
00111     virtual EV_Toolbar * _newToolbar(XAP_Frame *pFrame,
00112                  const char *szLayout,
00113                  const char *szLanguage);
00114 
00115     virtual bool _runModalContextMenu(AV_View * pView, const char * szMenuName,
00116                       UT_sint32 x, UT_sint32 y);
00117     void setTimeOfLastEvent(guint32 eventTime);
00118 
00119     virtual void _queue_resize();
00120     virtual void _rebuildMenus(void);
00121     virtual void _rebuildToolbar(UT_uint32 ibar);
00122     GtkWidget * _getSunkenBox(void) {return m_wSunkenBox;}
00123 
00124     virtual void _setFullScreen(bool changeToFullScreen);
00125 
00126     void _imCommit (GtkIMContext * imc, const gchar * text);
00127 
00128     virtual void dragText();
00129 
00130     static void _imCommit_cb(GtkIMContext *imc, const gchar* text, gpointer data);
00131     static void _imPreeditStart_cb (GtkIMContext *context, gpointer data);
00132     static void _imPreeditChanged_cb (GtkIMContext *context, gpointer data);
00133     static void _imPreeditEnd_cb (GtkIMContext *context, gpointer data);
00134     static gint _imRetrieveSurrounding_cb (GtkIMContext *context, gpointer data);
00135     static gint _imDeleteSurrounding_cb (GtkIMContext *slave, gint offset, gint n_chars, gpointer data);
00136 
00137 
00138     class _fe
00139         {
00140             friend class XAP_Frame;
00141           public:
00142             static gint button_press_event(GtkWidget * w, GdkEventButton * e);
00143             static gint button_release_event(GtkWidget * w, GdkEventButton * e);
00144             static gint configure_event(GtkWidget* w, GdkEventConfigure *e);
00145             static gint motion_notify_event(GtkWidget* w, GdkEventMotion* e);
00146             static gint scroll_notify_event(GtkWidget* w, GdkEventScroll* e);
00147             static gint key_press_event(GtkWidget* w, GdkEventKey* e);
00148             static gint key_release_event(GtkWidget* w, GdkEventKey* e);
00149             static gint delete_event(GtkWidget * w, GdkEvent * /*event*/, gpointer /*data*/);
00150             static gboolean draw(GtkWidget *w, cairo_t *cr, gpointer);
00151             static gint do_ZoomUpdate( gpointer /* xap_UnixFrame * */ p);
00152             static void vScrollChanged(GtkAdjustment * w, gpointer /*data*/);
00153             static void hScrollChanged(GtkAdjustment * w, gpointer /*data*/);
00154             static void destroy (GtkWidget * /*widget*/, gpointer /*data*/);
00155             static gboolean focus_in_event(GtkWidget *w,GdkEvent *event,gpointer user_data);
00156             static gboolean focus_out_event(GtkWidget *w,GdkEvent *event,gpointer user_data);
00157 
00158             static void realize(GtkWidget * widget, GdkEvent */* e*/,gpointer /*data*/);
00159             static void unrealize(GtkWidget * widget, GdkEvent */* e */,gpointer /* data */);
00160             static void sizeAllocate(GtkWidget * widget, GdkEvent */* e */,gpointer /* data */);
00161             static gint focusIn(GtkWidget * widget, GdkEvent */* e */,gpointer /* data */);
00162             static gint focusOut(GtkWidget * /*widget*/, GdkEvent */* e */,gpointer /* data */);
00163     };
00164     friend class _fe;
00165 
00166  private:
00167     bool                        m_bDoZoomUpdate;
00168     UT_sint32                   m_iNewX;
00169     UT_sint32                   m_iNewY;
00170     UT_sint32                   m_iNewWidth;
00171     UT_sint32                   m_iNewHeight;
00172     guint                       m_iZoomUpdateID;
00173     guint                       m_iAbiRepaintID;
00174 
00175 
00176     EV_UnixMenuPopup *          m_pUnixPopup; /* only valid while a context popup is up */
00177     AP_UnixDialogFactory        m_dialogFactory;
00178 
00179     UT_uint32                   m_iPreeditLen;
00180     UT_uint32                   m_iPreeditStart;
00181 };
00182 #endif /* XAP_UNIXFRAME_H */
00183 
00184 
00185 

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1