medit/moo/mooedit/mootextview-private.h

210 lines
6.8 KiB
C
Raw Normal View History

2006-05-21 16:11:05 -07:00
/*
* mootextview-private.h
*
2007-04-07 01:21:52 -07:00
* Copyright (C) 2004-2007 by Yevgen Muntyan <muntyan@math.tamu.edu>
*
2007-06-24 10:56:20 -07:00
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* See COPYING file that comes with this distribution.
*/
#ifndef MOOEDIT_COMPILATION
#error "Do not include this file"
#endif
#ifndef MOO_TEXT_VIEW_PRIVATE_H
#define MOO_TEXT_VIEW_PRIVATE_H
#include "mooedit/mootextview.h"
2005-12-12 20:22:40 -08:00
#include "mooedit/mootextsearch.h"
#include "mooutils/moohistorylist.h"
2006-04-04 23:22:26 -07:00
#include <gtk/gtk.h>
G_BEGIN_DECLS
/***********************************************************************/
/* GtkTextView stuff
2006-12-04 02:54:12 -08:00
*/
void _moo_text_view_move_cursor (GtkTextView *text_view,
GtkMovementStep step,
gint count,
gboolean extend_selection);
void _moo_text_view_page_horizontally (GtkTextView *text_view,
int count,
gboolean extend_selection);
void _moo_text_view_delete_from_cursor (GtkTextView *text_view,
GtkDeleteType type,
gint count);
int _moo_text_view_key_press_event (GtkWidget *widget,
GdkEventKey *event);
int _moo_text_view_key_release_event (GtkWidget *widget,
GdkEventKey *event);
int _moo_text_view_button_press_event (GtkWidget *widget,
GdkEventButton *event);
int _moo_text_view_button_release_event (GtkWidget *widget,
GdkEventButton *event);
int _moo_text_view_motion_event (GtkWidget *widget,
GdkEventMotion *event);
int _moo_text_view_extend_selection (MooTextView *view,
MooTextSelectionType type,
GtkTextIter *insert,
GtkTextIter *selection_bound);
void _moo_text_view_check_char_inserted (MooTextView *view);
void _moo_text_view_pend_cursor_blink (MooTextView *view);
int _moo_text_view_get_line_height (MooTextView *view);
2006-11-13 22:58:23 -08:00
void _moo_text_view_set_line_numbers_font (MooTextView *view,
const char *name);
typedef enum {
MOO_TEXT_VIEW_DRAG_NONE = 0,
MOO_TEXT_VIEW_DRAG_SELECT,
MOO_TEXT_VIEW_DRAG_DRAG,
MOO_TEXT_VIEW_DRAG_SELECT_LINES
} MooTextViewDragType;
2005-12-12 20:22:40 -08:00
typedef enum {
MOO_TEXT_VIEW_POS_LEFT,
MOO_TEXT_VIEW_POS_RIGHT,
MOO_TEXT_VIEW_POS_TOP,
MOO_TEXT_VIEW_POS_BOTTOM,
MOO_TEXT_VIEW_POS_INVALID
} MooTextViewPos;
2007-07-15 02:51:58 -07:00
typedef enum {
MOO_TEXT_VIEW_COLOR_CURRENT_LINE,
MOO_TEXT_VIEW_COLOR_RIGHT_MARGIN,
MOO_TEXT_VIEW_N_COLORS
} MooTextViewColor;
struct _MooTextViewPrivate {
gboolean constructed;
2006-04-28 22:37:29 -07:00
GdkRectangle *update_rectangle;
gboolean in_expose;
guint update_idle;
2005-11-21 00:00:10 -08:00
/* Clipboard */
gboolean manage_clipboard;
/* Overwrite mode cursor */
gboolean overwrite_mode;
gboolean saved_cursor_visible;
gboolean cursor_visible;
guint blink_timeout;
2005-11-21 00:00:10 -08:00
/***********************************************************************/
/* Drawing
2006-12-04 02:54:12 -08:00
*/
2006-08-26 02:46:29 -07:00
MooTextStyleScheme *style_scheme;
guint tab_width;
2007-07-15 02:51:58 -07:00
gboolean color_settings[MOO_TEXT_VIEW_N_COLORS];
char *colors[MOO_TEXT_VIEW_N_COLORS];
GdkGC *gcs[MOO_TEXT_VIEW_N_COLORS];
guint right_margin_offset;
int right_margin_pixel_offset;
2005-11-21 00:00:10 -08:00
gboolean draw_tabs;
gboolean draw_trailing_spaces;
gboolean highlight_matching_brackets;
gboolean highlight_mismatching_brackets;
2006-11-23 18:09:41 -08:00
struct {
gboolean show_icons;
int icon_width;
gboolean show_numbers;
int digit_width;
int numbers_width;
2006-11-23 18:09:41 -08:00
PangoFontDescription *numbers_font;
gboolean show_folds;
int fold_width;
} lm;
2006-11-23 18:09:41 -08:00
int n_lines;
guint update_n_lines_idle;
gboolean enable_folding;
2006-11-23 18:09:41 -08:00
GSList *line_marks;
/***********************************************************************/
/* Search
2006-12-04 02:54:12 -08:00
*/
int last_search_stamp;
GtkTextMark *last_found_start, *last_found_end;
/***********************************************************************/
/* Indentation
2006-12-04 02:54:12 -08:00
*/
MooIndenter *indenter;
gboolean backspace_indents;
gboolean enter_indents;
MooTextTabKeyAction tab_key_action;
/***********************************************************************/
/* Keyboard
2006-12-04 02:54:12 -08:00
*/
2005-11-11 12:08:24 -08:00
gboolean smart_home_end;
gboolean ctrl_up_down_scrolls;
gboolean ctrl_page_up_down_scrolls;
/* key press handler sets this flag in order to distinguish typed in
characters in buffer's insert-text signal */
gboolean in_key_press;
gunichar char_inserted;
int char_inserted_offset;
/***********************************************************************/
/* Selection and drag
2006-12-04 02:54:12 -08:00
*/
struct {
guint scroll_timeout;
GdkEventType button;
MooTextViewDragType type;
int start_x; /* buffer coordinates */
int start_y; /* buffer coordinates */
2007-04-08 08:12:07 -07:00
GtkTextMark *start_mark;
guint moved : 1;
guint double_click_selects_brackets : 1;
guint double_click_selects_inside : 1;
} dnd;
2005-11-17 21:13:25 -08:00
/***********************************************************************/
/* Drag'n'drop from outside
2006-12-04 02:54:12 -08:00
*/
2005-11-17 21:13:25 -08:00
gboolean drag_inside;
gboolean drag_drop;
GtkTargetList *targets;
GtkTextMark *dnd_mark;
2005-12-12 20:22:40 -08:00
/***********************************************************************/
/* Children
2006-12-04 02:54:12 -08:00
*/
2006-03-31 22:11:58 -08:00
GtkWidget *children[4];
GSList *boxes;
2005-12-12 20:22:40 -08:00
/***********************************************************************/
/* Search
2006-12-04 02:54:12 -08:00
*/
2006-04-04 23:22:26 -07:00
struct {
gboolean enable;
gboolean in_search;
GtkWidget *evbox;
GtkWidget *entry;
GtkToggleButton *case_sensitive;
GtkToggleButton *regex;
MooTextSearchFlags flags;
} qs;
2005-11-17 21:13:25 -08:00
};
enum {
DND_TARGET_TEXT = 1
};
G_END_DECLS
#endif /* MOO_TEXT_VIEW_PRIVATE_H */