Beispiel #1
0
QState PSConsole::ChangeModeMenu(PSConsole *me, QEvent const *e) 
{
    switch (e->sig) 
    {
        case Q_ENTRY_SIG:
            PrintMenuTitles(UPDWN_MENU_COUNT, menuUpDown);
            PrintMode();
            return Q_HANDLED();
        case MENU_SELECT_SIG: 
        {
            uint8_t new_value;
            
            switch (((MenuSelectEvt*)e)->item_index)
            {
            case 0:
                return Q_TRAN(&PSConsole::ChangeSettingsMenu);
            case 2:
                StepUp<uint8_t>((PTP*)&Ps, PS_DPC_ShootingMode);
                PrintMode();
                return Q_HANDLED();
            case 1:
                StepDown<uint8_t>((PTP*)&Ps, PS_DPC_ShootingMode);
                PrintMode();
                return Q_HANDLED();
            } // switch (((MenuSelectEvt*)e)->item_index)
        } // case MENU_SELECT_SIG:
    }
    return Q_SUPER(&PSConsole::Active);
}
Beispiel #2
0
void PSConsole::ShowParams()
{
    PrintMode();
    PrintAperture();
    PrintShutterSpeed();
    PrintWB();
    PrintIso();
    PrintExpCompensation();
    PrintCamOutput();
    PrintZoom();
}
Beispiel #3
0
int main(int argc, char * argv[])
{
   W_mode mode = {0, 640, 480, 16, 0, 1, 0, 0, 0, 0, 0, 0, 0};

   fputs("testfullscreen: info: going to 640x480x16 fullscreen for 2 seconds\n", stdout);

   if(!W_CreateWindow("Test Window", NULL, 0, &mode, NULL))
   {
      fputs("testfullscreen: test failed: W_CreateWindow failed for mode:\n  ", stderr);
      PrintMode(&mode, stderr);
      fputs("\n", stderr);
      return 1;
   }

   WaitASec();

   W_DestroyWindow();
   fputs("testfullscreen: test succeeded\n", stdout);
   return 0;
}
Beispiel #4
0
//
//Traverse a directory.The data blocks are 
//mapped to the directory entry strcuture and 
//assign the details of the files into the guifile structure.
//
void printinode(enum DISK_TYPE disk,DWORD peslb,DWORD inode)
{   
	int k=0,i,num=0,small_size=0;
	WORD sindblock ;
	DWORD prev_rec_len=0;
	int count =0,isam;
	BYTE inodebuf[512],indbuf[512];
	BYTE sindbuf[4096];
	BYTE dirbuf[4097];
	DWORD past=0,inodesam;
	DWORD n=0,m=0 ,j;

	if((size==1024)||(size ==2048))
		n=4;
	else if(size==4096)
		n=8;

	if(ReadDiskSector(groupdescr,disk,peslb+n,1)==FALSE) 
		PrintError("Can not read disk sector");
	grblock=(struct group *)malloc(sizeof(struct group));
	grblock=(struct group *)groupdescr;
	do
	{
		inodesam=Inode_to_Lba(inode);
		if(ReadDiskSector(inodebuf,disk,peslb+inodesam,1)==FALSE)
			PrintError("Can not read disk sector");
		sb = (struct super_block *)buf;
		i=Get_Index(inode);
		intab[i]=(struct ext2_inode *)&inodebuf[i*128];
		k=(intab[i]->i_mode&0xF000)>>12 ;
   
	 /********************READING DIRECTORY ENTRY **********************/
	 //printf("******DIRECT DATA BLOCKS\n");
		for(k=0;k<12;k++)
		{
	
			if(intab[i]->i_block[k]!=0)
			{
				prev_rec_len=0;
				if(ReadDiskSector(dirbuf,disk,peslb+(size/512)*intab[i]->i_block[k],size/512)==FALSE)
					{
						MessageBox(NULL , "Cannot Read Disk Sector ", "Error" , MB_OK);
						exit(0);
						return;
					}
		 //printf("\n*****directory Entry*****%d\n",k);
				do
				{
					direntry=(struct ext2_dir_entry_2*)&dirbuf[prev_rec_len];			 
					strcpy(dirbuf,"");
					if(strcmp(direntry->name,".")==0){ present_inode=direntry->inode;goto da;}
					if(strcmp(direntry->name,"..")==0){ past=direntry->inode;}
					for(j=0;j<direntry->name_len;j++)
					{
						guifile[count].filename[j] = direntry->name[j];
					}
					guifile[count].filename[direntry->name_len]='\0';
					guifile[count].inode = direntry->inode;
					inodesam=Inode_to_Lba(direntry->inode);
					if(ReadDiskSector(indbuf,disk,peslb+inodesam,1)==FALSE)
						PrintError("Can not read disk sector");
					isam = Get_Index(direntry->inode);
					intab1[isam]=(struct ext2_inode *)&indbuf[isam*128];
					guifile[count].isize=intab1[isam]->i_size;
					guifile[count].file_type=direntry->file_type;
					strncpy(guifile[count].acrights,PrintMode(intab1[isam]->i_mode),13);
					count++;
			da:
					if(direntry->rec_len+prev_rec_len>=size) goto a;
					prev_rec_len = direntry->rec_len+prev_rec_len;
					
				} while(direntry->rec_len>0);
			}a: ;
		}
	 //*********************READING DATA BLOCK ************************
	 //singly indirect block 
       
	 
		if(intab[i]->i_block[12]!=0)
		{ 
		//printf("******SINGLY INDIRECT DATA BLOCK\n");
			sindblock=size/4;
			if(ReadDiskSector(sindbuf,disk,peslb+(size/512)*intab[i]->i_block[12],size/512)==FALSE)
				PrintError("Can not read disk sector");
			sind=(struct sindirect*)sindbuf;
			for(j=0;j<sindblock;j++)
			{     
				prev_rec_len=0;
				if(sind->add[j]!=0)
				{
					if(ReadDiskSector(dirbuf,disk,peslb+(size/512)*sind->add[j],8)==FALSE)
						PrintError("Can not read disk sector");
				//printf("\n*****directory Entry*****\n");
					do
					{
						direntry=(struct ext2_dir_entry_2*)&dirbuf[prev_rec_len];
						strcpy(dirbuf,"");
						//for(k=0;k<direntry->name_len;k++)
							//printf("%c",direntry->name[k]);
						direntry->name[direntry->name_len]='\0';
						strcpy(guifile[count].filename,direntry->name);
						guifile[count].inode = direntry->inode;
						inodesam=Inode_to_Lba(direntry->inode);
						if(ReadDiskSector(indbuf,disk,peslb+inodesam,1)==FALSE)
							PrintError("Can not read disk sector");
						isam = Get_Index(direntry->inode);
						intab1[isam]=(struct ext2_inode *)&indbuf[isam*128];
						guifile[count].file_type=direntry->file_type;
						strncpy(guifile[count].acrights,PrintMode(intab1[isam]->i_mode),13);
						count++;	
						if(direntry->rec_len+prev_rec_len>=size) goto b;
						prev_rec_len = direntry->rec_len+prev_rec_len;

					} while(direntry->rec_len>0);
				}
			b:;	 
			}
	 
		}
	//end:
	 num_files = count;
	 	
	}while(ch=='y');
}