Subversion Repositories Kolibri OS

Rev

Rev 4438 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4438 Rev 5372
Line 51... Line 51...
51
    panel->ctrl.handler = panel_proc;
51
    panel->ctrl.handler = panel_proc;
52
    panel->ctrl.parent  = (ctrl_t*)win;
52
    panel->ctrl.parent  = (ctrl_t*)win;
Line 53... Line 53...
53
 
53
 
Line 54... Line -...
54
    panel->layout = 0;
-
 
55
    
54
    panel->layout = 0;
56
    panel->bitmap.width  = 1920;
-
 
57
    panel->bitmap.height = PANEL_HEIGHT;
-
 
58
    panel->bitmap.flags  = 0;
-
 
59
 
-
 
60
    if( create_bitmap(&panel->bitmap) )
-
 
61
    {
-
 
62
        printf("not enough memory for panel bitmap\n");
-
 
63
        return 0;
-
 
64
    }
-
 
65
 
55
 
66
    ctx->pixmap   = &panel->bitmap;
56
    ctx->pixmap_data = user_alloc(1920*PANEL_HEIGHT*4);
Line 67... Line 57...
67
    ctx->offset_x = 0;
57
    ctx->offset_x = 0;
Line 98... Line 88...
98
 
88
 
99
//    btn->img_default = res_minimize_btn;
89
//    btn->img_default = res_minimize_btn;
100
//    btn->img_hilite  = res_minimize_btn_hl;
90
//    btn->img_hilite  = res_minimize_btn_hl;
Line 101... Line -...
101
//    btn->img_pressed = res_minimize_btn_pressed;
-
 
102
 
-
 
103
 
91
//    btn->img_pressed = res_minimize_btn_pressed;
Line 104... Line 92...
104
 
92
 
105
    update_panel_size(win);
93
    update_panel_size(win);
Line 155... Line 143...
155
};
143
};
Line 156... Line 144...
156
 
144
 
157
void update_panel_size(window_t *win)
145
void update_panel_size(window_t *win)
158
{
146
{
159
    panel_t *panel = &win->panel;
-
 
Line 160... Line 147...
160
    bitmap_t  *bitmap = &panel->bitmap;
147
    panel_t  *panel  = &win->panel;
161
 
-
 
Line 162... Line 148...
162
    bitmap->width = win->w;
148
 
163
    resize_bitmap(bitmap);
149
    panel->ctx.pixmap_pitch = win->w*4;
Line 164... Line 150...
164
    
150
 
Line 198... Line 184...
198
};
184
};
Line 199... Line 185...
199
 
185
 
200
 
186
 
-
 
187
void draw_panel(panel_t *panel)
201
void draw_panel(panel_t *panel)
188
{
202
{
189
    ctx_t  *ctx = &panel->ctx;
Line 203... Line -...
203
    int *pixmap, *src;
-
 
204
    int  i, j, w;
-
 
205
 
190
    int *pixmap, *src;
206
    lock_bitmap(&panel->bitmap);
191
    int  i, j, w;
Line 207... Line -...
207
    
-
 
208
    blit_raw(&panel->ctx, res_panel_left, 0, 0,
192
 
209
             PANEL_CORNER_W, PANEL_HEIGHT, PANEL_CORNER_W*4);
193
    blit_raw(ctx, res_panel_left, 0, 0,
210
 
194
             PANEL_CORNER_W, PANEL_HEIGHT, PANEL_CORNER_W*4);
211
 
195
 
212
    w = panel->ctrl.w - (2*PANEL_CORNER_W);
196
    w = panel->ctrl.w - (2*PANEL_CORNER_W);
213
    if( w > 0)
197
    if( w > 0)
Line 214... Line 198...
214
    {
198
    {
215
        pixmap = (int*)panel->ctx.pixmap->data;
199
        pixmap = (int*)ctx->pixmap_data;
216
        pixmap+= PANEL_CORNER_W;
200
        pixmap+= PANEL_CORNER_W;
217
        src = res_panel_body;
201
        src = res_panel_body;
218
 
202
 
219
        for(i = 0; i < PANEL_HEIGHT; i++)
203
        for(i = 0; i < PANEL_HEIGHT; i++)
220
        {
204
        {
Line 221... Line 205...
221
            for(j = 0; j < w; j++)
205
            for(j = 0; j < w; j++)
222
                pixmap[j] = src[i];
206
                pixmap[j] = src[i];
Line 300... Line 284...
300
    return 1;
284
    return 1;
301
};
285
};
Line 302... Line 286...
302
 
286
 
303
void blit_panel(panel_t *panel)
287
void blit_panel(panel_t *panel)
304
{
-
 
305
//    printf("%s w:%d h:%d stride: %d\n",__FUNCTION__,
-
 
306
//            cpt->ctrl.w, cpt->ctrl.h, cpt->ctx.stride);
-
 
307
 
288
{
Line 308... Line 289...
308
    lock_bitmap(&panel->bitmap);
289
    ctx_t  *ctx = &panel->ctx;
309
 
290
 
310
    Blit(panel->ctx.pixmap->data, panel->draw.l, panel->draw.t,
291
    Blit(ctx->pixmap_data, panel->draw.l, panel->draw.t,
311
         0, 0, panel->ctrl.w, panel->ctrl.h,
292
         0, 0, panel->ctrl.w, panel->ctrl.h,