// ----------------------------------------------------------------------------
// CCreate2WayVideoSessionDialog::PreLayoutDynInitL()
// .
// ----------------------------------------------------------------------------
//
void CCreate2WayVideoSessionDialog::PreLayoutDynInitL()
    {
    CEikEdwin* edwinPoCAddress = static_cast<CEikEdwin*>(
                               Control( ESessionDialog2WayVideoRecipientAddress ) );
      
    TBuf<KBufLength> defaultAddress;
    defaultAddress.Copy(iParams->iRecipentAddress);
    edwinPoCAddress->SetTextL(&defaultAddress);
    edwinPoCAddress->SetCursorPosL(defaultAddress.Length(),EFalse);
    
    CAknPopupFieldText* popupFieldText = 
        static_cast <CAknPopupFieldText*> (Control(ESessionDialog2WayVideoVideoCodec));
        
    popupFieldText->SetCurrentValueIndex(0);
    
    popupFieldText = 
        static_cast <CAknPopupFieldText*> (Control(ESessionDialog2WayVideoAudioCodec));
        
    popupFieldText->SetCurrentValueIndex(0);
    
    popupFieldText = 
        static_cast <CAknPopupFieldText*> (Control(ESessionDialog2WayVideoViewFinder));
        
    popupFieldText->SetCurrentValueIndex(0);
    
    popupFieldText = 
        static_cast <CAknPopupFieldText*> (Control(ESessionDialog2WayVideoCamera));
        
    popupFieldText->SetCurrentValueIndex(0);
    
    CAknForm::PreLayoutDynInitL();
    }
Esempio n. 2
0
bool TimerTraits::traits_del_unlocked (TimerTraits::Index & idx)
{
    bool ret = false;

    if (idx.valid)
    {
        ControlSet::iterator i = _timer_set.lower_bound(Control(idx.era, idx.msec));
        ControlSet::iterator j = _timer_set.upper_bound(Control(idx.era, idx.msec));

        for (; i != j; i++)
        {
            const Control & ctrl = (*i);

            if ((idx.value && !(ctrl._value & idx.value)))
                continue;

            if (((idx.func && ctrl._func == idx.func) || !idx.func) && ((idx.data && ctrl._data == idx.data) || !idx.data))
            {
                if (_timer_set.begin() == i)
                    _condition.signal();

                _timer_set.erase(i);

                ret = true;
                break;
            }
        }

        idx.valid = false;
    }

    return ret;
}
void
JoystickKeyboardController::process_hat_event(const SDL_JoyHatEvent& jhat)
{
  Uint8 changed = hat_state ^ jhat.value;

  if (wait_for_joystick >= 0)
  {
    if (changed & SDL_HAT_UP && jhat.value & SDL_HAT_UP)
      bind_joyhat(jhat.which, SDL_HAT_UP, Control(wait_for_joystick));

    if (changed & SDL_HAT_DOWN && jhat.value & SDL_HAT_DOWN)
      bind_joyhat(jhat.which, SDL_HAT_DOWN, Control(wait_for_joystick));

    if (changed & SDL_HAT_LEFT && jhat.value & SDL_HAT_LEFT)
      bind_joyhat(jhat.which, SDL_HAT_LEFT, Control(wait_for_joystick));

    if (changed & SDL_HAT_RIGHT && jhat.value & SDL_HAT_RIGHT)
      bind_joyhat(jhat.which, SDL_HAT_RIGHT, Control(wait_for_joystick));

    MenuStorage::get_joystick_options_menu()->update();
    wait_for_joystick = -1;
  }
  else
  {
    if (changed & SDL_HAT_UP)
    {
      HatMap::iterator it = joy_hat_map.find(std::make_pair(jhat.which, SDL_HAT_UP));
      if (it != joy_hat_map.end())
        set_joy_controls(it->second, jhat.value & SDL_HAT_UP);
    }

    if (changed & SDL_HAT_DOWN)
    {
      HatMap::iterator it = joy_hat_map.find(std::make_pair(jhat.which, SDL_HAT_DOWN));
      if (it != joy_hat_map.end())
        set_joy_controls(it->second, jhat.value & SDL_HAT_DOWN);
    }

    if (changed & SDL_HAT_LEFT)
    {
      HatMap::iterator it = joy_hat_map.find(std::make_pair(jhat.which, SDL_HAT_LEFT));
      if (it != joy_hat_map.end())
        set_joy_controls(it->second, jhat.value & SDL_HAT_LEFT);
    }

    if (changed & SDL_HAT_RIGHT)
    {
      HatMap::iterator it = joy_hat_map.find(std::make_pair(jhat.which, SDL_HAT_RIGHT));
      if (it != joy_hat_map.end())
        set_joy_controls(it->second, jhat.value & SDL_HAT_RIGHT);
    }
  }

  hat_state = jhat.value;
}
Esempio n. 4
0
void CStopwatchForm::PreLayoutDynInitL()
{
    CEikDurationEditor* durationEd = (CEikDurationEditor*)Control( EStopwatchSettingDuration );
    durationEd->SetDuration( iData->iDuration );

    CAknPopupFieldText* popupFieldTextWhen = (CAknPopupFieldText*)Control( EStopwatchSettingPlayWhen );
    popupFieldTextWhen->SetCurrentValueIndex( iData->iPlayWhenIndex );

    CAknPopupFieldText* popupFieldTextWhat = (CAknPopupFieldText*)Control( EStopwatchSettingPlayWhat );
    popupFieldTextWhat->SetCurrentValueIndex( iData->iPlayWhatIndex );
}
Esempio n. 5
0
File: main.c Progetto: reveriel/uCOS
int main(void)
{

	int i = 100000000;
	int j = 10000000;
	int  cnt = 1000;
	delay_init();

	led_Configuration();
	MPU6050_Configuration();
//	PWM_Configuration();
	TIM3_PWM_Init();
	TIM1_PWM_Init();
	TIM2_PWM_Init();
	
//	SysTick_Config(SystemCoreClock / 1000); // ms
	
	CtrData = CTRL_UP;
	
	while (i-- > 0) {
		while (j-- > 0) {
			;
		}
	}
	while (1) {
		
		
		if(schedulercnt_2ms >= 2)
		{	 
			if (cnt > 0)
			{
				//读加速度计和陀螺仪数据
				READ_MPU6050();
					//飞控函数
				Control();
				//PWM波输出函数
				PWMControl(PWM);
				cnt--;
			}
			else {
				CtrData = CTRL_STOP;
				Control();
				PWMControl(PWM);
				
			}
			
		schedulercnt_2ms = 0;
	    }
		

		
	}
	
}
void CRecordFormatOptionsDialog::PreLayoutDynInitL()
	{
	// set up bit rate, sample, channel, codec lists
	CFormatOptionsDialog::PreLayoutDynInitL();
	// add gain and balance, which are recording specific parameters
    CEikNumberEditor* gain = static_cast<CEikNumberEditor*>(Control(EGain));
	gain->SetMinimumAndMaximum(0,iMaxGain);
	gain->SetNumber(iMaxGain/2);
    CEikNumberEditor* balance = static_cast<CEikNumberEditor*>(Control(EBalance));
	balance->SetMinimumAndMaximum(KMMFBalanceMaxLeft,KMMFBalanceMaxRight);
	balance->SetNumber(KMMFBalanceCenter);
	}
Esempio n. 7
0
void CSettingsDialog::PreLayoutDynInitL()
	{
	// Populate dialog with initial settings
	CEikEdwin* name=(CEikEdwin*)Control(EServerName);
	name->SetTextL(&iConnectSettings.iAddress);
	CEikEdwin* page=(CEikEdwin*)Control(EPage);
	TBuf<KSettingFieldWidth> temp;
	temp.Copy(iConnectSettings.iPage);
	page->SetTextL(&temp);
	CEikNumberEditor* port = (CEikNumberEditor*)Control(EPort);
	port->SetNumber(iConnectSettings.iPortNum);
	}
TBool CRecordFormatOptionsDialog::OkToExitL(TInt /*aKeycode*/)
	{
	// get bit rate, sample, channel, codec settings
	CFormatOptionsDialog::OkToExitL(0);
	// get gain and balance, which are recording specific parameters
    CEikNumberEditor* gain = static_cast<CEikNumberEditor*>(Control(EGain));
	iRecordFormatOptions.iGain = gain->Number();
    CEikNumberEditor* balance = static_cast<CEikNumberEditor*>(Control(EBalance));
	iRecordFormatOptions.iBalance = balance->Number();
	iRecordFormatOptions.iGainSet = iRecordFormatOptions.iBalanceSet = ETrue;

	return ETrue;
	}
Esempio n. 9
0
TBool CStopwatchForm::SaveFormDataL()
{
    CEikDurationEditor* durationEd = (CEikDurationEditor*)Control( EStopwatchSettingDuration );
    iData->iDuration=durationEd->Duration();

    CAknPopupFieldText* popupFieldTextWhen = (CAknPopupFieldText*)Control( EStopwatchSettingPlayWhen );
    iData->iPlayWhenIndex=(TStopwatchData::TPlayWhen)popupFieldTextWhen->CurrentValueIndex();

    CAknPopupFieldText* popupFieldTextWhat = (CAknPopupFieldText*)Control( EStopwatchSettingPlayWhat );
    iData->iPlayWhatIndex=(TStopwatchData::TPlayWhat)popupFieldTextWhat->CurrentValueIndex();

    return ETrue;
}
Esempio n. 10
0
TBool CSettingsDialog::OkToExitL(TInt /*aButtonId*/)
	{
	// Store dialog input
	CEikEdwin* name=(CEikEdwin*)Control(EServerName);
	name->GetText(iConnectSettings.iAddress);
	CEikEdwin* page=(CEikEdwin*)Control(EPage);
	TBuf<KSettingFieldWidth> temp;
	page->GetText(temp);
	iConnectSettings.iPage.Copy(temp);
	CEikNumberEditor* port = (CEikNumberEditor*)Control(EPort);
	iConnectSettings.iPortNum = port->Number();

	return ETrue;
	}
main()
{
	int a,b,n;
	char c[10];
	Player p;
	PlayerList pl;
	p = GetInitPlayer();
	pl = GetDefaultPlayerList();
	SetPlayerListFromFile(pl,FILENAME);
	do
	{
		menu(pl);
		gets(c);
		fflush(stdin);
		n=Input(pl,c);
		Control(pl,n);


	
	
	
	}while(1);
		
	

}
Esempio n. 12
0
TimerTraits::Index TimerTraits::traits_add_unlocked (unsigned int msecs, const void * func, const void * data, unsigned int value)
{
    unsigned int ms_tick = TimerTraits::tick();

    unsigned int ms_left =  UINT_MAX - ms_tick;
    unsigned int ms_real =  msecs;

    unsigned int age_num = _age_count;

    if (ms_left < msecs)
    {
        ms_real -= ms_left;
        ++age_num;
    }
    else
    {
        ms_real += ms_tick;
    }

    ControlSet::iterator it = _timer_set.insert(Control(age_num,ms_real,func,data,value));

    if (_timer_set.size() == 1 || _timer_set.begin() == it)
    {
        _condition.signal();
    };

    return Index(age_num, ms_real, msecs, func, data, value);
}
Esempio n. 13
0
static int         GetTextureFileName (lua_State          *State)
 {
  P3DPlugLUAControl                    Control(State);
  const char                          *TexName;

  TexName = Control.GetArgString(1);

  Control.Commit();

   {
    std::string    FileName = P3DApp::GetApp()->GetTexFS()->Generic2System(TexName);

    if (FileName.empty())
     {
      Control.PushString(TexName);
     }
    else
     {
      Control.PushString(FileName.c_str());
     }
   }

  Control.Commit();

  return(1);
 }
Esempio n. 14
0
returnValue DiscreteTimeExport::setDifferentialEquation(	const Expression& rhs_ )
{
	if( rhs_.getDim() > 0 ) {
		Parameter         dummy0;
		Control           dummy1;
		DifferentialState dummy2;
		AlgebraicState 	  dummy3;
		DifferentialStateDerivative dummy4;
		dummy0.clearStaticCounters();
		dummy1.clearStaticCounters();
		dummy2.clearStaticCounters();
		dummy3.clearStaticCounters();
		dummy4.clearStaticCounters();

		NX2 = rhs_.getDim() - NXA;
		x = DifferentialState(NX1+NX2);
		z = AlgebraicState(NXA);
		dx = DifferentialStateDerivative(NDX);
		u = Control(NU);
		p = Parameter(NP);

		DifferentialEquation f;
		f << rhs_;

		DifferentialEquation g;
		for( uint i = 0; i < rhs_.getDim(); i++ ) {
			g << forwardDerivative( rhs_(i), x );
			g << forwardDerivative( rhs_(i), u );
			// There are not supposed to be algebraic states or differential state derivatives !
		}

		return (rhs.init( f,"acado_rhs",NX,NXA,NU ) & diffs_rhs.init( g,"acado_diffs",NX,NXA,NU ) );
	}
	return SUCCESSFUL_RETURN;
}
Esempio n. 15
0
// -----------------------------------------------------------------------------
// CLandmarksEditDialog::FetchFloatL
// 
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CLandmarksEditDialog::FetchFloatL(
    TRealX& aFloat, 
    TInt aEditorResourceId, 
    TInt aErrorResourceId)
    {
    const TChar KDecimalPoint = '.';
    TBuf<KPosLmMaxTextFieldLength> textFieldValue;
    TLex fieldLex;
    TInt result(KErrNone);
    CEikEdwin* editor = static_cast <CEikEdwin*> (Control(aEditorResourceId));

    editor->GetText(textFieldValue);
    if (textFieldValue == KNullDesC)
        {
        // User has indicated that he/she wants this value to be undefined.
        aFloat.SetNaN();
        }
    else 
        {
        // Try to extract value
        fieldLex = textFieldValue;
        TReal floatValue(0);
        result = fieldLex.Val(floatValue, KDecimalPoint);
        if (result != KErrNone)
            {
            NotifyErrorToUserL(aErrorResourceId);
            }

        // Update output parameter
        User::LeaveIfError(aFloat.Set(floatValue));
        }
    }
Esempio n. 16
0
/**
 * Re-enables user control
 */
void ControlOn() {
	if (!TinselV2) {
		Control(CONTROL_ON);
		return;
	}

	g_bEnableMenu = false;

	if (g_controlState == CONTROL_OFF) {
		// Control is on
		g_controlState = CONTROL_ON;

		// Restore cursor to where it was
		if (g_bStartOff == true)
			g_bStartOff = false;
		else
			SetCursorXY(g_controlX, g_controlY);

		// Re-instate cursor
		UnHideCursor();

		// Turn tags back on
		if (!InventoryActive())
			EnableTags();
	}
}
TBool CFormatOptionsDialog::OkToExitL(TInt /*aKeycode*/)
	{
	CEikChoiceList* list = static_cast<CEikChoiceList*>(Control(ECodecs));
	if (list->IsVisible()) 
		{iFormatOptions.i4CC = iDataTypes[list->CurrentItem()]; iFormatOptions.i4CCSet = ETrue; }
	list = static_cast<CEikChoiceList*>(Control(EBitRates));
	if (list->IsVisible()) 
		{iFormatOptions.iBitRate = iBitRates[list->CurrentItem()]; iFormatOptions.iBitRateSet = ETrue; }
	list = static_cast<CEikChoiceList*>(Control(ESampleRates));
	if (list->IsVisible()) 
		{iFormatOptions.iSampleRate = iSampleRates[list->CurrentItem()]; iFormatOptions.iSampleRateSet = ETrue; }
	list = static_cast<CEikChoiceList*>(Control(EChannels));
	if (list->IsVisible()) 
		{iFormatOptions.iChannel = iChannels[list->CurrentItem()]; iFormatOptions.iChannelSet = ETrue; }
	return ETrue;
	}
Esempio n. 18
0
//---------------------------------------------------------------
void main()
{
   int i,j;
   clrscr();

   for(i=0;i<9;i++)     // flush all the arrays
      for(j=0;j<9;j++)
	 cnt = arr[i][j] = stat[i][j] = puzz[i][j] = hnt[i][j] = 0;

   int gd=DETECT,gm;
   initgraph(&gd, &gm,path);

   if(LOAD)  loading();

   clrscr();
   initgraph(&gd, &gm,path);

   setbkcolor(BLACK);
   rectangle(0,27,637,477);
   setfillstyle(1,BLUE);
   floodfill(25,30,15);
   frame(20,100,90,460,LIGHTRED,RED,GREEN);

   _1.draw();   _4.draw();   _7.draw();
   _2.draw();   _5.draw();   _8.draw();
   _3.draw();   _6.draw();   _9.draw();
   _ER.draw();

   ext_button();
   menubar();
   maze();
   fill_maze();
   Control();
}
Esempio n. 19
0
void OSD::Init()
{
    //PIN_MODE(PORTB, PB3,OUTPUT);
    //PIN_MODE(MAX7456_VSYNC, INPUT);
    //DIGITAL_WRITE(MAX7456_VSYNC,HIGH); //enabling pull-up resistor
    DDRB |= _BV(PB3);

    DetectMode();

    //DIGITAL_WRITE(PORTB, PB3,LOW);
    Select();;
    //read black level register
    spi_transfer(MAX7456_OSDBL_reg_read);//black level read register
    byte osdbl_r = spi_transfer(0xff);
    spi_transfer(MAX7456_VM0_reg);
    spi_transfer(MAX7456_RESET | video_mode);
    delay(50);
    //set black level
    byte osdbl_w = (osdbl_r & 0xef); //Set bit 4 to zero 11101111
    spi_transfer(MAX7456_OSDBL_reg); //black level write register
    spi_transfer(osdbl_w);

    // set all rows to same charactor white level, 90%
    for (uint8_t x = 0; x < MAX7456_screen_rows; x++)
    {
        spi_transfer(x + 0x10);
        spi_transfer(MAX7456_WHITE_level_120);
    }
    // define sync (auto,int,ext) and
    // making sure the Max7456 is enabled
    Control(1);
}
Esempio n. 20
0
void main()
{
	TxBuf[0]=0x00; 
	Read_18B20_Temperature();
	Read_18B20_Temperature();
	delay1ms(200);
	Read_18B20_Temperature();
	Read_18B20_Temperature();
	delay1ms(200);
	Read_18B20_Temperature();
	Read_18B20_Temperature();
	delay1ms(200);
	nRF24L01_Config();	  //初始化NRF24L01
	SPI_RW_Reg(FLUSH_TX,0);	
	EX1=1;
	IT1=1;
	EA=1;
	init_1602();
	while(1)
	{
		Read_18B20_Temperature();
		keyscan();
		Control();
		display();
		TxBuf[0]=0xAA;
		TxBuf[2]=Tem_dispbuf[4];
		TxBuf[3]=Tem_dispbuf[0]; 
		TxBuf[4]=beep_flag;
		nRF24L01_TxPacket(TxBuf); //发送数据
		delay1ms(10);
	}

}
Esempio n. 21
0
void main()
{
	nRF24L01_Config();
	SetRX_Mode();
	if(MAX_RT)
	{
		SPI_RW_Reg(FLUSH_TX,0);
	}
	SPI_RW_Reg(WRITE_REG+STATUS,0xFF);// clear RX_DR or TX_DS or MAX_RT interrupt flag
    SPI_RW_Reg(FLUSH_RX,0);
	SCON =0x40;
	TMOD = 0x20;
	TH1 = 0xfd;
	TL1 = 0xfd;
	TR1 = 1;
	EX1=1;
	IT1=0;
	EA=1;
	init_1602();
	while(1)
	{
		Control(); 
		display();
		if(RxBuf[0]==0xAA)
		{
			RxBuf[0]=0;
			//PH_dat=RxBuf[1];
			temp_dat=RxBuf[2];
			temp_dot=RxBuf[3];
			beep_flag=RxBuf[4];
		}
		delay1ms(10);
	}
}
void CWebForm::PostLayoutDynInitL()
{
	CAknForm::PostLayoutDynInitL();
	// To Following line change the edit mode
	SetEditableL(ETrue);

	// The following line set to change status
	// This avoid back set form View status in the beginning 
	// Usually without change back do that, like when we start an empty Form.
	SetChangesPending(ETrue);

	TInt list_count=2;
	TInt lists[]={ CL_WEB_FROM_LIST_ID, CL_WEB_TO_LIST_ID };

	for (int list=0; list<list_count; list++) {
		CSavedPoints::TEndPoint p=(CSavedPoints::TEndPoint)list;
		const CDesCArray& texts=iPoints->Points(p);
		if (texts.Count()>0) {
			CAknPopupFieldText* f=(CAknPopupFieldText*)Control(lists[list]);
			CDesCArray* contents=f->iArray;
			contents->Delete(0);
			for (int t=0; t<texts.Count(); t++) {
				contents->AppendL(texts[t]);
			}
			f->SetCurrentValueIndex(0);
			iSaved[list]=true;
		}
	}
}
Esempio n. 23
0
void CProfileListDialog::PreLayoutDynInitL() {
    ButtonGroupContainer().SetDefaultCommand(ECmdProfileListConnect);

    iProfileArray = new (ELeave) CDesCArrayFlat(8);

    // Add default as the first profile
    iProfileArray->AppendL(KDefaultProfileName);

    // Find all profile files from the profile directory and add them to the
    // list    
    RFs &fs = CEikonEnv::Static()->FsSession();
    CDir *dir;
    User::LeaveIfError(fs.GetDir(iProfileDirectory, KEntryAttNormal,
                                 ESortByName, dir));
    CleanupStack::PushL(dir);
    for ( TInt i = 0; i < dir->Count(); i++ ) {
        iProfileArray->AppendL((*dir)[i].iName);
    }
    CleanupStack::PopAndDestroy(); //dir

    // Set profiles to the listbox
    CEikTextListBox *lbox = ((CEikTextListBox*)Control(EProfileListDlgProfileList));
    CTextListBoxModel *lbm = lbox->Model();
    lbm->SetItemTextArray(iProfileArray);
    lbm->SetOwnershipType(ELbmDoesNotOwnItemArray);

    // Enable scroll bars
    CEikScrollBarFrame *sbf = lbox->CreateScrollBarFrameL(ETrue);
    sbf->SetScrollBarVisibilityL(CEikScrollBarFrame::EAuto,
                                 CEikScrollBarFrame::EAuto);

    ButtonGroupContainer().SetDefaultCommand(ECmdProfileListConnect);
}
void
JoystickKeyboardController::process_axis_event(const SDL_JoyAxisEvent& jaxis)
{
  if (wait_for_joystick >= 0)
  {
    if (abs(jaxis.value) > dead_zone) {
      if (jaxis.value < 0)
        bind_joyaxis(jaxis.which, -(jaxis.axis + 1), Control(wait_for_joystick));
      else
        bind_joyaxis(jaxis.which, jaxis.axis + 1, Control(wait_for_joystick));

      MenuStorage::get_joystick_options_menu()->update();
      wait_for_joystick = -1;
    }
  }
  else
  {
    // Split the axis into left and right, so that both can be
    // mapped separately (needed for jump/down vs up/down)
    int axis = jaxis.axis + 1;

    AxisMap::iterator left  = joy_axis_map.find(std::make_pair(jaxis.which, -axis));
    AxisMap::iterator right = joy_axis_map.find(std::make_pair(jaxis.which, axis));

    if(left == joy_axis_map.end()) {
      // std::cout << "Unmapped joyaxis " << (int)jaxis.axis << " moved" << std::endl;
    } else {
      if (jaxis.value < -dead_zone)
        set_joy_controls(left->second,  true);
      else if (jaxis.value > dead_zone)
        set_joy_controls(left->second, false);
      else
        set_joy_controls(left->second, false);
    }

    if(right == joy_axis_map.end()) {
      // std::cout << "Unmapped joyaxis " << (int)jaxis.axis << " moved" << std::endl;
    } else {
      if (jaxis.value < -dead_zone)
        set_joy_controls(right->second, false);
      else if (jaxis.value > dead_zone)
        set_joy_controls(right->second, true);
      else
        set_joy_controls(right->second, false);
    }
  }
}
void
JoystickKeyboardController::process_menu_key_event(const SDL_KeyboardEvent& event)
{
  // wait for key mode?
  if(wait_for_key >= 0) {
    if(event.type == SDL_KEYUP)
      return;

    if(event.keysym.sym != SDLK_ESCAPE
       && event.keysym.sym != SDLK_PAUSE) {
      bind_key(event.keysym.sym, Control(wait_for_key));
    }
    reset();
    MenuStorage::get_key_options_menu()->update();
    wait_for_key = -1;
    return;
  }
  if(wait_for_joystick >= 0) {
    if(event.keysym.sym == SDLK_ESCAPE) {
      reset();
      MenuStorage::get_joystick_options_menu()->update();
      wait_for_joystick = -1;
    }
    return;
  }

  Control control;
  /* we use default keys when the menu is open (to avoid problems when
   * redefining keys to invalid settings
   */
  switch(event.keysym.sym) {
    case SDLK_UP:
      control = Controller::UP;
      break;
    case SDLK_DOWN:
      control = Controller::DOWN;
      break;
    case SDLK_LEFT:
      control = Controller::LEFT;
      break;
    case SDLK_RIGHT:
      control = Controller::RIGHT;
      break;
    case SDLK_SPACE:
    case SDLK_RETURN:
    case SDLK_KP_ENTER:
      control = Controller::MENU_SELECT;
      break;
    case SDLK_ESCAPE:
    case SDLK_PAUSE:
      control = Controller::PAUSE_MENU;
      break;
    default:
      return;
      break;
  }

  controller->set_control(control, (event.type == SDL_KEYDOWN));
}
Esempio n. 26
0
void CWordStyleGallery::DrawEdwinL()
	{
	CEikGlobalTextEditor* edwin=(CEikGlobalTextEditor*)Control(EWordCidStyleInfo);
	TViewYPosQualifier yPosQualifier;
	yPosQualifier.SetMakeLineFullyVisible();
	edwin->TextView()->HandleGlobalChangeL(yPosQualifier); // !! Reconsider this
	edwin->DrawNow();
	}
Esempio n. 27
0
void Menu()
{
	int done = 0;
	int ctrl = 0;

	// Set video mode based on aspect ratio
	if(CONF_GetAspectRatio() == CONF_ASPECT_16_9) isWide = 1;
	setVideoMode();
	drawLogo();

	dListTotal = findPaks();
	dListCurrentPosition = 0;
	if(dListTotal != 1)
	{
		sortList();
		getAllLogs();
		initMenu(1);
		drawMenu();
		pControl = ControlMenu;

		while(!done)
		{
			ctrl = Control();
			switch(ctrl)
			{
				case 1:
				case 2:
					done = 1;
					break;

				case 3:
					drawLogs();
					break;

				case -1:
					drawMenu();
					break;

				case -2:
					// BGM player isn't supported
					break;
			}
		}
		freeAllLogs();
		termMenu();
		if(ctrl == 2)
		{
			if (filelist)
			{
				free(filelist);
				filelist = NULL;
			}
			borExit(0);
		}
	}
	getBasePath(packfile, filelist[dListCurrentPosition+dListScrollPosition].filename, 1);
	free(filelist);
}
Esempio n. 28
0
	/// Enables/disables messages with specific parameters
	static void Control(
		DebugSource source,
		DebugType type,
		DebugSeverity severity,
		bool enable
	)
	{
		Control(source, type, severity, 0, nullptr, enable);
	}
Esempio n. 29
0
// This function init DC.
// set the default parameters.
static void dc_InitDC(PDC pdc, HWND hWnd, BOOL bIsClient)
{
    PCONTROL pCtrl;

    pdc->hwnd = hWnd;
    pdc->gc = PHYSICALGC;

    pdc->bkcolor = PIXEL_lightwhite;
    pdc->bkmode = 0;

    pdc->brushtype = BT_SOLID;
    pdc->brushcolor = PIXEL_lightwhite;
    pdc->BrushOrig.x = pdc->BrushOrig.y = 0;

    pdc->pentype = PT_SOLID;
    pdc->pencolor = PIXEL_black;
    pdc->CurPenPos.x = pdc->CurPenPos.y = 0;

    pdc->textcolor = PIXEL_black;
    if (!(pdc->pLogFont = GetWindowFont (hWnd)))
        pdc->pLogFont = GetSystemFont (SYSLOGFONT_WCHAR_DEF);
    pdc->tabstop = 8;
    pdc->CurTextPos.x = pdc->CurTextPos.y = 0;
    pdc->cExtra = pdc->alExtra = pdc->blExtra = 0;

    pdc->mapmode = MM_TEXT;
    pdc->ViewOrig.x = pdc->ViewOrig.y = 0;
    pdc->ViewExtent.x = pdc->ViewExtent.y = 1;
    pdc->WindowOrig.x = pdc->WindowOrig.y = 0;
    pdc->WindowExtent.x = pdc->WindowExtent.y = 1;

    // assume that the local clip region is empty.
  
    // Get global clip region info and generate effective clip region.
    pdc->pGCRInfo = GetGCRgnInfo (hWnd);

    pthread_mutex_lock (&pdc->pGCRInfo->lock);

    pdc->oldage = pdc->pGCRInfo->age;
    ClipRgnCopy (&pdc->ecrgn, &pdc->pGCRInfo->crgn);

    if (bIsClient)
        WndClientRect (pdc->hwnd, &pdc->DevRC);
    else
        WndRect (pdc->hwnd, &pdc->DevRC);

    pdc->bIsClient = bIsClient;
    if (bIsClient)
        IntersectClipRect (&pdc->ecrgn, &pdc->DevRC);

    pCtrl = Control (pdc->hwnd);
    if (pCtrl && !(pCtrl->dwExStyle & WS_EX_CTRLASMAINWIN))
        RestrictControlECRGN (&pdc->ecrgn, pCtrl);

    pthread_mutex_unlock (&pdc->pGCRInfo->lock);

}
Esempio n. 30
0
/*!	\brief Get transfer statistics for this interface.
	
	\param statistics The structure is copied into this argument.
	
	\return \c true on success, \c false otherwise.
*/
bool
PPPInterface::GetStatistics(ppp_statistics *statistics) const
{
	printf("PPPInterface::GetStatistics\n");
	if (!statistics)
		return false;
	
	return Control(PPPC_GET_STATISTICS, statistics, sizeof(ppp_statistics)) == B_OK;
}