Back to index

texmacs  1.0.7.15
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Events | Private Attributes | Friends
edit_main_rep Class Reference

#include <edit_main.hpp>

Inheritance diagram for edit_main_rep:
Inheritance graph
[legend]
Collaboration diagram for edit_main_rep:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 edit_main_rep (server_rep *sv, tm_buffer buf)
 ~edit_main_rep ()
void set_property (scheme_tree what, scheme_tree val)
void set_bool_property (string what, bool val)
void set_int_property (string what, int val)
void set_string_property (string what, string val)
scheme_tree get_property (scheme_tree what)
bool get_bool_property (string what)
int get_int_property (string what)
string get_string_property (string what)
void clear_buffer ()
void new_window ()
void clone_window ()
void tex_buffer ()
url get_name ()
void focus_on_this_editor ()
void notify_page_change ()
void print (url ps_name, bool to_file, int first, int last)
void print_to_file (url ps_name, string first="1", string last="1000000")
void print_buffer (string first="1", string last="1000000")
void export_ps (url ps_name, string first="1", string last="1000000")
array< int > print_snippet (url u, tree t)
void footer_eval (string s)
tree the_line ()
tree the_root ()
tree the_buffer ()
tree the_subtree (path p)
path the_buffer_path ()
path the_path ()
path the_shifted_path ()
void show_tree ()
void show_env ()
void show_path ()
void show_cursor ()
void show_selection ()
void show_meminfo ()
void edit_special ()
void edit_test ()
 operator tree ()
void suspend ()
void resume ()
void get_size (SI &wx, SI &wy)
int get_pixel_size ()
void set_shrinking_factor (int sf)
void invalidate (SI x1, SI y1, SI x2, SI y2)
void invalidate (rectangles rs)
void update_visible ()
SI get_window_height ()
void scroll_to (SI x, SI y1)
void set_extents (SI x1, SI y1, SI x2, SI y2)
void draw_text (renderer ren, rectangles &l)
void draw_surround (renderer ren, rectangle r)
void draw_context (renderer ren, rectangle r)
void draw_env (renderer ren)
void draw_cursor (renderer ren)
void draw_selection (renderer ren)
void draw_graphics (renderer ren)
void draw_pre (renderer ren, rectangle r)
void draw_post (renderer ren, rectangle r)
void draw_with_shadow (rectangle r)
void draw_with_stored (rectangle r)
void notify_change (int changed)
bool has_changed (int question)
int idle_time (int event_type=ANY_EVENT)
int change_time ()
void apply_changes ()
void animate ()
void compute_env_rects (path p, rectangles &rs, bool recurse)
void cursor_visible ()
void selection_visible ()
void full_screen_mode (bool flag)
void before_menu_action ()
void after_menu_action ()
cursor search_cursor (path p)
selection search_selection (path start, path end)
rectangle get_window_extents ()
int get_input_mode ()
void set_input_mode (int mode)
void set_input_normal ()
bool in_normal_mode ()
bool in_search_mode ()
bool in_replace_mode ()
bool in_spell_mode ()
bool kbd_get_command (string which, string &help, command &cmd)
void interrupt_shortcut ()
bool try_shortcut (string comb)
tree kbd (string s)
tree kbd_shortcut (string s)
void key_press (string key)
void emulate_keyboard (string keys, string action="")
bool complete_try ()
void complete_message ()
void complete_start (string prefix, array< string > compls)
bool complete_keypress (string key)
string session_complete_command (tree t)
void custom_complete (tree t)
void mouse_any (string s, SI x, SI y, int mods, time_t t)
void mouse_click (SI x, SI y)
bool mouse_extra_click (SI x, SI y)
void mouse_drag (SI x, SI y)
void mouse_select (SI x, SI y, int mods, bool drag)
void mouse_paste (SI x, SI y)
void mouse_adjust (SI x, SI y)
void mouse_scroll (SI x, SI y, bool up)
cursor get_cursor ()
void set_pointer (string name)
void set_pointer (string curs_name, string mask_name)
void update_active_loci ()
tree compute_text_footer (tree st)
tree compute_operation_footer (tree st)
tree compute_compound_footer (tree t, path p)
bool set_latex_footer (tree st)
bool set_hybrid_footer (tree st)
void set_left_footer (tree l)
void set_left_footer ()
void append_left_footer (tree &l, string env_var)
void set_right_footer (tree r)
void set_right_footer ()
void set_footer ()
void set_message (tree l, tree r="", bool temp=false)
void recall_message ()
void handle_get_size_hint (SI &w, SI &h)
void handle_notify_resize (SI w, SI h)
void handle_keypress (string key, time_t t)
void handle_keypress (keypress_event ev)
void handle_keyboard_focus (bool has_focus, time_t t)
void handle_keyboard_focus (keyboard_focus_event ev)
void handle_mouse (string kind, SI x, SI y, int mods, time_t t)
void handle_mouse (mouse_event ev)
void handle_set_shrinking_factor (int sf)
void handle_clear (SI x1, SI y1, SI x2, SI y2)
void handle_clear (clear_event ev)
void handle_repaint (SI x1, SI y1, SI x2, SI y2)
void handle_repaint (repaint_event ev)
virtual void table_del_format (string var="")=0
virtual path make_cursor_accessible (path p, bool forwards)=0
virtual void show_cursor_if_hidden ()=0
virtual void go_to (SI x, SI y, bool absolute=true)=0
virtual void go_to (path p)=0
virtual void go_left_physical ()=0
virtual void go_right_physical ()=0
virtual void go_left ()=0
virtual void go_right ()=0
virtual void go_up ()=0
virtual void go_down ()=0
virtual void go_start_line ()=0
virtual void go_end_line ()=0
virtual void go_page_up ()=0
virtual void go_page_down ()=0
virtual void go_to_correct (path p)=0
virtual void go_to_start (path p)=0
virtual void go_to_end (path p)=0
virtual void go_to_border (path p, bool at_start)=0
virtual void go_to_here ()=0
virtual void go_start ()=0
virtual void go_end ()=0
virtual void go_start_of (tree_label what)=0
virtual void go_end_of (tree_label what)=0
virtual void go_start_with (string var, string val)=0
virtual void go_end_with (string var, string val)=0
virtual void go_start_paragraph ()=0
virtual void go_end_paragraph ()=0
virtual void go_to_label (string s)=0
virtual tree get_labels ()=0
virtual bool inside_graphics (bool b=true)=0
virtual bool inside_active_graphics (bool b=true)=0
virtual bool over_graphics (SI x, SI y)=0
virtual tree get_graphics ()=0
virtual double get_x ()=0
virtual double get_y ()=0
virtual frame find_frame (bool last=false)=0
virtual grid find_grid ()=0
virtual void find_limits (point &lim1, point &lim2)=0
virtual bool find_graphical_region (SI &x1, SI &y1, SI &x2, SI &y2)=0
virtual point adjust (point p)=0
virtual tree find_point (point p)=0
virtual tree graphical_select (double x, double y)=0
virtual tree graphical_select (double x1, double y1, double x2, double y2)=0
virtual tree get_graphical_object ()=0
virtual void set_graphical_object (tree t)=0
virtual void invalidate_graphical_object ()=0
virtual void draw_graphical_object (renderer ren)=0
virtual bool mouse_graphics (string s, SI x, SI y, int mods, time_t t)=0
virtual void clear_local_info ()=0
virtual void set_data (new_data data)=0
virtual void get_data (new_data &data)=0
virtual SI as_length (string l)=0
virtual string add_lengths (string l1, string l2)=0
virtual string multiply_length (double x, string l)=0
virtual bool is_length (string s)=0
virtual double divide_lengths (string l1, string l2)=0
virtual void drd_update ()=0
virtual bool defined_at_cursor (string var_name)=0
virtual bool defined_at_init (string var_name)=0
virtual bool defined_in_init (string var_name)=0
virtual tree get_env_value (string var_name, path p)=0
virtual tree get_env_value (string var_name)=0
virtual tree get_init_value (string var_name)=0
virtual string get_env_string (string var_name)=0
virtual string get_init_string (string var_name)=0
virtual int get_env_int (string var_name)=0
virtual int get_init_int (string var_name)=0
virtual double get_env_double (string var_name)=0
virtual double get_init_double (string var_name)=0
virtual language get_env_language ()=0
virtual tree exec_texmacs (tree t, path p)=0
virtual tree exec_texmacs (tree t)=0
virtual tree exec_verbatim (tree t, path p)=0
virtual tree exec_verbatim (tree t)=0
virtual tree exec_html (tree t, path p)=0
virtual tree exec_html (tree t)=0
virtual tree exec_latex (tree t, path p)=0
virtual tree exec_latex (tree t)=0
virtual tree texmacs_exec (tree t)=0
virtual tree get_style ()=0
virtual void set_style (tree t)=0
virtual void init_style ()=0
virtual void init_style (string style)=0
virtual void init_add_package (string package)=0
virtual void init_remove_package (string package)=0
virtual void init_env (string var, tree by)=0
virtual void init_default (string var)=0
virtual void typeset_invalidate (path p)=0
virtual void typeset_invalidate_all ()=0
virtual void notify_assign (path p, tree u)=0
virtual void notify_insert (path p, tree u)=0
virtual void notify_remove (path p, int nr)=0
virtual void notify_split (path p)=0
virtual void notify_join (path p)=0
virtual void notify_assign_node (path p, tree_label op)=0
virtual void notify_insert_node (path p, tree t)=0
virtual void notify_remove_node (path p)=0
virtual void notify_set_cursor (path p, tree data)=0
virtual void post_notify (path p)=0
virtual void clear_undo_history ()=0
virtual double this_author ()=0
virtual void archive_state ()=0
virtual void start_editing ()=0
virtual void end_editing ()=0
virtual void start_slave (double a)=0
virtual void mark_start (double a)=0
virtual bool mark_cancel (double a)=0
virtual void mark_end (double a)=0
virtual void add_undo_mark ()=0
virtual void remove_undo_mark ()=0
virtual int undo_possibilities ()=0
virtual void unredoable_undo ()=0
virtual void undo (int i=0)=0
virtual int redo_possibilities ()=0
virtual void redo (int i=0)=0
virtual void require_save ()=0
virtual void notify_save (bool real_save=true)=0
virtual bool need_save (bool real_save=true)=0
virtual void show_history ()=0
virtual observer position_new (path p)=0
virtual void position_delete (observer o)=0
virtual void position_set (observer o, path p)=0
virtual path position_get (observer o)=0
virtual void correct (path p)=0
virtual void correct_concat (path p, int done=0)=0
virtual bool insert_return ()=0
virtual void remove_return (path p)=0
virtual void insert_tree (tree t, path p_in_t)=0
virtual void insert_tree (tree t)=0
virtual void var_insert_tree (tree t, path p_in_t)=0
virtual void remove_text (bool forward)=0
virtual void remove_structure (bool forward)=0
virtual void remove_structure_upwards ()=0
virtual void make_space (tree t)=0
virtual void make_space (string w)=0
virtual void make_space (string w, string y1, string y2)=0
virtual void make_hspace (string s)=0
virtual void make_hspace (string smin, string sdef, string smax)=0
virtual void make_vspace_before (string s)=0
virtual void make_vspace_before (string smin, string sdef, string smax)=0
virtual void make_vspace_after (string s)=0
virtual void make_vspace_after (string smin, string sdef, string smax)=0
virtual void make_htab (string spc)=0
virtual void make_image (string file_name, bool link, string w, string h, string x, string y)=0
virtual void make_rigid ()=0
virtual void make_lprime (string s)=0
virtual void make_rprime (string s)=0
virtual void make_below ()=0
virtual void make_above ()=0
virtual void make_script (bool sup, bool right)=0
virtual void make_fraction ()=0
virtual void make_sqrt ()=0
virtual void make_var_sqrt ()=0
virtual void make_wide (string wide)=0
virtual void make_wide_under (string wide)=0
virtual void make_neg ()=0
virtual void make_tree ()=0
virtual void make_table (int nr_rows=1, int nr_cols=1)=0
virtual void make_subtable (int nr_rows=1, int nr_cols=1)=0
virtual void table_disactivate ()=0
virtual void table_extract_format ()=0
virtual void table_insert_row (bool forward)=0
virtual void table_insert_column (bool forward)=0
virtual void table_remove_row (bool forward, bool flag=false)=0
virtual void table_remove_column (bool forward, bool flag=false)=0
virtual int table_nr_rows ()=0
virtual int table_nr_columns ()=0
virtual void table_set_extents (int rows, int cols)=0
virtual int table_which_row ()=0
virtual int table_which_column ()=0
virtual path table_search_cell (int row, int col)=0
virtual void table_go_to (int row, int col)=0
virtual void table_set_format (string var, tree val)=0
virtual string table_get_format (string var)=0
virtual void table_format_center ()=0
virtual void table_row_decoration (bool forward)=0
virtual void table_column_decoration (bool forward)=0
virtual void table_correct_block_content ()=0
virtual void table_resize_notify ()=0
virtual void set_cell_mode (string mode)=0
virtual string get_cell_mode ()=0
virtual void cell_set_format (string var, tree val)=0
virtual string cell_get_format (string var)=0
virtual void cell_del_format (string var="")=0
virtual void table_test ()=0
virtual bool in_source ()=0
virtual path find_dynamic (path p)=0
virtual void make_compound (tree_label l, int n=-1)=0
virtual void activate ()=0
virtual void go_to_argument (path p, bool start_flag)=0
virtual void insert_argument (path p, bool forward)=0
virtual void insert_argument (bool forward)=0
virtual void remove_empty_argument (path p, bool forward)=0
virtual void remove_argument (path p, bool forward)=0
virtual void remove_argument (bool forward)=0
virtual void make_with (string var, string val)=0
virtual void insert_with (path p, string var, tree val)=0
virtual void remove_with (path p, string var)=0
virtual void make_mod_active (tree_label l)=0
virtual void make_style_with (string var, string val)=0
virtual void make_hybrid ()=0
virtual bool activate_latex ()=0
virtual void activate_hybrid (bool with_args_hint)=0
virtual void activate_symbol ()=0
virtual bool make_return_before ()=0
virtual bool make_return_after ()=0
virtual void temp_proof_fix ()=0
virtual void generate_bibliography (string bib, string sty, string fname)=0
virtual void generate_table_of_contents (string toc)=0
virtual void generate_index (string idx)=0
virtual void generate_glossary (string glo)=0
virtual void generate_aux (string which="")=0
virtual bool get_save_aux ()=0
virtual path semantic_root (path p)=0
virtual bool semantic_active (path p)=0
virtual bool semantic_select (path p, path &q1, path &q2, int mode)=0
virtual void select (path p)=0
virtual void select (path start, path end)=0
virtual void select_all ()=0
virtual void select_line ()=0
virtual void select_from_cursor ()=0
virtual void select_from_cursor_if_active ()=0
virtual void select_from_keyboard (bool flag)=0
virtual void select_from_shift_keyboard ()=0
virtual void select_enlarge_text ()=0
virtual void select_enlarge ()=0
virtual void select_enlarge_environmental ()=0
virtual bool selection_active_any ()=0
virtual bool selection_active_normal ()=0
virtual bool selection_active_table (bool strict=true)=0
virtual bool selection_active_small ()=0
virtual bool selection_active_enlarging ()=0
virtual void selection_raw_set (string key, tree t)=0
virtual tree selection_raw_get (string key)=0
virtual void selection_correct (path i1, path i2, path &o1, path &o2)=0
virtual path selection_get_subtable (int &i1, int &j1, int &i2, int &j2)=0
virtual void selection_get (selection &sel)=0
virtual void selection_get (path &start, path &end)=0
virtual tree selection_get ()=0
virtual path selection_get_start ()=0
virtual path selection_get_end ()=0
virtual path selection_get_path ()=0
virtual path selection_get_cursor_path ()=0
virtual tree selection_get_env_value (string var)=0
virtual void selection_set (string key, tree t, bool persistant=false)=0
virtual void selection_set (tree t)=0
virtual void selection_set_start (path p=path())=0
virtual void selection_set_end (path p=path())=0
virtual void selection_set_paths (path start, path end)=0
virtual void selection_copy (string key="primary")=0
virtual void selection_paste (string key="primary")=0
virtual void selection_clear (string key="primary")=0
virtual void selection_cancel ()=0
virtual void selection_set_import (string fm)=0
virtual void selection_set_export (string fm)=0
virtual string selection_get_import ()=0
virtual string selection_get_export ()=0
virtual void selection_cut (string key="primary")=0
virtual tree selection_get_cut ()=0
virtual void selection_move ()=0
virtual void cut (path p)=0
virtual void cut (path start, path end)=0
virtual path manual_focus_get ()=0
virtual void manual_focus_set (path p, bool force=true)=0
virtual void manual_focus_release ()=0
virtual path focus_get (bool skip_flag=true)=0
virtual bool inside (string what)=0
virtual bool inside (tree_label l)=0
virtual bool inside_with (string var, string val)=0
virtual string inside_which (tree t)=0
virtual path search_upwards (string what)=0
virtual path search_upwards (tree_label l)=0
virtual path search_parent_upwards (tree_label l)=0
virtual path search_parent_upwards (tree_label l, int &last)=0
virtual path search_upwards_with (string var, string val)=0
virtual path search_upwards_in_set (tree t)=0
virtual path search_previous_compound (path init, string which)=0
virtual path search_next_compound (path init, string which)=0
virtual void search_start (bool forward=true)=0
virtual void search_button_next ()=0
virtual bool search_keypress (string s)=0
virtual tree search_tree ()=0
virtual void replace_start (tree what, tree by, bool forward=true)=0
virtual bool replace_keypress (string s)=0
virtual void spell_start ()=0
virtual void spell_replace (string by)=0
virtual bool spell_keypress (string s)=0
virtual tm_ostreamprint (tm_ostream &out)
virtual void send (slot s, blackbox val)
virtual void send (slot s, blackbox val)
virtual blackbox query (slot s, int type_id)
virtual blackbox query (slot s, int type_id)
virtual widget read (slot s, blackbox index)
virtual widget read (slot s, blackbox index)
virtual void write (slot s, blackbox index, widget w)
virtual void write (slot s, blackbox index, widget w)
virtual void notify (slot s, blackbox new_val)
virtual void notify (slot s, blackbox new_val)
virtual TMMenuItemas_menuitem ()
virtual QAction * as_qaction ()
virtual QWidget * get_canvas ()
 Get a texmacs canvas (if available).
QTMWidgettm_canvas ()
void handle_get_size (get_size_event ev)
void handle_attach_window (attach_window_event ev)
void handle_resize (resize_event ev)
void handle_set_integer (set_integer_event ev)
void handle_set_coord2 (set_coord2_event ev)
void handle_get_coord2 (get_coord2_event ev)
virtual void handle_get_integer (get_integer_event ev)
virtual void handle_get_double (get_double_event ev)
virtual void handle_get_string (get_string_event ev)
virtual void handle_get_coord1 (get_coord1_event ev)
virtual void handle_get_coord3 (get_coord3_event ev)
virtual void handle_get_coord4 (get_coord4_event ev)
virtual void handle_set_double (set_double_event ev)
virtual void handle_set_string (set_string_event ev)
virtual void handle_set_coord1 (set_coord1_event ev)
virtual void handle_set_coord3 (set_coord3_event ev)
virtual void handle_set_coord4 (set_coord4_event ev)
virtual bool handle (event ev)
virtual void handle_get_widget (get_widget_event ev)
virtual void handle_set_widget (set_widget_event ev)
virtual void handle_position (position_event ev)
virtual void handle_move (move_event ev)
virtual void handle_destroy (destroy_event ev)
virtual void handle_alarm (alarm_event ev)
virtual void handle_update (update_event ev)
virtual void handle_refresh (refresh_event ev)
virtual void handle_invalidate (invalidate_event ev)
virtual void handle_keyboard_grab (keyboard_grab_event ev)
virtual void handle_mouse_grab (mouse_grab_event ev)
virtual void handle_request_alarm (request_alarm_event ev)
virtual void handle_find_child (find_child_event ev)
virtual bool is_window_widget ()
SI x1 ()
SI y1 ()
SI x2 ()
SI y2 ()
bool attached ()
void wk_error (string message)
virtual void connect (slot s, widget w2, slot s2)
virtual void deconnect (slot s, widget w2, slot s2)
virtual widget plain_window_widget (string s, command q)
 Sets the view's title to _title, then constructs a wrapper widget for the view and returns it.
virtual widget plain_window_widget (string s)
void set_current_renderer (basic_renderer _r)
basic_renderer get_current_renderer ()
virtual QWidget * as_qwidget ()
 Returns the actual QWidget wrapped by this qt_widget_rep.
virtual widget make_popup_widget ()
virtual widget make_popup_widget ()
virtual widget popup_window_widget (string s)
virtual widget popup_window_widget (string s)
virtual QMenu * get_qmenu ()
 This method must not give ownership of the menu to the caller, thus allowing menu caching at the TeXmacs level.
virtual QLayoutItem * as_qlayoutitem ()
 Returns a QLayoutItem...
void go_to (SI x, SI y, bool absolute=true)
void go_to (path p)
void go_left_physical ()
void go_right_physical ()
void go_left ()
void go_right ()
void go_up ()
void go_down ()
void go_start_line ()
void go_end_line ()
void go_page_up ()
void go_page_down ()
void adjust_cursor ()
void go_to_here ()
void go_to_correct (path p)
void go_to_start (path p)
void go_to_end (path p)
void go_to_border (path p, bool at_start)
void go_start ()
void go_end ()
void go_start_paragraph ()
void go_end_paragraph ()
void go_start_of (tree_label what)
void go_end_of (tree_label what)
void go_start_with (string var, string val)
void go_end_with (string var, string val)
void go_to_label (string s)
tree get_labels ()
path graphics_path ()
bool inside_graphics (bool b)
bool inside_active_graphics (bool b)
bool over_graphics (SI x, SI y)
tree get_graphics ()
double get_x ()
double get_y ()
frame find_frame (bool last=false)
grid find_grid ()
void find_limits (point &lim1, point &lim2)
bool find_graphical_region (SI &x1, SI &y1, SI &x2, SI &y2)
point adjust (point p)
tree find_point (point p)
tree graphical_select (double x, double y)
tree graphical_select (double x1, double y1, double x2, double y2)
tree get_graphical_object ()
void set_graphical_object (tree t)
void invalidate_graphical_object ()
void draw_graphical_object (renderer ren)
bool mouse_graphics (string s, SI x, SI y, int mods, time_t t)
void back_in_text_at (tree t, path p, bool forward)
void clear_local_info ()
void set_data (new_data data)
void get_data (new_data &data)
SI as_length (string l)
string add_lengths (string l1, string l2)
string multiply_length (double x, string l)
bool is_length (string s)
double divide_lengths (string l1, string l2)
void drd_update ()
bool defined_at_cursor (string var_name)
bool defined_at_init (string var_name)
bool defined_in_init (string var_name)
tree get_env_value (string var_name, path p)
tree get_env_value (string var_name)
tree get_init_value (string var_name)
string get_env_string (string var_name)
string get_init_string (string var_name)
int get_env_int (string var_name)
int get_init_int (string var_name)
double get_env_double (string var_name)
double get_init_double (string var_name)
language get_env_language ()
tree exec (tree t, hashmap< string, tree > env, bool expand_refs=true)
tree exec_texmacs (tree t, path p)
tree exec_texmacs (tree t)
tree exec_verbatim (tree t, path p)
tree exec_verbatim (tree t)
tree exec_html (tree t, path p)
tree exec_html (tree t)
tree exec_latex (tree t, path p)
tree exec_latex (tree t)
tree texmacs_exec (tree t)
void init_env (string var, tree by)
void init_default (string var)
void init_style ()
void init_style (string style)
void init_add_package (string package)
void init_remove_package (string package)
void typeset_style_use_cache (tree style)
void typeset_preamble ()
void typeset_prepare ()
void typeset_invalidate_env ()
void typeset_exec_until (path p)
void typeset_invalidate (path p)
void typeset_invalidate_all ()
void typeset (SI &x1, SI &y1, SI &x2, SI &y2)
double this_author ()
void notify_assign (path p, tree u)
void notify_insert (path p, tree u)
void notify_remove (path p, int nr)
void notify_split (path p)
void notify_join (path p)
void notify_assign_node (path p, tree_label op)
void notify_insert_node (path p, tree t)
void notify_remove_node (path p)
void notify_set_cursor (path p, tree data)
void post_notify (path p)
void clear_undo_history ()
void archive_state ()
void start_editing ()
void end_editing ()
void start_slave (double a)
void mark_start (double a)
bool mark_cancel (double a)
void mark_end (double a)
void add_undo_mark ()
void remove_undo_mark ()
int undo_possibilities ()
void undo (bool redoable)
void undo (int i)
void unredoable_undo ()
int redo_possibilities ()
void redo (int i)
void require_save ()
void notify_save (bool real_save=true)
bool need_save (bool real_save=true)
void show_history ()
observer position_new (path p)
void position_delete (observer o)
void position_set (observer o, path p)
path position_get (observer o)
bool insert_return ()
void remove_return (path p)
void insert_tree (tree t, path p_in_t)
void insert_tree (tree t)
void var_insert_tree (tree t, path p_in_t)
void remove_text (bool forward)
void remove_structure (bool forward)
void remove_structure_upwards ()
void make_space (tree t)
void make_space (string w)
void make_space (string w, string y1, string y2)
void make_hspace (string s)
void make_hspace (string smin, string sdef, string smax)
void make_vspace_before (string s)
void make_vspace_before (string smin, string sdef, string smax)
void make_vspace_after (string s)
void make_vspace_after (string smin, string sdef, string smax)
void make_htab (string spc)
void make_image (string file_name, bool link, string w, string h, string x, string y)
void make_rigid ()
void make_lprime (string s)
void make_rprime (string s)
void make_below ()
void make_above ()
void make_script (bool sup, bool right)
void make_fraction ()
void make_sqrt ()
void make_var_sqrt ()
void make_wide (string wide)
void make_wide_under (string wide)
void make_neg ()
void make_tree ()
void back_around (tree t, path p, bool forward)
void back_prime (tree t, path p, bool forward)
void back_in_around (tree t, path p, bool forward)
void back_in_long_arrow (tree t, path p, bool forward)
void back_in_wide (tree t, path p, bool forward)
void back_in_tree (tree t, path p, bool forward)
void pre_remove_around (path p)
string table_get_format (string var)
void table_set_format (string var, tree val)
void table_del_format (string var)
void table_format_center ()
void table_set_extents (int rows, int cols)
void table_go_to (int row, int col)
void make_table (int nr_rows, int nr_cols)
void make_subtable (int nr_rows, int nr_cols)
void destroy_table ()
void table_disactivate ()
void table_extract_format ()
void table_insert_row (bool forward)
void table_insert_column (bool forward)
void table_remove_row (bool forward, bool flag=false)
void table_remove_column (bool forward, bool flag=false)
int table_nr_rows ()
int table_nr_columns ()
int table_which_row ()
int table_which_column ()
path table_search_cell (int row, int col)
void table_row_decoration (bool forward)
void table_column_decoration (bool forward)
void table_correct_block_content ()
void table_resize_notify ()
void set_cell_mode (string mode)
string get_cell_mode ()
void cell_set_format (string var, tree val)
string cell_get_format (string var)
void cell_del_format (string var)
void table_test ()
bool in_source ()
path find_dynamic (path p)
bool is_multi_paragraph_macro (tree t)
void make_compound (tree_label l, int n)
void activate ()
void go_to_argument (path p, bool start_flag)
void insert_argument (path p, bool forward)
void insert_argument (bool forward)
void remove_empty_argument (path p, bool forward)
void remove_argument (path p, bool forward)
void remove_argument (bool forward)
void back_monolithic (path p)
void back_general (path p, bool forward)
void back_in_general (tree t, path p, bool forward)
void make_with (string var, string val)
void insert_with (path p, string var, tree val)
void remove_with (path p, string var)
void back_in_with (tree t, path p, bool forward)
void make_mod_active (tree_label l)
void insert_style_with (path p, string var, string val)
void make_style_with (string var, string val)
void make_hybrid ()
bool activate_latex ()
void activate_hybrid (bool with_args_hint)
void activate_symbol ()
bool make_return_before ()
bool make_return_after ()
void temp_proof_fix ()
void generate_bibliography (string bib, string style, string fname)
void generate_table_of_contents (string toc)
void generate_index (string idx)
void generate_glossary (string glo)
void generate_aux (string which="")
bool get_save_aux ()
path semantic_root (path p)
bool semantic_active (path p)
bool semantic_select (path p, path &q1, path &q2, int mode)
void select (path p)
void select (path start, path end)
void select_all ()
void select_line ()
void select_from_cursor ()
void select_from_cursor_if_active ()
void select_from_keyboard (bool flag)
void select_from_shift_keyboard ()
void select_enlarge_text ()
void select_enlarge ()
void select_enlarge_environmental ()
bool selection_active_any ()
bool selection_active_normal ()
bool selection_active_table (bool strict=true)
bool selection_active_small ()
bool selection_active_enlarging ()
void selection_raw_set (string key, tree t)
tree selection_raw_get (string key)
void selection_correct (path i1, path i2, path &o1, path &o2)
path selection_get_subtable (int &row1, int &col1, int &row2, int &col2)
void selection_get (selection &sel)
void selection_get (path &start, path &end)
tree selection_get ()
path selection_get_start ()
path selection_get_end ()
path selection_get_path ()
path selection_get_cursor_path ()
tree selection_get_env_value (string var)
void selection_set (string key, tree t, bool persistant=false)
void selection_set (tree t)
void selection_set_start (path p=path())
void selection_set_end (path p=path())
void selection_set_paths (path start, path end)
void selection_copy (string key="primary")
void selection_paste (string key="primary")
void selection_clear (string key="primary")
void selection_cancel ()
void selection_set_import (string fm)
void selection_set_export (string fm)
string selection_get_import ()
string selection_get_export ()
void selection_cut (string key="primary")
tree selection_get_cut ()
void selection_move ()
void cut (path p)
void cut (path start, path end)
path manual_focus_get ()
void manual_focus_set (path p, bool force)
void manual_focus_release ()
path focus_search (path p, bool skip_flag, bool up_flag)
path focus_get (bool skip_flag)
bool inside (string what)
bool inside (tree_label l)
bool inside_with (string var, string val)
string inside_which (tree t)
path search_upwards (string what)
path search_upwards (tree_label l)
path search_parent_upwards (tree_label l, int &last)
path search_parent_upwards (tree_label l)
path search_upwards_with (string var, string val)
path search_upwards_in_set (tree t)
path search_previous_compound (path init, string which)
path search_next_compound (path init, string which)
path test_sub (path p, tree t)
path test (path p, tree t)
void step_ascend (bool forward)
void step_descend (bool forward)
void step_horizontal (bool forward)
void next_match (bool forward)
void search_start (bool forward=true)
void search_next (bool forward)
void search_next (tree what, bool forward, bool step)
void search_stop ()
void search_button_next ()
bool search_keypress (string s)
tree search_tree ()
void replace_start (tree what, tree by, bool forward=true)
void replace_next ()
bool replace_keypress (string s)
path test_spellable (path p)
void spell_next ()
void spell_replace (string by)
void spell_start ()
void spell_end ()
bool spell_keypress (string s)

Public Attributes

server_repsv
widget_repcvw
tm_view_repmvw
window win
SI ox
SI oy
SI w
SI h
gravity grav
array< wk_widgeta
array< stringname
int ref_count
int ref_count
int ref_count
QWidget * view
NSViewview
basic_renderer current_renderer

Protected Member Functions

virtual void get_selection (path &start, path &end)=0
virtual void set_selection (path start, path end)=0
virtual cursorthe_cursor ()=0
virtual cursorthe_ghost_cursor ()=0
virtual typesetter get_typesetter ()=0
virtual hashmap< string, treeget_init ()=0
virtual hashmap< string, treeget_fin ()=0
virtual void set_init (hashmap< string, tree > H=tree("?"))=0
virtual void add_init (hashmap< string, tree > H)=0
virtual void set_fin (hashmap< string, tree > H)=0
virtual void set_base_name (url name)=0
virtual void typeset_preamble ()=0
virtual void typeset_invalidate_env ()=0
virtual void typeset (SI &x1, SI &y1, SI &x2, SI &y2)=0
virtual void back_around (tree t, path p, bool forward)=0
virtual void back_prime (tree t, path p, bool forward)=0
virtual void back_in_around (tree t, path p, bool forward)=0
virtual void back_in_long_arrow (tree t, path p, bool forward)=0
virtual void back_in_wide (tree t, path p, bool forward)=0
virtual void back_in_tree (tree t, path p, bool forward)=0
virtual void pre_remove_around (path p)=0
virtual void back_table (path p, bool forward)=0
virtual void back_in_table (tree t, path p, bool forward)=0
virtual void back_monolithic (path p)=0
virtual void back_general (path p, bool forward)=0
virtual void back_in_with (tree t, path p, bool forward)=0
virtual void back_in_general (tree t, path p, bool forward)=0
virtual void back_in_text_at (tree t, path p, bool forward)=0
virtual path tree_path (path sp, SI x, SI y, SI delta)=0
virtual path search_format ()=0
virtual path search_format (int &row, int &col)=0
virtual void table_bound (path fp, int &i1, int &j1, int &i2, int &j2)=0
virtual tree table_get_subtable (path p, int i1, int j1, int i2, int j2)=0
virtual void table_write_subtable (path fp, int row, int col, tree subt)=0
virtual void table_del_format (path fp, int I1, int J1, int I2, int J2, string var)=0
cursorthe_cursor ()
cursorthe_ghost_cursor ()
path make_cursor_accessible (path p, bool forwards)
path tree_path (path sp, SI x, SI y, SI delta)
bool cursor_move_sub (SI &x0, SI &y0, SI &delta, SI dx, SI dy)
void cursor_move (SI dx, SI dy)
void adjust_ghost_cursor (int status)
void notify_cursor_moved (int status)
void show_cursor_if_hidden ()
typesetter get_typesetter ()
tree get_style ()
void set_style (tree t)
hashmap< string, treeget_init ()
hashmap< string, treeget_fin ()
void set_init (hashmap< string, tree > init=tree("?"))
void add_init (hashmap< string, tree > init)
void set_fin (hashmap< string, tree > fin)
void set_base_name (url name)
void correct_concat (path p, int done=0)
void correct (path p)
bool pure_line (path p)
bool accepts_return (path p)
path prepare_for_insert ()
void get_deletion_point (path &p, int &l, int &r, tree &t, tree &u, bool f)
path search_format ()
path search_format (path p)
path search_format (int &row, int &col)
path search_table ()
path search_table (path fp)
path search_table (int &row, int &col)
path search_row (path fp, int row)
path search_cell (path p, int col)
path search_cell (path fp, int row, int col)
void with_raw_read (tree with, int &i1, int &j1, int &i2, int &j2)
void with_decode (int nr_rows, int nr_cols, int &i1, int &j1, int &i2, int &j2)
void with_decode (int nr_rows, int nr_cols, int &I1, int &J1, int &I2, int &J2, int &i1, int &j1, int &i2, int &j2)
void with_read (tree with, int nr_rows, int nr_cols, int &i1, int &j1, int &i2, int &j2)
void with_read (tree with, int nr_rows, int nr_cols, int &I1, int &J1, int &I2, int &J2, int &i1, int &j1, int &i2, int &j2)
tree table_get_format (path fp)
tree table_get_format (path fp, string var)
tree table_get_format (path fp, int I1, int J1, int I2, int J2, string var)
void table_get_format (path fp, string var, tree **val, int nr_rows, int nr_cols)
void table_set_format (path fp, string var, tree val)
void table_set_format (path fp, int I1, int J1, int I2, int J2, string var, tree val)
void table_del_format (path fp, string var)
void table_del_format (path fp, int I1, int J1, int I2, int J2, string var)
void table_individualize (path fp, string var)
void table_format_center (path fp, int row, int col)
void table_get_extents (path fp, int &nr_rows, int &nr_cols)
void table_set_extents (path fp, int nr_rows, int nr_cols)
void table_get_limits (path fp, int &i1, int &j1, int &i2, int &j2)
void table_insert (path fp, int row, int col, int nr_rows, int nr_cols)
void table_remove (path fp, int row, int col, int nr_rows, int nr_cols)
tree table_get_subtable (path p, int i1, int j1, int i2, int j2)
tree table_get_subtable (path p, int i1, int j1, int i2, int j2, bool rec)
void table_write_subtable (path fp, int row, int col, tree subt)
void table_hor_insert_subtable (path fp, int col, tree subt)
void table_ver_insert_subtable (path fp, int row, tree subt)
void table_force_decoration (path fp, int row, int col)
void table_hor_decorate (path fp, int col, int cbef, int caft)
void table_ver_decorate (path fp, int row, int rbef, int raft)
void table_bound (path fp, int &row1, int &col1, int &row2, int &col2)
void table_go_to (path fp, int row, int col, bool at_start=false)
void table_go_to_border (path fp, bool right)
void back_table (path p, bool forward)
void back_in_table (tree t, path p, bool forward)
void get_selection (path &start, path &end)
void set_selection (path start, path end)
void raw_cut (path start, path end)
void spell_write (string s)
tree spell_read ()

Protected Attributes

int env_change
time_t last_change
time_t last_update
bool do_animate
time_t next_animate
bool full_screen
bool got_focus
string sh_s
double sh_mark
string pre_edit_s
double pre_edit_mark
widget popup_win
tree message_l
tree message_r
tree last_l
tree last_r
int sfactor
SI pixel
rectangles copy_always
int input_mode
SI last_x
SI last_y
time_t last_t
SI start_x
SI start_y
SI end_x
SI end_y
bool made_selection
bool table_selection
rectangles selection_rects
rectangles env_rects
rectangles foc_rects
rectangles sem_rects
bool sem_correct
cursor oc
bool temp_invalid_cursor
array< stringcompletions
string completion_prefix
int completion_pos
renderer shadow
SI vx1
SI vy1
SI vx2
SI vy2
rectangles stored_rects
renderer stored
rectangles locus_new_rects
rectangles locus_rects
list< stringactive_ids
int cur_sb
int cur_wb
SI cur_wx
SI cur_wy
tm_buffer buf
drd_info drd
treeet
box eb
path rp
path tp
int ptr_focus
list< widget_connectionin
list< widget_connectionin
list< widget_connectionin
list< widget_connectionout
list< widget_connectionout
list< widget_connectionout
cursor cu
cursor mv
int mv_status
point cur_pos
tree graphical_object
tree the_style
hashmap< path, hashmap< string,
tree > > 
cur
hashmap< string, treepre
hashmap< string, treeinit
hashmap< string, treefin
edit_env env
typesetter ttt
observer cur_pos
double author
archiver arch
string cell_mode
path start_p
path end_p
bool selecting
bool shift_selecting
path mid_p
string selection_import
string selection_export
path focus_p
bool focus_hold
bool forward
string search_mode
string search_lan
path search_at
path search_end
tree search_what
list< pathwhere_stack
tree what_stack
tree replace_by
int nr_replaced
path spell_end_p
string spell_s
tree spell_t
bool spell_dicmod

Events

emit_position(SI ox, SI oy, SI
w, SI h, gravity grav=north_west)
emit_invalidate(SI x1, SI y1,
SI x2, SI y2) emit_mouse(mouse_event
ev) emit_mouse(mouse_event ev,
string type) emit_mouse(mouse_event
ev, string type, SI x, SI y)
emit_clear(SI x1, SI y1, SI x2,
SI y2) emit_repaint(SI x1, SI
y1, SI x2, SI y2, bool &stop)
emit_find_child(SI x, SI y,
int &which) virtual void 
handle_get_size (get_size_event ev)

Private Attributes

hashmap< tree, treeprops
observer ed_obs

Friends

class editor
class interactive_command_rep
class tm_window_rep
class tm_server_rep
class server_command_rep
void edit_announce (editor_rep *ed, modification mod)
void edit_done (editor_rep *ed, modification mod)
string get_editor_status_report ()
void tm_failure (const char *msg)
void revert_buffer (url name, tree doc)
void set_aux (string aux, url name)
class wk_widget
class widget
class widget
class widget
class tm_window_rep
class tm_server_rep

Detailed Description

Definition at line 27 of file edit_main.hpp.


Constructor & Destructor Documentation

Definition at line 51 of file edit_main.cpp.

                                                          :
  editor_rep (sv, buf), props (UNKNOWN), ed_obs (edit_observer (this))
{
#ifdef EXPERIMENTAL
  cct= copy (subtree (et, rp));
  copy_ip (subtree (et, rp), cct);
#endif
  attach_observer (subtree (et, rp), ed_obs);
  notify_change (THE_TREE);
  tp= correct_cursor (et, rp * 0);
}

Here is the call graph for this function:

Definition at line 63 of file edit_main.cpp.

                               {
  detach_observer (subtree (et, rp), ed_obs);
#ifdef EXPERIMENTAL
  mem= memorizer ();
#endif
}

Here is the call graph for this function:


Member Function Documentation

bool edit_text_rep::accepts_return ( path  p) [protected, inherited]

Definition at line 105 of file edit_text.cpp.

                                     {
  tree st= subtree (et, path_up (p));
  return
    is_document (st) ||
    (is_func (st, SURROUND, 3) && (last_item (p) == 2)) ||
    (is_func (st, _FLOAT) && (last_item (p) == (N(st)-1))) ||
    (is_func (st, DATOMS) &&
     (last_item (p) == (N(st)-1)) && pure_line (p)) ||
    (is_func (st, MACRO) && (last_item (p) == (N(st)-1))) ||
    (is_func (st, XMACRO, 2) && (last_item (p) == 1)) ||
    ((is_func (st, WITH) || is_mod_active (st) ||
      is_func (st, STYLE_WITH) || is_func (st, VAR_STYLE_WITH) ||
      is_func (st, LOCUS) ||
      is_func (st, CANVAS) || is_func (st, ORNAMENT)) &&
     (last_item (p) == (N(st)-1)) && pure_line (p)) ||
    (is_extension (st) && (last_item (p) >= 0) && pure_line (p));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void edit_dynamic_rep::activate ( ) [virtual, inherited]

Implements editor_rep.

Definition at line 146 of file edit_dynamic.cpp.

                            {
  path p= search_upwards (INACTIVE);
  if (is_nil (p)) return;
  tree st= subtree (et, p * 0);

  if (is_func (st, COMPOUND) && is_atomic (st[0])) {
    tree u (make_tree_label (st[0]->label));
    u << A (st (1, N(st)));
    assign (p, u);
    go_to (end (et, p));
    correct (path_up (p));
  }
  else {
    bool acc= (p < path_up (tp) && drd->is_accessible_child (st, tp[N(p)]));
    remove_node (p * 0);
    if (!acc) go_to (end (et, p));
    correct (path_up (p));
  }
}

Here is the call graph for this function:

virtual void editor_rep::activate ( ) [pure virtual, inherited]

Implemented in edit_dynamic_rep.

void edit_dynamic_rep::activate_hybrid ( bool  with_args_hint) [virtual, inherited]

Implements editor_rep.

Definition at line 534 of file edit_dynamic.cpp.

                                                      {
  // WARNING: update edit_interface_rep::set_hybrid_footer when updating this
  if (activate_latex ()) return;
  set_message ("", "");
  path p= search_upwards (HYBRID);
  if (is_nil (p)) return;
  tree st= subtree (et, p);
  if (is_compound (st[0])) return;
  if (is_func (subtree (et, path_up (p)), INACTIVE))
    p= path_up (p);

  // activate macro argument
  string name= st[0]->label;
  path mp= search_upwards (MACRO);
  if (!is_nil (mp)) {
    tree mt= subtree (et, mp);
    int i, n= N(mt)-1;
    for (i=0; i<n; i++)
      if (mt[i] == name) {
       assign (p, tree (ARG, copy (name)));
       go_to (end (et, p));
       correct (path_up (p));
       return;
      }
  }

  // built-in primitives, macro applications and values
  bool old_locked= env_locked; env_locked= true;
  tree f= get_env_value (name);
  if ((drd->contains (name) && (f == UNINIT)) ||
      is_func (f, MACRO) || is_func (f, XMACRO)) {
    assign (p, "");
    correct (path_up (p));
    make_compound (make_tree_label (name));
    if (N(st) == 2) insert_tree (st[1]);
  }
  else if (f != UNINIT) {
    assign (p, tree (VALUE, copy (name)));
    go_to (end (et, p));
    correct (path_up (p));
  }
  else if (in_source ()) {
    assign (p, "");
    correct (path_up (p));
    make_compound (make_tree_label (name), with_args_hint? 1: 0);
    if (N(st) == 2) insert_tree (st[1]);
  }
  else set_message ("Error: unknown command",
                  "activate hybrid command");
  env_locked= old_locked;
}

Here is the call graph for this function:

virtual void editor_rep::activate_hybrid ( bool  with_args_hint) [pure virtual, inherited]

Implemented in edit_dynamic_rep.

bool edit_dynamic_rep::activate_latex ( ) [virtual, inherited]

Implements editor_rep.

Definition at line 511 of file edit_dynamic.cpp.

                                  {
  path p= search_upwards (LATEX);
  if (is_nil (p)) p= search_upwards (HYBRID);
  if (is_nil (p)) return false;
  tree st= subtree (et, p);
  if (is_atomic (st[0])) {
    if (is_func (subtree (et, path_up (p)), INACTIVE))
      p= path_up (p);
    string  s= st[0]->label, help;
    command cmd;
    if (kbd_get_command (s, help, cmd)) {
      cut (p * 0, p * 1);
      cmd ();
      if (N(st) == 2) insert_tree (copy (st[1]));
      return true;
    }
    set_message ("Error: not a command name",
               "activate latex command");
  }
  return false;
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool editor_rep::activate_latex ( ) [pure virtual, inherited]

Implemented in edit_dynamic_rep.

void edit_dynamic_rep::activate_symbol ( ) [virtual, inherited]

Implements editor_rep.

Definition at line 591 of file edit_dynamic.cpp.

                                   {
  path p= search_upwards (SYMBOL);
  if (is_nil (p)) return;
  tree st= subtree (et, p);
  if (is_func (subtree (et, path_up (p)), INACTIVE))
    p= path_up (p);
  string s= st[0]->label;
  if (is_int (s))
    assign (p, string (((char) as_int (s))));
  else {
    int i, n= N(s);
    for (i=0; i<n; i++)
      if ((s[i]=='<') || (s[i]=='>'))
       { s= ""; break; }
    assign (p, "<" * s * ">");
  }
  go_to (end (et, p));
  correct (path_up (p));
}

Here is the call graph for this function:

virtual void editor_rep::activate_symbol ( ) [pure virtual, inherited]

Implemented in edit_dynamic_rep.

void edit_typeset_rep::add_init ( hashmap< string, tree init) [protected, virtual, inherited]

Implements editor_rep.

Definition at line 80 of file edit_typeset.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void editor_rep::add_init ( hashmap< string, tree H) [protected, pure virtual, inherited]

Implemented in edit_typeset_rep.

string edit_typeset_rep::add_lengths ( string  l1,
string  l2 
) [virtual, inherited]

Implements editor_rep.

Definition at line 106 of file edit_typeset.cpp.

                                                   {
  return env->add_lengths (l1, l2); }
virtual string editor_rep::add_lengths ( string  l1,
string  l2 
) [pure virtual, inherited]

Implemented in edit_typeset_rep.

void edit_modify_rep::add_undo_mark ( ) [virtual, inherited]

Implements editor_rep.

Definition at line 321 of file edit_modify.cpp.

                                {
  arch->confirm ();
}
virtual void editor_rep::add_undo_mark ( ) [pure virtual, inherited]

Implemented in edit_modify_rep.

point edit_graphics_rep::adjust ( point  p) [virtual, inherited]

Implements editor_rep.

Definition at line 193 of file edit_graphics.cpp.

                                  {
  frame f= find_frame ();
  grid g= find_grid ();
  if (!is_nil (g) && !is_nil (gr0) && g != gr0) {
    graphical_select (p[0], p[1]);
    g= gr0;
  }
  if (is_nil (g)) return p;
  point res;
  gr_selections sels= copy (gs);
  frame f2= find_frame (true);
  if (is_nil (f2)) return p;
  point fp= f2 (p);
  if ((tree) g != "empty_grid") {
    point q= g->find_point_around (p, 10*get_pixel_size (), f);
    point fq= f2 (q);
    if (norm (fq - fp) < 10*get_pixel_size ()) {
      gr_selection sel;
      sel->type= "grid-point";
      sel->p   = fq;
      sel->dist= norm (fq - fp);
      sels << sel;
    }
    array<grid_curve> gc=
      g->get_curves_around (p, 10*get_pixel_size (), f);
    for (int i=0; i<N(gc); i++) {
      point fc= closest (f2 (gc[i]->c), fp);
      if (norm (fc - fp) < 10*get_pixel_size ()) {
        gr_selection sel;
        sel->type= "grid-curve-point";
        sel->p   = fc;
        sel->dist= norm (fc - fp);
        sel->c   = f2 (gc[i]->c);
        sels << sel;
      }
    }
  }
  double eps= get_pixel_size () / 10.0;
  gr_selection snap= snap_to_guide (fp, sels, eps);
  //cout << "Snap " << fp << " to " << snap << ", " << snap->p << "\n";
  point snapped= f2[snap->p];
  if (N(snapped) == 2) return snapped;
  return p;
  // FIXME: why can snapped be an invalid point?
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual point editor_rep::adjust ( point  p) [pure virtual, inherited]

Implemented in edit_graphics_rep.

Here is the caller graph for this function:

void edit_cursor_rep::adjust_cursor ( ) [inherited]

Definition at line 320 of file edit_cursor.cpp.

                                {
  path sp= find_innermost_scroll (eb, tp);
  cursor mv= copy (cu);
  SI dx= PIXEL << 8, ddelta= 0;
  path p= tree_path (sp, mv->ox, mv->oy, mv->delta);
  if (p != tp) {
    // cout << "Cursors don't match\n";
    while (dx != 0 || ddelta != 0) {
      // cout << "  " << tp << ", " << p << "\n";
      p= tree_path (sp, mv->ox, mv->oy, mv->delta);
      int eps= (path_inf (p, tp)? 1: -1);
      if (p == tp) eps= (mv->ox < cu->ox? 1: -1);
      if (p == tp && mv->ox == cu->ox) eps= (mv->delta < cu->delta? 1: -1);
      if (dx > 0) {
       if (p != tp ||
           tree_path (sp, mv->ox + eps * dx, mv->oy, mv->delta) == tp)
         mv->ox += eps * dx;
       dx >>= 1;
       if (dx == 0) ddelta= DELTA;
      }
      else if (ddelta > 0) {
       if (p != tp ||
           tree_path (sp, mv->ox, mv->oy, mv->delta + eps * ddelta) == tp)
         mv->delta += eps * ddelta;
       ddelta >>= 1;
      }
    }
  }
  if (p == tp) cu= mv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void edit_cursor_rep::adjust_ghost_cursor ( int  status) [protected, inherited]

Definition at line 147 of file edit_cursor.cpp.

                                                {
  if (status==mv_status) {
    if (status!=HORIZONTAL) {
      mv->ox   = cu->ox;
      mv->delta= cu->delta;
    }
    if (status!=VERTICAL)
      mv->oy= cu->oy;
  }
}

Here is the caller graph for this function:

void edit_interface_rep::after_menu_action ( ) [virtual, inherited]

Implements editor_rep.

Definition at line 681 of file edit_interface.cpp.

Here is the call graph for this function:

void edit_interface_rep::animate ( ) [virtual, inherited]

Implements editor_rep.

Definition at line 649 of file edit_interface.cpp.

                             {
  // cout << do_animate << ", " << next_animate << "\n";
  if (do_animate && texmacs_time () - next_animate >= 0) {
    bool flag= false;
    time_t at= 0;
    rectangles rs;
    eb->anim_get_invalid (flag, at, rs);
    if (flag && texmacs_time () - at >= 0)
      invalidate (rs);
    do_animate  = flag;
    next_animate= at;
  }
}

Here is the call graph for this function:

void edit_interface_rep::append_left_footer ( tree l,
string  env_var 
) [inherited]

Definition at line 27 of file edit_footer.cpp.

                                                               {
  if (!is_concat (l)) l= concat (l);
  string i= get_init_string (env_var);
  string c= get_env_string (env_var);
  if (c != i) l << (" " * c);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void edit_interface_rep::apply_changes ( ) [virtual, inherited]

Implements editor_rep.

Definition at line 388 of file edit_interface.cpp.

                                   {
  //cout << "Apply changes\n";
  //cout << "et= " << et << "\n";
  //cout << "tp= " << tp << "\n";
  //cout << HRULE << "\n";
  if (env_change == 0) {
    if (last_change-last_update > 0 &&
        idle_time (INTERRUPTED_EVENT) >= 1000/6)
    {
      SERVER (menu_main ("(horizontal (link texmacs-menu))"));
      SERVER (menu_icons (0, "(horizontal (link texmacs-main-icons))"));
      SERVER (menu_icons (1, "(horizontal (link texmacs-mode-icons))"));
      SERVER (menu_icons (2, "(horizontal (link texmacs-focus-icons))"));
      SERVER (menu_icons (3, "(horizontal (link texmacs-extra-icons))"));
      if (use_side_tools)
        { SERVER (side_tools (0, "(vertical (link texmacs-side-tools))")); }
      set_footer ();
      if (!get_renderer (this) -> interrupted ()) drd_update ();
      cache_memorize ();
      last_update= last_change;
    }
    return;
  }
  
  // cout << "Applying changes " << env_change << " to " << get_name() << "\n";
  // time_t t1= texmacs_time ();
  
  // cout << "Always\n";
  update_visible ();
  
  // cout << "Handling automatic resizing\n";
  int sb= 1;
  if (is_attached (this) &&
      get_server() -> has_window() &&
      get_init_string (PAGE_MEDIUM) == "automatic")
    {
      SI wx, wy;
      if (cvw == NULL) ::get_size (get_window (this), wx, wy);
      else ::get_size (widget (cvw), wx, wy);
      if (get_init_string (SCROLL_BARS) == "false") sb= 0;
      if (get_server () -> in_full_screen_mode ()) sb= 0;
#ifdef QTTEXMACS
      if (sb) wx -= 24 * PIXEL;
#else
      if (sb) wx -= 20 * PIXEL;
#endif
      if (wx != cur_wx || wy != cur_wy) {
       cur_wx= wx; cur_wy= wy;
       init_env (PAGE_SCREEN_WIDTH, as_string (wx*sfactor) * "tmpt");
       init_env (PAGE_SCREEN_HEIGHT, as_string (wy*sfactor) * "tmpt");
       notify_change (THE_ENVIRONMENT);
      }
    }
  if (sb != cur_sb) {
    cur_sb= sb;
    if (get_server() -> has_window()) {
      tm_window win= get_server () -> get_window ();
      win -> set_scrollbars (sb);
    }
  }
  
  // window decorations (menu bar, icon bars, footer)
  int wb= 2;
  if (is_attached (this)) {
    string val= get_init_string (WINDOW_BARS);
    if (val == "auto") wb= 2;
    else if (val == "false") wb= 0;
    else if (val == "true") wb= 1;
    if (wb != cur_wb) {
      cur_wb= wb;
      if (wb != 2) {
        get_server () -> show_header (wb);
        get_server () -> show_footer (wb);
      }
    }
  }
  
  // cout << "Handling selection\n";
  if (env_change & (THE_TREE+THE_ENVIRONMENT+THE_SELECTION)) {
    if (made_selection) {
      invalidate (selection_rects);
      if (!selection_active_any ()) {
        made_selection= false;
        set_selection (tp, tp);
        selection_rects= rectangles ();
      }
    }
  }
  
  // cout << "Handling environment\n";
  if (env_change & THE_ENVIRONMENT)
    typeset_invalidate_all ();

  // cout << "Handling tree\n";
  if (env_change & (THE_TREE+THE_ENVIRONMENT)) {
    typeset_invalidate_env ();
    SI x1, y1, x2, y2;
    typeset (x1, y1, x2, y2);
    invalidate (x1- 2*pixel, y1- 2*pixel, x2+ 2*pixel, y2+ 2*pixel);
    // check_data_integrety ();
    the_ghost_cursor()= eb->find_check_cursor (tp);
  }
  
#ifdef EXPERIMENTAL
  if (env_change & THE_ENVIRONMENT)
    environment_update ();
  if (env_change & THE_TREE) {
    cout << HRULE;
    mem= evaluate (ste, cct);
    tree rew= mem->get_tree ();
    cout << HRULE;
    cout << tree_to_texmacs (rew) << LF;
    //print_tree (rew);
  }
#endif
  
  // cout << "Handling extents\n";
  if (env_change & (THE_TREE+THE_ENVIRONMENT+THE_EXTENTS))
    set_extents (eb->x1, eb->y1, eb->x2, eb->y2);
  
  // cout << "Cursor\n";
  temp_invalid_cursor= false;
  if (env_change & (THE_TREE+THE_ENVIRONMENT+THE_EXTENTS+
                    THE_CURSOR+THE_SELECTION+THE_FOCUS)) {
    SI /*P1= pixel,*/ P2= 2*pixel, P3= 3*pixel;
    int THE_CURSOR_BAK= env_change & THE_CURSOR;
    go_to_here ();
    env_change= (env_change & (~THE_CURSOR)) | THE_CURSOR_BAK;
    if (env_change & (THE_TREE+THE_ENVIRONMENT+THE_EXTENTS+THE_CURSOR))
      if (!inside_active_graphics ())
        cursor_visible ();
    
    cursor cu= get_cursor();
    rectangle ocr (oc->ox+ ((SI) (oc->y1*oc->slope))- P3, oc->oy+ oc->y1- P3,
                   oc->ox+ ((SI) (oc->y2*oc->slope))+ P2, oc->oy+ oc->y2+ P3);
    copy_always= rectangles (ocr, copy_always);
    invalidate (ocr->x1, ocr->y1, ocr->x2, ocr->y2);
    rectangle ncr (cu->ox+ ((SI) (cu->y1*cu->slope))- P3, cu->oy+ cu->y1- P3,
                   cu->ox+ ((SI) (cu->y2*cu->slope))+ P2, cu->oy+ cu->y2+ P3);
    invalidate (ncr->x1, ncr->y1, ncr->x2, ncr->y2);
    copy_always= rectangles (ncr, copy_always);
    oc= copy (cu);
   
    // set hot spot in the gui
    send_cursor (this, (cu->ox-sfactor+1)/sfactor, (cu->oy-sfactor+1)/sfactor);

    path sp= selection_get_cursor_path ();
    bool semantic_flag= semantic_active (path_up (sp));
    bool full_context= (get_preference ("show full context") == "on");
    bool table_cells= (get_preference ("show table cells") == "on");
    bool show_focus= (get_preference ("show focus") == "on");
    bool semantic_only= (get_preference ("show only semantic focus") == "on");
    rectangles old_env_rects= env_rects;
    rectangles old_foc_rects= foc_rects;
    env_rects= rectangles ();
    foc_rects= rectangles ();
    path pp= path_up (tp);
    tree pt= subtree (et, pp);
    if (none_accessible (pt));
    else pp= path_up (pp);
    if (full_context || table_cells)
      compute_env_rects (pp, env_rects, true);
    if (show_focus && (!semantic_flag || !semantic_only))
      compute_env_rects (pp, foc_rects, false);
    if (env_rects != old_env_rects) {
      invalidate (old_env_rects);
      invalidate (env_rects);
    }
    else if (env_change & THE_FOCUS) invalidate (env_rects);
    if (foc_rects != old_foc_rects) {
      invalidate (old_foc_rects);
      invalidate (foc_rects);
    }
    else if (env_change & THE_FOCUS) invalidate (foc_rects);
    
    rectangles old_sem_rects= sem_rects;
    bool old_sem_correct= sem_correct;
    sem_rects= rectangles ();
    sem_correct= true;
    if (semantic_flag && show_focus) {
      path sp= selection_get_cursor_path ();
      path p1= tp, p2= tp;
      if (selection_active_any ()) selection_get (p1, p2);
      sem_correct= semantic_select (path_up (sp), p1, p2, 2);
      if (!sem_correct) {
        path sr= semantic_root (path_up (sp));
        p1= start (et, sr);
        p2= end (et, sr);
      }
      path q1, q2;
      selection_correct (p1, p2, q1, q2);
      selection sel= eb->find_check_selection (q1, q2);
      sem_rects << outline (sel->rs, pixel);
    }
    if (sem_rects != old_sem_rects || sem_correct != old_sem_correct) {
      invalidate (old_sem_rects);
      invalidate (sem_rects);
    }
    else if (env_change & THE_FOCUS) invalidate (sem_rects);
    
    invalidate_graphical_object ();
  }
  
  // cout << "Handling selection\n";
  if (env_change & THE_SELECTION) {
    made_selection= selection_active_any ();
    if (made_selection) {
      table_selection= selection_active_table ();
      selection sel; selection_get (sel);
      rectangles rs= thicken (sel->rs, pixel, 3*pixel);
#ifndef QTTEXMACS
      rs= simplify (::correct (rs - thicken (rs, -pixel, -pixel)));
#endif
      selection_rects= rs;
      invalidate (selection_rects);
    }
  }
  
  // cout << "Handling locus highlighting\n";
  if (env_change & (THE_TREE+THE_ENVIRONMENT+THE_EXTENTS))
    update_active_loci ();
  if (env_change & THE_LOCUS) {
    if (locus_new_rects != locus_rects) {
      invalidate (locus_rects);
      invalidate (locus_new_rects);
      locus_rects= locus_new_rects;
    }
  }
  
  // cout << "Handling backing store\n";
  if (!is_nil (stored_rects)) {
    if (env_change & (THE_TREE+THE_ENVIRONMENT+THE_SELECTION+THE_EXTENTS))
      stored_rects= rectangles ();
  }
  if (inside_active_graphics ()) {
    SI gx1, gy1, gx2, gy2;
    if (find_graphical_region (gx1, gy1, gx2, gy2)) {
      rectangle gr= rectangle (gx1, gy1, gx2, gy2);
      if (!is_nil (gr - stored_rects))
        invalidate (gx1, gy1, gx2, gy2);
    }
  }
  
  // cout << "Handling environment changes\n";
  if (env_change & THE_ENVIRONMENT)
    send_invalidate_all (this);
  
  // cout << "Applied changes\n";
  // time_t t2= texmacs_time ();
  // if (t2 - t1 >= 10) cout << "apply_changes took " << t2-t1 << "ms\n";
  env_change  = 0;
  last_change = texmacs_time ();
  last_update = last_change-1;
  manual_focus_release ();
}

Here is the caller graph for this function:

void edit_modify_rep::archive_state ( ) [virtual, inherited]

Implements editor_rep.

Definition at line 278 of file edit_modify.cpp.

                                {
  path sp1= selection_get_start ();
  path sp2= selection_get_end ();
  if (path_less (sp1, sp2)) {
    //cout << "Selection: " << sp1 << "--" << sp2 << "\n";
    set_cursor (sp2, compound ("end", as_string (author)));
    set_cursor (sp1, compound ("start", as_string (author)));
    set_cursor (tp, compound ("cursor", as_string (author)));
  }
  else set_cursor (tp, compound ("cursor-clear", as_string (author)));
}

Here is the call graph for this function:

virtual void editor_rep::archive_state ( ) [pure virtual, inherited]

Implemented in edit_modify_rep.

Here is the caller graph for this function:

SI edit_typeset_rep::as_length ( string  l) [virtual, inherited]

Implements editor_rep.

Definition at line 102 of file edit_typeset.cpp.

                                     {
  return env->as_length (l); }
virtual SI editor_rep::as_length ( string  l) [pure virtual, inherited]

Implemented in edit_typeset_rep.

TMMenuItem * simple_widget_rep::as_menuitem ( ) [virtual, inherited]

Reimplemented from aqua_widget_rep.

Definition at line 482 of file aqua_menu.mm.

{
  TMMenuItem *mi = [[[TMMenuItem alloc] init] autorelease];
  [mi setWidget:this];
  return mi;
}

Here is the call graph for this function:

QAction * simple_widget_rep::as_qaction ( ) [virtual, inherited]

Reimplemented from qt_widget_rep.

Definition at line 223 of file qt_menu.cpp.

                               {
  QAction* a= new QTMAction (NULL);
  QPixmap pxm (impress (this));
  QIcon icon (pxm);
  a->setIcon (icon);
  return a;
}

Here is the call graph for this function:

virtual QLayoutItem* qt_widget_rep::as_qlayoutitem ( ) [inline, virtual, inherited]

Returns a QLayoutItem...

Reimplemented in qt_ui_element_rep, and qt_input_text_widget_rep.

Definition at line 84 of file qt_widget.hpp.

{ return NULL; }
virtual QWidget* qt_view_widget_rep::as_qwidget ( ) [inline, virtual, inherited]

Returns the actual QWidget wrapped by this qt_widget_rep.

This is used to connect to signals, to change properties of the QWidget, etc.

Reimplemented from qt_widget_rep.

Definition at line 42 of file qt_view_widget.hpp.

{ return view ; };
bool wk_widget_rep::attached ( ) [inherited]

Definition at line 108 of file wk_widget.cpp.

                         {
  return win != NULL;
}

Here is the caller graph for this function:

void edit_math_rep::back_around ( tree  t,
path  p,
bool  forward 
) [virtual, inherited]

Implements editor_rep.

Definition at line 181 of file edit_math.cpp.

                                                        {
  bool match= (get_preference ("automatic brackets") != "off");
  if (is_func (t, BIG_AROUND)) {
    if (match || forward)
      go_to_border (p * 1, forward);
    else {
      remove_node (t, 1);
      correct (path_up (p));
    }
  }
  else {
    int i= (forward? 0: 2);
    if (is_deleted (t[i]));
    else if (is_atomic (t[i]))
      assign (t[i], "<nobracket>");
    else if (is_func (t[i], LEFT))
      assign (t[i], tree (LEFT, "."));
    else if (is_func (t[i], RIGHT))
      assign (t[i], tree (RIGHT, "."));
    go_to_border (p * 1, forward);
    if (is_deleted (t[0]) && is_deleted (t[2])) {
      remove_node (t, 1);
      correct (path_up (p));
    }
  }
  if (!match) call ("brackets-refresh");
}

Here is the call graph for this function:

virtual void editor_rep::back_around ( tree  t,
path  p,
bool  forward 
) [protected, pure virtual, inherited]

Implemented in edit_math_rep.

Here is the caller graph for this function:

void edit_dynamic_rep::back_general ( path  p,
bool  forward 
) [virtual, inherited]

Implements editor_rep.

Definition at line 323 of file edit_dynamic.cpp.

                                                    {
  tree st= subtree (et, p);
  int n= N(st);
  if ((L(st) >= START_EXTENSIONS) && in_source () && (forward || (n == 0))) {
    tree u (COMPOUND, copy (as_string (L(st))));
    u << copy (A (st));
    assign (p, u);
    go_to_border (p * 0, forward);
  }
  else if (n==0) back_monolithic (p);
  else if ((n==1) && is_func (st[0], DOCUMENT, 1) &&
          (is_func (st[0][0], TFORMAT) || is_func (st[0][0], TABLE)))
    back_table (p * path (0, 0), forward);
  else if ((n==1) && (is_func (st[0], TFORMAT) || is_func (st[0], TABLE)))
    back_table (p * 0, forward);
  else go_to_argument (p * (forward? 0: n-1), forward);
}

Here is the call graph for this function:

virtual void editor_rep::back_general ( path  p,
bool  forward 
) [protected, pure virtual, inherited]

Implemented in edit_dynamic_rep.

Here is the caller graph for this function:

void edit_math_rep::back_in_around ( tree  t,
path  p,
bool  forward 
) [virtual, inherited]

Implements editor_rep.

Definition at line 210 of file edit_math.cpp.

                                                           {
  bool match= (get_preference ("automatic brackets") != "off");
  if (is_empty (t[1]) && match) {
    assign (t, "");
    correct (path_up (p, 2));
  }
  else if (is_func (t, BIG_AROUND)) {
    if (match || forward)
      go_to_border (path_up (p), !forward);
    else {
      remove_node (t, 1);
      correct (path_up (p, 2));
    }
  }
  else {
    int i= (forward? 2: 0);
    if (is_deleted (t[i]));
    else if (is_atomic (t[i]))
      assign (t[i], "<nobracket>");
    else if (is_func (t[i], LEFT))
      assign (t[i], tree (LEFT, "."));
    else if (is_func (t[i], RIGHT))
      assign (t[i], tree (RIGHT, "."));
    go_to_border (path_up (p), !forward);
    if (is_deleted (t[0]) && is_deleted (t[2])) {
      remove_node (t, 1);
      correct (path_up (p, 2));
    }
  }
  if (!match) call ("brackets-refresh");  
}

Here is the call graph for this function:

virtual void editor_rep::back_in_around ( tree  t,
path  p,
bool  forward 
) [protected, pure virtual, inherited]

Implemented in edit_math_rep.

Here is the caller graph for this function:

void edit_dynamic_rep::back_in_general ( tree  t,
path  p,
bool  forward 
) [virtual, inherited]

Implements editor_rep.

Definition at line 342 of file edit_dynamic.cpp.

                                                               {
  if (is_func (subtree (et, path_up (p, 2)), INACTIVE) || in_source ())
    if ((L(t) >= START_EXTENSIONS) && (last_item (p) == 0) && (!forward)) {
      bool src_flag= in_source () && (!drd->contains (as_string (L(t))));
      tree u (COMPOUND, copy (as_string (L(t))));
      if (is_empty (t[0]) && src_flag) u << A (copy (t (1, N(t))));
      else u << A (copy (t));
      assign (path_up (p), u);
      go_to_end (p);
      return;
    }
  remove_empty_argument (p, forward);
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void editor_rep::back_in_general ( tree  t,
path  p,
bool  forward 
) [protected, pure virtual, inherited]

Implemented in edit_dynamic_rep.

Here is the caller graph for this function:

void edit_math_rep::back_in_long_arrow ( tree  t,
path  p,
bool  forward 
) [virtual, inherited]

Implements editor_rep.

Definition at line 243 of file edit_math.cpp.

                                                               {
  int i= last_item (p);
  if (i == 2) {
    if (is_empty (t[2])) remove (path_up (p) * 2, 1);
    if (forward) go_to_border (path_up (p), !forward);
    else go_to_border (path_up (p) * 1, forward);
  }
  else if (i == 1) {
    if (N(t) == 2 && is_empty (t[1])) {
      assign (path_up (p), "");
      correct (path_up (p, 2));
    }
    else if (forward && N(t) >= 3)
      go_to_border (path_up (p) * 2, forward);
    else go_to_border (path_up (p), !forward);
  }
  else go_to_border (path_up (p), !forward);
}

Here is the call graph for this function:

virtual void editor_rep::back_in_long_arrow ( tree  t,
path  p,
bool  forward 
) [protected, pure virtual, inherited]

Implemented in edit_math_rep.

Here is the caller graph for this function:

void edit_table_rep::back_in_table ( tree  t,
path  p,
bool  forward 
) [protected, virtual, inherited]

Implements editor_rep.

Definition at line 672 of file edit_table.cpp.

                                                           {
  if (is_func (t, TFORMAT) &&
      (is_func (subtree (et, path_up (p, 2)), INACTIVE) || in_source ()))
    {
      remove_empty_argument (p, forward);
      return;
    }

  int i, j, row, col, nr_rows, nr_cols;
  p= search_table (row, col);
  if (is_nil (p)) return;
  table_get_extents (p, nr_rows, nr_cols);

  bool flag=true;
  for (j=0; j<nr_cols; j++) {
    path q= search_cell (p, row, j);
    flag= flag && is_empty_cell (subtree (et, q));
  }
  if (flag) {
    int i1, j1, i2, j2;
    path fp= search_format ();
    if (is_nil (fp)) return;
    table_get_limits (fp, i1, j1, i2, j2);
    if (nr_rows-1 >= i1) {
      table_remove_row (forward, true);
      return;
    }
  }

  flag= true;
  for (i=0; i<nr_rows; i++) {
    path q= search_cell (p, i, col);
    flag= flag && is_empty_cell (subtree (et, q));
  }
  if (flag) {
    int i1, j1, i2, j2;
    path fp= search_format ();
    if (is_nil (fp)) return;
    table_get_limits (fp, i1, j1, i2, j2);
    if (nr_cols-1 >= j1) {
      table_remove_column (forward, true);
      return;
    }
  }

  flag=true;
  for (i=0; i<nr_rows; i++)
    for (j=0; j<nr_cols; j++) {
      path q= search_cell (p, i, j);
      flag= flag && is_empty_cell (subtree (et, q));
    }
  if (flag) {
    destroy_table ();
    return;
  }

  if (forward) {
    if (col<(nr_cols-1)) { table_go_to (p, row, col+1, true); return; }
    if (row<(nr_rows-1)) { table_go_to (p, row+1, 0, true); return; }
  }
  else {
    if (col>0) { table_go_to (p, row, col-1, false); return; }
    if (row>0) { table_go_to (p, row-1, nr_cols-1, false); return; }
  }
  table_go_to_border (p, !forward);
}

Here is the call graph for this function:

virtual void editor_rep::back_in_table ( tree  t,
path  p,
bool  forward 
) [protected, pure virtual, inherited]

Implemented in edit_table_rep.

Here is the caller graph for this function:

void edit_graphics_rep::back_in_text_at ( tree  t,
path  p,
bool  forward 
) [virtual, inherited]

Implements editor_rep.

Definition at line 348 of file edit_graphics.cpp.

                                                                {
  int i= last_item (p);
  if ((i == 0) && is_empty (t[0])) {
    p= path_up (p);
    if (is_func (subtree (et, path_up (p)), WITH)) p= path_up (p);
    tree st= subtree (et, path_up (p));
    if (is_func (st, GRAPHICS)) {
      if (N(st) == 1) assign (p, "");
      else {
        remove (p, 1);
        go_to_border (path_up (p) * 0, true);
      }
    }
  }
}

Here is the call graph for this function:

virtual void editor_rep::back_in_text_at ( tree  t,
path  p,
bool  forward 
) [protected, pure virtual, inherited]

Implemented in edit_graphics_rep.

Here is the caller graph for this function:

void edit_math_rep::back_in_tree ( tree  t,
path  p,
bool  forward 
) [virtual, inherited]

Implements editor_rep.

Definition at line 342 of file edit_math.cpp.

                                                         {
  int i= last_item (p);
  if (i>0) {
    if ((i>0) && (t[i] == "")) {
      path q= path_up (p);
      if (N (t) == 2) {
       assign (q, t[0]);
       correct (path_up (q));
      }
      else {
       remove (q * i, 1);
       if (forward) {
         if (i == N (subtree (et, q))) go_to_end (q);
         else go_to_start (q * i);
       }
      }
    }
    else if (!forward) go_to_end (path_up (p) * (i-1));
    else if (i == N(t)-1) go_to_end (path_up (p));
    else go_to_start (path_up (p) * (i+1));
  }
  else {
    if (t == tree (TREE, "", "")) {
      p= path_up (p);
      assign (p, "");
      correct (path_up (p));
    }
    else if (forward) go_to_start (path_inc (p));
    else go_to_start (path_up (p));
  }
}

Here is the call graph for this function:

virtual void editor_rep::back_in_tree ( tree  t,
path  p,
bool  forward 
) [protected, pure virtual, inherited]

Implemented in edit_math_rep.

Here is the caller graph for this function:

void edit_math_rep::back_in_wide ( tree  t,
path  p,
bool  forward 
) [virtual, inherited]

Implements editor_rep.

Definition at line 288 of file edit_math.cpp.

                                                         {
  int i= last_item (p);
  if ((i == 0) && is_empty (t[0])) {
    assign (path_up (p), "");
    correct (path_up (p, 2));
  }
  else go_to_border (path_up (p), !forward);
}

Here is the call graph for this function:

virtual void editor_rep::back_in_wide ( tree  t,
path  p,
bool  forward 
) [protected, pure virtual, inherited]

Implemented in edit_math_rep.

Here is the caller graph for this function:

void edit_dynamic_rep::back_in_with ( tree  t,
path  p,
bool  forward 
) [virtual, inherited]

Implements editor_rep.

Definition at line 430 of file edit_dynamic.cpp.

                                                            {
  if (is_func (subtree (et, path_up (p, 2)), INACTIVE) ||
      ((is_func (t, WITH) || is_func (t, LOCUS)) && in_source ()))
    back_in_general (t, p, forward);
  else if (t[N(t)-1] == "") {
    assign (path_up (p), "");
    correct (path_up (p, 2));
  }
  else go_to_border (path_up (p), !forward);
}

Here is the call graph for this function:

virtual void editor_rep::back_in_with ( tree  t,
path  p,
bool  forward 
) [protected, pure virtual, inherited]

Implemented in edit_dynamic_rep.

Here is the caller graph for this function:

void edit_dynamic_rep::back_monolithic ( path  p) [virtual, inherited]

Implements editor_rep.

Definition at line 316 of file edit_dynamic.cpp.

                                         {
  if (!is_concat (subtree (et, path_up (p)))) assign (p, "");
  else remove (p, 1);
  correct (path_up (p));
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void editor_rep::back_monolithic ( path  p) [protected, pure virtual, inherited]

Implemented in edit_dynamic_rep.

Here is the caller graph for this function:

void edit_math_rep::back_prime ( tree  t,
path  p,
bool  forward 
) [virtual, inherited]

Implements editor_rep.

Definition at line 263 of file edit_math.cpp.

                                                       {
  if ((N(t) == 1) && is_atomic (t[0])) {
    string s= t[0]->label;
    if (forward) {
      int i= 0, n= N(s);
      tm_char_forwards (s, i);
      if (i >= n) {
       assign (p, "");
       correct (path_up (p));
      }
      else remove (p * path (0, 0), i);
    }
    else {
      int n= N(s), i= n;
      tm_char_backwards (s, i);
      if (i <= 0) {
       assign (p, "");
       correct (path_up (p));
      }
      else remove (p * path (0, i), n-i);
    }
  }
}

Here is the call graph for this function:

virtual void editor_rep::back_prime ( tree  t,
path  p,
bool  forward 
) [protected, pure virtual, inherited]

Implemented in edit_math_rep.

Here is the caller graph for this function:

void edit_table_rep::back_table ( path  p,
bool  forward 
) [protected, virtual, inherited]

Implements editor_rep.

Definition at line 646 of file edit_table.cpp.

                                                {
  while (true) {
    tree st= subtree (et, p);
    if (!is_func (st, TFORMAT)) break;
    if (!is_func (st [N(st)-1], TABLE)) {
      back_general (p, forward);
      return;
    }
    p= p * (N(st)-1);
  }
  while (rp < p) {
    tree st= subtree (et, p);
    if (is_func (st, TABLE)) break;
    p= path_up (p);
  }
  if (!(rp < p)) return;

  if (forward) table_go_to (p, 0, 0, true);
  else {
    int nr_rows, nr_cols;
    table_get_extents (p, nr_rows, nr_cols);
    table_go_to (p, nr_rows-1, nr_cols-1, false);
  }
}

Here is the call graph for this function:

virtual void editor_rep::back_table ( path  p,
bool  forward 
) [protected, pure virtual, inherited]

Implemented in edit_table_rep.

Here is the caller graph for this function:

void edit_interface_rep::before_menu_action ( ) [virtual, inherited]

Implements editor_rep.

Definition at line 674 of file edit_interface.cpp.

Here is the call graph for this function:

void edit_table_rep::cell_del_format ( string  var) [virtual, inherited]

Implements editor_rep.

Definition at line 1432 of file edit_table.cpp.

                                           {
  if (selection_active_table (false)) {
    int row1, col1, row2, col2;
    path fp= selection_get_subtable (row1, col1, row2, col2);
    table_del_format (fp, row1+1, col1+1, row2+1, col2+1, var);
  }
  else {
    int row, col;
    path fp= search_format (row, col); row++; col++;
    if (is_nil (fp)) return;
    if (cell_mode=="row") table_del_format (fp, row, 1, row, -1, var);
    else if (cell_mode=="column") table_del_format (fp, 1, col, -1, col, var);
    else if (cell_mode=="table") table_del_format (fp, 1, 1, -1, -1, var);
    else table_del_format (fp, row, col, row, col, var);
  }
  table_correct_block_content ();
}

Here is the call graph for this function:

virtual void editor_rep::cell_del_format ( string  var = "") [pure virtual, inherited]

Implemented in edit_table_rep.

string edit_table_rep::cell_get_format ( string  var) [virtual, inherited]

Implements editor_rep.

Definition at line 1418 of file edit_table.cpp.

                                           {
  int row, col;
  path fp= search_format (row, col); row++; col++;
  if (is_nil (fp)) return "";
  if (cell_mode=="row")
    return as_string (table_get_format (fp, row, 1, row, -1, var));
  else if (cell_mode=="column")
    return as_string (table_get_format (fp, 1, col, -1, col, var));
  else if (cell_mode=="table")
    return as_string (table_get_format (fp, 1, 1, -1, -1, var));
  else return as_string (table_get_format (fp, row, col, row, col, var));
}

Here is the call graph for this function:

virtual string editor_rep::cell_get_format ( string  var) [pure virtual, inherited]

Implemented in edit_table_rep.

void edit_table_rep::cell_set_format ( string  var,
tree  val 
) [virtual, inherited]

Implements editor_rep.

Definition at line 1392 of file edit_table.cpp.

                                                     {
  if (selection_active_table (false)) {
    int row1, col1, row2, col2, rows, cols;
    path fp= selection_get_subtable (row1, col1, row2, col2);
    row1++; col1++; row2++; col2++;
    table_get_extents (fp, rows, cols);
    if (rows > row1 && row1 <= 2 && row2 == rows) row2= -1;
    if (cols > col1 && col1 <= 2 && col2 == cols) col2= -1;
    table_set_format (fp, row1, col1, row2, col2, var, val);
  }
  else {
    int row, col;
    path fp= search_format (row, col); row++; col++;
    if (is_nil (fp)) return;
    if (cell_mode=="row")
      table_set_format (fp, row, 1, row, -1, var, val);
    else if (cell_mode=="column")
      table_set_format (fp, 1, col, -1, col, var, val);
    else if (cell_mode=="table")
      table_set_format (fp, 1, 1, -1, -1, var, val);
    else table_set_format (fp, row, col, row, col, var, val);
  }
  table_correct_block_content ();
}

Here is the call graph for this function:

virtual void editor_rep::cell_set_format ( string  var,
tree  val 
) [pure virtual, inherited]

Implemented in edit_table_rep.

int edit_interface_rep::change_time ( ) [virtual, inherited]

Implements editor_rep.

Definition at line 383 of file edit_interface.cpp.

                                 {
  return last_change;
}
void edit_main_rep::clear_buffer ( ) [virtual]

Implements editor_rep.

Definition at line 124 of file edit_main.cpp.

                             {
  assign (rp, tree (DOCUMENT, tree ("")));
}

Here is the call graph for this function:

void edit_typeset_rep::clear_local_info ( ) [virtual, inherited]

Implements editor_rep.

Definition at line 92 of file edit_typeset.cpp.

virtual void editor_rep::clear_local_info ( ) [pure virtual, inherited]

Implemented in edit_typeset_rep.

void edit_modify_rep::clear_undo_history ( ) [virtual, inherited]

Implements editor_rep.

Definition at line 268 of file edit_modify.cpp.

Here is the call graph for this function:

virtual void editor_rep::clear_undo_history ( ) [pure virtual, inherited]

Implemented in edit_modify_rep.

void edit_main_rep::clone_window ( ) [virtual]

Implements editor_rep.

Definition at line 133 of file edit_main.cpp.

                             {
}
bool edit_interface_rep::complete_keypress ( string  key) [virtual, inherited]

Implements editor_rep.

Definition at line 128 of file edit_complete.cpp.

                                                 {
  set_message ("", "");
  if (key == "space") key= " ";
  if ((key != "tab") && (key != "S-tab")) {
    set_input_normal (); return false; }
  tree st= subtree (et, path_up (tp));
  if (is_compound (st)) {
    set_input_normal (); return false; }
  string s= st->label;
  int end= last_item (tp);
  string old_s= completions [completion_pos];
  string test= completion_prefix * old_s;
  if ((end<N(test)) || (s (end-N(test), end) != test)) {
    set_input_normal (); return false; }

  if (key == "tab") completion_pos++;
  else completion_pos--;
  if (completion_pos < 0) completion_pos= N(completions)-1;
  if (completion_pos >= N(completions)) completion_pos= 0;
  string new_s= completions [completion_pos];
  remove (path_up (tp) * (end-N(old_s)), N(old_s));
  insert (path_up (tp) * (end-N(old_s)), new_s);
  complete_message ();
  return true;
}

Here is the call graph for this function:

Definition at line 88 of file edit_complete.cpp.

                                      {
  int i, n= N(completions);
  string s= "Other completions: ";
  for (i=1; i<min(n,11); i++) {
    int j= (completion_pos + i) % n;
    if (i != 1) s << ", ";
    s << completion_prefix << completions[j];
  }
  set_message (s, "tab");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void edit_interface_rep::complete_start ( string  prefix,
array< string compls 
) [virtual, inherited]

Implements editor_rep.

Definition at line 100 of file edit_complete.cpp.

                                                                       {
  // check consistency
  tree st= subtree (et, path_up (tp));
  if (is_compound (st)) return;
  string s= st->label;
  int end= last_item (tp);
  if ((end<N(prefix)) || (s (end-N(prefix), end) != prefix)) return;

  // perform first completion and switch to completion mode if necessary
  if (N (compls) == 1) {
    string s= compls[0];
    if (ends (s, "()")) // temporary fix for Pari
      insert_tree (s, path (N(s)-1));
    else insert_tree (s);
    completions= array<string> ();
  }
  else {
    completion_prefix= prefix;
    completions      = close_completions (compls);
    completion_pos   = 0;
    insert_tree (completions[0]);
    complete_message ();
    beep ();
    set_input_mode (INPUT_COMPLETE);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool edit_interface_rep::complete_try ( ) [virtual, inherited]

Implements editor_rep.

Definition at line 59 of file edit_complete.cpp.

                                  {
  tree st= subtree (et, path_up (tp));
  if (is_compound (st)) return false;
  string s= st->label, ss;
  int end= last_item (tp);
  array<string> a;
  if (inside (LABEL) || inside (REFERENCE) || inside (PAGEREF)) {
    if (end != N(s)) return false;
    ss= copy (s);
    tree t= get_labels ();
    int i, n= N(t);
    for (i=0; i<n; i++)
      if (is_atomic (t[i]) && starts (t[i]->label, s))
       a << string (t[i]->label (N(s), N(t[i]->label)));
  }
  else {
    if ((end==0) || (!is_iso_alpha (s[end-1])) ||
       ((end!=N(s)) && is_iso_alpha (s[end]))) return false;
    int start= end-1;
    while ((start>0) && is_iso_alpha (s[start-1])) start--;
    ss= s (start, end);
    a= find_completions (drd, et, ss);
  }
  if (N(a) == 0) return false;
  complete_start (ss, a);
  return true;
}

Here is the call graph for this function:

Definition at line 249 of file edit_footer.cpp.

                                                           {
  if (!(rp < p)) return "";
  tree up= compute_compound_footer (t, path_up (p));
  if (N(focus_get (false))+1 < N(p)) return up;
  tree st= subtree (t, path_up (p));
  int  l = last_item (p);
  switch (L (st)) {
  case DOCUMENT:
  case PARA:
    return up;
  case SURROUND:
    if (l == 0) return concat (up, "left surrounding ");
    if (l == 1) return concat (up, "right surrounding ");
    return up;
  case CONCAT:
    return up;
  case MOVE:
    if (l == 0) return concat (up, "move ");
    else return up;
  case SHIFT:
    if (l==0) return concat (up, "shift ");
    else return up;
  case RESIZE:
    if (l==0) return concat (up, "resize ");
    else return up;
  case CLIPPED:
    if (l==0) return concat (up, "clipped ");
    else return up;
  case _FLOAT:
    if (N(st) >= 1 && is_atomic (st[0]))
      return concat (up, st[0]->label * " ");
    else return concat (up, "float ");
  case LONG_ARROW:
    if (l == 1) return concat (up, "above ");
    else if (l == 2) return concat (up, "below ");
    else return up;
  case BELOW:
    if (l==0) return concat (up, "body ");
    else return concat (up, "script below ");
  case ABOVE:
    if (l==0) return concat (up, "body ");
    else return concat (up, "script above ");
  case FRAC:
    if (l==0) return concat (up, "numerator ");
    else return concat (up, "denominator ");
  case SQRT:
    if (N(st)==1) return concat (up, "square root ");
    if (l==0) return concat (up, "root ");
    else return concat (up, "index ");
  case WIDE:
    if (N(st) >= 1)
      return concat (up, get_accent_type (as_string (st[1])) * " ");
    else
      return concat (up, "wide ");
  case VAR_WIDE:
    if (N(st) >= 1)
      return concat (up, "under " * get_accent_type (as_string (st[1])) * " ");
    else
      return concat (up, "var-wide ");
  case TREE:
    if (l==0) return concat (up, "root ");
    else return concat (up, "branch(" * as_string (l) * ") ");
  case TFORMAT:
    return up;
  case TABLE:
    return concat (up, "(" * as_string (l+1) * ",");
  case ROW:
    return concat (up, as_string (l+1) * ") ");
  case CELL:
    return up;
  case WITH:
    return concat (up, get_with_text (st), " ");
  case DRD_PROPS:
    if (l == 0)
      return concat (up, "drd property(variable) ");
    if ((l&1) == 1)
      return concat (up, "drd property(" * as_string (l/2+1) * ") ");
    return concat (up, "value(" * as_string (l/2) * ") ");
  case COMPOUND:
    if (N(st) >= 1 && is_atomic (st[0]))
      return concat (up, as_string (st[0]) * " ");
    else
      return concat (up, "compound ");
  case HLINK:
    if (N(st) >= 2)
      return concat (up, "hyperlink(" * as_string (st[1]) * ") ");
    else
      return concat (up, "hyperlink ");
  case TUPLE:
    return concat (up, "tuple(" * as_string (l+1) * ") ");
  case ATTR:
    if ((l&1) == 0)
      return concat (up, "variable(" * as_string (l/2+1) * ") ");
    else
      return concat (up, "value(" * as_string (l/2+1) * ") ");
  case SPECIFIC:
    return concat (up, "texmacs ");
  case ANIM_CONSTANT:
    if (l == 0)
      return concat (up, "anim-constant ");
    else return up;
  case ANIM_TRANSLATE:
    if (l == 0)
      return concat (up, "anim-translate ");
    else return up;
  case ANIM_PROGRESSIVE:
    if (l == 0)
      return concat (up, "anim-progressive ");
    else return up;
  default:
    return concat (up, drd->get_name (L(st)) * " ");
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void edit_interface_rep::compute_env_rects ( path  p,
rectangles rs,
bool  recurse 
) [inherited]

Definition at line 290 of file edit_interface.cpp.

                                                                           {
  if (p == rp) return;
  tree st= subtree (et, p);
  if ((is_func (st, TABLE) || is_func (st, SUBTABLE)) &&
      recurse && get_preference ("show table cells") == "on") {
    rectangles rl;
    for (int i=0; i<N(st); i++) {
      if (is_func (st[i], ROW))
        for (int j=0; j<N(st[i]); j++) {
          selection sel= eb->find_check_selection (p*i*j*0, p*i*j*1);
          rectangles rsel= copy (thicken (sel->rs, 0, 2 * pixel));
          if (i > 0 && is_func (st[i-1], ROW) && j < N(st[i-1])) {
            selection bis= eb->find_check_selection (p*(i-1)*j*0, p*(i-1)*j*1);
            rectangles rbis= copy (thicken (bis->rs, 0, 2 * pixel));
            correct_adjacent (rbis, rsel);
          }
          if (i+1 < N(st) && is_func (st[i+1], ROW) && j < N(st[i+1])) {
            selection bis= eb->find_check_selection (p*(i+1)*j*0, p*(i+1)*j*1);
            rectangles rbis= copy (thicken (bis->rs, 0, 2 * pixel));
            correct_adjacent (rsel, rbis);
          }
          rectangles selp= thicken (rsel,  pixel/2,  pixel/2);
          rectangles selm= thicken (rsel, -pixel/2, -pixel/2);
          rl << simplify (::correct (selp - selm));
        }
    }
    rs << simplify (rl);
    if (recurse) compute_env_rects (path_up (p), rs, recurse);
  }
  else if (is_atomic (st) ||
           drd->is_child_enforcing (st) ||
           //is_document (st) || is_concat (st) ||
           is_func (st, TABLE) || is_func (st, SUBTABLE) ||
           is_func (st, ROW) || is_func (st, TFORMAT) ||
           is_graphical (st) ||
           (is_func (st, WITH) && is_graphical (st[N(st)-1])) ||
           (is_func (st, WITH) && is_graphical_text (st[N(st)-1])) ||
           (is_compound (st, "math", 1) &&
            is_compound (subtree (et, path_up (p)), "input")))
    compute_env_rects (path_up (p), rs, recurse);
  else {
    int new_mode= DRD_ACCESS_NORMAL;
    if (get_init_string (MODE) == "src") new_mode= DRD_ACCESS_SOURCE;
    int old_mode= set_access_mode (new_mode);
    tree st= subtree (et, p);
    if (is_accessible_cursor (et, p * right_index (st)) || in_source ()) {
      bool right;
      path p1= p * 0, p2= p * 1, q1, q2;
      if (is_script (subtree (et, p), right)) {
       p1= start (et, p * 0);
       p2= end   (et, p * 0);
      }
      if (is_func (st, CELL)) { q1= p1; q2= p2; }
      else selection_correct (p1, p2, q1, q2);
      selection sel= eb->find_check_selection (q1, q2);
      if (N(focus_get ()) >= N(p))
        if (!recurse || get_preference ("show full context") == "on")
          rs << outline (sel->rs, pixel);
    }
    set_access_mode (old_mode);
    if (recurse || N(rs) == 0)
      compute_env_rects (path_up (p), rs, recurse);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 161 of file edit_footer.cpp.

                                                     {
  tree r= "";
  if (N(st) >= 2) {
    switch (L (st)) {
    case VAR_WIDE:
      r= concat ("under ", get_accent_type (as_string (st[1]))); break;
    default: ;
    }
  }
  if (r == "" && N(st) >= 1) {
    switch (L (st)) {
    case HSPACE:
      r= concat ("space"); break;
    case VAR_VSPACE:
      r= concat ("vertical space before");
      break;
    case VSPACE:
      r= concat ("vertical space"); break;
    case SPACE:
      r= concat ("space"); break;
    case _FLOAT:
      r= (is_atomic (st[0])? st[0]->label: string ("float")); break;
    case MID:
      r= concat ("middle ", as_symbol (st[0])); break;
    case RIGHT:
      r= concat ("close ", as_symbol (st[0])); break;
    case BIG:
      r= concat ("big ", as_symbol (st[0])); break;
    case LPRIME:
      r= concat ("left prime ", as_string (st[0])); break;
    case LONG_ARROW:
      r= concat ("long arrow ", as_string (st[0])); break;
    case RPRIME:
      r= concat ("prime ", as_string (st[0])); break;
    case SQRT:
      r= tree ((char*) ((N(st)==1)? "square root": "n-th root")); break;
    case WIDE:
      r= tree (get_accent_type (as_string (st[1]))); break;
    case ASSIGN:
      r= concat ("assign ", as_string (st[0])); break;
    case WITH:
      r= concat ("with ", get_with_text (st)); break;
    case PROVIDES:
      r= concat ("provides ", as_string (st[0])); break;
    case VALUE:
      r= concat ("value ", as_string (st[0])); break;
    case QUOTE_VALUE:
      r= concat ("quoted value ", as_string (st[0])); break;
    case ARG:
      r= concat ("argument ", as_string (st[0])); break;
    case QUOTE_ARG:
      r= concat ("quoted argument ", as_string (st[0])); break;
    case COMPOUND:
      if (is_atomic (st[0])) r= as_string (st[0]);
      else r= "compound";
      break;
    case INCLUDE:
      r= concat ("include ", as_string (st[0])); break;
    case INACTIVE:
      r= concat ("inactive ", drd->get_name (L(st[0]))); break;
    case VAR_INACTIVE:
      r= concat ("inactive ", drd->get_name (L(st[0]))); break;
    case LABEL:
      r= concat ("label: ", as_string (st[0])); break;
    case REFERENCE:
      r= concat ("reference: ", as_string (st[0])); break;
    case PAGEREF:
      r= concat ("page reference: ", as_string (st[0])); break;
    case WRITE:
      r= concat ("write to ", as_string (st[0])); break;
    case SPECIFIC:
      r= concat ("specific ", as_string (st[0])); break;
    case IMAGE:
      r= concat ("image"); break;
    default: ;
    }
  }
  if (r == "") {
    switch (L (st)) {
    case IMAGE: r= "image"; break;
    default: r= drd->get_name (L(st));
    }
  }
  if (last_item (tp) == 0) r= concat ("before ", r);
  return r;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 106 of file edit_footer.cpp.

                                                {
  string r;
  language lan= get_env_language ();
  int end  = last_item (tp);
  int start= end;
  tm_char_backwards (st->label, start);
  r= st->label (start, end);
  if (r == "") r= "start";
  if (r == " ") r= "space";
  if (r == "space" && get_env_string (MODE) == "math") r= "apply";
  return r;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void widget_rep::connect ( slot  s,
widget  w2,
slot  s2 
) [virtual, inherited]

Definition at line 150 of file widget.cpp.

                                               {
  widget_connection con (this, s, w2.rep, s2);
  insert (out, con);
  insert (w2->in, con);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void edit_text_rep::correct ( path  p) [protected, virtual, inherited]

Implements editor_rep.

Definition at line 82 of file edit_text.cpp.

                              {
  tree t (subtree (et, p));
  if (L(t) == CONCAT) correct_concat (p);
  if (t == "") correct (path_up (p));
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void editor_rep::correct ( path  p) [pure virtual, inherited]

Implemented in edit_text_rep.

Here is the caller graph for this function:

void edit_text_rep::correct_concat ( path  p,
int  done = 0 
) [protected, virtual, inherited]

Implements editor_rep.

Definition at line 29 of file edit_text.cpp.

                                               {
  tree t (subtree (et, p));
  if (L(t) != CONCAT) {
    cerr << "\nThe tree was <" << t << ">\n";
    FAILED ("concat expected");
  }

  int i, n= N(t);
  if (n == 0) { assign (p, string ("")); return; }
  if (n == 1) { remove_node (p * 0); return; }
  for (i=done; i<n; i++) {
    if (t[i] == "") {
      remove (p * i, 1);
      correct_concat (p, i);
      return;
    }
    if ((i<n-1) && is_atomic (t[i]) && is_atomic (t[i+1])) {
      join (p * i);
      correct_concat (p, i);
      return;
    }
    if (is_concat (t[i])) {
      insert_node (p * 0, CONCAT);
      split (p * path (0, i));
      split (p * path (1, 1));
      remove_node (p * path (1, 0));
      if (subtree (et, p * 0) == tree (CONCAT)) remove (p * 0, 1);
      else join (p * 0);
      if (subtree (et, p * 1) == tree (CONCAT)) remove (p * 1, 1);
      else join (p * 0);
      remove_node (p * 0);
      correct_concat (p, max (i-1, 0));
      return;
    }
    else if (is_multi_paragraph (t[i]) &&
            is_document (subtree (et, path_up (p))))
      {
       if ((i+1)<n) {
         split (p * (i+1));
         correct_concat (path_inc (p));
       }
       if (i==0) remove_node (p * 0);
       else {
         split (p * i);
         remove_node (path_inc (p) * 0);
         correct_concat (p);
       }
       return;
      }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void editor_rep::correct_concat ( path  p,
int  done = 0 
) [pure virtual, inherited]

Implemented in edit_text_rep.

Here is the caller graph for this function:

void edit_cursor_rep::cursor_move ( SI  dx,
SI  dy 
) [protected, inherited]

Definition at line 134 of file edit_cursor.cpp.

                                          {
  //time_t t1= texmacs_time ();
  //stretched_print ((tree) eb, false);
  cursor_move_sub (mv->ox, mv->oy, mv->delta, dx, dy);
  //time_t t2= texmacs_time ();
  //if (t2 - t1 >= 10) cout << "cursor_move took " << t2-t1 << "ms\n";
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool edit_cursor_rep::cursor_move_sub ( SI x0,
SI y0,
SI delta,
SI  dx,
SI  dy 
) [protected, inherited]

Definition at line 73 of file edit_cursor.cpp.

                                                                      {
  path sp= find_innermost_scroll (eb, tp);
  searching_forwards= dx == 1 || dy == -1;

  int i,d;
  path ref_p= tree_path (sp, x0, y0, d0);
  if (ref_p != tp) {
    tp= ref_p;
    return true;
  }
  
  // cout << "ref_p = " << ref_p << "\n";
  if (ref_p == tree_path (sp, x0, y0, d0+ dx*DELTA)) {
    for (i=1; i<DELTA; i=i<<1)
      if (ref_p != tree_path (sp, x0+ dx*i, y0+ dy*i, d0+ dx*DELTA))
       break;
    if (i>=DELTA) return false;
    for (d=i>>2; d>=1; d=d>>1)
      if (ref_p != tree_path (sp, x0+ dx*(i-d), y0+ dy*(i-d), d0+ dx*DELTA))
       i-=d;

    x0 += dx*i;
    y0 += dy*i;
  }
  
  // cout << "path  = " << tree_path (sp, x0, y0, d0) << "\n";
  if (dx!=0) {
    if (ref_p == tree_path (sp, x0, y0, d0)) {
      for (i=1; i<DELTA; i=i<<1)
       if (ref_p != tree_path (sp, x0, y0, d0+ dx*i)) break;
      if (i>=DELTA)
       FAILED ("inconsistent cursor handling");
      for (d=i>>2; d>=1; d=d>>1)
       if (ref_p != tree_path (sp, x0, y0, d0+ dx*(i-d))) i-=d;
      d0 += dx*i;
    }
    else {
      for (i=1; i<DELTA; i=i<<1)
       if (ref_p == tree_path (sp, x0, y0, d0- dx*i)) break;
      if (i<DELTA) {
       for (d=i>>2; d>=1; d=d>>1)
         if (ref_p == tree_path (sp, x0, y0, d0- dx*(i-d))) i-=d;
       i--;
       d0 -= dx*i;
      }
      else {  // exceptional case
       ref_p= tree_path (sp, x0, y0, d0- dx*DELTA);
       for (i=1; i<DELTA; i=i<<1)
         if (ref_p == tree_path (sp, x0, y0, d0- dx*i)) break;
       for (d=i>>2; d>=1; d=d>>1)
         if (ref_p == tree_path (sp, x0, y0, d0- dx*(i-d))) i-=d;
       d0 -= dx*i;
      }
    }
  }

  tp= tree_path (sp, x0, y0, d0);
  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void edit_interface_rep::cursor_visible ( ) [inherited]

Definition at line 171 of file edit_interface.cpp.

                                    {
  path sp= find_innermost_scroll (eb, tp);
  cursor cu= get_cursor ();
  if (is_nil (sp)) {
    update_visible ();
    cu->y1 -= 2*pixel; cu->y2 += 2*pixel;
    if ((cu->ox+ ((SI) (cu->y1 * cu->slope)) <  vx1) ||
       (cu->ox+ ((SI) (cu->y2 * cu->slope)) >= vx2) ||
       (cu->oy+ cu->y1 <  vy1) ||
       (cu->oy+ cu->y2 >= vy2))
      {
       scroll_to (cu->ox- ((vx2-vx1)>>1), cu->oy+ ((vy2-vy1)>>1));
       send_invalidate_all (this);
      }
  }
  else {
    SI x, y, sx, sy;
    rectangle outer, inner;
    find_canvas_info (eb, sp, x, y, sx, sy, outer, inner);
    if ((cu->ox+ ((SI) (cu->y1 * cu->slope)) < x + outer->x1) ||
       (cu->ox+ ((SI) (cu->y2 * cu->slope)) > x + outer->x2))
      {
       SI tx= inner->x2 - inner->x1;
       SI cx= outer->x2 - outer->x1;
       if (tx > cx) {
         SI outer_cx= cu->ox - x;
         SI inner_cx= outer_cx - sx;
         SI dx= inner_cx - inner->x1;
         double p= 100.0 * ((double) (dx - (cx>>1))) / ((double) (tx-cx));
         p= max (min (p, 100.0), 0.0);
         tree old_xt= eb[path_up (sp)]->get_info ("scroll-x");
         tree new_xt= as_string (p) * "%";
         if (new_xt != old_xt && is_accessible (obtain_ip (old_xt))) {
           object fun= symbol_object ("tree-set");
           object cmd= list_object (fun, old_xt, new_xt);
           exec_delayed (scheme_cmd (cmd));
           temp_invalid_cursor= true;
         }
       }
      }
    if ((cu->oy+ cu->y1 < y + outer->y1) ||
       (cu->oy+ cu->y2 > y + outer->y2))
      {
       SI ty= inner->y2 - inner->y1;
       SI cy= outer->y2 - outer->y1;
       if (ty > cy) {
         SI outer_cy= cu->oy + ((cu->y1 + cu->y2) >> 1) - y;
         SI inner_cy= outer_cy - sy;
         SI dy= inner_cy - inner->y1;
         double p= 100.0 * ((double) (dy - (cy>>1))) / ((double) (ty-cy));
         p= max (min (p, 100.0), 0.0);
         tree old_yt= eb[path_up (sp)]->get_info ("scroll-y");
         tree new_yt= as_string (p) * "%";
         if (new_yt != old_yt && is_accessible (obtain_ip (old_yt))) {
           object fun= symbol_object ("tree-set");
           object cmd= list_object (fun, old_yt, new_yt);
           exec_delayed (scheme_cmd (cmd));
           temp_invalid_cursor= true;
         }
       }
      }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void edit_interface_rep::custom_complete ( tree  t) [virtual, inherited]

Implements editor_rep.

Definition at line 202 of file edit_complete.cpp.

                                           {
  if (!is_tuple (r)) return;
  int i, n= N(r);
  string prefix;
  array<string> compls;
  for (i=0; i<n; i++)
    if (is_atomic (r[i])) {
      string l= r[i]->label;
      if (is_quoted (l)) l= scm_unquote (l);
      if (prefix == "") prefix= l;
      else compls << l;
    }
  // cout << prefix << ", " << compls << LF;

  if ((prefix == "") || (N(compls) == 0)) return;
  complete_start (prefix, compls);
}

Here is the call graph for this function:

void edit_select_rep::cut ( path  p) [virtual, inherited]

Implements editor_rep.

Definition at line 770 of file edit_select.cpp.

                            {
  cut (start (et, p), end (et, p));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void edit_select_rep::cut ( path  start,
path  end 
) [virtual, inherited]

Implements editor_rep.

Definition at line 775 of file edit_select.cpp.

                                      {
  path p = common (p1, p2);
  tree st= subtree (et, p);
  raw_cut (p1, p2);
  if (!is_func (st, TFORMAT) &&
      !is_func (st, TABLE) &&
      !is_func (st, ROW) &&
      !is_document (subtree (et, p)) &&
      is_concat (subtree (et, path_up (p))))
    correct_concat (path_up (p));
}

Here is the call graph for this function:

virtual void editor_rep::cut ( path  p) [pure virtual, inherited]

Implemented in edit_select_rep.

Here is the caller graph for this function:

virtual void editor_rep::cut ( path  start,
path  end 
) [pure virtual, inherited]

Implemented in edit_select_rep.

void widget_rep::deconnect ( slot  s,
widget  w2,
slot  s2 
) [virtual, inherited]

Definition at line 157 of file widget.cpp.

                                                 {
  widget_connection con (this, s, w2.rep, s2);
  remove (out, con);
  remove (w2->in, con);
}
bool edit_typeset_rep::defined_at_cursor ( string  var_name) [virtual, inherited]

Implements editor_rep.

Definition at line 269 of file edit_typeset.cpp.

                                               {
  typeset_exec_until (tp);
  return cur[tp]->contains (var);
}

Here is the call graph for this function:

virtual bool editor_rep::defined_at_cursor ( string  var_name) [pure virtual, inherited]

Implemented in edit_typeset_rep.

bool edit_typeset_rep::defined_at_init ( string  var_name) [virtual, inherited]

Implements editor_rep.

Definition at line 297 of file edit_typeset.cpp.

                                             {
  if (init->contains (var)) return true;
  if (N(pre)==0) typeset_preamble ();
  return pre->contains (var);
}

Here is the call graph for this function:

virtual bool editor_rep::defined_at_init ( string  var_name) [pure virtual, inherited]

Implemented in edit_typeset_rep.

bool edit_typeset_rep::defined_in_init ( string  var_name) [virtual, inherited]

Implements editor_rep.

Definition at line 304 of file edit_typeset.cpp.

                                             {
  return init->contains (var);
}
virtual bool editor_rep::defined_in_init ( string  var_name) [pure virtual, inherited]

Implemented in edit_typeset_rep.

void edit_table_rep::destroy_table ( ) [inherited]

Definition at line 1093 of file edit_table.cpp.

                               {
  path fp= search_format ();
  if (is_nil (fp)) return;
  while (rp < fp) {
    tree st= subtree (et, path_up (fp));
    if (!is_func (st, TFORMAT)) break;
    fp= path_up (fp);
  }
  if ((rp < fp) &&
      is_document (subtree (et, path_up (fp))) &&
      (rp < path_up (fp)) &&
      is_extension (subtree (et, path_up (fp, 2)), 1))
    fp= path_up (fp);
  if ((rp < fp) && is_extension (subtree (et, path_up (fp)), 1))
    fp= path_up (fp);
  if ((rp < fp) && is_func (subtree (et, path_up (fp)), SUBTABLE, 1))
    fp= path_up (fp);
  assign (fp, "");
  correct (path_up (fp));
}

Here is the call graph for this function:

Here is the caller graph for this function:

double edit_typeset_rep::divide_lengths ( string  l1,
string  l2 
) [virtual, inherited]

Implements editor_rep.

Definition at line 118 of file edit_typeset.cpp.

                                                      {
  return env->divide_lengths (l1, l2); }
virtual double editor_rep::divide_lengths ( string  l1,
string  l2 
) [pure virtual, inherited]

Implemented in edit_typeset_rep.

void edit_interface_rep::draw_context ( renderer  ren,
rectangle  r 
) [inherited]

Definition at line 107 of file edit_repaint.cpp.

                                                           {
  int i;
  ren->set_color (light_grey);
  ren->set_line_style (pixel);
  for (i=1; i<N(eb[0]); i++) {
    SI y= eb->sy(0)+ eb[0]->sy2(i);
    if ((y >= r->y1) && (y < r->y2))
      ren->line (r->x1, y, r->x2, y);
  }
  draw_surround (ren, r);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void edit_interface_rep::draw_cursor ( renderer  ren) [inherited]

Definition at line 55 of file edit_repaint.cpp.

                                             {
  if (!temp_invalid_cursor && (got_focus || full_screen)) {
    cursor cu= get_cursor();
    if (!inside_active_graphics ()) {
      cu->y1 -= 2*pixel; cu->y2 += 2*pixel;
      SI x1= cu->ox + ((SI) (cu->y1 * cu->slope)), y1= cu->oy + cu->y1;
      SI x2= cu->ox + ((SI) (cu->y2 * cu->slope)), y2= cu->oy + cu->y2;
      ren->set_line_style (pixel);
      string mode= get_env_string (MODE);
      string family, series;
      if ((mode == "text") || (mode == "src")) {
       family= get_env_string (FONT_FAMILY);
       series= get_env_string (FONT_SERIES);
      }
      else if (mode == "math") {
       family= get_env_string (MATH_FONT_FAMILY);
       series= get_env_string (MATH_FONT_SERIES);
      }
      else if (mode == "prog") {
       family= get_env_string (PROG_FONT_FAMILY);
       series= get_env_string (PROG_FONT_SERIES);
      }
      if (cu->valid) {
       if (mode == "math")
         ren->set_color (rgb_color (192, 0, 255));
       else ren->set_color (red);
      }
      else ren->set_color (green);
      SI lserif= (series=="bold"? 2*pixel: pixel), rserif= pixel;
      if (family == "ss") lserif= rserif= 0;
      ren->line (x1-lserif, y1, x1+rserif, y1);
      if (y1<=y2-pixel) {
       ren->line (x1, y1, x2, y2-pixel);
       if (series == "bold") ren->line (x1-pixel, y1, x2-pixel, y2-pixel);
       ren->line (x2-lserif, y2-pixel, x2+rserif, y2-pixel);
      }
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void edit_interface_rep::draw_env ( renderer  ren) [inherited]

Definition at line 36 of file edit_repaint.cpp.

                                          {
  if (!full_screen) {
    if (!is_nil (env_rects)) {
      ren->set_color (rgb_color (0, 85, 85, 24));
      ren->draw_rectangles (env_rects);
    }
    if (!is_nil (foc_rects)) {
      ren->set_color (rgb_color (0, 255, 255));
      ren->draw_rectangles (foc_rects);
    }
    if (!is_nil (sem_rects)) {
      if (sem_correct) ren->set_color (rgb_color (112, 208, 112));
      else ren->set_color (rgb_color (208, 144, 80));
      ren->draw_rectangles (sem_rects);
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void edit_graphics_rep::draw_graphical_object ( renderer  ren) [virtual, inherited]

Implements editor_rep.

Definition at line 326 of file edit_graphics.cpp.

                                                      {
  if (is_nil (go_box)) set_graphical_object (graphical_object);
  if (is_nil (go_box)) return;
  SI ox1, oy1, ox2, oy2;
  ren->get_clipping (ox1, oy1, ox2, oy2);
  SI gx1, gy1, gx2, gy2;
  if (find_graphical_region (gx1, gy1, gx2, gy2))
    ren->extra_clipping (gx1, gy1, gx2, gy2);
  int i;
  for (i=0; i<go_box->subnr(); i++) {
    box b= go_box->subbox (i);
    if ((tree)b=="point" || (tree)b=="curve")
      b->display (ren);
    else {
      rectangles rs;
      b->redraw (ren, path (), rs);
    }
  }
  ren->set_clipping (ox1, oy1, ox2, oy2);
}

Here is the call graph for this function:

virtual void editor_rep::draw_graphical_object ( renderer  ren) [pure virtual, inherited]

Implemented in edit_graphics_rep.

Here is the caller graph for this function:

void edit_interface_rep::draw_graphics ( renderer  ren) [inherited]

Definition at line 136 of file edit_repaint.cpp.

                                               {
  if (got_focus || full_screen) {
    cursor cu= get_cursor();
    if (over_graphics(cu->ox, cu->oy) && inside_active_graphics ()) {
      eval ("(graphics-reset-context 'graphics-cursor)");
      draw_graphical_object (ren);
      string tm_curs= as_string (eval ("graphics-texmacs-pointer"));
      if (tm_curs != "none") {
       if (tm_curs == "graphics-cross") {
         ren->set_line_style (pixel);
         ren->set_color (red);
         ren->line (cu->ox, cu->oy-5*pixel, cu->ox, cu->oy+5*pixel);
         ren->line (cu->ox-5*pixel, cu->oy, cu->ox+5*pixel, cu->oy);
        }
       else if (tm_curs == "graphics-cross-arrows") {
         static int s= 6*pixel, a= 2*pixel;
         ren->set_line_style (pixel);
         ren->set_color (red);
         ren->line (cu->ox, cu->oy-s, cu->ox, cu->oy+s);
         ren->line (cu->ox-s, cu->oy, cu->ox+s, cu->oy);
         ren->line (cu->ox, cu->oy-s,cu->ox-a, cu->oy-s+a);
         ren->line (cu->ox, cu->oy-s, cu->ox+a, cu->oy-s+a);
         ren->line (cu->ox, cu->oy+s, cu->ox-a, cu->oy+s-a);
         ren->line (cu->ox, cu->oy+s, cu->ox+a, cu->oy+s-a);
         ren->line (cu->ox-s, cu->oy, cu->ox-s+a, cu->oy+a);
         ren->line (cu->ox-s, cu->oy, cu->ox-s+a, cu->oy-a);
         ren->line (cu->ox+s, cu->oy, cu->ox+s-a, cu->oy+a);
         ren->line (cu->ox+s, cu->oy, cu->ox+s-a, cu->oy-a);
        }
      }
    }
    else eval ("(graphics-reset-context 'text-cursor)");
  }
}

Here is the call graph for this function: