Magellan Linux

Diff of /trunk/busybox/patches/busybox-1.19.0-fbsplash-tykef-1.0.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1516 by niro, Mon Sep 5 17:48:40 2011 UTC revision 1517 by niro, Mon Sep 5 21:30:02 2011 UTC
# Line 58  diff -Naur busybox-1.19.0/miscutils/Conf Line 58  diff -Naur busybox-1.19.0/miscutils/Conf
58   default n  # doesn't build on Ubuntu 8.04   default n  # doesn't build on Ubuntu 8.04
59  diff -Naur busybox-1.19.0/miscutils/fbsplash.c busybox-1.19.0-magellan/miscutils/fbsplash.c  diff -Naur busybox-1.19.0/miscutils/fbsplash.c busybox-1.19.0-magellan/miscutils/fbsplash.c
60  --- busybox-1.19.0/miscutils/fbsplash.c 2011-08-11 02:23:58.000000000 +0200  --- busybox-1.19.0/miscutils/fbsplash.c 2011-08-11 02:23:58.000000000 +0200
61  +++ busybox-1.19.0-magellan/miscutils/fbsplash.c 2011-09-05 21:00:45.000000000 +0200  +++ busybox-1.19.0-magellan/miscutils/fbsplash.c 2011-09-06 01:04:13.000000000 +0200
62  @@ -1,6 +1,7 @@  @@ -1,6 +1,7 @@
63   /* vi: set sw=4 ts=4: */   /* vi: set sw=4 ts=4: */
64   /*   /*
# Line 425  diff -Naur busybox-1.19.0/miscutils/fbsp Line 425  diff -Naur busybox-1.19.0/miscutils/fbsp
425   close(fbfd);   close(fbfd);
426   }   }
427    
428  @@ -140,142 +407,50 @@  @@ -140,142 +407,60 @@
429    
430    
431   /**   /**
# Line 565  diff -Naur busybox-1.19.0/miscutils/fbsp Line 565  diff -Naur busybox-1.19.0/miscutils/fbsp
565  + fb_sprite(G.nbar_posx + w0 + w1, G.nbar_posy, w0 + w1, w2, G.spb1, 0); // right "empty" area  + fb_sprite(G.nbar_posx + w0 + w1, G.nbar_posy, w0 + w1, w2, G.spb1, 0); // right "empty" area
566   }   }
567    
568    +static struct sprite *fb_newsprite(int pw, int ph, int scrx, int scry) {
569    + struct sprite *s;
570    + s=xmalloc(sizeof(struct sprite) +
571    +        ph * pw * G.bytes_per_pixel);
572    + s->w = pw;
573    + s->h = ph;
574    + s->bw = pw * G.bytes_per_pixel;
575    + if (scrx >= 0) fb_getsprite(scrx, scry, s); // read
576    + return s;
577    +}
578    
579   /**   /**
580  - * Draw image from PPM file  - * Draw image from PPM file
# Line 600  diff -Naur busybox-1.19.0/miscutils/fbsp Line 610  diff -Naur busybox-1.19.0/miscutils/fbsp
610   /* Parse ppm header:   /* Parse ppm header:
611   * - Magic: two characters "P6".   * - Magic: two characters "P6".
612   * - Whitespace (blanks, TABs, CRs, LFs).   * - Whitespace (blanks, TABs, CRs, LFs).
613  @@ -289,53 +464,721 @@  @@ -289,55 +474,723 @@
614   * - A raster of Width * Height pixels in triplets of rgb   * - A raster of Width * Height pixels in triplets of rgb
615   *   in pure binary by 1 or 2 bytes. (we support only 1 byte)   *   in pure binary by 1 or 2 bytes. (we support only 1 byte)
616   */   */
# Line 689  diff -Naur busybox-1.19.0/miscutils/fbsp Line 699  diff -Naur busybox-1.19.0/miscutils/fbsp
699  + p->buftail = i;  + p->buftail = i;
700  + } else {  + } else {
701  + p->buftail = 0;  + p->buftail = 0;
702   }  + }
703  + while (p->buftail < (p->sizx * 3)) {  + while (p->buftail < (p->sizx * 3)) {
704  + i=read(p->fd, &(p->buf[p->buftail]), (p->sizx * 3) - p->buftail);  + i=read(p->fd, &(p->buf[p->buftail]), (p->sizx * 3) - p->buftail);
705  + if (i < 0) return NULL;  + if (i < 0) return NULL;
706  + p->buftail += i;  + p->buftail += i;
707  + }   }
708  + p->bufhead = p->sizx * 3;  + p->bufhead = p->sizx * 3;
709  + return &(p->buf[0]);  + return &(p->buf[0]);
710  +}  +}
# Line 778  diff -Naur busybox-1.19.0/miscutils/fbsp Line 788  diff -Naur busybox-1.19.0/miscutils/fbsp
788  + sprpix += G.bytes_per_pixel;  + sprpix += G.bytes_per_pixel;
789  + }  + }
790  + }  + }
791   pixel += 3;  + pixel += 3;
792  + rgbpix += G.bytes_per_pixel;  + rgbpix += G.bytes_per_pixel;
793   }  + }
794  + fb_putpixrow(G.x0,j + G.y0,width,rgbline);  + fb_putpixrow(G.x0,j + G.y0,width,rgbline);
795   }  + }
 - free(pixline);  
 - fclose(theme_file);  
796  + free(rgbline);  + free(rgbline);
797  + ppm_close(ppm);  + ppm_close(ppm);
798  + // recalc cfg if centered image  + // recalc cfg if centered image
# Line 828  diff -Naur busybox-1.19.0/miscutils/fbsp Line 836  diff -Naur busybox-1.19.0/miscutils/fbsp
836  + thispix = makecol(pixel[0],pixel[1],pixel[2]);  + thispix = makecol(pixel[0],pixel[1],pixel[2]);
837  + }  + }
838  + memcpy(rgbpix,&thispix,G.bytes_per_pixel);  + memcpy(rgbpix,&thispix,G.bytes_per_pixel);
839  + pixel += 3;   pixel += 3;
840  + rgbpix += G.bytes_per_pixel;  + rgbpix += G.bytes_per_pixel;
841  + }  + }
842  + }  + }
# Line 837  diff -Naur busybox-1.19.0/miscutils/fbsp Line 845  diff -Naur busybox-1.19.0/miscutils/fbsp
845  +readsprites_out:  +readsprites_out:
846  + if (s != NULL) free(s);  + if (s != NULL) free(s);
847  + return NULL;  + return NULL;
848   }  +}
849    +
850  +#define fb_putanim(x,y,n,s) fb_sprite(x + G.x0,y + G.y0,s->h * n,s->h,s,0)  +#define fb_putanim(x,y,n,s) fb_sprite(x + G.x0,y + G.y0,s->h * n,s->h,s,0)
851  +#endif  +#endif
852  +  +
# Line 931  diff -Naur busybox-1.19.0/miscutils/fbsp Line 939  diff -Naur busybox-1.19.0/miscutils/fbsp
939  + g = GF.glyphs + GF.ud.entries[i].fontpos * GF.charsize;  + g = GF.glyphs + GF.ud.entries[i].fontpos * GF.charsize;
940  + break;  + break;
941  + }  + }
942  + }   }
943  +#endif  +#endif
944  + }  + }
945  + *s=c;  + *s=c;
# Line 971  diff -Naur busybox-1.19.0/miscutils/fbsp Line 979  diff -Naur busybox-1.19.0/miscutils/fbsp
979  +   fb_putpixel(nXPos + x, nYPos + y,thispix);  +   fb_putpixel(nXPos + x, nYPos + y,thispix);
980  + }  + }
981  + }  + }
982  + }   }
983  +}  - free(pixline);
984  +  - fclose(theme_file);
985  +   }
986  +/**  
987    
988     /**
989  + *     Draws a string on framebuffer.  + *     Draws a string on framebuffer.
990  + * \param *strString pointer to the string.  + * \param *strString pointer to the string.
991  + */  + */
# Line 1354  diff -Naur busybox-1.19.0/miscutils/fbsp Line 1364  diff -Naur busybox-1.19.0/miscutils/fbsp
1364  +}  +}
1365  +#endif // FONTLOAD  +#endif // FONTLOAD
1366  +#endif // TEXT  +#endif // TEXT
1367    +
1368   /**  +/**
1369    * Parse configuration file    * Parse configuration file
1370  @@ -347,6 +1190,9 @@    * \param *cfg_filename name of the configuration file
1371      */
1372    @@ -347,6 +1200,9 @@
1373   "BAR_WIDTH\0" "BAR_HEIGHT\0"   "BAR_WIDTH\0" "BAR_HEIGHT\0"
1374   "BAR_LEFT\0" "BAR_TOP\0"   "BAR_LEFT\0" "BAR_TOP\0"
1375   "BAR_R\0" "BAR_G\0" "BAR_B\0"   "BAR_R\0" "BAR_G\0" "BAR_B\0"
# Line 1367  diff -Naur busybox-1.19.0/miscutils/fbsp Line 1379  diff -Naur busybox-1.19.0/miscutils/fbsp
1379   #if DEBUG   #if DEBUG
1380   "DEBUG\0"   "DEBUG\0"
1381   #endif   #endif
1382  @@ -354,15 +1200,15 @@  @@ -354,15 +1210,15 @@
1383   char *token[2];   char *token[2];
1384   parser_t *parser = config_open2(cfg_filename, xfopen_stdin);   parser_t *parser = config_open2(cfg_filename, xfopen_stdin);
1385   while (config_read(parser, token, 2, 2, "#=",   while (config_read(parser, token, 2, 2, "#=",
# Line 1386  diff -Naur busybox-1.19.0/miscutils/fbsp Line 1398  diff -Naur busybox-1.19.0/miscutils/fbsp
1398   G.bdebug_messages = val;   G.bdebug_messages = val;
1399   if (G.bdebug_messages)   if (G.bdebug_messages)
1400   G.logfile_fd = xfopen_for_write("/tmp/fbsplash.log");   G.logfile_fd = xfopen_for_write("/tmp/fbsplash.log");
1401  @@ -376,11 +1222,24 @@  @@ -376,11 +1232,24 @@
1402   int fbsplash_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;   int fbsplash_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
1403   int fbsplash_main(int argc UNUSED_PARAM, char **argv)   int fbsplash_main(int argc UNUSED_PARAM, char **argv)
1404   {   {
# Line 1414  diff -Naur busybox-1.19.0/miscutils/fbsp Line 1426  diff -Naur busybox-1.19.0/miscutils/fbsp
1426    
1427   INIT_G();   INIT_G();
1428    
1429  @@ -388,9 +1247,19 @@  @@ -388,9 +1257,19 @@
1430   fb_device = "/dev/fb0";   fb_device = "/dev/fb0";
1431   cfg_filename = NULL;   cfg_filename = NULL;
1432   fifo_filename = NULL;   fifo_filename = NULL;
# Line 1435  diff -Naur busybox-1.19.0/miscutils/fbsp Line 1447  diff -Naur busybox-1.19.0/miscutils/fbsp
1447   // parse configuration file   // parse configuration file
1448   if (cfg_filename)   if (cfg_filename)
1449   init(cfg_filename);   init(cfg_filename);
1450  @@ -406,8 +1275,20 @@  @@ -406,8 +1285,20 @@
1451   full_write(STDOUT_FILENO, "\033[?25l", 6);   full_write(STDOUT_FILENO, "\033[?25l", 6);
1452   }   }
1453    
# Line 1456  diff -Naur busybox-1.19.0/miscutils/fbsp Line 1468  diff -Naur busybox-1.19.0/miscutils/fbsp
1468   if (!fifo_filename)   if (!fifo_filename)
1469   return EXIT_SUCCESS;   return EXIT_SUCCESS;
1470    
1471  @@ -424,31 +1305,137 @@  @@ -424,31 +1315,137 @@
1472   // when last writer closes input end.   // when last writer closes input end.
1473   // The simplest way is to open fifo for writing too   // The simplest way is to open fifo for writing too
1474   // and become an additional writer :)   // and become an additional writer :)

Legend:
Removed from v.1516  
changed lines
  Added in v.1517