Classes | Defines | Enumerations | Functions | Variables

abiwidget-gtk2.cpp File Reference

#include <string.h>
#include <glib/gi18n.h>
#include <stdio.h>
#include <stdlib.h>
#include "abiwidget.h"
#include <gsf/gsf-input.h>
#include <gsf/gsf-output.h>
#include <gsf/gsf-input-memory.h>
#include <gsf/gsf-output-memory.h>
#include <gsf/gsf-utils.h>
#include "gr_CairoGraphics.h"
#include "gr_Painter.h"
#include "ev_EditMethod.h"
#include "ut_assert.h"
#include "fv_View.h"
#include "ap_UnixFrame.h"
#include "ap_FrameData.h"
#include "ap_FrameListener.h"
#include "pd_Document.h"
#include "ie_imp.h"
#include "ie_exp.h"
#include "ie_impGraphic.h"
#include "xap_UnixDialogHelper.h"
#include "ap_UnixFrameImpl.h"
#include "ap_UnixApp.h"
#include "ut_sleep.h"
#include "fg_Graphic.h"
#include "fl_DocLayout.h"
#include "ut_go_file.h"
#include "ut_timer.h"
#include "ev_Toolbar_Actions.h"
#include "ap_Toolbar_Id.h"
#include "px_CR_Span.h"
#include "gr_UnixCairoGraphics.h"
#include "gr_UnixImage.h"
#include "gr_UnixPangoPixmapGraphics.h"
#include "gr_DrawArgs.h"
#include "fp_Page.h"

Classes

struct  _AbiPrivData
class  Stateful_ViewListener
class  AbiWidget_ViewListener
class  AbiWidget_FrameListener

Defines

#define GET_CLASS(instance)   G_TYPE_INSTANCE_GET_CLASS (instance, ABI_WIDGET_TYPE, AbiWidgetClass)
#define EM_NAME(n)   _abi_em_##n
#define PUBLIC_EM_NAME(n)   abi_widget_##n
#define EM_CHARPTR_INT_INT__BOOL(n, p)
#define EM_VOID__BOOL(n, p)
#define EM_INT_INT__BOOL(n, p)
#define EM_CHARPTR__BOOL(n, p)
#define INSTALL_VOID_SIGNAL(signal_offset, signal_name, signal_func)
#define INSTALL_BOOL_SIGNAL(signal_offset, signal_name, signal_func)
#define INSTALL_INT_SIGNAL(signal_offset, signal_name, signal_func)
#define INSTALL_DOUBLE_SIGNAL(signal_offset, signal_name, signal_func)
#define INSTALL_STRING_SIGNAL(signal_offset, signal_name, signal_func)
#define INSTALL_COLOR_SIGNAL(signal_offset, signal_name, signal_func)
#define FIRE_BOOL(query, var, fire)   do { bool val = (query); if (val != var) { var = val; fire(val); } } while(0)
#define FIRE_SINT32(query, var, fire)   do { UT_sint32 val = (query); if (val != var) { var = val; fire(val); } } while(0)
#define FIRE_UINT32(query, var, fire)   do { UT_uint32 val = (query); if (val != var) { var = val; fire(val); } } while(0)
#define FIRE_UTF8STRING(query, var, fire)   do { const UT_UTF8String& val = (query); if (val != var) { var = val; fire(val.utf8_str()); } } while(0)
#define FIRE_BOOL_CHARFMT(prop, prop_val, multiple, var, fire)
#define FIRE_DOUBLE_CHARFMT(prop, var, fire)   do { const gchar * sz = UT_getAttribute(prop, props_in); if (sz) { double val = g_ascii_strtod(sz, NULL); if (val != var) { var = val; fire(val); } } } while(0)
#define FIRE_STRING_CHARFMT(prop, var, fire)   do { const gchar * sz = UT_getAttribute(prop, props_in); if (sz) { if (strcmp(var.utf8_str(), sz) != 0) { var = sz; fire(sz); } } } while(0)
#define FIRE_COLOR_CHARFMT(prop, var, fire)   do { const gchar * sz = UT_getAttribute(prop, props_in); if (sz) { UT_RGBColor val(0,0,0); UT_parseColor(sz, val); if (val != var) { var = val; fire(val); } } } while(0)
#define TOOLBAR_DELAY   1000

Enumerations

enum  {
  ARG_0, CURSOR_ON, UNLINK_AFTER_LOAD, VIEWPARA,
  VIEWPRINTLAYOUT, VIEWNORMALLAYOUT, VIEWWEBLAYOUT, CONTENT,
  SELECTION, CONTENT_LENGTH, SELECTION_LENGTH, SHADOW_TYPE,
  ARG_LAST
}
enum  {
  SIGNAL_BOLD, SIGNAL_ITALIC, SIGNAL_UNDERLINE, SIGNAL_OVERLINE,
  SIGNAL_LINE_THROUGH, SIGNAL_TOPLINE, SIGNAL_BOTTOMLINE, SIGNAL_SUPERSCRIPT,
  SIGNAL_SUBSCRIPT, SIGNAL_COLOR, SIGNAL_CHANGED, SIGNAL_CAN_UNDO,
  SIGNAL_CAN_REDO, SIGNAL_FONT_SIZE, SIGNAL_FONT_FAMILY, SIGNAL_IS_DIRTY,
  SIGNAL_LEFT_ALIGN, SIGNAL_RIGHT_ALIGN, SIGNAL_CENTER_ALIGN, SIGNAL_JUSTIFY_ALIGN,
  SIGNAL_STYLE_NAME, SIGNAL_TEXT_SELECTED, SIGNAL_IMAGE_SELECTED, SIGNAL_SELECTION_CLEARED,
  SIGNAL_ENTER_SELECTION, SIGNAL_LEAVE_SELECTION, SIGNAL_TABLE_STATE, SIGNAL_PAGE_COUNT,
  SIGNAL_CURRENT_PAGE, SIGNAL_ZOOM_PERCENTAGE, SIGNAL_LAST
}

Functions

static gboolean s_abi_widget_map_cb (GObject *w, gpointer p)
void g_cclosure_user_marshal_VOID__INT_INT_INT (GClosure *closure, GValue *, guint n_param_values, const GValue *param_values, gpointer, gpointer marshal_data)
static void _abi_widget_class_install_signals (AbiWidgetClass *klazz)
static void _abi_widget_unbindListener (AbiWidget *widget)
static void _abi_widget_releaseListener (AbiWidget *widget)
static bool _abi_widget_bindListenerToView (AbiWidget *widget, AV_View *pView)
static void s_LoadingCursorCallback (UT_Worker *pTimer)
static void s_StartStopLoadingCursor (bool bStartStop, XAP_Frame *pFrame)
static gboolean _abi_widget_set_show_margin (AbiWidget *abi, gboolean bShowMargin)
gboolean abi_widget_set_show_margin (AbiWidget *abi, gboolean bShowMargin)
gboolean abi_widget_get_show_margin (AbiWidget *abi)
gboolean abi_widget_set_show_authors (AbiWidget *abi, gboolean bShowAuthors)
gboolean abi_widget_get_show_authors (AbiWidget *abi)
gboolean abi_widget_set_word_selections (AbiWidget *abi, gboolean gb)
gboolean abi_widget_get_word_selections (AbiWidget *abi)
gboolean abi_widget_file_open (AbiWidget *abi)
static IEFileType s_abi_widget_get_file_type (const char *extension_or_mimetype, const char *contents, UT_uint32 contents_len, bool bImport)
gchar * abi_widget_get_content (AbiWidget *w, const char *extension_or_mimetype, const char *exp_props, gint *iLength)
gchar * abi_widget_get_selection (AbiWidget *w, const gchar *extension_or_mimetype, gint *iLength)
gboolean abi_widget_get_mouse_pos (AbiWidget *w, gint32 *x, gint32 *y)
GdkPixbuf * abi_widget_render_page_to_image (AbiWidget *abi, int iPage)
gboolean abi_widget_set_font_name (AbiWidget *w, gchar *szName)
gboolean abi_widget_set_font_size (AbiWidget *w, gchar *szSize)
gboolean abi_widget_set_style (AbiWidget *w, gchar *szName)
gboolean abi_widget_insert_table (AbiWidget *abi, gint32 rows, gint32 cols)
gboolean abi_widget_insert_image (AbiWidget *w, char *szFile, gboolean positioned)
gboolean abi_widget_set_text_color (AbiWidget *w, guint8 red, guint8 green, guint8 blue)
const gchar ** abi_widget_get_font_names (AbiWidget *)
gboolean abi_widget_load_file (AbiWidget *w, const gchar *pszFile, const gchar *extension_or_mimetype)
gboolean abi_widget_load_file_from_gsf (AbiWidget *w, GsfInput *input)
gboolean abi_widget_load_file_from_memory (AbiWidget *w, const gchar *extension_or_mimetype, const gchar *buf, gint length)
static void abi_widget_get_prop (GObject *object, guint arg_id, GValue *arg, GParamSpec *)
void abi_widget_get_property (GObject *object, guint arg_id, GValue *arg, GParamSpec *pspec)
static void abi_widget_set_prop (GObject *object, guint arg_id, const GValue *arg, GParamSpec *)
void abi_widget_set_property (GObject *object, guint arg_id, const GValue *arg, GParamSpec *pspec)
static void abi_widget_size_request (GtkWidget *widget, GtkRequisition *requisition)
static void abiwidget_add (GtkContainer *container, GtkWidget *widget)
static void abiwidget_remove (GtkContainer *container, GtkWidget *widget)
static GType abiwidget_child_type (GtkContainer *container)
static void abi_widget_init (AbiWidget *abi)
static void abi_widget_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
static void abi_widget_grab_focus (GtkWidget *widget)
static void abi_widget_realize (GtkWidget *widget)
static void abi_widget_destroy_gtk (GtkObject *object)
static void abi_widget_class_init (AbiWidgetClass *abi_class)
static void abi_widget_construct (AbiWidget *, const char *)
void abi_widget_turn_on_cursor (AbiWidget *abi)
GType abi_widget_get_type (void)
GtkWidget * abi_widget_new (void)
 abi_widget_new
GtkWidget * abi_widget_new_with_file (const gchar *file)
 abi_widget_new_with_file
XAP_Frameabi_widget_get_frame (AbiWidget *w)
gboolean abi_widget_invoke (AbiWidget *w, const char *mthdName)
 abi_widget_invoke()
gboolean abi_widget_invoke_ex (AbiWidget *w, const char *mthdName, const char *data, gint32 x, gint32 y)
 abi_widget_invoke_ex()
void abi_widget_draw (AbiWidget *w)
gboolean abi_widget_save (AbiWidget *w, const char *fname, const char *extension_or_mimetype, const char *exp_props)
gboolean abi_widget_save_to_gsf (AbiWidget *w, GsfOutput *output, const char *extension_or_mimetype, const char *exp_props)
gboolean abi_widget_set_zoom_percentage (AbiWidget *w, guint32 zoom)
guint32 abi_widget_get_zoom_percentage (AbiWidget *w)
static FV_View_get_fv_view (AbiWidget *w)
void abi_widget_set_find_string (AbiWidget *w, gchar *search_str)
gboolean abi_widget_find_next (AbiWidget *w, gboolean sel_start)
gboolean abi_widget_find_prev (AbiWidget *w)
guint32 abi_widget_get_page_count (AbiWidget *w)
void abi_widget_set_current_page (AbiWidget *w, guint32 curpage)
guint32 abi_widget_get_current_page_num (AbiWidget *w)

Variables

static GtkBinClass * parent_class = 0
static const guint32 ABI_DEFAULT_WIDTH = 250
static const guint32 ABI_DEFAULT_HEIGHT = 250
static guint abiwidget_signals [SIGNAL_LAST] = { 0 }
static bool s_bFirstDrawDone = false
static bool s_bFreshDraw = false
static UT_Timers_pToUpdateCursor = NULL
static XAP_Frames_pLoadingFrame = NULL
static AD_Documents_pLoadingDoc = NULL
static UT_sint32 s_iLastYScrollOffset = -1
static UT_sint32 s_iLastXScrollOffset = -1

Define Documentation

#define EM_CHARPTR__BOOL (   n,
  p 
)
Value:
static gboolean EM_NAME(n) (AbiWidget * w, const char * str) \
{ \
return abi_widget_invoke_ex (w, #n, str, 0, 0); \
} \
extern "C" gboolean PUBLIC_EM_NAME(p) (AbiWidget * w, const char * str) \
{ \
return GET_CLASS (w)->p (w, str); \
}
#define EM_CHARPTR_INT_INT__BOOL (   n,
  p 
)
Value:
static gboolean EM_NAME(n) (AbiWidget * w, const char * str, gint32 x, gint32 y) \
{ \
return abi_widget_invoke_ex (w, #n, str, x, y); \
} \
extern "C" gboolean PUBLIC_EM_NAME(p) (AbiWidget * w, const char * str, gint32 x, gint32 y) \
{ \
return GET_CLASS (w)->p (w, str, x, y); \
}
#define EM_INT_INT__BOOL (   n,
  p 
)
Value:
static gboolean EM_NAME(n) (AbiWidget * w, gint32 x, gint32 y) \
{ \
return abi_widget_invoke_ex (w, #n, 0, x, y); \
} \
extern "C" gboolean PUBLIC_EM_NAME(p) (AbiWidget * w, gint32 x, gint32 y) \
{ \
return GET_CLASS (w)->p (w, x, y); \
}
#define EM_NAME (   n  )     _abi_em_##n

Referenced by abi_widget_class_init().

#define EM_VOID__BOOL (   n,
  p 
)
Value:
static gboolean EM_NAME(n) (AbiWidget * w)\
{ \
return abi_widget_invoke_ex (w, #n, 0, 0, 0); \
}\
extern "C" gboolean PUBLIC_EM_NAME(p) (AbiWidget * w)\
{ \
return GET_CLASS (w)->p (w); \
}
#define FIRE_BOOL (   query,
  var,
  fire 
)    do { bool val = (query); if (val != var) { var = val; fire(val); } } while(0)
#define FIRE_BOOL_CHARFMT (   prop,
  prop_val,
  multiple,
  var,
  fire 
)
Value:
do {\
const gchar * sz = UT_getAttribute(prop, props_in); \
if (sz) \
{ bool val; \
if (multiple) \
val = (NULL != strstr(sz, prop_val)); \
else \
val = (0 == strcmp(sz, prop_val)); \
if (val != var) { \
var = val; \
fire(var); \
} \
} \
} while(0)

Referenced by Stateful_ViewListener::notify().

#define FIRE_COLOR_CHARFMT (   prop,
  var,
  fire 
)    do { const gchar * sz = UT_getAttribute(prop, props_in); if (sz) { UT_RGBColor val(0,0,0); UT_parseColor(sz, val); if (val != var) { var = val; fire(val); } } } while(0)
#define FIRE_DOUBLE_CHARFMT (   prop,
  var,
  fire 
)    do { const gchar * sz = UT_getAttribute(prop, props_in); if (sz) { double val = g_ascii_strtod(sz, NULL); if (val != var) { var = val; fire(val); } } } while(0)
#define FIRE_SINT32 (   query,
  var,
  fire 
)    do { UT_sint32 val = (query); if (val != var) { var = val; fire(val); } } while(0)
#define FIRE_STRING_CHARFMT (   prop,
  var,
  fire 
)    do { const gchar * sz = UT_getAttribute(prop, props_in); if (sz) { if (strcmp(var.utf8_str(), sz) != 0) { var = sz; fire(sz); } } } while(0)
#define FIRE_UINT32 (   query,
  var,
  fire 
)    do { UT_uint32 val = (query); if (val != var) { var = val; fire(val); } } while(0)
#define FIRE_UTF8STRING (   query,
  var,
  fire 
)    do { const UT_UTF8String& val = (query); if (val != var) { var = val; fire(val.utf8_str()); } } while(0)
#define GET_CLASS (   instance  )     G_TYPE_INSTANCE_GET_CLASS (instance, ABI_WIDGET_TYPE, AbiWidgetClass)
#define INSTALL_BOOL_SIGNAL (   signal_offset,
  signal_name,
  signal_func 
)
Value:
do { \
    abiwidget_signals[signal_offset] = \
        g_signal_new (signal_name, \
                      G_TYPE_FROM_CLASS (klazz), \
                      G_SIGNAL_RUN_LAST, \
                      G_STRUCT_OFFSET (AbiWidgetClass, signal_func), \
                                      NULL, NULL, \
                                      g_cclosure_marshal_VOID__BOOLEAN, \
                                      G_TYPE_NONE, 1, G_TYPE_BOOLEAN); } while(0)

Referenced by _abi_widget_class_install_signals().

#define INSTALL_COLOR_SIGNAL (   signal_offset,
  signal_name,
  signal_func 
)
Value:
do { \
    abiwidget_signals[signal_offset] = \
        g_signal_new (signal_name, \
                      G_TYPE_FROM_CLASS (klazz), \
                      G_SIGNAL_RUN_LAST, \
                      G_STRUCT_OFFSET (AbiWidgetClass, signal_func), \
                                      NULL, NULL, \
                                      g_cclosure_user_marshal_VOID__INT_INT_INT, \
                                      G_TYPE_NONE, 3, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT); } while(0)

Referenced by _abi_widget_class_install_signals().

#define INSTALL_DOUBLE_SIGNAL (   signal_offset,
  signal_name,
  signal_func 
)
Value:
do { \
    abiwidget_signals[signal_offset] = \
        g_signal_new (signal_name, \
                      G_TYPE_FROM_CLASS (klazz), \
                      G_SIGNAL_RUN_LAST, \
                      G_STRUCT_OFFSET (AbiWidgetClass, signal_func), \
                                      NULL, NULL, \
                                      g_cclosure_marshal_VOID__DOUBLE, \
                                      G_TYPE_NONE, 1, G_TYPE_DOUBLE); } while(0)

Referenced by _abi_widget_class_install_signals().

#define INSTALL_INT_SIGNAL (   signal_offset,
  signal_name,
  signal_func 
)
Value:
do { \
    abiwidget_signals[signal_offset] = \
        g_signal_new (signal_name, \
                      G_TYPE_FROM_CLASS (klazz), \
                      G_SIGNAL_RUN_LAST, \
                      G_STRUCT_OFFSET (AbiWidgetClass, signal_func), \
                                      NULL, NULL, \
                                      g_cclosure_marshal_VOID__INT, \
                                      G_TYPE_NONE, 1, G_TYPE_INT); } while(0)

Referenced by _abi_widget_class_install_signals().

#define INSTALL_STRING_SIGNAL (   signal_offset,
  signal_name,
  signal_func 
)
Value:
do { \
    abiwidget_signals[signal_offset] = \
        g_signal_new (signal_name, \
                      G_TYPE_FROM_CLASS (klazz), \
                      G_SIGNAL_RUN_LAST, \
                      G_STRUCT_OFFSET (AbiWidgetClass, signal_func), \
                                      NULL, NULL, \
                                      g_cclosure_marshal_VOID__STRING, \
                                      G_TYPE_NONE, 1, G_TYPE_STRING); } while(0)

Referenced by _abi_widget_class_install_signals().

#define INSTALL_VOID_SIGNAL (   signal_offset,
  signal_name,
  signal_func 
)
Value:
do { \
    abiwidget_signals[signal_offset] = \
        g_signal_new (signal_name, \
                      G_TYPE_FROM_CLASS (klazz), \
                      G_SIGNAL_RUN_LAST, \
                      G_STRUCT_OFFSET (AbiWidgetClass, signal_func), \
                                      NULL, NULL, \
                                      g_cclosure_marshal_VOID__VOID, \
                                      G_TYPE_NONE, 0); } while(0)

Referenced by _abi_widget_class_install_signals().

#define PUBLIC_EM_NAME (   n  )     abi_widget_##n
#define TOOLBAR_DELAY   1000

Enumeration Type Documentation

anonymous enum
Enumerator:
ARG_0 
CURSOR_ON 
UNLINK_AFTER_LOAD 
VIEWPARA 
VIEWPRINTLAYOUT 
VIEWNORMALLAYOUT 
VIEWWEBLAYOUT 
CONTENT 
SELECTION 
CONTENT_LENGTH 
SELECTION_LENGTH 
SHADOW_TYPE 
ARG_LAST 
anonymous enum
Enumerator:
SIGNAL_BOLD 
SIGNAL_ITALIC 
SIGNAL_UNDERLINE 
SIGNAL_OVERLINE 
SIGNAL_LINE_THROUGH 
SIGNAL_TOPLINE 
SIGNAL_BOTTOMLINE 
SIGNAL_SUPERSCRIPT 
SIGNAL_SUBSCRIPT 
SIGNAL_COLOR 
SIGNAL_CHANGED 
SIGNAL_CAN_UNDO 
SIGNAL_CAN_REDO 
SIGNAL_FONT_SIZE 
SIGNAL_FONT_FAMILY 
SIGNAL_IS_DIRTY 
SIGNAL_LEFT_ALIGN 
SIGNAL_RIGHT_ALIGN 
SIGNAL_CENTER_ALIGN 
SIGNAL_JUSTIFY_ALIGN 
SIGNAL_STYLE_NAME 
SIGNAL_TEXT_SELECTED 
SIGNAL_IMAGE_SELECTED 
SIGNAL_SELECTION_CLEARED 
SIGNAL_ENTER_SELECTION 
SIGNAL_LEAVE_SELECTION 
SIGNAL_TABLE_STATE 
SIGNAL_PAGE_COUNT 
SIGNAL_CURRENT_PAGE 
SIGNAL_ZOOM_PERCENTAGE 
SIGNAL_LAST 

Function Documentation

static bool _abi_widget_bindListenerToView ( AbiWidget widget,
AV_View pView 
) [static]
static void _abi_widget_class_install_signals ( AbiWidgetClass klazz  )  [static]
static void _abi_widget_releaseListener ( AbiWidget widget  )  [static]
static gboolean _abi_widget_set_show_margin ( AbiWidget abi,
gboolean  bShowMargin 
) [static]
static void _abi_widget_unbindListener ( AbiWidget widget  )  [static]
static FV_View* _get_fv_view ( AbiWidget w  )  [static]
static void abi_widget_class_init ( AbiWidgetClass abi_class  )  [static]

References _abi_widget_class_install_signals(), _AbiWidgetClass::align_center, _AbiWidgetClass::align_justify, _AbiWidgetClass::align_left, _AbiWidgetClass::align_right, CONTENT, CONTENT_LENGTH, _AbiWidgetClass::copy, CURSOR_ON, _AbiWidgetClass::cut, _AbiWidgetClass::delete_bob, _AbiWidgetClass::delete_bod, _AbiWidgetClass::delete_bol, _AbiWidgetClass::delete_bow, _AbiWidgetClass::delete_eob, _AbiWidgetClass::delete_eod, _AbiWidgetClass::delete_eol, _AbiWidgetClass::delete_eow, _AbiWidgetClass::delete_left, _AbiWidgetClass::delete_right, _AbiWidgetClass::edit_footer, _AbiWidgetClass::edit_header, EM_NAME, _AbiWidgetClass::file_open, _AbiWidgetClass::file_save, _AbiWidgetClass::insert_data, _AbiWidgetClass::insert_space, _AbiWidgetClass::invoke, _AbiWidgetClass::invoke_ex, _AbiWidgetClass::moveto_bob, _AbiWidgetClass::moveto_bod, _AbiWidgetClass::moveto_bol, _AbiWidgetClass::moveto_bop, _AbiWidgetClass::moveto_bow, _AbiWidgetClass::moveto_eob, _AbiWidgetClass::moveto_eod, _AbiWidgetClass::moveto_eol, _AbiWidgetClass::moveto_eop, _AbiWidgetClass::moveto_eow, _AbiWidgetClass::moveto_left, _AbiWidgetClass::moveto_next_line, _AbiWidgetClass::moveto_next_page, _AbiWidgetClass::moveto_next_screen, _AbiWidgetClass::moveto_prev_line, _AbiWidgetClass::moveto_prev_page, _AbiWidgetClass::moveto_prev_screen, _AbiWidgetClass::moveto_right, _AbiWidgetClass::moveto_to_xy, parent_class, _AbiWidgetClass::paste, _AbiWidgetClass::paste_special, _AbiWidgetClass::redo, _AbiWidgetClass::remove_footer, _AbiWidgetClass::remove_header, _AbiWidgetClass::save_immediate, _AbiWidgetClass::select_all, _AbiWidgetClass::select_block, _AbiWidgetClass::select_bob, _AbiWidgetClass::select_bod, _AbiWidgetClass::select_bol, _AbiWidgetClass::select_bow, _AbiWidgetClass::select_eob, _AbiWidgetClass::select_eod, _AbiWidgetClass::select_eol, _AbiWidgetClass::select_eow, _AbiWidgetClass::select_left, _AbiWidgetClass::select_line, _AbiWidgetClass::select_next_line, _AbiWidgetClass::select_page_down, _AbiWidgetClass::select_page_up, _AbiWidgetClass::select_prev_line, _AbiWidgetClass::select_right, _AbiWidgetClass::select_screen_down, _AbiWidgetClass::select_screen_up, _AbiWidgetClass::select_to_xy, _AbiWidgetClass::select_word, SELECTION, SELECTION_LENGTH, SHADOW_TYPE, _AbiWidgetClass::toggle_bold, _AbiWidgetClass::toggle_bottomline, _AbiWidgetClass::toggle_bullets, _AbiWidgetClass::toggle_insert_mode, _AbiWidgetClass::toggle_italic, _AbiWidgetClass::toggle_numbering, _AbiWidgetClass::toggle_overline, _AbiWidgetClass::toggle_plain, _AbiWidgetClass::toggle_strike, _AbiWidgetClass::toggle_sub, _AbiWidgetClass::toggle_super, _AbiWidgetClass::toggle_topline, _AbiWidgetClass::toggle_underline, _AbiWidgetClass::toggle_unindent, _AbiWidgetClass::undo, UNLINK_AFTER_LOAD, _AbiWidgetClass::view_formatting_marks, _AbiWidgetClass::view_normal_layout, _AbiWidgetClass::view_online_layout, _AbiWidgetClass::view_print_layout, VIEWNORMALLAYOUT, VIEWPARA, VIEWPRINTLAYOUT, VIEWWEBLAYOUT, _AbiWidgetClass::zoom_whole, and _AbiWidgetClass::zoom_width.

static void abi_widget_construct ( AbiWidget ,
const char *   
) [static]

References UT_DEBUGMSG.

Referenced by abi_widget_new(), and abi_widget_new_with_file().

static void abi_widget_destroy_gtk ( GtkObject *  object  )  [static]
void abi_widget_draw ( AbiWidget w  ) 
gboolean abi_widget_file_open ( AbiWidget abi  ) 
gboolean abi_widget_find_next ( AbiWidget w,
gboolean  sel_start 
)
gboolean abi_widget_find_prev ( AbiWidget w  ) 
gchar* abi_widget_get_content ( AbiWidget w,
const char *  extension_or_mimetype,
const char *  exp_props,
gint *  iLength 
)

Extract all the content in the document. Caller must g_free the memory. Number of bytes is returned in iLength

References gchar, XAP_App::getApp(), XAP_App::getPrefs(), _AbiPrivData::m_iContentLength, _AbiPrivData::m_pDoc, _AbiWidget::priv, s_abi_widget_get_file_type(), PD_Document::saveAs(), XAP_Prefs::setIgnoreNextRecent(), size, UT_OK, and UT_return_val_if_fail.

Referenced by abi_widget_get_prop().

guint32 abi_widget_get_current_page_num ( AbiWidget w  ) 
const gchar** abi_widget_get_font_names ( AbiWidget  ) 
XAP_Frame* abi_widget_get_frame ( AbiWidget w  ) 
gboolean abi_widget_get_mouse_pos ( AbiWidget w,
gint32 *  x,
gint32 *  y 
)
guint32 abi_widget_get_page_count ( AbiWidget w  ) 
static void abi_widget_get_prop ( GObject *  object,
guint  arg_id,
GValue *  arg,
GParamSpec *   
) [static]
void abi_widget_get_property ( GObject *  object,
guint  arg_id,
GValue *  arg,
GParamSpec *  pspec 
)
gchar* abi_widget_get_selection ( AbiWidget w,
const gchar *  extension_or_mimetype,
gint *  iLength 
)

Extract all the content in the selection Caller must g_free the memory. Number of bytes is returned in iLength

Referenced by abi_widget_get_prop().

gboolean abi_widget_get_show_authors ( AbiWidget abi  ) 
gboolean abi_widget_get_show_margin ( AbiWidget abi  ) 
GType abi_widget_get_type ( void   ) 
gboolean abi_widget_get_word_selections ( AbiWidget abi  ) 
guint32 abi_widget_get_zoom_percentage ( AbiWidget w  ) 
static void abi_widget_grab_focus ( GtkWidget *  widget  )  [static]
static void abi_widget_init ( AbiWidget abi  )  [static]

References _AbiWidget::priv.

gboolean abi_widget_insert_image ( AbiWidget w,
char *  szFile,
gboolean  positioned 
)
gboolean abi_widget_insert_table ( AbiWidget abi,
gint32  rows,
gint32  cols 
)
gboolean abi_widget_invoke ( AbiWidget w,
const char *  mthdName 
)

abi_widget_invoke()

Invoke any of abiword's edit methods by name

Parameters:
w - An AbiWord widget
mthdName - A null-terminated string representing the method's name
Returns:
FALSE if any preconditions fail
TRUE|FALSE depending on the result of the EditMethod's completion

example usage:

gboolean b = FALSE; GtkWidget * w = abi_widget_new ();

b = abi_widget_invoke (ABI_WIDGET(w), "alignCenter");

Referenced by abi_widget_file_open().

gboolean abi_widget_invoke_ex ( AbiWidget w,
const char *  mthdName,
const char *  data,
gint32  x,
gint32  y 
)

abi_widget_invoke_ex()

Invoke any of abiword's edit methods by name

Parameters:
w - An AbiWord widget
mthdName - A null-terminated string representing the method's name
data - an optional null-terminated string data to pass to the method
x - an optional x-coordinate to pass to the method (usually 0)
y - an optional y-coordinate to pass to the method (usuall 0)
Returns:
FALSE if any preconditions fail
TRUE|FALSE depending on the result of the EditMethod's completion

example usage:

gboolean b = FALSE; GtkWidget * w = abi_widget_new ();

b = abi_widget_invoke_ex (ABI_WIDGET(w), "insertData", "Hello World!", 0, 0); b = abi_widget_invoke_ex (ABI_WIDGET(w), "alignCenter", 0, 0, 0);

Referenced by abi_widget_invoke(), abi_widget_set_font_name(), and abi_widget_set_font_size().

gboolean abi_widget_load_file ( AbiWidget w,
const gchar *  pszFile,
const gchar *  extension_or_mimetype 
)
gboolean abi_widget_load_file_from_gsf ( AbiWidget w,
GsfInput *  input 
)
gboolean abi_widget_load_file_from_memory ( AbiWidget w,
const gchar *  extension_or_mimetype,
const gchar *  buf,
gint  length 
)
GtkWidget* abi_widget_new ( void   ) 

abi_widget_new

Creates a new AbiWord widget using an internal Abiword App

GtkWidget* abi_widget_new_with_file ( const gchar *  file  ) 

abi_widget_new_with_file

Creates a new AbiWord widget and tries to load the file This uses an internal Abiword App

Parameters:
file - A file on your HD

Referenced by AP_UnixApp::AP_UnixApp().

static void abi_widget_realize ( GtkWidget *  widget  )  [static]
GdkPixbuf* abi_widget_render_page_to_image ( AbiWidget abi,
int  iPage 
)

Caller owns the returned GdkPixmap and must free it after use. The first page is "1"

gboolean abi_widget_save ( AbiWidget w,
const char *  fname,
const char *  extension_or_mimetype,
const char *  exp_props 
)
gboolean abi_widget_save_to_gsf ( AbiWidget w,
GsfOutput *  output,
const char *  extension_or_mimetype,
const char *  exp_props 
)
void abi_widget_set_current_page ( AbiWidget w,
guint32  curpage 
)
void abi_widget_set_find_string ( AbiWidget w,
gchar *  search_str 
)
gboolean abi_widget_set_font_name ( AbiWidget w,
gchar *  szName 
)
gboolean abi_widget_set_font_size ( AbiWidget w,
gchar *  szSize 
)
static void abi_widget_set_prop ( GObject *  object,
guint  arg_id,
const GValue *  arg,
GParamSpec *   
) [static]
void abi_widget_set_property ( GObject *  object,
guint  arg_id,
const GValue *  arg,
GParamSpec *  pspec 
)
gboolean abi_widget_set_show_authors ( AbiWidget abi,
gboolean  bShowAuthors 
)
gboolean abi_widget_set_show_margin ( AbiWidget abi,
gboolean  bShowMargin 
)
gboolean abi_widget_set_style ( AbiWidget w,
gchar *  szName 
)
gboolean abi_widget_set_text_color ( AbiWidget w,
guint8  red,
guint8  green,
guint8  blue 
)
gboolean abi_widget_set_word_selections ( AbiWidget abi,
gboolean  gb 
)
gboolean abi_widget_set_zoom_percentage ( AbiWidget w,
guint32  zoom 
)
static void abi_widget_size_allocate ( GtkWidget *  widget,
GtkAllocation *  allocation 
) [static]
static void abi_widget_size_request ( GtkWidget *  widget,
GtkRequisition *  requisition 
) [static]

References ABI_WIDGET.

void abi_widget_turn_on_cursor ( AbiWidget abi  ) 

Referenced by abi_widget_set_prop().

static void abiwidget_add ( GtkContainer *  container,
GtkWidget *  widget 
) [static]
static GType abiwidget_child_type ( GtkContainer *  container  )  [static]
static void abiwidget_remove ( GtkContainer *  container,
GtkWidget *  widget 
) [static]
void g_cclosure_user_marshal_VOID__INT_INT_INT ( GClosure *  closure,
GValue *  ,
guint  n_param_values,
const GValue *  param_values,
gpointer  ,
gpointer  marshal_data 
)
static IEFileType s_abi_widget_get_file_type ( const char *  extension_or_mimetype,
const char *  contents,
UT_uint32  contents_len,
bool  bImport 
) [static]
static gboolean s_abi_widget_map_cb ( GObject *  w,
gpointer  p 
) [static]
static void s_LoadingCursorCallback ( UT_Worker pTimer  )  [static]
static void s_StartStopLoadingCursor ( bool  bStartStop,
XAP_Frame pFrame 
) [static]

Control Method for the updating loader.

Parameters:
bool bStartStop true to start the updating loader, flase to stop it after the document has loaded.
XAP_Frame * pFrame Pointer to the new frame being loaded.

References AV_FOCUS_HERE, DELETEP, FV_View::focusChange(), XAP_Frame::getCurrentDoc(), XAP_Frame::getCurrentView(), GR_Graphics::GR_CURSOR_DEFAULT, s_LoadingCursorCallback(), UT_Timer::set(), XAP_Frame::setCursor(), FV_View::setCursorToContext(), UT_Timer::start(), UT_Timer::static_constructor(), and UT_Timer::stop().

Referenced by abi_widget_load_file(), abi_widget_load_file_from_gsf(), and abi_widget_load_file_from_memory().


Variable Documentation

const guint32 ABI_DEFAULT_HEIGHT = 250 [static]
const guint32 ABI_DEFAULT_WIDTH = 250 [static]
guint abiwidget_signals[SIGNAL_LAST] = { 0 } [static]
GtkBinClass* parent_class = 0 [static]
bool s_bFirstDrawDone = false [static]
bool s_bFreshDraw = false [static]
AD_Document* s_pLoadingDoc = NULL [static]
XAP_Frame* s_pLoadingFrame = NULL [static]
UT_Timer* s_pToUpdateCursor = NULL [static]