⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 windows.c.bak

📁 port of ARM to NOkia 3310 display
💻 BAK
📖 第 1 页 / 共 3 页
字号:
#include "globals.h"



void draw_image(unsigned char X, unsigned char Y, unsigned char SIZEX, unsigned char SIZEY, const char *image)
{
            int space=0x00;
            unsigned char l=0, c=0, q=0, count=0;
            
            space = (SIZEX*SIZEY)/8;
            
            // GRAPHIC ICON 36x36 pixels !!!!
            for(l = 0 ; l != space; ++l)
	     { 
	         for(c = 0; c != 8 ; c ++)
		  {
		           //draw icone with Offset (+1)!
			    if(testbit(image[l],c)) LcdPixel(q+X,c+Y, PIXEL_ON);
			    else  LcdPixel(q+X, c+Y, PIXEL_OFF);
		   }
		   count++;q++;
		   if(count== 36)
		   {
		        count=0;
		        Y += 8;
		        q=0;
		   }
	     }
    return;
}



void draw_select_border(void)
{

    /*draw selec border sub
      border size 25[x]x24[y] 
      start position 2 pixels[x] 
      
       2  25    2
      |_|_____| |________________
      | |         |                          |
      | |         | 24                     |
      | |_____|                          |
      |                                     |
      |                                     |
      |                                     |
      |_____________________|
      
    */
    //SUB
      
    // 6 icons
    switch(menu_counter)
    {
    
       
        //first line icons
        case 0:
        {
           draw_image(2,0,36,32,&tools[0]); 
           break;
        }
        
        case 1:
        {
            draw_image(25,0,36,32,&clock[0]);
	     break;
        }
        
        case 2:
        {
            draw_image(46,0,36,32,&weather[0]); 
            break;
        }
        
        
        //second line icons
        case 3:
        {
            draw_image(0,15,36,32,&batt[0]);
            break;
        }
        
        case 4:
        {
           
            break;
        }
        
        case 5:
        {
	    break;
        }
    }
    return;
}



/* 
        Draw Full Size Picture
*/
void draw_picture(const char *pic)
{
    int count;


    for(count=0;count != 504;count++)
    {
              LcdCache[count]=pic[count];
    }
    LoWaterMark=0; HiWaterMark=504;
    
    //DRAW BORDER
    draw_select_border();     
    
    return;
}




//draw rectangular window 
void Draw_Window(unsigned char sxa,unsigned char syb, unsigned char xa, unsigned char yb, const char *text, const char *text1)

{
	/*   
	     size
		xa, yb
	     start 
		sxa, sxb
        */
	
	//variables
	unsigned char q,c,l,m,oldX, oldY, count, Xoffset, Yoffset;
		
	//initialize
	oldX=sxa;
	oldY=syb;
	
	Xoffset=15;
	Yoffset=1;
	
	
	// CREATE WINDOW 
	
	//clear window insight
	for(l=oldX+1; l!= xa+oldX; l++)
	{
		for(m=oldY+1; m!= yb+oldY; m++)	LcdPixel(l, m, PIXEL_OFF);
	}
	
	
	// DRAW BORDER
	//x1
	LcdLine(oldX, oldY, xa+oldX, oldY, PIXEL_ON);
	//y1
	LcdLine(xa+oldX, oldY, xa+oldX, yb+oldY, PIXEL_ON);
	//y2
	LcdLine(xa+oldX, yb+oldY, oldX, yb+oldY, PIXEL_ON);
	//x2
	LcdLine(oldX, yb+oldY, oldX, oldY, PIXEL_ON);
	
	
	// GRAPHIC ICON 8x8 pixels !!!!
	for(q = 0 ; q != 8; ++q)
	{
		for(c = 0; c != 8 ; c ++)
		{
			//draw icone with Offset (+1)!
			if(testbit(info[q],c)) LcdPixel(q+sxa+1,c+syb+1, PIXEL_ON);
			else  LcdPixel(q+sxa+1, c+syb+1, PIXEL_OFF);
		}
	}
	
	
	//// TITLE TEXT 5x8 font!!!!
	count=strlen(text);
	for(l=0;l!=count;l++)
	{
		for(q = 0 ; q != 5; ++q)
		{
			for(c = 0; c != 8 ; c ++)
			{
				//draw icone with Offset!
				if(testbit(FontLookup[*text][q],c)) 
				LcdPixel(q+sxa+Xoffset,c+syb+Yoffset, PIXEL_ON);
				else  
				LcdPixel(q+sxa+Xoffset, c+syb+Yoffset, PIXEL_OFF);
			}
		}
		//next char
		*text++;	
		//Offset for next char
		Xoffset+=5;
	}
	
	//Line #1
	LcdLine(oldX,oldY+9,(xa)+oldX,oldY+9, PIXEL_ON);
	
	
	//// TEXT INSIGHT WINDOW
	//text coordinates insight window
	Yoffset+=12; Xoffset=2;
		
	count=strlen(text1);
	for(l=0;l!=count;l++)
	{
		for(q = 0 ; q != 5; ++q)
		{
			for(c = 0; c != 8 ; c ++)
			{
				//draw icone with Offset!
				if(testbit(FontLookup[*text1][q],c)) 
				LcdPixel(q+sxa+Xoffset,c+syb+Yoffset, PIXEL_ON);
				else  
				LcdPixel(q+sxa+Xoffset, c+syb+Yoffset, PIXEL_OFF);
			}
		}
		//next char
		*text1++;	
		//Offset for next char
		Xoffset+=5;
	}
	
	
  
	return;
}





// Main Window 48x84
const char mainwin[]=
{
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0xE0,    /*  @@@.....  */
0x10,    /*  ...@....  */
0x08,    /*  ....@...  */
0xF8,    /*  @@@@@...  */
0x80,    /*  @.......  */
0x80,    /*  @.......  */
0x80,    /*  @.......  */
0xF8,    /*  @@@@@...  */
0x18,    /*  ...@@...  */
0xB0,    /*  @.@@....  */
0xE0,    /*  @@@.....  */
0x00,    /*  ........  */
0xF0,    /*  @@@@....  */
0x08,    /*  ....@...  */
0xE8,    /*  @@@.@...  */
0x08,    /*  ....@...  */
0xF0,    /*  @@@@....  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0xC0,    /*  @@......  */
0xA0,    /*  @.@.....  */
0xE0,    /*  @@@.....  */
0xE0,    /*  @@@.....  */
0xC0,    /*  @@......  */
0x20,    /*  ..@.....  */
0x90,    /*  @..@....  */
0x20,    /*  ..@.....  */
0xC0,    /*  @@......  */
0xA0,    /*  @.@.....  */
0xE0,    /*  @@@.....  */
0xE0,    /*  @@@.....  */
0xC0,    /*  @@......  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0xC0,    /*  @@......  */
0x30,    /*  ..@@....  */
0xC0,    /*  @@......  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x30,    /*  ..@@....  */
0x4C,    /*  .@..@@..  */
0x30,    /*  ..@@....  */
0x80,    /*  @.......  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x01,    /*  .......@  */
0x02,    /*  ......@.  */
0xFE,    /*  @@@@@@@.  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0xFE,    /*  @@@@@@@.  */
0xFE,    /*  @@@@@@@.  */
0x03,    /*  ......@@  */
0x01,    /*  .......@  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x0F,    /*  ....@@@@  */
0xF0,    /*  @@@@....  */
0x97,    /*  @..@.@@@  */
0xF0,    /*  @@@@....  */
0x0F,    /*  ....@@@@  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0xC0,    /*  @@......  */
0x30,    /*  ..@@....  */
0x88,    /*  @...@...  */
0x84,    /*  @....@..  */
0x04,    /*  .....@..  */
0x82,    /*  @.....@.  */
0x82,    /*  @.....@.  */
0x82,    /*  @.....@.  */
0x8A,    /*  @...@.@.  */
0x46,    /*  .@...@@.  */
0x26,    /*  ..@..@@.  */
0x16,    /*  ...@.@@.  */
0x0C,    /*  ....@@..  */
0x0C,    /*  ....@@..  */
0x98,    /*  @..@@...  */
0x70,    /*  .@@@....  */
0xE0,    /*  @@@.....  */
0x80,    /*  @.......  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x70,    /*  .@@@....  */
0x39,    /*  ..@@@..@  */
0x6C,    /*  .@@.@@..  */
0x26,    /*  ..@..@@.  */
0x72,    /*  .@@@..@.  */
0x3B,    /*  ..@@@.@@  */
0x7F,    /*  .@@@@@@@  */
0x3F,    /*  ..@@@@@@  */
0xFF,    /*  @@@@@@@@  */
0xFF,    /*  @@@@@@@@  */
0x7F,    /*  .@@@@@@@  */
0x3F,    /*  ..@@@@@@  */
0x7E,    /*  .@@@@@@.  */
0x3E,    /*  ..@@@@@.  */
0x7C,    /*  .@@@@@..  */
0x38,    /*  ..@@@...  */
0x70,    /*  .@@@....  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x1C,    /*  ...@@@..  */
0x22,    /*  ..@...@.  */
0x41,    /*  .@.....@  */
0x7D,    /*  .@@@@@.@  */
0x04,    /*  .....@..  */
0x04,    /*  .....@..  */
0x05,    /*  .....@.@  */
0x7D,    /*  .@@@@@.@  */
0x63,    /*  .@@...@@  */
0x36,    /*  ..@@.@@.  */
0x1C,    /*  ...@@@..  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x20,    /*  ..@.....  */
0x7F,    /*  .@@@@@@@  */
0x20,    /*  ..@.....  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x00,    /*  ........  */
0x01,    /*  .......@  */
0x06,    /*  .....@@.  */
0x08,    /*  ....@...  */
0x10,    /*  ...@....  */
0x50,    /*  .@.@....  */
0x20,    /*  ..@.....  */
0x20,    /*  ..@.....  */
0x30,    /*  ..@@....  */
0x38,    /*  ..@@@...  */
0x30,    /*  ..@@....  */
0x30,    /*  ..@@....  */
0x30,    /*  ..@@....  */
0x58,    /*  .@.@@...  */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -