/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* EText - Text item for evolution. * Copyright (C) 2000 Helix Code, Inc. * * Author: Chris Lahey * * A majority of code taken from: * * Text item type for GnomeCanvas widget * * GnomeCanvas is basically a port of the Tk toolkit's most excellent * canvas widget. Tk is copyrighted by the Regents of the University * of California, Sun Microsystems, and other parties. * * Copyright (C) 1998 The Free Software Foundation * * Author: Federico Mena */ #ifndef E_TEXT_H #define E_TEXT_H #include #include "e-text-event-processor.h" #include "e-text-model.h" BEGIN_GNOME_DECLS /* Text item for the canvas. Text items are positioned by an anchor point and an anchor direction. * * A clipping rectangle may be specified for the text. The rectangle is anchored at the text's anchor * point, and is specified by clipping width and height parameters. If the clipping rectangle is * enabled, it will clip the text. * * In addition, x and y offset values may be specified. These specify an offset from the anchor * position. If used in conjunction with the clipping rectangle, these could be used to implement * simple scrolling of the text within the clipping rectangle. * * The following object arguments are available: * * name type read/write description * ------------------------------------------------------------------------------------------ * text string RW The string of the text label * x double RW X coordinate of anchor point * y double RW Y coordinate of anchor point * font string W X logical font descriptor * fontset string W X logical fontset descriptor * font_gdk GdkFont* RW Pointer to a GdkFont * anchor GtkAnchorType RW Anchor side for the text * justification GtkJustification RW Justification for multiline text * fill_color string W X color specification for text * fill_color_gdk GdkColor* RW Pointer to an allocated GdkColor * fill_stipple GdkBitmap* RW Stipple pattern for filling the text * clip_width double RW Width of clip rectangle * clip_height double RW Height of clip rectangle * clip boolean RW Use clipping rectangle? * x_offset double RW Horizontal offset distance from anchor position * y_offset double RW Vertical offset distance from anchor position * text_width double R Used to query the width of the rendered text * text_height double R Used to query the rendered height of the text * width double RW A synonym for clip_width * height double R A synonym for text_height * * These are currently ignored in the AA version: * editable boolean RW Can this item be edited * use_ellipsis boolean RW Whether to use ellipsises if text gets cut off. Meaningless if clip == false. * ellipsis string RW The characters to use as ellipsis. NULL = "...". * line_wrap boolean RW Line wrap when not editing. * break_characters string RW List of characters to optionally break on. * max_lines int RW Number of lines possible when doing line wrap. */ #define E_TYPE_TEXT (e_text_get_type ()) #define E_TEXT(obj) (GTK_CHECK_CAST ((obj), E_TYPE_TEXT, EText)) #define E_TEXT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_TEXT, ETextClass)) #define E_IS_TEXT(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_TEXT)) #define E_IS_TEXT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), E_TYPE_TEXT)) typedef struct _EText EText; typedef struct _ETextClass ETextClass; typedef struct _ETextSuckFont ETextSuckFont; typedef struct _ETextSuckChar ETextSuckChar; struct _ETextSuckChar { int left_sb; int right_sb; int width; int ascent; int descent; int bitmap_offset; /* in pixels */ }; struct _ETextSuckFont { guchar *bitmap; gint bitmap_width; gint bitmap_height; gint ascent; ETextSuckChar chars[256]; }; 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 */ double x, y; /* Position at anchor */ GdkFont *font; /* Font for text */ 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? */ /* Antialiased specific stuff follows */ ETextSuckFont *suckfont; /* Sucked font */ 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 */ /* This needs to be reworked a bit once we get line wrapping. */ int selection_start; /* Start of selection */ int selection_end; /* End of selection */ 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 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 */ }; struct _ETextClass { GnomeCanvasItemClass parent_class; void (* resize) (EText *text); void (* change) (EText *text); }; /* Standard Gtk function */ GtkType e_text_get_type (void); END_GNOME_DECLS #endif ermissions, fix install by non-rootamdmi32015-10-132-17/+12 * - Add missing directories to plist, fixing stage-qaamdmi32015-10-132-10/+19 * Remove #pragma to fix build with all compiler versionsjohans2015-10-111-0/+1 * Remove trailing whitespace from Makefiles, M-X.olgeni2015-10-081-1/+1 * - cleanupdinoex2015-10-081-13/+11 * - cleanupdinoex2015-10-082-20/+3 * Move BROKEN to the correct place, suck-cnews slave builds fineantoine2015-10-041-2/+1 * Mark BROKEN: fails to linkantoine2015-10-041-0/+2 * - cleanupdinoex2015-09-292-27/+1 * Fix leftover directory.mandree2015-09-241-1/+0 * - Remove obsolete MAN1amdmi32015-09-231-1/+0 * Rework husky ports to use a more conventional MASTER/SLAVE port pattern.bdrewery2015-09-228-54/+34 * Update to INN 2.6.0johans2015-09-226-66/+66 * Make all GNUstep ports install into the System domain so that the Local domai...theraven2015-09-192-13/+13 * - Fix shebangsamdmi32015-09-021-2/+3 * - Switch to options helpersamdmi32015-09-021-7/+4 * - Add NO_ARCHamdmi32015-08-282-11/+3 * Update to new upstream release 1.11.11. (Bugfixes)mandree2015-08-254-15/+38 * - Add LICENSEamdmi32015-08-211-0/+3 * Reset maintainererwin2015-08-191-1/+1 * Remove UNIQUENAME and LATEST_LINK.mat2015-08-172-3/+0 * - support disk with more than 4G blocks freedinoex2015-08-012-1/+12 * - Fix shebangsamdmi32015-08-011-1/+26 * Switch default python_CMD used by shebangfix to ${PYTHON_CMD} for portsantoine2015-07-301-2/+1 * Update to 2.21.svnmir2015-07-202-3/+3 * - Drop @dirrm* from plistamdmi32015-07-161-4/+0 * - Update to INN 2.5.5johans2015-07-133-58/+36 * - Drop @dirrm* from plistamdmi32015-07-131-2/+0 * Update tin to 2.3.1johans2015-07-102-4/+3 * Convert to USES=jpegantoine2015-06-231-3/+2 * - Strip binaryamdmi32015-06-191-1/+4 * Reset maintainership for obrienerwin2015-06-131-1/+1 * - Switch to USES=autoreconfamdmi32015-06-112-26/+3 * - Add NO_ARCHsunpoet2015-06-111-1/+2 * - Update to 15.2.1sunpoet2015-06-102-3/+3 * - Add LICENSEamdmi32015-06-082-7/+7 * - Update to 15.0madpilot2015-05-274-9/+10 * Remove $FreeBSD$ from patches files everywhere.mat2015-05-231-3/+0 * - remove option broken by r385280dinoex2015-05-192-34/+7 * - Add CPE infoamdmi32015-05-181-1/+2 * MASTER_SITES cleanup.mat2015-05-1411-22/+11 * - Update to 14.2wen2015-05-072-4/+3 * Remove _*OWNGRP, with staging it's not useful anymoreantoine2015-05-041-1/+1 * Allow packaging as a user by overwriting OWNER/GROUPbapt2015-05-031-1/+2 * Overwrite variables via MAKE_ARGS instead of patching a filebapt2015-05-031-15/+3 * - Update to 15.1.0sunpoet2015-04-222-3/+3 * Bump PORTREVISION after r384253 and r384264jbeich2015-04-191-1/+1 * news/husky-(fidoconf|htick|hpt) : builds INFO pages everywhere againmarino2015-04-193-19/+7 * Add patches to unbreak INFO build on DragonFly and FreeBSD 11+jbeich2015-04-192-0/+45 * news/husky-fidoconf: Test feature rather than OPSYS/OSVERSIONmarino2015-04-181-4/+2 * news/husky-(hpt|htick): Restore build on FreeBSD 11 and DFmarino2015-04-18