Ticket #6019: MarkAs-wim.patch
File MarkAs-wim.patch, 1.2 KB (added by , 14 years ago) |
---|
-
src/add-ons/tracker/mark_as/MarkAs.cpp
9 9 #include <Directory.h> 10 10 #include <Entry.h> 11 11 #include <FindDirectory.h> 12 #include <InterfaceDefs.h> 12 13 #include <MenuItem.h> 13 14 #include <Message.h> 14 15 #include <Node.h> 15 16 #include <Path.h> 16 17 #include <PopUpMenu.h> 17 18 #include <String.h> 18 #include <View.h>19 #include <Window.h>20 19 21 20 22 /*! Returns the current mouse position in screen coordinates.23 Since there is no method to retrieve this in the Be API without a view,24 this looks a bit more complicated.25 */26 21 static BPoint 27 22 mouse_position() 28 23 { 29 BWindow* window = new BWindow(BRect(-1000, -1000, -900, -900), "mouse", 30 B_NO_BORDER_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, 31 B_AVOID_FRONT | B_AVOID_FOCUS); 32 BView* view = new BView(window->Bounds(), "mouse", B_FOLLOW_ALL, 0); 33 window->AddChild(view); 34 window->Run(); 35 36 window->Lock(); 37 24 // Returns the mouse position in screen coordinates 38 25 BPoint position; 39 uint32 buttons; 40 view->GetMouse(&position, &buttons); 41 view->ConvertToScreen(&position); 42 43 window->Quit(); 44 26 get_mouse(&position, NULL); 45 27 return position; 46 28 } 47 29