Ticket #5978: app_server-wim-2.patch
File app_server-wim-2.patch, 17.6 KB (added by , 14 years ago) |
---|
-
src/servers/app/ServerApp.cpp
622 622 fDesktop->BroadcastToAllApps(AS_UPDATE_DECORATOR); 623 623 break; 624 624 } 625 625 626 case AS_COUNT_DECORATORS: 626 627 { 627 628 fLink.StartMessage(B_OK); … … 629 630 fLink.Flush(); 630 631 break; 631 632 } 633 632 634 case AS_GET_DECORATOR: 633 635 { 634 636 fLink.StartMessage(B_OK); … … 636 638 fLink.Flush(); 637 639 break; 638 640 } 641 639 642 case AS_GET_DECORATOR_NAME: 640 643 { 641 644 int32 index; … … 651 654 fLink.Flush(); 652 655 break; 653 656 } 657 654 658 case AS_R5_SET_DECORATOR: 655 659 { 656 660 // Sort of supports Tracker's nifty Easter Egg. It was easy to do … … 671 675 672 676 break; 673 677 } 678 674 679 case AS_CREATE_BITMAP: 675 680 { 676 681 STRACE(("ServerApp %s: Received BBitmap creation request\n", … … 737 742 fLink.Flush(); 738 743 break; 739 744 } 745 740 746 case AS_DELETE_BITMAP: 741 747 { 742 748 STRACE(("ServerApp %s: received BBitmap delete request\n", … … 760 766 fMapLocker.Unlock(); 761 767 break; 762 768 } 769 763 770 case AS_GET_BITMAP_OVERLAY_RESTRICTIONS: 764 771 { 765 772 overlay_restrictions restrictions; … … 787 794 fLink.Flush(); 788 795 break; 789 796 } 797 790 798 case AS_GET_BITMAP_SUPPORT_FLAGS: 791 799 { 792 800 uint32 colorSpace; … … 962 970 fDesktop->HWInterface()->SetCursorVisible(fCursorHideLevel == 0); 963 971 break; 964 972 } 973 965 974 case AS_HIDE_CURSOR: 966 975 { 967 976 STRACE(("ServerApp %s: Hide Cursor\n", Signature())); … … 969 978 fDesktop->HWInterface()->SetCursorVisible(fCursorHideLevel == 0); 970 979 break; 971 980 } 981 972 982 case AS_OBSCURE_CURSOR: 973 983 { 974 984 STRACE(("ServerApp %s: Obscure Cursor\n", Signature())); 975 985 fDesktop->HWInterface()->ObscureCursor(); 976 986 break; 977 987 } 988 978 989 case AS_QUERY_CURSOR_HIDDEN: 979 990 { 980 991 STRACE(("ServerApp %s: Received IsCursorHidden request\n", … … 984 995 fLink.Flush(); 985 996 break; 986 997 } 998 987 999 case AS_SET_CURSOR: 988 1000 { 989 1001 STRACE(("ServerApp %s: SetCursor\n", Signature())); … … 1023 1035 } 1024 1036 break; 1025 1037 } 1038 1026 1039 case AS_SET_VIEW_CURSOR: 1027 1040 { 1028 1041 STRACE(("ServerApp %s: AS_SET_VIEW_CURSOR:\n", Signature())); … … 1079 1092 } 1080 1093 break; 1081 1094 } 1095 1082 1096 case AS_CREATE_CURSOR: 1083 1097 { 1084 1098 STRACE(("ServerApp %s: Create Cursor\n", Signature())); 1099 1085 1100 // Attached data: 1086 1101 // 1) 68 bytes of fAppCursor data 1087 1102 // 2) port_id reply port … … 1124 1139 fLink.Flush(); 1125 1140 break; 1126 1141 } 1142 1127 1143 case AS_REFERENCE_CURSOR: 1128 1144 { 1129 1145 STRACE(("ServerApp %s: Reference BCursor\n", Signature())); 1146 1130 1147 // Attached data: 1131 1148 // 1) int32 token ID of the cursor to reference 1149 1132 1150 int32 token; 1133 1151 if (link.Read<int32>(&token) != B_OK) 1134 1152 break; … … 1145 1163 1146 1164 break; 1147 1165 } 1166 1148 1167 case AS_DELETE_CURSOR: 1149 1168 { 1150 1169 STRACE(("ServerApp %s: Delete BCursor\n", Signature())); 1170 1151 1171 // Attached data: 1152 1172 // 1) int32 token ID of the cursor to delete 1173 1153 1174 int32 token; 1154 1175 if (link.Read<int32>(&token) != B_OK) 1155 1176 break; … … 1166 1187 1167 1188 break; 1168 1189 } 1190 1169 1191 case AS_GET_CURSOR_POSITION: 1170 1192 { 1171 1193 STRACE(("ServerApp %s: Get Cursor position\n", Signature())); 1194 1172 1195 // Returns 1173 1196 // 1) BPoint mouse location 1174 1197 // 2) int32 button state 1198 1175 1199 BPoint where; 1176 1200 int32 buttons; 1177 1201 fDesktop->GetLastMouseState(&where, &buttons); … … 1181 1205 fLink.Flush(); 1182 1206 break; 1183 1207 } 1208 1209 case AS_GET_CURSOR_BITMAP: 1210 { 1211 STRACE(("ServerApp %s: Get Cursor bitmap\n", Signature())); 1212 1213 // Returns 1214 // 1) uint32 number of data bytes of the bitmap 1215 // 2) uint32 cursor width in number of pixels 1216 // 3) uint32 cursor height in number of pixels 1217 // 4) BPoint cursor hot spot 1218 // 5) cursor bitmap data 1219 1220 ServerCursorReference cursorRef = fDesktop->Cursor(); 1221 ServerCursor* cursor = cursorRef.Get(); 1222 if (cursor != NULL) { 1223 uint32 size = cursor->BitsLength(); 1224 fLink.StartMessage(B_OK); 1225 fLink.Attach<uint32>(size); 1226 fLink.Attach<uint32>(cursor->Width()); 1227 fLink.Attach<uint32>(cursor->Height()); 1228 fLink.Attach<BPoint>(cursor->GetHotSpot()); 1229 fLink.Attach(cursor->Bits(), size); 1230 } else 1231 fLink.StartMessage(B_ERROR); 1232 1233 fLink.Flush(); 1234 1235 break; 1236 } 1237 1184 1238 case AS_GET_SCROLLBAR_INFO: 1185 1239 { 1186 1240 STRACE(("ServerApp %s: Get ScrollBar info\n", Signature())); … … 1196 1250 } else 1197 1251 fLink.StartMessage(B_ERROR); 1198 1252 1199 1253 fLink.Flush(); 1200 1254 break; 1201 1255 } 1256 1202 1257 case AS_SET_SCROLLBAR_INFO: 1203 1258 { 1204 1259 STRACE(("ServerApp %s: Set ScrollBar info\n", Signature())); 1260 1205 1261 // Attached Data: 1206 1262 // 1) scroll_bar_info scroll bar info structure 1263 1207 1264 scroll_bar_info info; 1208 1265 if (link.Read<scroll_bar_info>(&info) == B_OK) { 1209 1266 LockedDesktopSettings settings(fDesktop); … … 1233 1290 fLink.Flush(); 1234 1291 break; 1235 1292 } 1293 1236 1294 case AS_SET_MENU_INFO: 1237 1295 { 1238 1296 STRACE(("ServerApp %s: Set menu info\n", Signature())); … … 1253 1311 { 1254 1312 STRACE(("ServerApp %s: Set Mouse Focus mode\n", 1255 1313 Signature())); 1314 1256 1315 // Attached Data: 1257 1316 // 1) enum mode_mouse mouse focus mode 1317 1258 1318 mode_mouse mouseMode; 1259 1319 if (link.Read<mode_mouse>(&mouseMode) == B_OK) { 1260 1320 LockedDesktopSettings settings(fDesktop); … … 1262 1322 } 1263 1323 break; 1264 1324 } 1325 1265 1326 case AS_GET_MOUSE_MODE: 1266 1327 { 1267 1328 STRACE(("ServerApp %s: Get Mouse Focus mode\n", … … 1280 1341 fLink.Flush(); 1281 1342 break; 1282 1343 } 1344 1283 1345 case AS_SET_FOCUS_FOLLOWS_MOUSE_MODE: 1284 1346 { 1285 1347 STRACE(("ServerApp %s: Set Focus Follows Mouse mode\n", Signature())); 1348 1286 1349 // Attached Data: 1287 1350 // 1) enum mode_focus_follows_mouse FFM mouse mode 1351 1288 1352 mode_focus_follows_mouse focusFollowsMousMode; 1289 1353 if (link.Read<mode_focus_follows_mouse>(&focusFollowsMousMode) == B_OK) { 1290 1354 LockedDesktopSettings settings(fDesktop); … … 1292 1356 } 1293 1357 break; 1294 1358 } 1359 1295 1360 case AS_GET_FOCUS_FOLLOWS_MOUSE_MODE: 1296 1361 { 1297 1362 STRACE(("ServerApp %s: Get Focus Follows Mouse mode\n", Signature())); … … 1310 1375 fLink.Flush(); 1311 1376 break; 1312 1377 } 1378 1313 1379 case AS_SET_ACCEPT_FIRST_CLICK: 1314 1380 { 1315 1381 STRACE(("ServerApp %s: Set Accept First Click\n", Signature())); 1382 1316 1383 // Attached Data: 1317 1384 // 1) bool accept_first_click 1385 1318 1386 bool acceptFirstClick; 1319 1387 if (link.Read<bool>(&acceptFirstClick) == B_OK) { 1320 1388 LockedDesktopSettings settings(fDesktop); … … 1322 1390 } 1323 1391 break; 1324 1392 } 1393 1325 1394 case AS_GET_ACCEPT_FIRST_CLICK: 1326 1395 { 1327 1396 STRACE(("ServerApp %s: Get Accept First Click\n", Signature())); … … 1437 1506 } 1438 1507 break; 1439 1508 } 1509 1440 1510 case AS_GET_SYSTEM_DEFAULT_FONT: 1441 1511 { 1442 1512 // input: … … 1473 1543 fLink.Flush(); 1474 1544 break; 1475 1545 } 1546 1476 1547 case AS_GET_SYSTEM_FONTS: 1477 1548 { 1478 1549 FTRACE(("ServerApp %s: AS_GET_SYSTEM_FONTS\n", Signature())); … … 1509 1580 font = &fPlainFont; 1510 1581 fLink.AttachString("plain"); 1511 1582 break; 1583 1512 1584 case 1: 1513 1585 font = &fBoldFont; 1514 1586 fLink.AttachString("bold"); 1515 1587 break; 1588 1516 1589 case 2: 1517 1590 font = &fFixedFont; 1518 1591 fLink.AttachString("fixed"); … … 1530 1603 fLink.Flush(); 1531 1604 break; 1532 1605 } 1606 1533 1607 case AS_GET_FONT_LIST_REVISION: 1534 1608 { 1535 1609 STRACE(("ServerApp %s: AS_GET_FONT_LIST_REVISION\n", Signature())); … … 1540 1614 fLink.Flush(); 1541 1615 break; 1542 1616 } 1617 1543 1618 case AS_GET_FAMILY_AND_STYLES: 1544 1619 { 1545 1620 FTRACE(("ServerApp %s: AS_GET_FAMILY_AND_STYLES\n", Signature())); 1621 1546 1622 // Attached Data: 1547 1623 // 1) int32 the index of the font family to get 1548 1624 … … 1583 1659 fLink.Flush(); 1584 1660 break; 1585 1661 } 1662 1586 1663 case AS_GET_FAMILY_AND_STYLE: 1587 1664 { 1588 1665 FTRACE(("ServerApp %s: AS_GET_FAMILY_AND_STYLE\n", Signature())); 1666 1589 1667 // Attached Data: 1590 1668 // 1) uint16 - family ID 1591 1669 // 2) uint16 - style ID … … 1593 1671 // Returns: 1594 1672 // 1) font_family The name of the font family 1595 1673 // 2) font_style - name of the style 1674 1596 1675 uint16 familyID, styleID; 1597 1676 link.Read<uint16>(&familyID); 1598 1677 link.Read<uint16>(&styleID); … … 1611 1690 gFontManager->Unlock(); 1612 1691 break; 1613 1692 } 1693 1614 1694 case AS_GET_FAMILY_AND_STYLE_IDS: 1615 1695 { 1616 1696 FTRACE(("ServerApp %s: AS_GET_FAMILY_AND_STYLE_IDS\n", … … 1662 1742 fLink.Flush(); 1663 1743 break; 1664 1744 } 1745 1665 1746 case AS_GET_FONT_FILE_FORMAT: 1666 1747 { 1667 1748 FTRACE(("ServerApp %s: AS_GET_FONT_FILE_FORMAT\n", Signature())); 1749 1668 1750 // Attached Data: 1669 1751 // 1) uint16 - family ID 1670 1752 // 2) uint16 - style ID … … 1689 1771 fLink.Flush(); 1690 1772 break; 1691 1773 } 1774 1692 1775 case AS_GET_STRING_WIDTHS: 1693 1776 { 1694 1777 FTRACE(("ServerApp %s: AS_GET_STRING_WIDTHS\n", Signature())); 1778 1695 1779 // Attached Data: 1696 1780 // 1) uint16 ID of family 1697 1781 // 2) uint16 ID of style … … 1756 1840 } 1757 1841 break; 1758 1842 } 1843 1759 1844 case AS_GET_FONT_BOUNDING_BOX: 1760 1845 { 1761 1846 FTRACE(("ServerApp %s: AS_GET_BOUNDING_BOX unimplemented\n", 1762 1847 Signature())); 1848 1763 1849 // Attached Data: 1764 1850 // 1) uint16 - family ID 1765 1851 // 2) uint16 - style ID … … 1772 1858 fLink.Flush(); 1773 1859 break; 1774 1860 } 1861 1775 1862 case AS_GET_TUNED_COUNT: 1776 1863 { 1777 1864 FTRACE(("ServerApp %s: AS_GET_TUNED_COUNT\n", Signature())); 1865 1778 1866 // Attached Data: 1779 1867 // 1) uint16 - family ID 1780 1868 // 2) uint16 - style ID 1781 1869 1782 1870 // Returns: 1783 1871 // 1) int32 - number of font strikes available 1872 1784 1873 uint16 familyID, styleID; 1785 1874 link.Read<uint16>(&familyID); 1786 1875 link.Read<uint16>(&styleID); … … 1798 1887 fLink.Flush(); 1799 1888 break; 1800 1889 } 1890 1801 1891 case AS_GET_TUNED_INFO: 1802 1892 { 1803 1893 FTRACE(("ServerApp %s: AS_GET_TUNED_INFO unimplmemented\n", 1804 1894 Signature())); 1895 1805 1896 // Attached Data: 1806 1897 // 1) uint16 - family ID 1807 1898 // 2) uint16 - style ID … … 1810 1901 // Returns: 1811 1902 // 1) tuned_font_info - info on the strike specified 1812 1903 // ToDo: implement me! 1904 1813 1905 fLink.StartMessage(B_ERROR); 1814 1906 fLink.Flush(); 1815 1907 break; 1816 1908 } 1909 1817 1910 case AS_GET_EXTRA_FONT_FLAGS: 1818 1911 { 1819 1912 FTRACE(("ServerApp %s: AS_GET_EXTRA_FONT_FLAGS\n", 1820 1913 Signature())); 1914 1821 1915 // Attached Data: 1822 1916 // 1) uint16 - family ID 1823 1917 // 2) uint16 - style ID 1824 1918 1825 1919 // Returns: 1826 1920 // 1) uint32 - extra font flags 1921 1827 1922 uint16 familyID, styleID; 1828 1923 link.Read<uint16>(&familyID); 1829 1924 link.Read<uint16>(&styleID); … … 1841 1936 fLink.Flush(); 1842 1937 break; 1843 1938 } 1939 1844 1940 case AS_GET_FONT_HEIGHT: 1845 1941 { 1846 1942 FTRACE(("ServerApp %s: AS_GET_FONT_HEIGHT\n", Signature())); 1943 1847 1944 // Attached Data: 1848 1945 // 1) uint16 family ID 1849 1946 // 2) uint16 style ID 1850 1947 // 3) float size 1948 1851 1949 uint16 familyID, styleID; 1852 1950 float size; 1853 1951 link.Read<uint16>(&familyID); … … 1870 1968 fLink.Flush(); 1871 1969 break; 1872 1970 } 1971 1873 1972 case AS_GET_GLYPH_SHAPES: 1874 1973 { 1875 1974 FTRACE(("ServerApp %s: AS_GET_GLYPH_SHAPES\n", Signature())); 1975 1876 1976 // Attached Data: 1877 1977 // 1) uint16 - family ID 1878 1978 // 2) uint16 - style ID … … 1938 2038 fLink.Flush(); 1939 2039 break; 1940 2040 } 2041 1941 2042 case AS_GET_HAS_GLYPHS: 1942 2043 { 1943 2044 FTRACE(("ServerApp %s: AS_GET_HAS_GLYPHS\n", Signature())); 2045 1944 2046 // Attached Data: 1945 2047 // 1) uint16 - family ID 1946 2048 // 2) uint16 - style ID … … 1976 2078 fLink.Flush(); 1977 2079 break; 1978 2080 } 2081 1979 2082 case AS_GET_EDGES: 1980 2083 { 1981 2084 FTRACE(("ServerApp %s: AS_GET_EDGES\n", Signature())); 2085 1982 2086 // Attached Data: 1983 2087 // 1) uint16 - family ID 1984 2088 // 2) uint16 - style ID … … 2016 2120 fLink.Flush(); 2017 2121 break; 2018 2122 } 2123 2019 2124 case AS_GET_ESCAPEMENTS: 2020 2125 { 2021 2126 FTRACE(("ServerApp %s: AS_GET_ESCAPEMENTS\n", Signature())); 2127 2022 2128 // Attached Data: 2023 2129 // 1) uint16 - family ID 2024 2130 // 2) uint16 - style ID … … 2110 2216 fLink.Flush(); 2111 2217 break; 2112 2218 } 2219 2113 2220 case AS_GET_ESCAPEMENTS_AS_FLOATS: 2114 2221 { 2115 2222 FTRACE(("ServerApp %s: AS_GET_ESCAPEMENTS_AS_FLOATS\n", Signature())); 2223 2116 2224 // Attached Data: 2117 2225 // 1) uint16 - family ID 2118 2226 // 2) uint16 - style ID … … 2120 2228 // 4) uint8 - spacing 2121 2229 // 5) float - rotation 2122 2230 // 6) uint32 - flags 2123 2124 2231 // 7) float - additional "nonspace" delta 2125 2232 // 8) float - additional "space" delta 2126 2127 2233 // 9) int32 - numChars 2128 2234 // 10) int32 - numBytes 2129 2235 // 11) char - the char buffer with size numBytes … … 2193 2299 fLink.Flush(); 2194 2300 break; 2195 2301 } 2302 2196 2303 case AS_GET_BOUNDINGBOXES_CHARS: 2197 2304 case AS_GET_BOUNDINGBOXES_STRING: 2198 2305 { 2199 2306 FTRACE(("ServerApp %s: AS_GET_BOUNDINGBOXES_CHARS\n", Signature())); 2307 2200 2308 // Attached Data: 2201 2309 // 1) uint16 - family ID 2202 2310 // 2) uint16 - style ID … … 2206 2314 // 6) float - false bold width 2207 2315 // 7) uint8 - spacing 2208 2316 // 8) uint32 - flags 2209 2210 2317 // 9) font_metric_mode - mode 2211 2318 // 10) bool - string escapement 2212 2213 2319 // 11) escapement_delta - additional delta 2214 2215 2320 // 12) int32 - numChars 2216 2321 // 13) int32 - numBytes 2217 2322 // 14) char - the char buffer with size numBytes … … 2284 2389 delete[] rectArray; 2285 2390 break; 2286 2391 } 2392 2287 2393 case AS_GET_BOUNDINGBOXES_STRINGS: 2288 2394 { 2289 2395 FTRACE(("ServerApp %s: AS_GET_BOUNDINGBOXES_STRINGS\n", … … 2298 2404 // 6) float - false bold width 2299 2405 // 7) uint8 - spacing 2300 2406 // 8) uint32 - flags 2301 2302 2407 // 9) font_metric_mode - mode 2303 2408 // 10) int32 numStrings 2304 2305 2409 // 11) escapement_delta - additional delta (numStrings times) 2306 2410 // 12) int32 string length to measure (numStrings times) 2307 2411 // 13) string - string (numStrings times) … … 2376 2480 { 2377 2481 // Attached data 2378 2482 // 1) int32 screen 2483 2379 2484 int32 id; 2380 2485 if (link.Read<int32>(&id) == B_OK 2381 2486 && id == B_MAIN_SCREEN_ID.id) … … 2391 2496 { 2392 2497 // Attached data 2393 2498 // 1) int32 screen 2499 2394 2500 int32 id; 2395 2501 link.Read<int32>(&id); 2396 2502 … … 2406 2512 2407 2513 // Attached data 2408 2514 // 1) int32 - window client token 2515 2409 2516 int32 clientToken; 2410 2517 if (link.Read<int32>(&clientToken) != B_OK) 2411 2518 status = B_BAD_DATA; … … 2447 2554 case AS_SCREEN_GET_MODE: 2448 2555 { 2449 2556 STRACE(("ServerApp %s: AS_SCREEN_GET_MODE\n", Signature())); 2557 2450 2558 // Attached data 2451 2559 // 1) int32 screen 2452 2560 // 2) uint32 workspace index … … 2465 2573 fLink.Flush(); 2466 2574 break; 2467 2575 } 2576 2468 2577 case AS_SCREEN_SET_MODE: 2469 2578 { 2470 2579 STRACE(("ServerApp %s: AS_SCREEN_SET_MODE\n", Signature())); 2580 2471 2581 // Attached data 2472 2582 // 1) int32 screen 2473 2583 // 2) workspace index … … 2561 2671 case AS_GET_SCREEN_FRAME: 2562 2672 { 2563 2673 STRACE(("ServerApp %s: AS_GET_SCREEN_FRAME\n", Signature())); 2674 2564 2675 // Attached data 2565 2676 // 1) int32 screen 2566 2677 // 2) uint32 workspace index … … 2652 2763 case AS_SET_UI_COLOR: 2653 2764 { 2654 2765 STRACE(("ServerApp %s: Set UI Color\n", Signature())); 2766 2655 2767 // Attached Data: 2656 2768 // 1) color_which which 2657 2769 // 2) rgb_color color 2770 2658 2771 color_which which; 2659 2772 rgb_color color; 2660 2773 … … 2747 2860 case AS_GET_TIMING_CONSTRAINTS: 2748 2861 { 2749 2862 STRACE(("ServerApp %s: get timing constraints\n", Signature())); 2863 2750 2864 // We aren't using the screen_id for now... 2751 2865 int32 id; 2752 2866 link.Read<int32>(&id); -
src/servers/app/ProfileMessageSupport.cpp
63 63 CODE(AS_END_RECT_TRACKING); 64 64 65 65 CODE(AS_GET_CURSOR_POSITION); 66 CODE(AS_GET_CURSOR_BITMAP); 66 67 67 68 // Window definitions 68 69 CODE(AS_SHOW_WINDOW); -
src/kits/interface/InterfaceDefs.cpp
16 16 17 17 #include <InterfaceDefs.h> 18 18 19 #include <new> 19 20 #include <stdio.h> 20 21 #include <stdlib.h> 21 22 #include <string.h> 22 23 24 #include <Bitmap.h> 23 25 #include <Clipboard.h> 24 26 #include <ControlLook.h> 25 27 #include <Font.h> … … 963 965 } 964 966 965 967 968 status_t 969 get_mouse_bitmap(BBitmap** bitmap, BPoint* hotspot) 970 { 971 if (bitmap == NULL && hotspot == NULL) 972 return B_BAD_VALUE; 973 974 BPrivate::AppServerLink link; 975 link.StartMessage(AS_GET_CURSOR_BITMAP); 976 977 int32 code; 978 status_t status = link.FlushWithReply(code); 979 if (status != B_OK) 980 return status; 981 if (code != B_OK) 982 return code; 983 984 uint32 size = 0; 985 uint32 cursorWidth = 0; 986 uint32 cursorHeight = 0; 987 988 // if link.Read() returns an error, the same error will be returned on 989 // subsequent calls, so we'll check only the return value of the last call 990 link.Read<uint32>(&size); 991 link.Read<uint32>(&cursorWidth); 992 link.Read<uint32>(&cursorHeight); 993 if (hotspot == NULL) { 994 BPoint dummy; 995 link.Read<BPoint>(&dummy); 996 } else 997 link.Read<BPoint>(hotspot); 998 999 void* data = NULL; 1000 if (size > 0) 1001 data = malloc(size); 1002 if (data == NULL) 1003 return B_NO_MEMORY; 1004 1005 status = link.Read(data, size); 1006 if (status != B_OK) { 1007 free(data); 1008 return status; 1009 } 1010 1011 BBitmap* cursorBitmap = new (std::nothrow) BBitmap(BRect(0, 0, 1012 cursorWidth - 1, cursorHeight - 1), B_RGBA32); 1013 1014 if (cursorBitmap == NULL) { 1015 free(data); 1016 return B_NO_MEMORY; 1017 } 1018 status = cursorBitmap->InitCheck(); 1019 if (status == B_OK) 1020 cursorBitmap->SetBits(data, size, 0, B_RGBA32); 1021 1022 free(data); 1023 1024 if (status == B_OK && bitmap != NULL) 1025 *bitmap = cursorBitmap; 1026 else 1027 delete cursorBitmap; 1028 1029 return status; 1030 } 1031 1032 966 1033 void 967 1034 set_accept_first_click(bool acceptFirstClick) 968 1035 { -
headers/os/interface/InterfaceDefs.h
9 9 #include <GraphicsDefs.h> 10 10 #include <OS.h> 11 11 12 13 class BBitmap; 14 class BPoint; 12 15 class BRect; 13 class BPoint;14 16 15 17 16 18 // some handy UTF-8 characters … … 382 384 mode_focus_follows_mouse focus_follows_mouse_mode(); 383 385 384 386 status_t get_mouse(BPoint* screenWhere, uint32* buttons); 387 status_t get_mouse_bitmap(BBitmap** bitmap, BPoint* hotspot); 385 388 386 389 void set_accept_first_click(bool acceptFirstClick); 387 390 bool accept_first_click(); -
headers/private/app/ServerProtocol.h
83 83 AS_END_RECT_TRACKING, 84 84 85 85 AS_GET_CURSOR_POSITION, 86 AS_GET_CURSOR_BITMAP, 86 87 87 88 // Window definitions 88 89 AS_SHOW_WINDOW,