X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Ftext-context.h;h=2cceaebb276db073b4ff7b37f8761ac7f98917ce;hb=0dc33d4ce43e0bb49c63aa53b826ec4a1ff68e28;hp=8441cb04be3204f5487ad5d348114b4da70e858c;hpb=6b15695578f07a3f72c4c9475c1a261a3021472a;p=inkscape.git diff --git a/src/text-context.h b/src/text-context.h index 8441cb04b..2cceaebb2 100644 --- a/src/text-context.h +++ b/src/text-context.h @@ -19,8 +19,7 @@ #include #include "event-context.h" -#include -#include +#include <2geom/point.h> #include "libnrtype/Layout-TNG.h" #define SP_TYPE_TEXT_CONTEXT (sp_text_context_get_type ()) @@ -35,48 +34,48 @@ class SPCanvasArena; struct SPTextContext : public SPEventContext { - sigc::connection sel_changed_connection; - sigc::connection sel_modified_connection; - sigc::connection style_set_connection; - sigc::connection style_query_connection; + sigc::connection sel_changed_connection; + sigc::connection sel_modified_connection; + sigc::connection style_set_connection; + sigc::connection style_query_connection; - GtkIMContext *imc; + GtkIMContext *imc; - SPItem *text; // the text we're editing, or NULL if none selected + SPItem *text; // the text we're editing, or NULL if none selected - /* Text item position in root coordinates */ - NR::Point pdoc; - /* Insertion point position */ - Inkscape::Text::Layout::iterator text_sel_start; - Inkscape::Text::Layout::iterator text_sel_end; + /* Text item position in root coordinates */ + Geom::Point pdoc; + /* Insertion point position */ + Inkscape::Text::Layout::iterator text_sel_start; + Inkscape::Text::Layout::iterator text_sel_end; - gchar uni[9]; - bool unimode; - guint unipos; + gchar uni[9]; + bool unimode; + guint unipos; - SPCanvasItem *cursor; - SPCanvasItem *indicator; - SPCanvasItem *frame; // hiliting the first frame of flowtext; FIXME: make this a list to accommodate arbitrarily many chained shapes - std::vector text_selection_quads; - gint timeout; - guint show : 1; - guint phase : 1; - guint nascent_object : 1; // true if we're clicked on canvas to put cursor, but no text typed yet so ->text is still NULL + SPCanvasItem *cursor; + SPCanvasItem *indicator; + SPCanvasItem *frame; // hiliting the first frame of flowtext; FIXME: make this a list to accommodate arbitrarily many chained shapes + std::vector text_selection_quads; + gint timeout; + guint show : 1; + guint phase : 1; + guint nascent_object : 1; // true if we're clicked on canvas to put cursor, but no text typed yet so ->text is still NULL - guint over_text : 1; // true if cursor is over a text object + guint over_text : 1; // true if cursor is over a text object - guint dragging : 2; // dragging selection over text + guint dragging : 2; // dragging selection over text - guint creating : 1; // dragging rubberband to create flowtext - SPCanvasItem *grabbed; // we grab while we are creating, to get events even if the mouse goes out of the window - NR::Point p0; // initial point if the flowtext rect + guint creating : 1; // dragging rubberband to create flowtext + SPCanvasItem *grabbed; // we grab while we are creating, to get events even if the mouse goes out of the window + Geom::Point p0; // initial point if the flowtext rect - /* Preedit String */ - gchar* preedit_string; + /* Preedit String */ + gchar* preedit_string; }; struct SPTextContextClass { - SPEventContextClass parent_class; + SPEventContextClass parent_class; }; /* Standard Gtk function */ @@ -84,6 +83,10 @@ GtkType sp_text_context_get_type (void); bool sp_text_paste_inline(SPEventContext *ec); Glib::ustring sp_text_get_selected_text(SPEventContext const *ec); +SPCSSAttr *sp_text_get_style_at_cursor(SPEventContext const *ec); bool sp_text_delete_selection(SPEventContext *ec); +void sp_text_context_place_cursor (SPTextContext *tc, SPObject *text, Inkscape::Text::Layout::iterator where); +void sp_text_context_place_cursor_at (SPTextContext *tc, SPObject *text, Geom::Point const p); +Inkscape::Text::Layout::iterator *sp_text_context_get_cursor_position(SPTextContext *tc, SPObject *text); #endif