- Timestamp:
- 04/08/14 16:14:20 (10 years ago)
- Location:
- titan/titan
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/titan/defaults.h
r25406 r28462 123 123 status.virtualzap = getconfigint("virtualzap", NULL); 124 124 status.fontsizeadjust = getskinconfigint("fontsizeadjust", NULL); 125 status.rcskipms = getconfigint("rcskipms", NULL); 125 126 126 127 if(checkbox("ATEMIO7600") == 1) delconfig("fastzap"); -
titan/titan/rc.h
r23286 r28462 214 214 int ret = 0, len = 0, fromthread = 0, longpress = 0, longpresscount = 0; 215 215 struct rc *node; 216 struct timeval aktrctime; 216 217 217 218 if(pthread_self() != status.mainthread) … … 273 274 continue; 274 275 } 275 276 if(time(NULL) - rcdata.time.tv_sec > 1) 276 277 gettimeofday(&aktrctime, NULL); 278 if(status.rcskipms > 0 && ((aktrctime.tv_sec - rcdata.time.tv_sec) * 1000000LL + aktrctime.tv_usec - rcdata.time.tv_usec) > status.rcskipms) 277 279 { 278 280 usleep(10000); 279 281 continue; 280 282 } 281 283 284 printf(".\n"); 285 282 286 debug(100, "key code=%d, type=%d, value=%d", rcdata.code, rcdata.type, rcdata.value); 283 287 treffer = 1; -
titan/titan/skin.h
r28456 r28462 23 23 else 24 24 printf("screen = NULL\n"); 25 }26 27 int getrectdiff(int x, int y, int w, int h, int x1, int y1, int w1, int h1, int* x2, int* y2, int* w2, int* h2)28 {29 int xx = x + w;30 int xx1 = x1 + w1;31 int yy = y + h;32 int yy1 = y1 + h1;33 34 *x2 = OMAX(x, x1);35 *w2 = OMIN(xx, xx1); (*w2) = (*w2) - (*x2);36 *y2 = OMAX(y, y1);37 *h2 = OMIN(yy, yy1); (*h2) = (*h2) - (*y2);38 39 if(*w2 <= 0 || *h2 <=0) return 1;40 return 0;41 }42 43 void resetchangeflag(struct skin* node)44 {45 if(node == NULL) return;46 struct skin* child = node->child;47 48 node->flag = setbit(node->flag, 1);49 50 while(child != NULL)51 {52 child->flag = setbit(child->flag, 1);53 child = child->next;54 }55 25 } 56 26 … … 552 522 newnode->titlebgcol = -1; 553 523 newnode->deaktivcol = -1; 554 newnode->flag = setbit(newnode->flag, 1);555 524 556 525 if(line != NULL) … … 601 570 free(ret); 602 571 } 603 ret = getxmlentry(line, " picwidth="); 604 if(ret != NULL) 605 { 606 newnode->picwidth = convertxmlentry(ret, &newnode->picprozwidth); 607 free(ret); 608 } 609 ret = getxmlentry(line, " picheight="); 610 if(ret != NULL) 611 { 612 newnode->picheight = convertxmlentry(ret, &newnode->picprozheight); 613 free(ret); 572 // disable skinadjust is verry slow... 573 if(checkbox("ATEMIO5200") != 1) 574 { 575 ret = getxmlentry(line, " picwidth="); 576 if(ret != NULL) 577 { 578 newnode->picwidth = convertxmlentry(ret, &newnode->picprozwidth); 579 free(ret); 580 } 581 ret = getxmlentry(line, " picheight="); 582 if(ret != NULL) 583 { 584 newnode->picheight = convertxmlentry(ret, &newnode->picprozheight); 585 free(ret); 586 } 614 587 } 615 588 ret = getxmlentry(line, " picquality="); … … 647 620 { 648 621 newnode->hidden = convertxmlentry(ret, NULL); 649 free(ret);650 }651 ret = getxmlentry(line, " usesavebg=");652 if(ret != NULL)653 {654 newnode->usesavebg = atoi(ret);655 622 free(ret); 656 623 } … … 2710 2677 { 2711 2678 m_lock(&status.drawingmutex, 0); 2712 resetchangeflag(node);2713 2679 clearrect(node->rposx, node->rposy, node->rwidth, node->rheight); 2714 2680 clearshadow(node); … … 2718 2684 void clearscreennolock(struct skin* node) 2719 2685 { 2720 resetchangeflag(node);2721 2686 clearrect(node->rposx, node->rposy, node->rwidth, node->rheight); 2722 2687 clearshadow(node); … … 2891 2856 } 2892 2857 2893 void drawtitlebgcolpart(struct skin* node, int posx, int posy, int width, int height)2894 {2895 int iposx = 0, iposy = 0, iwidth = 0, iheight = 0;2896 int rposx = 0, rposy = 0, rwidth = 0, rheight = 0;2897 2898 if(getrectdiff(posx, posy, width, height, rposx, rposy, rwidth, rheight, &iposx, &iposy, &iwidth, &iheight) == 0)2899 fillrect(iposx, iposy, iwidth, iheight, node->bgcol, node->transparent);2900 if(status.picbordersize > 0)2901 {2902 rposx = node->rposx + status.picbordersize;2903 rposy = node->rposy + status.picbordersize;2904 rwidth = node->rwidth - (status.picbordersize << 1);2905 rheight = node->rheight - (node->rheight - node->titlesize);2906 2907 if(getrectdiff(posx, posy, width, height, rposx, rposy, rwidth, rheight, &iposx, &iposy, &iwidth, &iheight) == 0)2908 fillrect(iposx, iposy, iwidth, iheight, node->titlebgcol, node->transparent);2909 }2910 else2911 {2912 rposx = node->rposx;2913 rposy = node->rposy;2914 rwidth = node->rwidth;2915 rheight = node->rheight - (node->rheight - node->titlesize);2916 2917 if(getrectdiff(posx, posy, width, height, rposx, rposy, rwidth, rheight, &iposx, &iposy, &iwidth, &iheight) == 0)2918 fillrect(iposx, iposy, iwidth, iheight, node->titlebgcol, node->transparent);2919 }2920 }2921 2922 2858 void drawbginnercol(struct skin* node) 2923 2859 { … … 2928 2864 { 2929 2865 fillrect(node->rposx + node->bgspace, node->rposy + node->bgspace, node->rwidth - (node->bgspace << 1), node->rheight - (node->bgspace << 1), node->bgcol, node->transparent); 2930 }2931 2932 void drawbgcolpart(struct skin* node, int posx, int posy, int width, int height)2933 {2934 int iposx = 0, iposy = 0, iwidth = 0, iheight = 0;2935 int rposx = node->rposx + node->bgspace;2936 int rposy = node->rposy + node->bgspace;2937 int rwidth = node->rwidth - (node->bgspace << 1);2938 int rheight = node->rheight - (node->bgspace << 1);2939 2940 if(getrectdiff(posx, posy, width, height, rposx, rposy, rwidth, rheight, &iposx, &iposy, &iwidth, &iheight) == 0)2941 fillrect(iposx, iposy, iwidth, iheight, node->bgcol, node->transparent);2942 2866 } 2943 2867 … … 2963 2887 } 2964 2888 2965 void drawprogressbarpart(struct skin* node, int posx, int posy, int width, int height)2966 {2967 int iposx = 0, iposy = 0, iwidth = 0, iheight = 0;2968 int rposx = node->rposx + node->bordersize;2969 int rposy = node->rposy + node->bordersize;2970 int rwidth = 0;2971 int rheight = node->iheight;2972 2973 if(node->progresssize > 100) node->progresssize = 100;2974 rwidth = (((node->iwidth * 100) / 100) * node->progresssize) / 100;2975 2976 if(getrectdiff(posx, posy, width, height, rposx, rposy, rwidth, rheight, &iposx, &iposy, &iwidth, &iheight) == 0)2977 fillrect(iposx, iposy, iwidth, iheight, node->progresscol, node->transparent);2978 }2979 2980 2889 void drawmultiprogressbar(struct skin* node) 2981 2890 { … … 2993 2902 if(val2 > val1) 2994 2903 fillrect(node->rposx + node->bordersize + node->bgspace + val1, node->rposy + node->bgspace + node->bordersize, val2 - val1 + (node->bgspace << 1), node->iheight + (node->bgspace << 1), node->progresscol, node->transparent); 2995 epgrecord = epgrecord->next;2996 }2997 }2998 2999 void drawmultiprogressbarpart(struct skin* node, int posx, int posy, int width, int height)3000 {3001 struct epgrecord* epgrecord = node->epgrecord;3002 int val1 = 0, val2 = 0;3003 int iposx = 0, iposy = 0, iwidth = 0, iheight = 0;3004 int rposx = 0, rposy = 0, rwidth = 0, rheight = 0;3005 3006 3007 while(epgrecord != NULL)3008 {3009 3010 if(epgrecord->posx > 100) epgrecord->posx = 100;3011 val1 = (((node->iwidth * 100) / 100) * epgrecord->posx) / 100;3012 if(epgrecord->size > 100) epgrecord->size = 100;3013 val2 = (((node->iwidth * 100) / 100) * epgrecord->size) / 100;3014 3015 if(val2 > val1)3016 {3017 rposx = node->rposx + node->bordersize + node->bgspace + val1;3018 rposy = node->rposy + node->bgspace + node->bordersize;3019 rwidth = val2 - val1 + (node->bgspace << 1);3020 rheight = node->iheight + (node->bgspace << 1);3021 3022 if(getrectdiff(posx, posy, width, height, rposx, rposy, rwidth, rheight, &iposx, &iposy, &iwidth, &iheight) == 0)3023 fillrect(iposx, iposy, iwidth, iheight, node->progresscol, node->transparent);3024 3025 }3026 2904 epgrecord = epgrecord->next; 3027 2905 } … … 3099 2977 if(node->bordertype == 0 || checkbit(node->bordertype, 3) == 1) 3100 2978 fillrect(node->rposx + node->rwidth - node->bordersize, node->rposy, node->bordersize, node->rheight, node->bordercol, node->transparent); 3101 }3102 }3103 3104 void drawborderpart(struct skin* node, int posx, int posy, int width, int height)3105 {3106 int iposx = 0, iposy = 0, iwidth = 0, iheight = 0;3107 int rposx = 0, rposy = 0, rwidth = 0, rheight = 0;3108 3109 if(node->bordertype == 0 || checkbit(node->bordertype, 0) == 1)3110 {3111 rposx = node->rposx;3112 rposy = node->rposy;3113 rwidth = node->rwidth;3114 rheight = node->bordersize;3115 3116 if(getrectdiff(posx, posy, width, height, rposx, rposy, rwidth, rheight, &iposx, &iposy, &iwidth, &iheight) == 0)3117 fillrect(iposx, iposy, iwidth, iheight, node->bordercol, node->transparent);3118 }3119 if(node->bordertype == 0 || checkbit(node->bordertype, 1) == 1)3120 {3121 rposx = node->rposx;3122 rposy = node->rposy + node->rheight - node->bordersize;3123 rwidth = node->rwidth;3124 rheight = node->bordersize;3125 3126 if(getrectdiff(posx, posy, width, height, rposx, rposy, rwidth, rheight, &iposx, &iposy, &iwidth, &iheight) == 0)3127 fillrect(iposx, iposy, iwidth, iheight, node->bordercol, node->transparent);3128 }3129 if(node->bordertype == 0 || checkbit(node->bordertype, 2) == 1)3130 {3131 rposx = node->rposx;3132 rposy = node->rposy;3133 rwidth = node->bordersize;3134 rheight = node->rheight;3135 3136 if(getrectdiff(posx, posy, width, height, rposx, rposy, rwidth, rheight, &iposx, &iposy, &iwidth, &iheight) == 0)3137 fillrect(iposx, iposy, iwidth, iheight, node->bordercol, node->transparent);3138 }3139 if(node->bordertype == 0 || checkbit(node->bordertype, 3) == 1)3140 {3141 rposx = node->rposx + node->rwidth - node->bordersize;3142 rposy = node->rposy;3143 rwidth = node->bordersize;3144 rheight = node->rheight;3145 3146 if(getrectdiff(posx, posy, width, height, rposx, rposy, rwidth, rheight, &iposx, &iposy, &iwidth, &iheight) == 0)3147 fillrect(iposx, iposy, iwidth, iheight, node->bordercol, node->transparent);3148 2979 } 3149 2980 } … … 3206 3037 } 3207 3038 3208 void drawshadowpart(struct skin* node, int posx, int posy, int width, int height)3209 {3210 int iposx = 0, iposy = 0, iwidth = 0, iheight = 0;3211 int rposx = 0, rposy = 0, rwidth = 0, rheight = 0;3212 3213 switch(node->shadowpos)3214 {3215 case BOTTOMLEFT:3216 rposx = node->rposx - node->shadowsize;3217 rposy = node->rposy + node->rheight;3218 rwidth = node->rwidth;3219 rheight = node->shadowsize;3220 3221 if(getrectdiff(posx, posy, width, height, rposx, rposy, rwidth, rheight, &iposx, &iposy, &iwidth, &iheight) == 0)3222 fillrect(iposx, iposy, iwidth, iheight, node->shadowcol, node->transparent);3223 3224 rposx = node->rposx - node->shadowsize;3225 rposy = node->rposy + node->shadowsize;3226 rwidth = node->shadowsize;3227 rheight = node->rheight;3228 3229 if(getrectdiff(posx, posy, width, height, rposx, rposy, rwidth, rheight, &iposx, &iposy, &iwidth, &iheight) == 0)3230 fillrect(iposx, iposy, iwidth, iheight, node->shadowcol, node->transparent);3231 3232 break;3233 case BOTTOMRIGHT:3234 rposx = node->rposx + node->shadowsize;3235 rposy = node->rposy + node->rheight;3236 rwidth = node->rwidth;3237 rheight = node->shadowsize;3238 3239 if(getrectdiff(posx, posy, width, height, rposx, rposy, rwidth, rheight, &iposx, &iposy, &iwidth, &iheight) == 0)3240 fillrect(iposx, iposy, iwidth, iheight, node->shadowcol, node->transparent);3241 3242 rposx = node->rposx + node->rwidth;3243 rposy = node->rposy + node->shadowsize;3244 rwidth = node->shadowsize;3245 rheight = node->rheight;3246 3247 if(getrectdiff(posx, posy, width, height, rposx, rposy, rwidth, rheight, &iposx, &iposy, &iwidth, &iheight) == 0)3248 fillrect(iposx, iposy, iwidth, iheight, node->shadowcol, node->transparent);3249 3250 break;3251 case TOPLEFT:3252 rposx = node->rposx - node->shadowsize;3253 rposy = node->rposy - node->shadowsize;3254 rwidth = node->rwidth;3255 rheight = node->shadowsize;3256 3257 if(getrectdiff(posx, posy, width, height, rposx, rposy, rwidth, rheight, &iposx, &iposy, &iwidth, &iheight) == 0)3258 fillrect(iposx, iposy, iwidth, iheight, node->shadowcol, node->transparent);3259 3260 rposx = node->rposx - node->shadowsize;3261 rposy = node->rposy - node->shadowsize;3262 rwidth = node->shadowsize;3263 rheight = node->rheight;3264 3265 if(getrectdiff(posx, posy, width, height, rposx, rposy, rwidth, rheight, &iposx, &iposy, &iwidth, &iheight) == 0)3266 fillrect(iposx, iposy, iwidth, iheight, node->shadowcol, node->transparent);3267 3268 break;3269 default:3270 rposx = node->rposx + node->shadowsize;3271 rposy = node->rposy - node->shadowsize;3272 rwidth = node->rwidth;3273 rheight = node->shadowsize;3274 3275 if(getrectdiff(posx, posy, width, height, rposx, rposy, rwidth, rheight, &iposx, &iposy, &iwidth, &iheight) == 0)3276 fillrect(iposx, iposy, iwidth, iheight, node->shadowcol, node->transparent);3277 3278 rposx = node->rposx + node->rwidth;3279 rposy = node->rposy - node->shadowsize;3280 rwidth = node->shadowsize;3281 rheight = node->rheight;3282 3283 if(getrectdiff(posx, posy, width, height, rposx, rposy, rwidth, rheight, &iposx, &iposy, &iwidth, &iheight) == 0)3284 fillrect(iposx, iposy, iwidth, iheight, node->shadowcol, node->transparent);3285 3286 break;3287 }3288 }3289 3290 //flag 0: draw all parts before node3291 //flag 1: draw all parts after node3292 struct skin* drawnodepart(struct skin* tmp, struct skin* screen, struct skin* parent, struct skin* node, int flag)3293 {3294 int posx = 0, posy = 0, width = 0, height = 0;3295 struct skin* child = NULL;3296 3297 if(screen == NULL || node == NULL || screen == node) return NULL;3298 if(checkbit(node->flag, 1) == 0 || checkbit(screen->flag, 1) == 1) return NULL;3299 3300 //printf("drawnodepart %s %d\n", node->name, flag);3301 if(flag == 0)3302 child = screen;3303 else3304 child = tmp;3305 3306 while(child != NULL)3307 {3308 if(flag == 0 && child == node) return child->drawnext;3309 if(child->hidden == YES || child->locked == YES || checkbit(child->flag, 0) == 0 || checkbit(child->flag, 1) == 1 || child == node)3310 {3311 if(child == screen)3312 child = screen->drawnext;3313 else3314 child = child->drawnext;3315 continue;3316 }3317 3318 if(getrectdiff(node->rposx, node->rposy, node->rwidth, node->rheight, child->rposx, child->rposy, child->rwidth, child->rheight, &posx, &posy, &width, &height) == 1)3319 {3320 if(child == screen)3321 child = screen->drawnext;3322 else3323 child = child->drawnext;3324 continue;3325 }3326 3327 if(child->shadowsize > 0)3328 drawshadowpart(child, node->rposx, node->rposy, node->rwidth, node->rheight);3329 if(child->bgcol > -1)3330 {3331 //if(node->child != NULL && status.picbordersize > 0)3332 // drawbginnercol(node);3333 //else3334 //printf("drawbgcolpart %s %s x=%d y=%d w=%d h=%d\n", node->name, child->name, node->rposx, node->rposy, node->rwidth, node->rheight);3335 drawbgcolpart(child, node->rposx, node->rposy, node->rwidth, node->rheight);3336 }3337 /*3338 if(node->child != NULL && status.bgpic != NULL)3339 drawpic(status.bgpic, node->iposx, node->iposy, node->iwidth, node->iheight, node->iwidth, node->iheight, node->halign, node->valign, node->transparent, node->picquality, node->picmem);3340 if(child->gradient > 0)3341 drawbggradient(child);3342 */3343 if(child->titlebgcol > -1)3344 drawtitlebgcolpart(child, node->rposx, node->rposy, node->rwidth, node->rheight);3345 //if(child->titlegradient > 0)3346 // drawtitlebggradient(child);3347 if(child->progresssize > 0)3348 {3349 //printf("1) %s %d\n", child->name, child->progresssize);3350 drawprogressbarpart(child, node->rposx, node->rposy, node->rwidth, node->rheight);3351 }3352 if(child->type & MULTIPROGRESSBAR)3353 drawmultiprogressbarpart(child, node->rposx, node->rposy, node->rwidth, node->rheight);3354 if(child->bordersize > 0)3355 {3356 //if(node->child != NULL && status.picbordersize > 0)3357 //drawpicborder(node);3358 //else3359 drawborderpart(child, node->rposx, node->rposy, node->rwidth, node->rheight);3360 //if((node->child != NULL && status.borderradius > 0) || node->borderradius > 0)3361 //drawroundborder(node, bglt, bglb, bgrt, bgrb);3362 }3363 3364 3365 if(child == screen)3366 child = screen->drawnext;3367 else3368 child = child->drawnext;3369 }3370 3371 return NULL;3372 }3373 3374 3039 //flag 0: del background 3375 3040 //flag 1: don't del background … … 3378 3043 long color = 0, color2 = 0; 3379 3044 int len = 0; 3380 char* bglt = NULL, *bglb = NULL, *bgrt = NULL, *bgrb = NULL, *tmpstr = NULL; 3381 /* 3382 printf("drawnode: node->flag=%d\n",node->flag); 3383 printf("drawnode: node->hidden=%d\n",node->hidden); 3384 printf("drawnode: node->locked=%d\n",node->locked); 3385 printf("drawnode: node->text=%s\n",node->text); 3386 printf("drawnode: node->bgcol=%ld\n",node->bgcol); 3387 printf("drawnode: node->bgcol2=%ld\n",node->bgcol2); 3388 printf("drawnode: node->titlebgcol=%ld\n",node->titlebgcol); 3389 printf("drawnode: node->titlebgcol2=%ld\n",node->titlebgcol2); 3390 printf("drawnode: node->progresscol=%ld\n",node->progresscol); 3391 printf("drawnode: node->bordercol=%ld\n",node->bordercol); 3392 printf("drawnode: node->shadowcol=%ld\n",node->shadowcol); 3393 printf("drawnode: node->deaktivcol=%ld\n",node->deaktivcol); 3394 printf("drawnode: node->gradient=%d\n",node->gradient); 3395 printf("drawnode: node->transparent=%d\n",node->transparent); 3396 printf("drawnode: node->rposx=%d\n",node->rposx); 3397 printf("drawnode: node->rposy=%d\n",node->rposy); 3398 printf("drawnode: node->rwidth=%d\n",node->rwidth); 3399 printf("drawnode: node->rheight=%d\n",node->rheight); 3400 printf("drawnode: node->usesavebg=%d\n",node->usesavebg); 3401 printf("drawnode: node->name=%s\n",node->name); 3402 printf("drawnode: node->savebg=%s\n",node->savebg); 3045 char* bglt = NULL, *bglb = NULL, *bgrt = NULL, *bgrb = NULL; 3403 3046 3404 debug(555, "#############################################"); 3405 debug(555, "node->text=%s", node->text); 3406 debug(555, "node->name=%s", node->name); 3407 debug(555, "node->rposx=%d", node->rposx); 3408 debug(555, "node->rposy=%d", node->rposy); 3409 debug(555, "node->rwidth=%d", node->rwidth); 3410 debug(555, "node->rheight=%d", node->rheight); 3411 debug(555, "node->usesavebg=%d", node->usesavebg); 3412 debug(555, "#############################################"); 3413 */ 3414 3415 // printf("text=%s bgcol=%ld bgcol2=%ld\n", node->text, node->bgcol, node->bgcol2); 3416 //printf("drawnode: weiter check\n"); 3417 3418 if(checkbit(node->flag, 1) == 0) return; 3419 //printf("drawnode: weiter ok\n"); 3420 3421 if((node->usesavebg == 1 || node->usesavebg == 2) && node->savebg != NULL) 3422 { 3423 debug(555, "--------------------------------------------"); 3424 debug(555, "drawnode: restore savebg"); 3425 // printf("drawnode: restore savebg: %d\n",node->usesavebg); 3426 3427 tmpstr = ostrcat(node->savebg, NULL, 0, 0); 3428 restorescreen(node->savebg, node); 3429 if(node->usesavebg == 1) 3430 node->savebg = ostrcat(tmpstr, NULL, 0, 0); 3431 else 3432 node->savebg = NULL; 3433 free(tmpstr), tmpstr = NULL; 3434 debug(555, "node->rposx=%d", node->rposx); 3435 debug(555, "node->rposy=%d", node->rposy); 3436 debug(555, "node->rwidth=%d", node->rwidth); 3437 debug(555, "node->rheight=%d", node->rheight); 3438 debug(555, "node->text=%s", node->text); 3439 debug(555, "node->name=%s", node->name); 3440 debug(555, "node->hidden=%d", node->hidden); 3441 debug(555, "--------------------------------------------"); 3442 } 3443 3444 // if(node->usesavebg == 1 && node->hidden == 0 && node->savebg == NULL) 3445 if((node->usesavebg == 1 || node->usesavebg == 2)/* && node->rposx != 0 && node->rposy != 0 && node->rheight != 0 && node->rheight != 1*/ && node->savebg == NULL) 3446 { 3447 debug(555, "--------------------------------------------"); 3448 debug(555, "drawnode: backup savebg"); 3449 // printf("drawnode: backup savebg: %d\n",node->usesavebg); 3450 node->savebg = savescreen(node); 3451 debug(555, "node->rposx=%d", node->rposx); 3452 debug(555, "node->rposy=%d", node->rposy); 3453 debug(555, "node->rwidth=%d", node->rwidth); 3454 debug(555, "node->rheight=%d", node->rheight); 3455 debug(555, "node->text=%s", node->text); 3456 debug(555, "node->name=%s", node->name); 3457 debug(555, "node->hidden=%d", node->hidden); 3458 debug(555, "--------------------------------------------"); 3459 } 3460 3461 if(node->hidden == YES || node->locked == YES) return; 3462 3047 node->flag = setbit(node->flag, 0); 3048 3463 3049 if(node->bordersize > 0) 3464 3050 { … … 3477 3063 } 3478 3064 3479 /*3480 3065 if(flag == 0 && node->bgcol == -1) 3481 3066 { … … 3483 3068 clearrect(node->rposx + node->bordersize, node->rposy + node->bordersize, node->rwidth - (node->bordersize << 1), node->rheight - (node->bordersize << 1)); 3484 3069 else 3485 clearrect(node->rposx, node->rposy, node->rwidth, node->rheight); 3486 } 3487 */ 3070 clearscreennolock(node); 3071 } 3488 3072 3489 3073 if(node->deaktivcol > -1) … … 3511 3095 if(node->gradient > 0) 3512 3096 drawbggradient(node); 3513 3514 3097 if(node->titlebgcol > -1) 3515 3098 drawtitlebgcol(node); 3516 3517 3099 if(node->titlegradient > 0) 3518 3100 drawtitlebggradient(node); 3519 3520 3101 if(node->progresssize > 0) 3521 3102 drawprogressbar(node); 3522 3523 3103 if(node->type & MULTIPROGRESSBAR) 3524 3104 drawmultiprogressbar(node); 3525 3526 3105 if(node->selectpic != NULL && !(node->type & FILELIST)) 3527 3106 drawpic(node->selectpic, node->iposx, node->iposy, node->iwidth, node->iheight, node->iwidth, node->iheight, LEFT, TOP, node->transparent, node->picquality, node->picmem); 3528 3529 3107 if(node->pic != NULL && !(node->type & FILELIST)) 3530 3108 drawpic(node->pic, node->iposx, node->iposy, node->rpicwidth, node->rpicheight, node->iwidth, node->iheight, node->halign, node->valign, node->transparent, node->picquality, node->picmem); … … 3667 3245 { 3668 3246 struct skin* child = NULL, *last = NULL, *found = NULL; 3669 int selcol = 0 , change = 1;3247 int selcol = 0; 3670 3248 3671 3249 if(node->type == FILELIST) … … 3691 3269 else if(ostrcmp(child->parent, node->name) != 0 || child->hidden == YES) 3692 3270 { 3693 child->pagecount = 0;3694 3271 child = child->next; 3695 3272 continue; … … 3698 3275 else if(child->parentpointer != node || child->hidden == YES) 3699 3276 { 3700 child->pagecount = 0;3701 3277 child = child->next; 3702 3278 continue; … … 3705 3281 if(child->locked == YES) 3706 3282 { 3707 child->pagecount = 0;3708 3283 child = child->next; 3709 3284 continue; … … 3718 3293 { 3719 3294 node->pagecount++; 3720 /*3721 if(node->aktpage == -1)3722 {3723 if(found == NULL) change = node->pagecount;3724 }3725 else3726 {3727 if(node->pagecount == node->aktpage) change = node->pagecount;3728 }3729 */3730 3295 node->poscount = child->rheight; 3731 3296 } … … 3741 3306 node->linecount++; 3742 3307 last = child; 3743 3744 /*3745 if(node->aktpage == -1)3746 {3747 if(change == node->pagecount && checkbit(child->flag, 1) == 0) change = 0;3748 }3749 else3750 {3751 if(change == node->aktpage && checkbit(child->flag, 1) == 0) change = 0;3752 }3753 */3754 3308 3755 3309 if(node->aktline == -1 && child->pagecount == node->aktpage) … … 3775 3329 child = child->next; 3776 3330 } 3777 3778 //if(change > 0) node->flag = setbit(node->flag, 1);3779 3331 3780 3332 if(found == NULL) … … 3989 3541 } 3990 3542 3991 int checknodechange(struct skin* parent, struct skin* node)3992 {3993 int ret = 0, hash = 0;3994 3995 if(parent == NULL || node == NULL) return ret;3996 3997 hash = ((hash << 5) + hash) ^ node->hidden;3998 hash = ((hash << 5) + hash) ^ node->locked;3999 hash = ((hash << 5) + hash) ^ node->iposx;4000 hash = ((hash << 5) + hash) ^ node->iposy;4001 hash = ((hash << 5) + hash) ^ node->iwidth;4002 hash = ((hash << 5) + hash) ^ node->iheight;4003 hash = ((hash << 5) + hash) ^ node->rposx;4004 hash = ((hash << 5) + hash) ^ node->rposy;4005 hash = ((hash << 5) + hash) ^ node->rwidth;4006 hash = ((hash << 5) + hash) ^ node->rheight;4007 hash = ((hash << 5) + hash) ^ node->bordersize;4008 hash = ((hash << 5) + hash) ^ node->progresssize;4009 hash = ((hash << 5) + hash) ^ node->bgcol;4010 hash = ((hash << 5) + hash) ^ node->aktpage;4011 if(! (node->type & LISTBOX) || (node->type & FILELIST) || (node->type & GRID))4012 {4013 hash = ((hash << 5) + hash) ^ node->linecount;4014 hash = ((hash << 5) + hash) ^ node->pagecount;4015 hash = ((hash << 5) + hash) ^ node->poscount;4016 }4017 4018 if(hash != node->hash)4019 {4020 node->hash = hash;4021 node->flag = setbit(node->flag, 1);4022 ret = 1;4023 }4024 4025 return ret;4026 }4027 4028 3543 int setnodeattr(struct skin* node, struct skin* parent, int screencalc) 4029 3544 { 4030 3545 if(node != skin) node->flag = clearbit(node->flag, 0); 4031 3546 if((parent->type & LISTBOX) || (parent->type & FILELIST) || (parent->type & GRID)) 4032 { 4033 if(node->pagecount != parent->aktpage) 4034 { 4035 node->flag = setbit(node->flag, 1); 4036 return 1; 4037 } 4038 } 3547 if(node->pagecount != parent->aktpage) return 1; 4039 3548 4040 3549 int shadowlx = 0, shadowrx = 0, shadowoy = 0, shadowuy = 0; … … 4073 3582 if(screencalc != 2) 4074 3583 { 4075 if(checkbit(parent->flag, 0) == 0) 4076 return 1; 4077 if(node->hidden == YES || parent->hidden == YES || node->locked == YES || parent->locked == YES) 4078 return 0; 3584 if(node->hidden == YES || parent->hidden == YES || node->locked == YES || parent->locked == YES) return 1; 3585 if(checkbit(parent->flag, 0) == 0) return 1; 4079 3586 } 4080 3587 … … 4115 3622 node->rpicheight = node->picheight; 4116 3623 4117 4118 3624 if(node->rposx - shadowlx < parent->iposx) 4119 3625 { … … 4193 3699 { 4194 3700 char* pos = NULL; 4195 4196 3701 calctext(node->input, NULL, &node->linecount, &node->pagecount, &node->poscount, 1, node->aktpage); 4197 3702 … … 4305 3810 struct fb* merkskinfb = NULL; 4306 3811 int ret; 4307 struct skin *child = NULL, *parent = NULL, *oldparent = NULL , *oldchild = NULL;3812 struct skin *child = NULL, *parent = NULL, *oldparent = NULL; 4308 3813 4309 3814 if(node == NULL) … … 4416 3921 } 4417 3922 3923 if(screencalc == 0 || flag == 4) 3924 { 3925 if(flag == 0 || flag == 2 || flag == 4) clearscreenalways(); 3926 drawnode(node, 0); 3927 } 4418 3928 parent = node; 4419 3929 oldparent = node; 4420 oldchild = node;4421 3930 child = node->child; 4422 node->drawnext = NULL; 4423 if(screencalc == 0 || flag == 4) 4424 { 4425 if(flag == 0 || flag == 2 || flag == 4) clearscreenalways(); 4426 node->flag = setbit(node->flag, 0); 4427 checknodechange(parent, node); 4428 4429 //printf("aaaaaaaaaaaaaaaaa\n"); 4430 drawnode(node, 0); 4431 } 4432 4433 //calc 3931 4434 3932 while(child != NULL) 4435 3933 { … … 4444 3942 parent = oldparent; 4445 3943 4446 child->drawnext = NULL; 4447 if(setnodeattr(child, parent, screencalc) == 0) 4448 { 4449 child->flag = setbit(child->flag, 0); 4450 oldchild->drawnext = child; 4451 oldchild = child; 4452 } 4453 3944 if(setnodeattr(child, parent, screencalc) == 0 && screencalc == 0) 3945 drawnode(child, 1); 4454 3946 child = child->next; 4455 3947 } 4456 4457 //draw4458 if(screencalc == 0)4459 {4460 child = node->drawnext;4461 while(child != NULL)4462 {4463 if(child->parentpointer != NULL)4464 parent = child->parentpointer;4465 else if(child->parent != NULL)4466 {4467 parent = getscreennode(node, child->parent);4468 if(parent == status.skinerr) parent = oldparent;4469 }4470 else4471 parent = oldparent;4472 4473 checknodechange(parent, child);4474 struct skin* tmp = drawnodepart(NULL, node, parent, child, 0);4475 /*4476 printf("bbbbbbbbbbb\n");4477 printf("node->bgcol=%ld\n",node->bgcol);4478 printf("node->name=%s\n",node->name);4479 printf("node->pic=%s\n",node->pic);4480 printf("node->picmem=%d\n",node->picmem);4481 printf("child->bgcol=%ld\n",child->bgcol);4482 printf("child->name=%s\n",child->name);4483 printf("child->pic=%s\n",child->pic);4484 printf("child->picmem=%d\n",child->picmem);4485 printf("child->usesavebg=%d\n",child->usesavebg);4486 4487 if(node->bgcol == -1 && child->pic != NULL)4488 {4489 debug(555, "add 1 %s->%s: %s", node->name, child->name, child->text);4490 printf("add 1 %s->%s: %s\n",node->name,child->name,child->text);4491 child->usesavebg = 1;4492 }4493 else4494 */4495 if(node->bgcol == -1 && node->pic != NULL && node->usesavebg != 1)4496 {4497 debug(555, "add 2 %s->%s: %s", node->name, child->name, child->text);4498 // printf("add 2 %s->%s: %s\n",node->name,child->name,child->text);4499 child->usesavebg = 2;4500 }4501 else4502 {4503 debug(555, "skip %s->%s: %s", node->name, child->name, child->text);4504 // printf("skip %s->%s: %s\n",node->name,child->name,child->text);4505 }4506 //printf("2child->usesavebg=%d\n",child->usesavebg);4507 4508 4509 drawnode(child, 1);4510 //printf("ccccccccccc\n");4511 drawnodepart(tmp, node, parent, child, 1);4512 //printf("ddddddddddd\n");4513 child->flag = clearbit(child->flag, 1);4514 child = child->drawnext;4515 }4516 }4517 4518 if(screencalc == 0 || flag == 4) node->flag = clearbit(node->flag, 1);4519 3948 4520 3949 if(flag == 0 || flag == 2 || flag == 4) … … 4526 3955 4527 3956 if(merkskinfb != NULL) 4528 { 3957 { 4529 3958 if(node->name != NULL && ostrstr(node->name, "LCD_spf") != NULL) 4530 3959 write_FB_to_JPEG_file(skinfb->fb, skinfb->width, skinfb->height, "/tmp/titanlcd.jpg", 75); … … 4583 4012 if(node != NULL) 4584 4013 { 4014 free(node->input); 4585 4015 if(text != NULL) 4586 4016 { 4587 4017 if((node->type & INPUTBOXNUM) && node->mask != NULL && strlen(text) == 0) 4588 {4589 if(ostrcmp(node->input, node->mask) != 0) node->flag = setbit(node->flag, 1);4590 free(node->input);4591 4018 node->input = strdup(node->mask); 4592 }4593 4019 else 4594 {4595 if(ostrcmp(node->input, text) != 0) node->flag = setbit(node->flag, 1);4596 free(node->input);4597 4020 node->input = strdup(text); 4598 }4599 4021 } 4600 4022 else 4601 4023 { 4602 4024 if((node->type & INPUTBOXNUM) && node->mask != NULL) 4603 {4604 if(ostrcmp(node->input, node->mask) != 0) node->flag = setbit(node->flag, 1);4605 free(node->input);4606 4025 node->input = strdup(node->mask); 4607 }4608 4026 else 4609 {4610 if(ostrcmp(node->input, text) != 0) node->flag = setbit(node->flag, 1);4611 free(node->input);4612 4027 node->input = text; 4613 }4614 4028 } 4615 4029 ret = 0; … … 4625 4039 if(node != NULL) 4626 4040 { 4041 free(node->text); 4627 4042 if(text != NULL) 4628 {4629 if(ostrcmp(node->text, text) != 0) node->flag = setbit(node->flag, 1);4630 free(node->text);4631 4043 node->text = strdup(text); 4632 }4633 4044 else 4634 {4635 if(node->text != NULL) node->flag = setbit(node->flag, 1);4636 free(node->text);4637 4045 node->text = text; 4638 }4639 4046 ret = 0; 4640 4047 } … … 4649 4056 if(node != NULL) 4650 4057 { 4058 free(node->text2); 4651 4059 if(text != NULL) 4652 {4653 if(ostrcmp(node->text2, text) != 0) node->flag = setbit(node->flag, 1);4654 free(node->text2);4655 4060 node->text2 = strdup(text); 4656 }4657 4061 else 4658 {4659 if(node->text2 != NULL) node->flag = setbit(node->flag, 1);4660 free(node->text2);4661 4062 node->text2 = text; 4662 }4663 4063 ret = 0; 4664 4064 } … … 4693 4093 if(node != NULL) 4694 4094 { 4095 free(node->pic); 4695 4096 if(text != NULL) 4696 4097 { 4697 char* tmpstr = changepicpath(text);4698 if(ostrcmp(node->pic, tmpstr) != 0) node->flag = setbit(node->flag, 1);4699 free(node->pic);4700 4098 node->picmem = 1; 4701 node->pic = tmpstr;4099 node->pic = changepicpath(text); 4702 4100 4703 4101 if(getpic(node->pic) == NULL) … … 4714 4112 } 4715 4113 else 4716 {4717 if(node->pic != NULL) node->flag = setbit(node->flag, 1);4718 free(node->pic);4719 4114 node->pic = text; 4720 }4721 4115 ret = 0; 4722 4116 } … … 4732 4126 { 4733 4127 node->picmem = 0; 4128 free(node->pic); 4734 4129 if(text != NULL) 4735 { 4736 char* tmpstr = changepicpath(text); 4737 if(ostrcmp(node->pic, tmpstr) != 0) node->flag = setbit(node->flag, 1); 4738 free(node->pic); 4739 node->pic = tmpstr; 4740 } 4130 node->pic = changepicpath(text); 4741 4131 else 4742 {4743 if(node->pic != NULL) node->flag = setbit(node->flag, 1);4744 free(node->pic);4745 4132 node->pic = text; 4746 }4747 4133 ret = 0; 4748 4134 } … … 4757 4143 if(node != NULL) 4758 4144 { 4145 free(node->selectpic); 4759 4146 if(text != NULL) 4760 { 4761 char* tmpstr = changepicpath(text); 4762 if(ostrcmp(node->selectpic, tmpstr) != 0) node->flag = setbit(node->flag, 1); 4763 free(node->selectpic); 4764 node->selectpic = tmpstr; 4765 } 4147 node->selectpic = changepicpath(text); 4766 4148 else 4767 {4768 if(node->selectpic != NULL) node->flag = setbit(node->flag, 1);4769 free(node->selectpic);4770 4149 node->selectpic = text; 4771 }4772 4150 ret = 0; 4773 4151 } … … 4782 4160 if(node != NULL) 4783 4161 { 4162 free(node->title); 4784 4163 if(text != NULL) 4785 4164 { 4786 if(ostrcmp(node->title, text) != 0) node->flag = setbit(node->flag, 1);4787 free(node->title);4788 4165 node->title = strdup(text); 4789 4166 node->titlesize = node->fontsize + 6; … … 4791 4168 else 4792 4169 { 4793 if(node->title != NULL) node->flag = setbit(node->flag, 1);4794 free(node->title);4795 4170 node->title = text; 4796 4171 node->titlesize = 0; … … 4851 4226 if(node != NULL) 4852 4227 { 4228 free(node->parent); 4853 4229 if(text != NULL) 4854 {4855 if(ostrcmp(node->parent, text) != 0) node->flag = setbit(node->flag, 1);4856 free(node->parent);4857 4230 node->parent = strdup(text); 4858 }4859 4231 else 4860 {4861 if(node->parent != NULL) node->flag = setbit(node->flag, 1);4862 free(node->parent);4863 4232 node->parent = text; 4864 }4865 4233 ret = 0; 4866 4234 } … … 4875 4243 if(node != NULL) 4876 4244 { 4245 free(node->font); 4877 4246 if(text != NULL) 4878 {4879 if(ostrcmp(node->font, text) != 0) node->flag = setbit(node->flag, 1);4880 free(node->font);4881 4247 node->font = strdup(text); 4882 }4883 4248 else 4884 {4885 if(node->font != NULL) node->flag = setbit(node->flag, 1);4886 free(node->font);4887 4249 node->font = text; 4888 }4889 4250 ret = 0; 4890 4251 } … … 4933 4294 if(node != NULL) 4934 4295 { 4296 free(node->choiceboxvalue); 4935 4297 if(text != NULL) 4936 {4937 if(ostrcmp(node->choiceboxvalue, text) != 0) node->flag = setbit(node->flag, 1);4938 free(node->choiceboxvalue);4939 4298 node->choiceboxvalue = strdup(text); 4940 }4941 4299 else 4942 {4943 if(node->choiceboxvalue != NULL) node->flag = setbit(node->flag, 1);4944 free(node->choiceboxvalue);4945 4300 node->choiceboxvalue = text; 4946 }4947 4301 ret = 0; 4948 4302 } -
titan/titan/struct.h
r28446 r28462 1509 1509 unsigned int drawscreencount; 1510 1510 int autoseek; 1511 //skip all rc input events older than this value in millisec 1512 int rcskipms; 1511 1513 } status; 1512 1514
Note: See TracChangeset
for help on using the changeset viewer.