Changeset d63623f in mainline for uspace/lib/ui/src/paint.c


Ignore:
Timestamp:
2021-07-16T17:45:12Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4afb6c9
Parents:
61bf9dd9
Message:

Seeking in entry text using mouse

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/src/paint.c

    r61bf9dd9 rd63623f  
    4949 * @param thickness Bevel thickness in pixels
    5050 * @param inside Place to store rectangle of the interior or @c NULL
    51  * @reutrn EOK on success or an error code
     51 * @return EOK on success or an error code
    5252 */
    5353errno_t ui_paint_bevel(gfx_context_t *gc, gfx_rect_t *rect,
     
    107107        }
    108108
    109         if (inside != NULL) {
    110                 inside->p0.x = rect->p0.x + thickness;
    111                 inside->p0.y = rect->p0.y + thickness;
    112                 inside->p1.x = rect->p1.x - thickness;
    113                 inside->p1.y = rect->p1.y - thickness;
    114         }
     109        if (inside != NULL)
     110                ui_paint_get_bevel_inside(gc, rect, thickness, inside);
    115111
    116112        return EOK;
    117113error:
    118114        return rc;
     115}
     116
     117/** Get bevel interior rectangle.
     118 *
     119 * Get the bevel interior rectangle without painting it.
     120 *
     121 * @param gc Graphic context
     122 * @param rect Rectangle to paint into
     123 * @param thickness Bevel thickness in pixels
     124 * @param inside Place to store rectangle of the interior
     125 */
     126void ui_paint_get_bevel_inside(gfx_context_t *gc, gfx_rect_t *rect,
     127    gfx_coord_t thickness, gfx_rect_t *inside)
     128{
     129        inside->p0.x = rect->p0.x + thickness;
     130        inside->p0.y = rect->p0.y + thickness;
     131        inside->p1.x = rect->p1.x - thickness;
     132        inside->p1.y = rect->p1.y - thickness;
    119133}
    120134
     
    147161error:
    148162        return rc;
     163}
     164
     165/** Get inset frame interior rectangle.
     166 *
     167 * This allows one to get the interior rectangle without actually painting
     168 * the inset frame.
     169 *
     170 * @param resource UI resource
     171 * @param rect Rectangle to paint onto
     172 * @param inside Place to store inside rectangle or @c NULL
     173 */
     174void ui_paint_get_inset_frame_inside(ui_resource_t *resource, gfx_rect_t *rect,
     175    gfx_rect_t *inside)
     176{
     177        ui_paint_get_bevel_inside(resource->gc, rect, 2, inside);
    149178}
    150179
Note: See TracChangeset for help on using the changeset viewer.