GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

textview.hh

Go to the documentation of this file.
00001 /* GFC-UI: GTK+ Foundation Classes (User Interface Library) 00002 * Copyright (C) 2002-2004 The GFC Development Team. 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00023 00024 #ifndef GFC_GTK_TEXT_VIEW_HH 00025 #define GFC_GTK_TEXT_VIEW_HH 00026 00027 #ifndef GFC_GTK_CONTAINER_HH 00028 #include <gfc/gtk/container.hh> 00029 #endif 00030 00031 #ifndef GFC_GTK_TEXT_BUFFER_HH 00032 #include <gfc/gtk/textbuffer.hh> 00033 #endif 00034 00035 #ifndef GTK_TEXT_VIEW_H 00036 #include <gtk/gtktextview.h> 00037 #endif 00038 00039 namespace GFC { 00040 00041 namespace Pango { 00042 class TabArray; 00043 } 00044 00045 namespace Gtk { 00046 00047 class Menu; 00048 00053 00054 enum TextWindowType 00055 { 00056 TEXT_WINDOW_PRIVATE = GTK_TEXT_WINDOW_PRIVATE, 00057 TEXT_WINDOW_WIDGET = GTK_TEXT_WINDOW_WIDGET, 00058 TEXT_WINDOW_TEXT = GTK_TEXT_WINDOW_TEXT, 00059 TEXT_WINDOW_LEFT = GTK_TEXT_WINDOW_LEFT, 00060 TEXT_WINDOW_RIGHT = GTK_TEXT_WINDOW_RIGHT, 00061 TEXT_WINDOW_TOP = GTK_TEXT_WINDOW_TOP, 00062 TEXT_WINDOW_BOTTOM = GTK_TEXT_WINDOW_BOTTOM 00063 }; 00064 00074 00075 class TextView : public Container 00076 { 00077 friend class G::Object; 00078 00079 TextView(const TextView&); 00080 TextView& operator=(const TextView&); 00081 00082 protected: 00085 00086 explicit TextView(GtkTextView *text_view, bool owns_reference = false); 00093 00097 00098 typedef G::Signal<void, Adjustment*, Adjustment*> SetScrollAdjustmentsSignalType; 00099 typedef G::SignalProxy<TypeInstance, SetScrollAdjustmentsSignalType> SetScrollAdjustmentsSignalProxy; 00100 static const SetScrollAdjustmentsSignalType set_scroll_adjustments_signal; 00107 00108 typedef G::Signal<void, Menu&> PopulatePopupSignalType; 00109 typedef G::SignalProxy<TypeInstance, PopulatePopupSignalType> PopulatePopupSignalProxy; 00110 static const PopulatePopupSignalType populate_popup_signal; 00116 00117 typedef G::Signal<void> SetAnchorSignalType; 00118 typedef G::SignalProxy<TypeInstance, SetAnchorSignalType> SetAnchorSignalProxy; 00119 static const SetAnchorSignalType set_anchor_signal; 00124 00125 typedef G::Signal<void, const String&> InsertAtCursorSignalType; 00126 typedef G::SignalProxy<TypeInstance, InsertAtCursorSignalType> InsertAtCursorSignalProxy; 00127 static const InsertAtCursorSignalType insert_at_cursor_signal; 00133 00135 00136 public: 00139 00140 TextView(); 00144 00145 explicit TextView(TextBuffer& buffer); 00151 00152 virtual ~TextView(); 00154 00158 00159 GtkTextView* gtk_text_view() const; 00161 00162 operator GtkTextView* () const; 00164 00165 TextBuffer* get_buffer() const; 00168 00169 void get_visible_rect(Gdk::Rectangle& visible_rect); 00175 00176 Gdk::Rectangle get_visible_rect() const; 00179 00180 bool get_cursor_visible() const; 00183 00184 void get_iter_location(const TextIter& iter, Gdk::Rectangle& location); 00191 00192 Gdk::Rectangle get_iter_location(const TextIter& iter) const; 00198 00199 TextIter get_iter_at_location(int x, int y) const; 00208 00209 void get_line_yrange(const TextIter& iter, int *y, int *height) const; 00218 00219 int get_line_y(const TextIter& iter) const; 00223 00224 int get_line_height(const TextIter& iter) const; 00228 00229 void get_line_at_y(TextIter& target_iter, int y, int *line_top) const; 00238 00239 TextIter get_line_at_y(int y) const; 00245 00246 Gdk::Window* get_window(TextWindowType window_type) const; 00255 00256 TextWindowType get_window_type(const Gdk::Window& window) const; 00263 00264 int get_border_window_size(TextWindowType type) const; 00268 00269 WrapMode get_wrap_mode() const; 00272 00273 bool get_editable() const; 00278 00279 bool get_overwrite() const; 00282 00283 bool get_accepts_tab() const; 00287 00288 int get_pixels_above_lines() const; 00291 00292 int get_pixels_below_lines() const; 00295 00296 int get_pixels_inside_wrap() const; 00299 00300 Justification get_justification() const; 00303 00304 int get_left_margin() const; 00307 00308 int get_right_margin() const; 00311 00312 int get_indent() const; 00317 00318 Pointer<Pango::TabArray> get_tabs() const; 00324 00325 Pointer<TextAttributes> get_default_attributes() const; 00332 00336 00337 void set_buffer(TextBuffer *buffer); 00344 00345 bool scroll_to_iter(const TextIter& iter, double within_margin, bool use_align, double xalign, double yalign); 00364 00365 void scroll_to_mark(const TextMark& mark, double within_margin, bool use_align, double xalign, double yalign); 00378 00379 void scroll_mark_onscreen(const TextMark& mark); 00383 00384 bool move_mark_onscreen(const TextMark& mark); 00388 00389 bool place_cursor_onscreen(); 00392 00393 void set_cursor_visible(bool setting); 00399 00400 void buffer_to_window_coords(TextWindowType window_type, int buffer_x, int buffer_y, int *window_x, int *window_y); 00410 00411 void window_to_buffer_coords(TextWindowType window_type, int window_x, int window_y, int *buffer_x, int *buffer_y); 00421 00422 void set_border_window_size(TextWindowType window_type, int size); 00432 00433 bool forward_display_line(TextIter& iter); 00444 00445 bool backward_display_line(TextIter& iter); 00456 00457 bool forward_display_line_end(TextIter& iter); 00468 00469 bool backward_display_line_start(TextIter& iter); 00480 00481 bool starts_display_line(const TextIter& iter); 00486 00487 bool move_visually(TextIter& iter, int count); 00493 00494 void add_child_at_anchor(Widget& child, TextChildAnchor& anchor); 00498 00499 void add_child_in_window(Widget& child, TextWindowType which_window, int xpos, int ypos); 00517 00518 void move_child(const Widget& child, int xpos, int ypos); 00523 00524 void set_wrap_mode(WrapMode wrap_mode); 00527 00528 void set_editable(bool setting); 00532 00533 void set_overwrite(bool overwrite); 00536 00537 void set_accepts_tab(bool accepts_tab); 00544 00545 void set_pixels_above_lines(int pixels_above_lines); 00550 00551 void set_pixels_below_lines(int pixels_below_lines); 00556 00557 void set_pixels_inside_wrap(int pixels_inside_wrap); 00563 00564 void set_justification(Justification justification); 00569 00570 void set_left_margin(int left_margin); 00575 00576 void set_right_margin(int right_margin); 00581 00582 void set_indent(int indent); 00587 00588 void set_tabs(const Pango::TabArray& tabs); 00593 00597 00598 const SetScrollAdjustmentsSignalProxy sig_set_scroll_adjustments(); 00601 00602 const PopulatePopupSignalProxy sig_populate_popup(); 00604 00605 const SetAnchorSignalProxy sig_set_anchor(); 00608 00609 const InsertAtCursorSignalProxy sig_insert_at_cursor(); 00612 00614 }; 00615 00616 } // namespace Gtk 00617 00618 } // namespace GFC 00619 00620 #include <gfc/gtk/inline/textview.inl> 00621 00622 #endif // GFC_GTK_TEXT_VIEW_HH 00623 00624

Generated on Tue Aug 24 00:34:32 2004 for GFC-UI by doxygen 1.3.8