EText
Details
struct ETextSuckFont
struct ETextSuckFont {
guchar *bitmap;
gint bitmap_width;
gint bitmap_height;
gint ascent;
ETextSuckChar chars[256];
};
struct ETextSuckChar
struct ETextSuckChar {
int left_sb;
int right_sb;
int width;
int ascent;
int descent;
int bitmap_offset; /* in pixels */
};
struct EText
struct EText {
GnomeCanvasItem item;
ETextModel *model;
gint model_changed_signal_id;
char *text; /* Text to display */
gpointer lines; /* Text split into lines (private field) */
int num_lines; /* Number of lines of text */
#if 0
GdkFont *font; /* Font for text */
#else
EFont *font;
#endif
GtkAnchorType anchor; /* Anchor side for text */
GtkJustification justification; /* Justification for text */
double clip_width; /* Width of optional clip rectangle */
double clip_height; /* Height of optional clip rectangle */
double xofs, yofs; /* Text offset distance from anchor position */
gulong pixel; /* Fill color */
GdkBitmap *stipple; /* Stipple for text */
GdkGC *gc; /* GC for drawing text */
int cx, cy; /* Top-left canvas coordinates for text */
int clip_cx, clip_cy; /* Top-left canvas coordinates for clip rectangle */
int clip_cwidth, clip_cheight; /* Size of clip rectangle in pixels */
int max_width; /* Maximum width of text lines */
int width; /* Rendered text width in pixels */
int height; /* Rendered text height in pixels */
guint clip : 1; /* Use clip rectangle? */
guint fill_clip_rectangle : 1; /* Fill the clipping rectangle. */
/* Antialiased specific stuff follows */
#if 0
ETextSuckFont *suckfont; /* Sucked font */
#endif
guint32 rgba; /* RGBA color for text */
double affine[6]; /* The item -> canvas affine */
char *ellipsis; /* The ellipsis characters. NULL = "...". */
double ellipsis_width; /* The width of the ellipsis. */
gboolean use_ellipsis; /* Whether to use the ellipsis. */
gboolean editable; /* Item is editable */
gboolean editing; /* Item is currently being edited */
int xofs_edit; /* Offset because of editing */
int yofs_edit; /* Offset because of editing */
/* This needs to be reworked a bit once we get line wrapping. */
int selection_start; /* Start of selection IN BYTES */
int selection_end; /* End of selection IN BYTES */
gboolean select_by_word; /* Current selection is by word */
/* This section is for drag scrolling and blinking cursor. */
gint timeout_id; /* Current timeout id for scrolling */
GTimer *timer; /* Timer for blinking cursor and scrolling */
gint lastx, lasty; /* Last x and y motion events */
gint last_state; /* Last state */
gulong scroll_start; /* Starting time for scroll (microseconds) */
gint show_cursor; /* Is cursor currently shown */
gboolean button_down; /* Is mouse button 1 down */
ETextEventProcessor *tep; /* Text Event Processor */
gint tep_command_id;
GtkWidget *invisible; /* For selection handling */
gboolean has_selection; /* TRUE if we have the selection */
gchar *primary_selection; /* Primary selection text */
gint primary_length; /* Primary selection text length */
gchar *clipboard_selection; /* Clipboard selection text */
gint clipboard_length; /* Clipboard selection text length*/
guint pointer_in : 1; /* Is the pointer currently over us? */
guint default_cursor_shown : 1; /* Is the default cursor currently shown? */
guint draw_borders : 1; /* Draw borders? */
guint line_wrap : 1; /* Do line wrap */
gchar *break_characters; /* Characters to optionally break after */
gint max_lines; /* Max number of lines (-1 = infinite) */
GdkCursor *default_cursor; /* Default cursor (arrow) */
GdkCursor *i_cursor; /* I beam cursor */
gint tooltip_timeout; /* Timeout for the tooltip */
GtkWidget *tooltip_window; /* GtkWindow for displaying the tooltip */
gint tooltip_count; /* GDK_ENTER_NOTIFY count. */
guint needs_redraw : 1; /* Needs redraw */
guint needs_recalc_bounds : 1; /* Need recalc_bounds */
guint needs_calc_height : 1; /* Need calc_height */
guint needs_calc_line_widths : 1; /* Needs calc_line_widths */
guint needs_split_into_lines : 1; /* Needs split_into_lines */
gint dbl_timeout; /* Double click timeout */
gint tpl_timeout; /* Triple click timeout */
};