00001 /* AbiSource Application Framework 00002 * Copyright (C) 1998 AbiSource, Inc. 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00017 * 02110-1301 USA. 00018 */ 00019 00020 #ifndef XAP_UNIXDIALOG_INSERT_SYMBOL_H 00021 #define XAP_UNIXDIALOG_INSERT_SYMBOL_H 00022 00023 #include <list> 00024 #include <string> 00025 00026 #include "xap_Dlg_Insert_Symbol.h" 00027 #include <gdk/gdkkeysyms.h> 00028 00029 #define DEFAULT_UNIX_SYMBOL_FONT "Symbol" 00030 00031 class XAP_Frame; 00032 class GR_CairoGraphics; 00033 00034 /*****************************************************************/ 00035 00036 class XAP_UnixDialog_Insert_Symbol : public XAP_Dialog_Insert_Symbol 00037 { 00038 public: 00039 XAP_UnixDialog_Insert_Symbol(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); 00040 virtual ~XAP_UnixDialog_Insert_Symbol(void); 00041 00042 virtual void runModal(XAP_Frame * pFrame); 00043 virtual void runModeless(XAP_Frame * pFrame); 00044 virtual void notifyActiveFrame(XAP_Frame *pFrame); 00045 virtual void notifyCloseFrame(XAP_Frame * /*pFrame*/ ){}; 00046 virtual void destroy(void); 00047 virtual void activate(void); 00048 00049 void event_Insert(void); 00050 void event_WindowDelete(void); 00051 void New_Font(void); 00052 void New_Row(void); 00053 void Scroll_Event (int direction); 00054 void setSymbolMap_size (UT_uint32 width, UT_uint32 height); 00055 00056 00057 static XAP_Dialog * static_constructor(XAP_DialogFactory *, XAP_Dialog_Id id); 00058 00059 typedef enum 00060 { 00061 BUTTON_INSERT, 00062 BUTTON_CLOSE = GTK_RESPONSE_CLOSE 00063 } ResponseId ; 00064 00065 // callbacks can fire these events 00066 void SymbolMap_exposed( void); 00067 void Symbolarea_exposed( void); 00068 void SymbolMap_clicked(GdkEvent * event); 00069 void CurrentSymbol_clicked(GdkEvent *event); 00070 gboolean Key_Pressed(GdkEventKey * e); 00071 00072 private: 00073 00074 GtkWidget * _constructWindow(void); 00075 void _getGlistFonts(std::list<std::string> & glFonts); 00076 GtkWidget * _createComboboxWithFonts (void); 00077 void _connectSignals (void); 00078 void _setScrolledWindow (void); 00079 00080 // pointers to widgets we need to query/set 00081 GtkWidget * m_windowMain; 00082 GtkWidget * m_SymbolMap; 00083 GtkWidget * m_fontcombo; 00084 GtkAdjustment * m_vadjust; 00085 std::list<std::string> m_InsertS_Font_list; 00086 00087 // private construction functions 00088 GtkWidget * _previewNew(int w, int h); 00089 00090 GtkWidget * m_areaCurrentSym; 00091 GR_CairoGraphics * m_unixGraphics; 00092 GR_CairoGraphics * m_unixarea; 00093 UT_uint32 m_ix; 00094 UT_uint32 m_iy; 00095 }; 00096 00097 #endif /* XAP_UNIXDIALOG_INSERT_SYMBOL_H */