Changeset 61b5b73d in mainline for uspace/lib/gui/common.c
- Timestamp:
- 2014-01-17T14:33:02Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 476f62c, 66be0288
- Parents:
- 6a3d0c7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/gui/common.c
r6a3d0c7 r61b5b73d 38 38 #include "common.h" 39 39 40 #define CROSS_WIDTH 14 41 #define CROSS_HEIGHT 14 42 43 static uint8_t cross_texture[] = { 44 0x00, 0x00, 0x02, 0x08, 0x04, 0x04, 0x08, 0x02, 0x10, 0x01, 0xa0, 0x00, 45 0x40, 0x00, 0xa0, 0x00, 0x10, 0x01, 0x08, 0x02, 0x04, 0x04, 0x02, 0x08, 46 0x01, 0x10, 0x00, 0x00 47 }; 48 49 static uint8_t cross_mask[] = { 50 0x00, 0x00, 0x02, 0x18, 0x06, 0x0c, 0x0c, 0x06, 0x18, 0x03, 0xb0, 0x01, 51 0xe0, 0x00, 0xe0, 0x00, 0xb0, 0x01, 0x18, 0x03, 0x0c, 0x06, 0x06, 0x0c, 52 0x03, 0x18, 0x00, 0x00 53 }; 54 55 void draw_icon_cross(surface_t *surface, sysarg_t hpos, sysarg_t vpos, 56 pixel_t highlight, pixel_t shadow) 57 { 58 for (unsigned int y = 0; y < CROSS_HEIGHT; y++) { 59 for (unsigned int x = 0; x < CROSS_WIDTH; x++) { 60 size_t offset = y * ((CROSS_WIDTH - 1) / 8 + 1) + x / 8; 61 bool visible = cross_mask[offset] & (1 << (x % 8)); 62 pixel_t pixel = (cross_texture[offset] & (1 << (x % 8))) ? 63 highlight : shadow; 64 65 if (visible) 66 surface_put_pixel(surface, hpos + x, vpos + y, pixel); 67 } 68 } 69 } 70 40 71 void draw_bevel(drawctx_t *drawctx, source_t *source, sysarg_t hpos, 41 72 sysarg_t vpos, sysarg_t width, sysarg_t height, pixel_t highlight,
Note:
See TracChangeset
for help on using the changeset viewer.