Changeset 28db46b in mainline
- Timestamp:
- 2020-01-25T22:26:50Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 01c2759
- Parents:
- 2012fe0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/seat.c
r2012fe0 r28db46b 183 183 } 184 184 185 /** Draw or clear seat pointer 186 * 187 * @param seat Seat 188 * @param shown @c true to display pointer, @c false to clear it 189 * 190 * @return EOK on success or an error code 191 */ 192 static errno_t ds_seat_draw_pointer(ds_seat_t *seat, bool shown) 185 /** Draw seat pointer 186 * 187 * @param seat Seat 188 * 189 * @return EOK on success or an error code 190 */ 191 static errno_t ds_seat_draw_pointer(ds_seat_t *seat) 193 192 { 194 193 errno_t rc; … … 204 203 goto error; 205 204 206 rc = ds_seat_draw_cross(seat, 8, 1, shown ? black : 207 seat->display->bg_color); 208 if (rc != EOK) 209 return rc; 210 211 rc = ds_seat_draw_cross(seat, 8, 0, shown ? white : 212 seat->display->bg_color); 213 if (rc != EOK) 214 return rc; 205 rc = ds_seat_draw_cross(seat, 8, 1, black); 206 if (rc != EOK) 207 goto error; 208 209 rc = ds_seat_draw_cross(seat, 8, 0, white); 210 if (rc != EOK) 211 goto error; 212 213 gfx_color_delete(black); 214 gfx_color_delete(white); 215 215 216 216 return EOK; … … 218 218 if (black != NULL) 219 219 gfx_color_delete(black); 220 if (white != NULL) 221 gfx_color_delete(white); 220 222 return rc; 223 } 224 225 /** Clear seat pointer 226 * 227 * @param seat Seat 228 * 229 * @return EOK on success or an error code 230 */ 231 static errno_t ds_seat_clear_pointer(ds_seat_t *seat) 232 { 233 gfx_rect_t rect; 234 235 rect.p0.x = seat->pntpos.x - 8; 236 rect.p0.y = seat->pntpos.y - 8; 237 rect.p1.x = seat->pntpos.x + 8 + 1; 238 rect.p1.y = seat->pntpos.y + 8 + 1; 239 240 return ds_display_paint(seat->display, &rect); 221 241 } 222 242 … … 277 297 278 298 printf("clear pointer\n"); 279 (void) ds_seat_ draw_pointer(seat, false);299 (void) ds_seat_clear_pointer(seat); 280 300 seat->pntpos = npos; 281 301 … … 291 311 292 312 printf("draw pointer\n"); 293 (void) ds_seat_draw_pointer(seat , true);313 (void) ds_seat_draw_pointer(seat); 294 314 } 295 315
Note:
See TracChangeset
for help on using the changeset viewer.