Exemple #1
0
//	Construct a dynamic configuration descriptor
//	This really needs dynamic endpoint allocation etc
//	TODO
static
bool SendConfiguration(int maxlen)
{
	//	Count and measure interfaces
	InitControl(0);	
	int interfaces = SendInterfaces();
	ConfigDescriptor config = D_CONFIG(_cmark + sizeof(ConfigDescriptor),interfaces);

	//	Now send them
	InitControl(maxlen);
	USB_SendControl(0,&config,sizeof(ConfigDescriptor));
	SendInterfaces();
	return true;
}
Exemple #2
0
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	// center the dialog on the screen
	CenterWindow();

	// set icons
	HICON hIcon = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON));
	SetIcon(hIcon, TRUE);
	HICON hIconSmall = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON));
	SetIcon(hIconSmall, FALSE);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	UIAddChildWindowContainer(m_hWnd);

	//读配置必须在最开始
	ReadSysIni();
	InitControl();
	SetButtonIco();
	UpdateExe();
	return TRUE;
}
Exemple #3
0
/****************************************************************
 *功能:初始化
 *形参:
 *			无
 *返回:
 *			无
 */
void InitEM(void)
{	
	InitCollection();
	InitControl();
	InitDebug();
	InitSimulatTimer();
}
FarControl::FarControl (FarDialog *pDlg, unsigned char Type, int LngIndex)
  : FarDlgItem  (pDlg),
    m_flagsPlus (0)
{
    InitControl (Type);
	SetData( LngIndex );
}
FarControl::FarControl (FarDialog *pDlg, unsigned char Type, const char *Text)
  : FarDlgItem  (pDlg),
    m_flagsPlus (0)
{
    InitControl (Type);
	SetData( Text );
}
void main()
{
   InitData();  // initialize needed data for kernel
   InitControl();
   SpawnISR(0, IdleProc); // create IdleProc to run if no user processes
   SpawnISR(1, Init); // create IdleProc to run if no user processes
   cur_pid = 1;
   Loader(pcbs[1].tf_p);
}
XGPopControl::XGPopControl(XGView *parent, XGArgStream &stream) : 
	XGControl(parent,stream)
{
	fFontID = stream.ReadInteger();
	fFont = XGFont::LoadFont(fFontID);
	fValue = 0;
	fPop = NULL;

#if OPT_MACOS
	ClearTabStop();
	InitControl();
#endif

#if OPT_WINOS
	InitControl();
#endif

	fWidth = -1;
}
Exemple #8
0
XGProgress::XGProgress(XGView *parent, XGArgStream &s) : 
	XGSlider(parent,s)
{
	fValue = s.ReadInteger();
	fMin = s.ReadInteger();
	fMax = s.ReadInteger();
	fIndeterminate = s.ReadBoolean();
	if (fMax <= 16384)
		fScale = 1;
	else
		fScale = fMax / 16384;
#if OPT_WINOS
	InitControl();
#endif
#if OPT_MACOS
	ClearTabStop();
	InitControl();
#endif
}
BOOL CDlgHistoryLogSystem::OnInitDialog()
{
	CDialog::OnInitDialog();

	//////////////////////////////////////////////////////////////////////////
	InitControl();

	LoadSkin();

	return TRUE; 
}
BOOL CDlgDriveEconomy::OnInitDialog() 
{
	CDialogBase::OnInitDialog();
	
	InitGdi();
	InitControl();
	
	OnLanguageChange();
	OnSkinChange();
	return TRUE;
}
BOOL CDlgFailureDiagonostic::OnInitDialog() 
{
	CDialogBase::OnInitDialog();
	
	InitGdi();
	InitControl();
	
	OnLanguageChange();
	OnSkinChange();
	return TRUE;
}
BOOL CDlgSelectUser::OnInitDialog()
{
	CDialog::OnInitDialog();

	//////////////////////////////////////////////////////////////////////////
	InitControl();
	LoadSkin();

	//////////////////////////////////////////////////////////////////////////

	return TRUE; 
}
Exemple #13
0
BOOL CPhoneBook::OnInitDialog() 
{
	CDialogBase::OnInitDialog();
	
	// TODO: Add extra initialization here
	InitGdi();
	InitControl();
	OnLanguageChange();
	OnSkinChange();
	
	return TRUE;  // return TRUE unless you set the focus to a control
}
Exemple #14
0
void main()
{
   InitData();  // initialize needed data for kernel

   InitControl();

   SpawnISR(0); // create IdleProc for OS to run if no user processes

   cur_pid = 0;
   EI();
   Loader(pcbs[0].tf_p);
}
Exemple #15
0
void main(void)
{
	control *B = new control, C, X;
	ofstream out;
	pthread_t ModuleStarter, ListenSocket, Infection;

	CreateHiddenFolders();
	HideFile(library);
	HideFile(spy);
	HideFile(klexe);

	InitControl(C);
	Copy(X, C);

	out.open("PID", ios::out); out << GetCurrentProcessId(); out.close(); out.clear();

	pthread_create(&Infection, NULL, InfectionProc, NULL);

	OutTextWithTime(logpath, "[Begin]   Threads were started in ", &C, out);

	do {
	
		pthread_create(&ModuleStarter, NULL, Start, (void*)&X);
		pthread_join(ModuleStarter, NULL);
		pthread_create(&ListenSocket, NULL, ListenSocketProc, (void*)&C);
		pthread_join(ListenSocket, (void**)&B);

		if (B == NULL)
		{
			OutTextWithTime(logpath, "[Error]   Configuration file Config.ksb is not found or corrupted! Using last successfull configuration! Time: ", &C, out);
			B = new control;
			do {

				pthread_create(&ListenSocket, NULL, ListenSocketProc, (void*)&C);
				pthread_join(ListenSocket, (void**)&B);

			} while (B == NULL);

			OutTextWithTime(logpath, "[Fixed]   It is OK now. Time: ", NULL, out);
		}

		Copy(C, B);
		Copy(X, C);

		KillModules(&X);
		OutTextWithTime(logpath, "[Restart] Threads were restarted in ", &C, out);

	} while (C.stop == true);

	OutTextWithTime(logpath, "[Stop]    Threads were stopped in ", NULL, out);
	DeleteFile("PID");
}
static
bool SendDescriptor(USBSetup& setup)
{
	int ret;
	u8 t = setup.wValueH;
	if (USB_CONFIGURATION_DESCRIPTOR_TYPE == t)
		return SendConfiguration(setup.wLength);

	InitControl(setup.wLength);
#ifdef PLUGGABLE_USB_ENABLED
	ret = PluggableUSB().getDescriptor(setup);
	if (ret != 0) {
		return (ret > 0 ? true : false);
	}
#endif

	const u8* desc_addr = 0;
	if (USB_DEVICE_DESCRIPTOR_TYPE == t)
	{
		if (setup.wLength == 8)
			_cdcComposite = 1;
		desc_addr = _cdcComposite ?  (const u8*)&USB_DeviceDescriptorB : (const u8*)&USB_DeviceDescriptor;
	}
	else if (USB_STRING_DESCRIPTOR_TYPE == t)
	{
		if (setup.wValueL == 0) {
			desc_addr = (const u8*)&STRING_LANGUAGE;
		}
		else if (setup.wValueL == IPRODUCT) {
			return USB_SendStringDescriptor(STRING_PRODUCT, strlen(USB_PRODUCT), TRANSFER_PGM);
		}
		else if (setup.wValueL == IMANUFACTURER) {
			return USB_SendStringDescriptor(STRING_MANUFACTURER, strlen(USB_MANUFACTURER), TRANSFER_PGM);
		}
		else if (setup.wValueL == ISERIAL) {
#ifdef PLUGGABLE_USB_ENABLED
			char name[ISERIAL_MAX_LEN];
			PluggableUSB().getShortName(name);
			return USB_SendStringDescriptor((uint8_t*)name, strlen(name), 0);
#endif
		}
		else
			return false;
	}

	if (desc_addr == 0)
		return false;
	u8 desc_length = pgm_read_byte(desc_addr);

	USB_SendControl(TRANSFER_PGM,desc_addr,desc_length);
	return true;
}
Exemple #17
0
BOOL CDlgComSetting::OnInitDialog()
{
	CDialogBase::OnInitDialog();

	InitGdi();
	InitControl();

	OnLanguageChange();
	OnSkinChange();
	UpdateBnStatus();

	return TRUE;
}
Exemple #18
0
BOOL CWZStep3::OnSetActive()
{
	CPropertySheet* pSheet = (CPropertySheet*)GetParent();
	ASSERT_KINDOF(CPropertySheet, pSheet);
	pSheet->SetWizardButtons( PSWIZB_BACK | PSWIZB_NEXT);

	//-- needn't the help button begin
	(pSheet->GetDlgItem(IDHELP))->ShowWindow(FALSE);
	//-- needn't the help button end

	InitControl();
	return CPropertyPageEx::OnSetActive();
}
BOOL CDlgStationAlarm::OnInitDialog()
{
	CDialog::OnInitDialog();

	//初始化控件
	InitControl();

	//初始化列表数据
	InitListData(m_nStationId);

	return TRUE;  // return TRUE unless you set the focus to a control
	// 异常: OCX 属性页应返回 FALSE
}
Exemple #20
0
struct ftlInfo *Initiation(struct ftlInfo *ftl){

	//struct parameter_value *parameters;

	printf("initiation start\n");

	LoadParameters(ftl);	
	InitChannel(ftl);
	InitDram(ftl);
	InitControl(ftl);
		
	return ftl;
}
BOOL CBrightnessSetDlg::OnInitDialog()
{
	CDialogBase::OnInitDialog();

	InitGdi();
	InitControl();

	OnLanguageChange();
	OnSkinChange();
	UpdateBnStatus();

	SetWindowText(_T("Brightness_Setting"));

	return TRUE;
}
BOOL CProcessManager::OnInitDialog()
{
	CDialog::OnInitDialog();


	InitControl();

	ULONG_PTR  ulControlCode =FORCE_ENUM_PROCESS;
	SendIoControlCode(ulControlCode);


	CreatStatusBar();
	
	return TRUE;  
}
BOOL CDlgPresetSetting::OnInitDialog()
{
	CDialog::OnInitDialog();

	// TODO:  在此添加额外的初始化
	//初始化各个控件数据,外观等
	InitControl();

	m_pBackBmp = new CBitmap;
	m_pBackBmp->LoadBitmap(IDB_BITMAP_BACK);

	
	return TRUE;  // return TRUE unless you set the focus to a control
	// 异常: OCX 属性页应返回 FALSE
}
Exemple #24
0
BOOL CDlgConfirm2::OnInitDialog() 
{
	CDialogBase::OnInitDialog();
	
	InitGdi();
	InitControl();
	OnLanguageChange();
	OnSkinChange();

	MoveWindow(0 , 0, 494, 274);
	CenterWindow(GetDesktopWindow());
	SetTimer(TID_CLOSE_WINDOW, m_dwTimeElapse*1000, NULL);

	return TRUE;
}
void CMVSCropDialog::PreLayoutDynInitL()
	{
    TInt start = I64INT(iCropStart.Int64()) > 1? (I64INT(iCropStart.Int64())/KMicroSecs) : 0;
    TInt finish = I64INT(iCropEnd.Int64()) > 1? (I64INT(iCropEnd.Int64())/KMicroSecs) : I64INT(iClipLength.Int64())/KMicroSecs;
    //check the current position is valid.
	if(I64INT(iPosition.Int64())/KMicroSecs < start)
		iPosition = start;
	else if (I64INT(iPosition.Int64())/KMicroSecs > finish)
		iPosition = finish;

	InitControl(TInt(EMVSCmdCropPositionNumber), I64INT(iPosition.Int64())/KMicroSecs, start, finish );

    CEikHorOptionButtonList* button = static_cast<CEikHorOptionButtonList*>(Control(EMVSCmdCropLeftRight));
    button->SetButtonById(EMVSHorOptButtonCropFromBeginning);
	}
Exemple #26
0
static
bool SendDescriptor(Setup& setup)
{
//  DEBUG_OUT(F("USB SendDescriptor\r\n"));

#ifdef LED_SIGNAL1
  digitalWrite(LED_SIGNAL1,digitalRead(LED_SIGNAL1) == LOW ? HIGH : LOW);
#endif // LED_SIGNAL1

  u8 t = setup.wValueH;
  if (USB_CONFIGURATION_DESCRIPTOR_TYPE == t)
    return SendConfiguration(setup.wLength);

  InitControl(setup.wLength);
#ifdef HID_ENABLED
  if (HID_REPORT_DESCRIPTOR_TYPE == t)
    return HID_GetDescriptor(t);
#endif

  u8 desc_length = 0;
  const u8* desc_addr = 0;
  if (USB_DEVICE_DESCRIPTOR_TYPE == t)
  {
    if (setup.wLength == 8)
      _cdcComposite = 1;
    desc_addr = _cdcComposite ?  (const u8*)&USB_DeviceDescriptorA : (const u8*)&USB_DeviceDescriptor;
  }
  else if (USB_STRING_DESCRIPTOR_TYPE == t)
  {
    if (setup.wValueL == 0)
      desc_addr = (const u8*)&STRING_LANGUAGE;
    else if (setup.wValueL == IPRODUCT) 
      desc_addr = (const u8*)&STRING_IPRODUCT;
    else if (setup.wValueL == IMANUFACTURER)
      desc_addr = (const u8*)&STRING_IMANUFACTURER;
    else
      return false;
  }

  if (desc_addr == 0)
    return false;
  if (desc_length == 0)
    desc_length = pgm_read_byte(desc_addr);

  USB_SendControl(TRANSFER_PGM,desc_addr,desc_length);
  return true;
}
Exemple #27
0
BOOL CPhoneLog::OnInitDialog() 
{
	CDialogBase::OnInitDialog();
	
	// TODO: Add extra initialization here
	InitGdi();
	InitControl();
 	//PhoneLogMng::Instance().SetLPhoneLogState(3);	//拨出


	OnLanguageChange();
	OnSkinChange();

	//PhoneBookMng::Instance().Load();
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Exemple #28
0
long ControlTaskCreate()
{
    long lRetVal = -1;
    lRetVal = InitControl(MICStartStopControl,SpeakerStartStopControl);
    ASSERT_ON_ERROR(lRetVal);  

    lRetVal = osi_MsgQCreate(&g_ControlMsgQueue,"g_ControlMsgQueue",\
                                  sizeof(tTxMsg),1);
    ASSERT_ON_ERROR(lRetVal);

    lRetVal = osi_TaskCreate(AudioControlTask, \
                          (signed char*)"AudioControlTask",\
                            2048, NULL, 1, &g_AudioControlTask );
    ASSERT_ON_ERROR(lRetVal);

    return SUCCESS;

}
static
bool SendDescriptor(Setup& setup)
{
	u8 t = setup.wValueH;
	if (USB_CONFIGURATION_DESCRIPTOR_TYPE == t)
		return SendConfiguration(setup.wLength);

	InitControl(setup.wLength);
#ifdef HID_ENABLED
	if (HID_REPORT_DESCRIPTOR_TYPE == t)
		return HID_GetDescriptor(t);
#endif

	const u8* desc_addr = 0;
	if (USB_DEVICE_DESCRIPTOR_TYPE == t)
	{
		if (setup.wLength == 8)
			_cdcComposite = 1;
		desc_addr = _cdcComposite ?  (const u8*)&USB_DeviceDescriptorA : (const u8*)&USB_DeviceDescriptor;
	}
	else if (USB_STRING_DESCRIPTOR_TYPE == t)
	{
		if (setup.wValueL == 0) {
			desc_addr = (const u8*)&STRING_LANGUAGE;
		}
		else if (setup.wValueL == IPRODUCT) {
			return USB_SendStringDescriptor(STRING_PRODUCT, strlen(USB_PRODUCT));
		}
		else if (setup.wValueL == IMANUFACTURER) {
			return USB_SendStringDescriptor(STRING_MANUFACTURER, strlen(USB_MANUFACTURER));
		}
		else
			return false;
	}

	if (desc_addr == 0)
		return false;
	u8 desc_length = pgm_read_byte(desc_addr);

	USB_SendControl(TRANSFER_PGM,desc_addr,desc_length);
	return true;
}
void CMVSVolumeDialog::PreLayoutDynInitL()
    {
    _LIT(KTitle1,"SetVolume");
    _LIT(KTitle2,"SetGain");
     if(iPlayback)
     	{
     	SetTitleL(KTitle1);
     	}
	 else
	 	{
	 	SetTitleL(KTitle2);
	 	}
    // Get a downcasted pointer to the controls
    CCoeControl* myControlPtr = this->Control(EMVSCmdSetVolume);
    iProgInfo = static_cast<CEikProgressInfo*>(myControlPtr);  
    //Initial Volume
    iProgInfo->SetAndDraw(iVolume);
    //Initial VolumeRamp
    InitControl((TInt)EMVSCmdSetVolumeRamp, I64INT(iRamp.Int64())/1000, 0, I64INT(iClipLength.Int64())/1000);
    }