Changeset a35b458 in mainline for uspace/lib/gui/canvas.c


Ignore:
Timestamp:
2018-03-02T20:10:49Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f1380b7
Parents:
3061bc1
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
Message:

style: Remove trailing whitespace on _all_ lines, including empty ones, for particular file types.

Command used: tools/srepl '\s\+$' '' -- *.c *.h *.py *.sh *.s *.S *.ag

Currently, whitespace on empty lines is very inconsistent.
There are two basic choices: Either remove the whitespace, or keep empty lines
indented to the level of surrounding code. The former is AFAICT more common,
and also much easier to do automatically.

Alternatively, we could write script for automatic indentation, and use that
instead. However, if such a script exists, it's possible to use the indented
style locally, by having the editor apply relevant conversions on load/save,
without affecting remote repository. IMO, it makes more sense to adopt
the simpler rule.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/gui/canvas.c

    r3061bc1 ra35b458  
    4545{
    4646        canvas_t *canvas = (canvas_t *) widget;
    47        
     47
    4848        surface_t *surface = window_claim(canvas->widget.window);
    4949        if (!surface) {
    5050                window_yield(canvas->widget.window);
    5151        }
    52        
     52
    5353        transform_t transform;
    5454        transform_identity(&transform);
    5555        transform_translate(&transform, widget->hpos, widget->vpos);
    56        
     56
    5757        source_t source;
    5858        source_init(&source);
     
    6060        source_set_texture(&source, canvas->surface,
    6161            PIXELMAP_EXTEND_TRANSPARENT_BLACK);
    62        
     62
    6363        drawctx_t drawctx;
    6464        drawctx_init(&drawctx, surface);
    65        
     65
    6666        drawctx_set_source(&drawctx, &source);
    6767        drawctx_transfer(&drawctx, widget->hpos, widget->vpos, widget->width,
    6868            widget->height);
    69        
     69
    7070        window_yield(canvas->widget.window);
    7171}
     
    7979{
    8080        canvas_t *canvas = (canvas_t *) widget;
    81        
     81
    8282        deinit_canvas(canvas);
    8383        free(canvas);
     
    9393{
    9494        canvas_t *canvas = (canvas_t *) widget;
    95        
     95
    9696        widget_modify(widget, hpos, vpos, canvas->width, canvas->height);
    9797        paint_internal(widget);
     
    107107{
    108108        canvas_t *canvas = (canvas_t *) widget;
    109        
     109
    110110        sig_send(&canvas->keyboard_event, &event);
    111111}
     
    115115        canvas_t *canvas = (canvas_t *) widget;
    116116        pos_event_t tevent;
    117        
     117
    118118        tevent = event;
    119119        tevent.hpos -= widget->hpos;
    120120        tevent.vpos -= widget->vpos;
    121        
     121
    122122        sig_send(&canvas->position_event, &tevent);
    123123}
     
    127127{
    128128        widget_init(&canvas->widget, parent, data);
    129        
     129
    130130        canvas->widget.width = width;
    131131        canvas->widget.height = height;
    132        
     132
    133133        canvas->widget.width_min = width;
    134134        canvas->widget.height_min = height;
     
    137137        canvas->widget.width_max = width;
    138138        canvas->widget.height_max = height;
    139        
     139
    140140        canvas->widget.destroy = canvas_destroy;
    141141        canvas->widget.reconfigure = canvas_reconfigure;
     
    144144        canvas->widget.handle_keyboard_event = canvas_handle_keyboard_event;
    145145        canvas->widget.handle_position_event = canvas_handle_position_event;
    146        
     146
    147147        canvas->width = width;
    148148        canvas->height = height;
    149149        canvas->surface = surface;
    150        
     150
    151151        return true;
    152152}
     
    156156        if (surface != NULL)
    157157                canvas->surface = surface;
    158        
     158
    159159        canvas_repaint(&canvas->widget);
    160160        return true;
     
    167167        if (!canvas)
    168168                return NULL;
    169        
     169
    170170        if (init_canvas(canvas, parent, data, width, height, surface))
    171171                return canvas;
    172        
     172
    173173        free(canvas);
    174174        return NULL;
Note: See TracChangeset for help on using the changeset viewer.