Ticket #5978: app_server-wim-1.patch

File app_server-wim-1.patch, 3.3 KB (added by Wim, 14 years ago)

Modified patch to add AS_GET_CURSOR_POSITION command to the app_server, including a corresponding function in InterfaceDefs

  • src/servers/app/ServerApp.cpp

     
    1111 *      Jérôme Duval, jerome.duval@free.fr
    1212 *      Andrej Spielmann, <andrej.spielmann@seh.ox.ac.uk>
    1313 *      Philippe Saint-Pierre, stpere@gmail.com
     14 *      Wim van der Meer, <WPJvanderMeer@gmail.com>
    1415 */
    1516
    1617
     
    11651166
    11661167            break;
    11671168        }
    1168 
     1169        case AS_GET_CURSOR_POSITION:
     1170        {
     1171            STRACE(("ServerApp %s: Get Cursor position\n", Signature()));
     1172            // Returns
     1173            // 1) BPoint mouse location
     1174            // 2) int32 button state
     1175            BPoint where;
     1176            int32 buttons;
     1177            fDesktop->GetLastMouseState(&where, &buttons);
     1178            fLink.StartMessage(B_OK);
     1179            fLink.Attach<BPoint>(where);
     1180            fLink.Attach<int32>(buttons);
     1181            fLink.Flush();
     1182            break;
     1183        }
    11691184        case AS_GET_SCROLLBAR_INFO:
    11701185        {
    11711186            STRACE(("ServerApp %s: Get ScrollBar info\n", Signature()));
  • src/servers/app/ProfileMessageSupport.cpp

     
    6161
    6262        CODE(AS_BEGIN_RECT_TRACKING);
    6363        CODE(AS_END_RECT_TRACKING);
     64       
     65        CODE(AS_GET_CURSOR_POSITION);
    6466
    6567        // Window definitions
    6668        CODE(AS_SHOW_WINDOW);
  • src/kits/interface/InterfaceDefs.cpp

     
    77 *      Caz <turok2@currantbun.com>
    88 *      Axel Dörfler, axeld@pinc-software.de
    99 *      Michael Lotz <mmlr@mlotz.ch>
     10 *      Wim van der Meer <WPJvanderMeer@gmail.com>
    1011 */
    1112
    1213
     
    2324#include <ControlLook.h>
    2425#include <Font.h>
    2526#include <Menu.h>
     27#include <Point.h>
    2628#include <Roster.h>
     29#include <Screen.h>
    2730#include <ScrollBar.h>
    28 #include <Screen.h>
    2931#include <String.h>
    3032#include <TextView.h>
    3133
     
    926928
    927929
    928930void
     931get_mouse(BPoint* screenWhere, uint32* buttons)
     932{
     933    BPrivate::AppServerLink link;
     934    link.StartMessage(AS_GET_CURSOR_POSITION);
     935   
     936    int32 code;
     937    if (link.FlushWithReply(code) == B_OK && code == B_OK) {
     938        link.Read<BPoint>(screenWhere);
     939        link.Read<uint32>(buttons);
     940    }
     941}
     942
     943
     944void
    929945set_accept_first_click(bool acceptFirstClick)
    930946{
    931947    BPrivate::AppServerLink link;
  • headers/os/interface/InterfaceDefs.h

     
    1010#include <OS.h>
    1111
    1212class BRect;
     13class BPoint;
    1314
    1415
    1516// some handy UTF-8 characters
     
    380381void            set_focus_follows_mouse_mode(mode_focus_follows_mouse mode);
    381382mode_focus_follows_mouse    focus_follows_mouse_mode();
    382383
     384void            get_mouse(BPoint* screenWhere, uint32* buttons);
     385
    383386void            set_accept_first_click(bool acceptFirstClick);
    384387bool            accept_first_click();
    385388
  • headers/private/app/ServerProtocol.h

     
    8181
    8282    AS_BEGIN_RECT_TRACKING,
    8383    AS_END_RECT_TRACKING,
     84   
     85    AS_GET_CURSOR_POSITION,
    8486
    8587    // Window definitions
    8688    AS_SHOW_WINDOW,