"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Edit/Interface/edit_mouse.cpp" between
TeXmacs-1.99.4-src.tar.gz and TeXmacs-1.99.5-src.tar.gz

About: GNU TeXmacs is a what-you-see-is-what-you-get scientific text editor, which was both inspired by TeX and GNU Emacs.

edit_mouse.cpp  (TeXmacs-1.99.4-src):edit_mouse.cpp  (TeXmacs-1.99.5-src)
skipping to change at line 358 skipping to change at line 358
left_x = 0; left_x = 0;
left_y = 0; left_y = 0;
} }
void void
disable_double_clicks () { disable_double_clicks () {
left_last -= (double_click_delay + 1); left_last -= (double_click_delay + 1);
} }
static string static string
detect_left_drag (void* handle, string type, SI x, SI y, time_t t, SI d) { detect_left_drag (void* handle, string type, SI x, SI y, time_t t,
int m, SI d) {
if (left_handle != handle) drag_left_reset (); if (left_handle != handle) drag_left_reset ();
left_handle= handle; left_handle= handle;
if (left_dragging && type == "move" && (m&1) == 0)
type= "release-left";
if (type == "press-left") { if (type == "press-left") {
left_dragging= true; left_dragging= true;
left_started = true; left_started = true;
left_x = x; left_x = x;
left_y = y; left_y = y;
} }
else if (type == "move") { else if (type == "move") {
if (left_started) { if (left_started) {
if (norm (point (x - left_x, y - left_y)) < d) return "wait-left"; if (norm (point (x - left_x, y - left_y)) < d) return "wait-left";
left_started= false; left_started= false;
skipping to change at line 411 skipping to change at line 414
void void
drag_right_reset () { drag_right_reset () {
right_started = false; right_started = false;
right_dragging= false; right_dragging= false;
right_x = 0; right_x = 0;
right_y = 0; right_y = 0;
right_last = 0; right_last = 0;
} }
static string static string
detect_right_drag (void* handle, string type, SI x, SI y, time_t t, SI d) { detect_right_drag (void* handle, string type, SI x, SI y, time_t t,
int m, SI d) {
if (right_handle != handle) drag_right_reset (); if (right_handle != handle) drag_right_reset ();
right_handle= handle; right_handle= handle;
if (right_dragging && type == "move" && (m&4) == 0)
type= "release-right";
if (type == "press-right") { if (type == "press-right") {
right_dragging= true; right_dragging= true;
right_started = true; right_started = true;
right_x = x; right_x = x;
right_y = y; right_y = y;
} }
else if (type == "move") { else if (type == "move") {
if (right_started) { if (right_started) {
if (norm (point (x - right_x, y - right_y)) < d) return "wait-right"; if (norm (point (x - right_x, y - right_y)) < d) return "wait-right";
right_started= false; right_started= false;
skipping to change at line 472 skipping to change at line 478
if (type == "leave") if (type == "leave")
set_pointer ("XC_top_left_arrow"); set_pointer ("XC_top_left_arrow");
if ((!move_like) && (type != "enter") && (type != "leave")) if ((!move_like) && (type != "enter") && (type != "leave"))
set_input_normal (); set_input_normal ();
if (!is_nil (popup_win) && (type != "leave")) { if (!is_nil (popup_win) && (type != "leave")) {
set_visibility (popup_win, false); set_visibility (popup_win, false);
destroy_window_widget (popup_win); destroy_window_widget (popup_win);
popup_win= widget (); popup_win= widget ();
} }
if (inside_graphics (false)) { //if (inside_graphics (false)) {
//if (inside_graphics ()) {
if (inside_graphics (type != "release-left")) {
if (mouse_graphics (type, x, y, mods, t)) return; if (mouse_graphics (type, x, y, mods, t)) return;
if (!over_graphics (x, y)) if (!over_graphics (x, y))
eval ("(graphics-reset-context 'text-cursor)"); eval ("(graphics-reset-context 'text-cursor)");
} }
if (type == "press-left" || type == "start-drag-left") { if (type == "press-left" || type == "start-drag-left") {
if (mods > 1) { if (mods > 1) {
mouse_adjusting = mods; mouse_adjusting = mods;
mouse_adjust_selection(x, y, mods); mouse_adjust_selection(x, y, mods);
} else } else
skipping to change at line 556 skipping to change at line 564
if (is_nil (eb)) apply_changes (); if (is_nil (eb)) apply_changes ();
start_editing (); start_editing ();
started= true; started= true;
x= ((SI) (x / magf)); x= ((SI) (x / magf));
y= ((SI) (y / magf)); y= ((SI) (y / magf));
//cout << kind << " (" << x << ", " << y << "; " << m << ")" //cout << kind << " (" << x << ", " << y << "; " << m << ")"
// << " at " << t << "\n"; // << " at " << t << "\n";
string rew= kind; string rew= kind;
SI dist= (SI) (5 * PIXEL / magf); SI dist= (SI) (5 * PIXEL / magf);
rew= detect_left_drag ((void*) this, rew, x, y, t, dist); rew= detect_left_drag ((void*) this, rew, x, y, t, m, dist);
if (rew == "start-drag-left") { if (rew == "start-drag-left") {
call_mouse_event (rew, left_x, left_y, m, t); call_mouse_event (rew, left_x, left_y, m, t);
delayed_call_mouse_event ("dragging-left", x, y, m, t); delayed_call_mouse_event ("dragging-left", x, y, m, t);
} }
else { else {
rew= detect_right_drag ((void*) this, rew, x, y, t, dist); rew= detect_right_drag ((void*) this, rew, x, y, t, m, dist);
if (rew == "start-drag-right") { if (rew == "start-drag-right") {
call_mouse_event (rew, right_x, right_y, m, t); call_mouse_event (rew, right_x, right_y, m, t);
delayed_call_mouse_event ("dragging-right", x, y, m, t); delayed_call_mouse_event ("dragging-right", x, y, m, t);
} }
else call_mouse_event (rew, x, y, m, t); else call_mouse_event (rew, x, y, m, t);
} }
end_editing (); end_editing ();
#ifdef USE_EXCEPTIONS #ifdef USE_EXCEPTIONS
} }
catch (string msg) { catch (string msg) {
 End of changes. 7 change blocks. 
5 lines changed or deleted 13 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS