]> git.lyx.org Git - features.git/blobdiff - src/BufferView.C
doubleClick, trippleClick, new UpdateInsetList some other small stuff
[features.git] / src / BufferView.C
index b3d4ecb98dca53ba0f4e92a7d23b6839dad711b1..94d7e5532db5a55147781d7b374331a58daad9b8 100644 (file)
@@ -61,8 +61,6 @@ extern bool input_prohibited;
 extern bool selection_possible;
 extern char ascii_type;
 extern void MenuPasteSelection(char at);
-extern InsetUpdateStruct * InsetUpdateList;
-extern void UpdateInsetUpdateList();
 extern void FreeUpdateTimer();
 
 BufferView::BufferView(LyXView * o, int xpos, int ypos,
@@ -774,6 +772,41 @@ void BufferView::workAreaButtonPress(int xpos, int ypos, unsigned int button)
 }
 
 
+void BufferView::doubleClick(int /*x*/, int /*y*/, unsigned int button) 
+{
+       // select a word
+       if (buffer_ && !the_locking_inset) {
+               if (screen && button == 1) {
+                       screen->HideCursor();
+                       screen->ToggleSelection();
+                       text->SelectWord();
+                       screen->ToggleSelection(false);
+                       /* This will fit the cursor on the screen
+                        * if necessary */
+                       update(0);
+               }
+       }            
+}
+
+
+void BufferView::trippleClick(int /*x*/, int /*y*/, unsigned int button)
+{
+       // select a line
+       if (buffer_ && screen && button == 1) {
+               screen->HideCursor();
+               screen->ToggleSelection();
+               text->CursorHome();
+               text->sel_cursor = text->cursor;
+               text->CursorEnd();
+               text->SetSelection();
+               screen->ToggleSelection(false);
+               /* This will fit the cursor on the screen
+                * if necessary */
+               update(0);
+       }
+}
+
+
 void BufferView::workAreaButtonRelease(int x, int y, unsigned int button)
 {
        if (buffer_ == 0 || screen == 0) return;
@@ -1097,9 +1130,9 @@ void BufferView::cursorToggleCB(FL_OBJECT * ob, long)
                else if (pid > 0)
                        sigchldhandler(pid, &status);
        }
-       if (InsetUpdateList) 
-               UpdateInsetUpdateList();
 
+       view->updatelist.update(view);
+       
        if (view && !view->screen){
                goto set_timer_and_return;
        }
@@ -1429,6 +1462,12 @@ bool BufferView::active() const
 }
 
 
+bool BufferView::belowMouse() const 
+{
+       return workarea->belowMouse();
+}
+
+
 void BufferView::showCursor()
 {
        if (screen)