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 18... Line 18...
18
 
18
 
Line 19... Line 19...
19
ctrl_t *create_control(size_t size, int id, int x, int y,
19
ctrl_t *create_control(size_t size, int id, int x, int y,
20
                         int w, int h, ctrl_t *parent)
20
                         int w, int h, ctrl_t *parent)
21
{
21
{
22
 
-
 
23
    ctrl_t  *ctrl;
22
    ctrl_t  *ctrl;
Line 24... Line 23...
24
 
23
 
25
    if( !parent )
24
    if( !parent )
Line 124... Line 123...
124
    int x, y;
123
    int x, y;
125
 
124
 
Line 126... Line 125...
126
    ctx = btn->ctrl.ctx;
125
    ctx = btn->ctrl.ctx;
Line 127... Line -...
127
 
-
 
128
    lock_bitmap(ctx->pixmap);
-
 
129
    
126
 
130
    x = btn->ctrl.rc.l - ctx->offset_x;
127
    x = btn->ctrl.rc.l - ctx->offset_x;
Line 131... Line 128...
131
    y = btn->ctrl.rc.t - ctx->offset_y;
128
    y = btn->ctrl.rc.t - ctx->offset_y;
Line 257... Line 254...
257
    int len = prg->ctrl.w;
254
    int len = prg->ctrl.w;
Line 258... Line 255...
258
 
255
 
Line 259... Line -...
259
    ctx = prg->ctrl.ctx;
-
 
260
    
-
 
261
    lock_bitmap(ctx->pixmap);
256
    ctx = prg->ctrl.ctx;
262
 
257
 
Line 263... Line 258...
263
    x = prg->ctrl.rc.l - ctx->offset_x;
258
    x = prg->ctrl.rc.l - ctx->offset_x;
264
    y = prg->ctrl.rc.t - ctx->offset_y;
259
    y = prg->ctrl.rc.t - ctx->offset_y;
265
 
260
 
Line 266... Line 261...
266
    if( background )
261
    if( background )
267
    {
262
    {
Line 268... Line 263...
268
        src = res_progress_bar;
263
        src = res_progress_bar;
269
 
264
 
270
        pixmap = (int*)ctx->pixmap->data;
265
        pixmap = (int*)ctx->pixmap_data;
271
        pixmap+= y * ctx->pixmap->pitch/4 + x;
266
        pixmap+= y * ctx->pixmap_pitch/4 + x;
Line 272... Line 267...
272
 
267
 
273
        for(i=0; i < 10; i++)
268
        for(i=0; i < 10; i++)
274
        {
269
        {
275
            for(j = 0; j < len; j++)
270
            for(j = 0; j < len; j++)
Line 276... Line -...
276
                pixmap[j] = *src;
-
 
277
 
271
                pixmap[j] = *src;
Line 278... Line 272...
278
            pixmap+= ctx->pixmap->pitch/4;
272
 
Line 279... Line 273...
279
            src++;
273
            pixmap+= ctx->pixmap_pitch/4;
280
        };
274
            src++;
Line 281... Line 275...
281
    };
275
        };
282
 
276
    };
283
 
277
 
284
    len = prg->current*prg->ctrl.w/(prg->max - prg->min);
278
    len = prg->current*prg->ctrl.w/(prg->max - prg->min);
285
 
279
 
286
    src = res_prg_level;
280
    src = res_prg_level;
287
 
281
 
Line 288... Line 282...
288
    pixmap = (int*)ctx->pixmap->data;
282
    pixmap = (int*)ctx->pixmap_data;
289
    pixmap+= y*ctx->pixmap->pitch/4 + x;
283
    pixmap+= y*ctx->pixmap_pitch/4 + x;
Line 361... Line 355...
361
    double level;
355
    double level;
362
 
356
 
Line 363... Line 357...
363
    ctx = lvl->ctrl.ctx;
357
    ctx = lvl->ctrl.ctx;
Line 364... Line -...
364
 
-
 
365
    lock_bitmap(ctx->pixmap);
-
 
366
    
358
 
367
    x = lvl->ctrl.rc.l - ctx->offset_x;
359
    x = lvl->ctrl.rc.l - ctx->offset_x;
Line 368... Line 360...
368
    y = lvl->ctrl.rc.t - ctx->offset_y;
360
    y = lvl->ctrl.rc.t - ctx->offset_y;
Line 375... Line 367...
375
        len = 0;
367
        len = 0;
376
    if(len > 96)
368
    if(len > 96)
377
        len = 96;
369
        len = 96;
378
 
370
 
Line 379... Line 371...
379
    pixmap = (int*)ctx->pixmap->data;
371
    pixmap = (int*)ctx->pixmap_data;
Line 380... Line 372...
380
 
372
 
Line 381... Line 373...
381
    pixmap+=  y*ctx->pixmap->pitch/4 + x;
373
    pixmap+=  y*ctx->pixmap_pitch/4 + x;
382
 
374
 
383
    for(i=0; i < 10; i++)
375
    for(i=0; i < 10; i++)
384
    {
376
    {
385
        for(j = 0; j < 96; j++)
377
        for(j = 0; j < 96; j++)
386
           pixmap[j] = 0xFF1C1C1C;
378
           pixmap[j] = 0xFF1C1C1C;
Line 387... Line 379...
387
           pixmap+= ctx->pixmap->pitch/4;
379
           pixmap+= ctx->pixmap_pitch/4;
Line 388... Line 380...
388
    };
380
    };
Line 395... Line 387...
395
 
387
 
396
int lvl_proc(ctrl_t *ctrl, uint32_t msg, uint32_t arg1, uint32_t arg2)
388
int lvl_proc(ctrl_t *ctrl, uint32_t msg, uint32_t arg1, uint32_t arg2)
397
{
389
{
398
    level_t *lvl = (level_t*)ctrl;
-
 
Line 399... Line 390...
399
//    int pos;
390
    level_t *lvl = (level_t*)ctrl;
400
 
391
 
401
    switch( msg )
392
    switch( msg )
402
    {
393
    {
Line 452... Line 443...
452
    double level;
443
    double level;
453
 
444
 
Line 454... Line 445...
454
    ctx = sld->ctrl.ctx;
445
    ctx = sld->ctrl.ctx;
Line 455... Line -...
455
 
-
 
456
    lock_bitmap(ctx->pixmap);
-
 
457
    
446
 
458
    x = sld->ctrl.rc.l - ctx->offset_x;
447
    x = sld->ctrl.rc.l - ctx->offset_x;
Line 459... Line 448...
459
    y = sld->ctrl.rc.t - ctx->offset_y;
448
    y = sld->ctrl.rc.t - ctx->offset_y;
Line 460... Line 449...
460
 
449
 
461
    len = 96 + 12;
450
    len = 96 + 12;
Line 462... Line 451...
462
 
451
 
463
    pixmap = (int*)ctx->pixmap->data;
452
    pixmap = (int*)ctx->pixmap_data;
464
    pixmap+=  y*ctx->pixmap->pitch/4 + x;
453
    pixmap+=  y*ctx->pixmap_pitch/4 + x;
465
 
454
 
466
    for(i=0; i < 11; i++)
455
    for(i=0; i < 11; i++)
467
    {
456
    {
Line 468... Line 457...
468
        for(j = 0; j < len; j++)
457
        for(j = 0; j < len; j++)
469
           pixmap[j] = 0xFF1C1C1C;
-
 
470
           pixmap+= ctx->pixmap->pitch/4;
458
           pixmap[j] = 0xFF1C1C1C;
Line 471... Line 459...
471
    };
459
           pixmap+= ctx->pixmap_pitch/4;
472
 
460
    };