您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ toggle函数代码示例

51自学网 2021-06-03 08:54:58
  C++
这篇教程C++ toggle函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中toggle函数的典型用法代码示例。如果您正苦于以下问题:C++ toggle函数的具体用法?C++ toggle怎么用?C++ toggle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了toggle函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: Q_UNUSED

void NetworkAnalyzerPanel::closeEvent(QCloseEvent *event){    Q_UNUSED(event);    toggle(false);}
开发者ID:wyuka,项目名称:rekonq,代码行数:5,


示例2: chaser_window

//.........这里部分代码省略.........bouton_track_stay(xcha+295, ycha+80, 0);bouton_track_down(xcha+345, ycha+80, 0);break;}//BEGIN POINT // END POINTol::Rect CurseurBeginPoint(ol::Vec2D(xcha+175+(chaser_begin_step_is[chaser_selected]*12),ycha+115),ol::Vec2D(12,12));CurseurBeginPoint.Draw(CouleurFader);if( Midi_Faders_Affectation_Type!=0 && mouse_x>xcha+175+(chaser_begin_step_is[chaser_selected]*12) && mouse_x<xcha+187+(chaser_begin_step_is[chaser_selected]*12)&& mouse_y>ycha+115 && mouse_y<ycha+127)//config midi{CurseurBeginPoint.SetLineWidth(2);CurseurBeginPoint.DrawOutline(CouleurRed);}ol::Rect CurseurEndPoint(ol::Vec2D(xcha+175+(chaser_end_step_is[chaser_selected]*12),ycha+127),ol::Vec2D(12,12));CurseurEndPoint.Draw(CouleurRed);if( Midi_Faders_Affectation_Type!=0 && mouse_x>xcha+175+(chaser_end_step_is[chaser_selected]*12) && mouse_x<xcha+187+(chaser_end_step_is[chaser_selected]*12)&& mouse_y>ycha+127 && mouse_y<ycha+139)//config midi{CurseurEndPoint.SetLineWidth(2);CurseurEndPoint.Draw(CouleurFond);CurseurEndPoint.DrawOutline(CouleurRed);}/////////////////////VIEW TRACK BUTTON////////////////////////////////////////////////bouton_view_track_downup(xcha+580, ycha+35, 0);int upsidedown=1;/////////POSITION TIME LINE + IN OUT POINT VIEW//////////////////////////////////////////////////for(int chcase=0;chcase<nbre_de_cases_par_track;chcase++){upsidedown=toggle(upsidedown);ol::Line(ol::Vec2D(xcha+175+(chcase*12),ycha+115),ol::Vec2D(xcha+175+(chcase*12),ycha+135)).Draw(CouleurLigne.WithAlpha(0.2));petitpetitchiffre.Print(ol::ToString(chcase+1),xcha+175+(chcase*12),ycha+123+(upsidedown*12));}ol::Line(ol::Vec2D(xcha+10,ycha+125),ol::Vec2D(xcha+590,ycha+125)).Draw(CouleurLigne.WithAlpha(0.3));////////////////////////TRACK/////////////////////////////////////////////for(int track_num=0;track_num<nbre_track_visualisables;track_num++){Track_draw(xcha+5,ycha+165+(track_num*40),position_affichage_track_num[chaser_selected]+track_num);}//CURSEUR TIMEol::Rect TimelineChaser(ol::Vec2D(xcha+175,ycha+145),ol::Vec2D(36*12,10));TimelineChaser.Draw(CouleurLigne.WithAlpha(0.2));if( Midi_Faders_Affectation_Type!=0)//config midi{if(mouse_x>xcha+175 && mouse_x<xcha+175+(nbre_de_cases_par_track*12) && mouse_y>ycha+145 && mouse_y<ycha+155){TimelineChaser.DrawOutline(CouleurBlind);}}int id_way=0;
开发者ID:ChristophGuillermet,项目名称:WHITECAT_opensource,代码行数:67,


示例3: menu_setup

int menu_setup(int timeout) {	FBWidth = currentWindow->framebuffer.width;	FBHeight = currentWindow->framebuffer.height;		imgiPhoneOS = framebuffer_load_image(dataiPhoneOSPNG, dataiPhoneOSPNG_size, &imgiPhoneOSWidth, &imgiPhoneOSHeight, TRUE);	imgiPhoneOSSelected = framebuffer_load_image(dataiPhoneOSSelectedPNG, dataiPhoneOSSelectedPNG_size, &imgiPhoneOSWidth, &imgiPhoneOSHeight, TRUE);	imgConsole = framebuffer_load_image(dataConsolePNG, dataConsolePNG_size, &imgConsoleWidth, &imgConsoleHeight, TRUE);	imgConsoleSelected = framebuffer_load_image(dataConsoleSelectedPNG, dataConsoleSelectedPNG_size, &imgConsoleWidth, &imgConsoleHeight, TRUE);	imgAndroidOS_unblended = framebuffer_load_image(dataAndroidOSPNG, dataAndroidOSPNG_size, &imgAndroidOSWidth, &imgAndroidOSHeight, TRUE);	imgAndroidOSSelected_unblended = framebuffer_load_image(dataAndroidOSSelectedPNG, dataAndroidOSSelectedPNG_size, &imgAndroidOSWidth, &imgAndroidOSHeight, TRUE);	imgHeader = framebuffer_load_image(dataHeaderPNG, dataHeaderPNG_size, &imgHeaderWidth, &imgHeaderHeight, TRUE);	bufferPrintf("menu: images loaded/r/n");	imgiPhoneOSX = (FBWidth - imgiPhoneOSWidth) / 2;	imgiPhoneOSY = 84;	imgConsoleX = (FBWidth - imgConsoleWidth) / 2;	imgConsoleY = 207;	imgAndroidOSX = (FBWidth - imgAndroidOSWidth) / 2;	imgAndroidOSY = 330;	imgHeaderX = (FBWidth - imgHeaderWidth) / 2;	imgHeaderY = 17;	framebuffer_draw_image(imgHeader, imgHeaderX, imgHeaderY, imgHeaderWidth, imgHeaderHeight);	framebuffer_draw_rect_hgradient(0, 42, 0, 360, FBWidth, (FBHeight - 12) - 360);	framebuffer_draw_rect_hgradient(0x22, 0x22, 0, FBHeight - 12, FBWidth, 12);	framebuffer_setloc(0, 47);	framebuffer_setcolors(COLOR_WHITE, 0x222222);	framebuffer_print_force(OPENIBOOT_VERSION_STR);	framebuffer_setcolors(COLOR_WHITE, COLOR_BLACK);	framebuffer_setloc(0, 0);	imgAndroidOS = malloc(imgAndroidOSWidth * imgAndroidOSHeight * sizeof(uint32_t));	imgAndroidOSSelected = malloc(imgAndroidOSWidth * imgAndroidOSHeight * sizeof(uint32_t));	framebuffer_capture_image(imgAndroidOS, imgAndroidOSX, imgAndroidOSY, imgAndroidOSWidth, imgAndroidOSHeight);	framebuffer_capture_image(imgAndroidOSSelected, imgAndroidOSX, imgAndroidOSY, imgAndroidOSWidth, imgAndroidOSHeight);	framebuffer_blend_image(imgAndroidOS, imgAndroidOSWidth, imgAndroidOSHeight, imgAndroidOS_unblended, imgAndroidOSWidth, imgAndroidOSHeight, 0, 0);	framebuffer_blend_image(imgAndroidOSSelected, imgAndroidOSWidth, imgAndroidOSHeight, imgAndroidOSSelected_unblended, imgAndroidOSWidth, imgAndroidOSHeight, 0, 0);	Selection = MenuSelectioniPhoneOS;	OtherFramebuffer = CurFramebuffer;	CurFramebuffer = (volatile uint32_t*) NextFramebuffer;	drawSelectionBox();	pmu_set_iboot_stage(0);	memcpy((void*)NextFramebuffer, (void*) CurFramebuffer, NextFramebuffer - (uint32_t)CurFramebuffer);	uint64_t startTime = timer_get_system_microtime();	while(TRUE) {		if(buttons_is_pushed(BUTTONS_HOLD)) {			toggle(TRUE);			startTime = timer_get_system_microtime();			udelay(200000);		}#ifndef CONFIG_IPOD		if(!buttons_is_pushed(BUTTONS_VOLUP)) {			toggle(FALSE);			startTime = timer_get_system_microtime();			udelay(200000);		}		if(!buttons_is_pushed(BUTTONS_VOLDOWN)) {			toggle(TRUE);			startTime = timer_get_system_microtime();			udelay(200000);		}#endif		if(buttons_is_pushed(BUTTONS_HOME)) {			break;		}		if(timeout > 0 && has_elapsed(startTime, (uint64_t)timeout * 1000)) {			bufferPrintf("menu: timed out, selecting current item/r/n");			break;		}		udelay(10000);	}	if(Selection == MenuSelectioniPhoneOS) {		Image* image = images_get(fourcc("ibox"));		if(image == NULL)			image = images_get(fourcc("ibot"));		void* imageData;		images_read(image, &imageData);		chainload((uint32_t)imageData);	}	if(Selection == MenuSelectionConsole) {		// Reset framebuffer back to original if necessary		if((uint32_t) CurFramebuffer == NextFramebuffer)		{			CurFramebuffer = OtherFramebuffer;//.........这里部分代码省略.........
开发者ID:Anon0,项目名称:iphonelinux,代码行数:101,


示例4: toggle

void UDoor::close(){    if (is_open())	    toggle();}
开发者ID:alucardxlx,项目名称:polserver-zulu,代码行数:5,


示例5: Grider_Box

int Grider_Box(int xb, int yb){Rect GriderBack(Vec2D(xb,yb),Vec2D(largeurGrider,hauteurGrider));GriderBack.SetRoundness(15);GriderBack.SetLineWidth(triple_epaisseur_ligne_fader);GriderBack.Draw(CouleurFond); if(window_focus_id==926){GriderBack.DrawOutline(CouleurFader); }else{GriderBack.DrawOutline(CouleurLigne);    }  neuro.Print( "Grid",(xb+90), (yb+15));neuro.Print( "Players",(xb+90), (yb+35));//definition debut chan du griderRect BackGriderChan(Vec2D(xb+245,yb+15),Vec2D(40,20));BackGriderChan.SetRoundness(4);BackGriderChan.Draw(CouleurBleuProcedure.WithAlpha(0.5));petitchiffre.Print("Beg.Chan.",xb+180,yb+30);petitchiffre.Print(ol::ToString(grider_begin_channel_is),xb+250,yb+30);//def number row and colsRect BackGriderCol(Vec2D(xb+315,yb+15),Vec2D(30,20));BackGriderCol.SetRoundness(4);BackGriderCol.Draw(CouleurBleuProcedure.WithAlpha(0.5));petitchiffre.Print("Col.:",xb+290,yb+30);petitchiffre.Print(ol::ToString(grider_nb_col),xb+320,yb+30);Rect BackGriderRow(Vec2D(xb+385,yb+15),Vec2D(30,20));BackGriderRow.SetRoundness(4);BackGriderRow.Draw(CouleurBleuProcedure.WithAlpha(0.5));petitchiffre.Print("Rows:",xb+347,yb+30);petitchiffre.Print(ol::ToString(grider_nb_row),xb+390,yb+30);//////////////EDIT MODE///////////////////////////////Rect GriderEditEnable( Vec2D((xb+430),(yb+15)),Vec2D(50,20));GriderEditEnable.SetRoundness(7.5);if(index_enable_edit_Grider==1){GriderEditEnable.Draw(CouleurFader);                                 }GriderEditEnable.DrawOutline(CouleurLigne);petitchiffre.Print("edit",xb+440 ,yb+27);/////////////nbre Gridplayers affichage///////////////////////////petitpetitchiffre.Print("GridPlayers",xb+535,yb+13);for(int o=0;o<core_user_define_nb_gridplayers;o++){Rect ShowGridB(Vec2D(xb+540+(o*15),yb+20),Vec2D(10,10));  if(index_show_grid_player[o]==1){ShowGridB.Draw(CouleurFader);}      ShowGridB.DrawOutline(CouleurLigne.WithAlpha(0.7));if(window_focus_id==W_GRID  && mouse_x>xb+540+(o*15) && mouse_x<xb+540+(o*15)+10 && mouse_y>yb+20 && mouse_y<yb+30){if(Midi_Faders_Affectation_Type!=0){char sttmp[24];sprintf(sttmp,"View GridPlayer %d",o+1);show_type_midi(1472+o,sttmp );ShowGridB.SetLineWidth(2.0);ShowGridB.DrawOutline(CouleurBlind);}}}if( window_focus_id==W_GRID  && mouse_y>yb+15 && mouse_y<yb+35){if(mouse_x>xb+245 && mouse_x<xb+285 &&  index_enable_edit_Grider==1)//chan edit{BackGriderChan.DrawOutline(CouleurLigne);               }          if(mouse_x>xb+315 && mouse_x<xb+355 &&  index_enable_edit_Grider==1)//col edit{BackGriderCol.DrawOutline(CouleurLigne);      } if(mouse_x>xb+385 && mouse_x<xb+425 &&  index_enable_edit_Grider==1)//rows edit{BackGriderRow.DrawOutline(CouleurLigne);      }    }//Global grid viewerpetitpetitchiffre.Print("View",xb+495,yb+13);Rect AllowGridViewerB(Vec2D(xb+495,yb+20),Vec2D(40,10));AllowGridViewerB.Draw(CouleurFader.WithAlpha(show_global_view_grider));AllowGridViewerB.DrawOutline(CouleurLigne);if( window_focus_id==W_GRID && mouse_b&1 && mouse_released==0){if(mouse_x>xb+495 && mouse_x<xb+535 && mouse_y>yb+20 && mouse_y<yb+30){show_global_view_grider=toggle(show_global_view_grider);  //.........这里部分代码省略.........
开发者ID:ChristophGuillermet,项目名称:WHITECAT_opensource,代码行数:101,


示例6: wxASSERT_MSG

bool KIWAY_PLAYER::ShowModal( wxString* aResult, wxWindow* aResultantFocusWindow ){    wxASSERT_MSG( IsModal(), wxT( "ShowModal() shouldn't be called on non-modal frame" ) );    /*        This function has a nice interface but a necessarily unsightly implementation.        Now the implementation is encapsulated, localizing future changes.        It works in tandem with DismissModal().  But only ShowModal() is in the        vtable and therefore cross-module capable.   */    // This is an exception safe way to zero a pointer before returning.    // Yes, even though DismissModal() clears this first normally, this is    // here in case there's an exception before the dialog is dismissed.    struct NULLER    {        void*&  m_what;        NULLER( void*& aPtr ) : m_what( aPtr ) {}        ~NULLER() { m_what = 0; }   // indeed, set it to NULL on destruction    } clear_this( (void*&) m_modal_loop );    m_modal_resultant_parent = aResultantFocusWindow;    Show( true );    Raise();    // Needed on some Window managers to always display the frame    SetFocus();    {        // We have to disable all frames but the the modal one.        // wxWindowDisabler does that, but it also disables all top level windows        // We do not want to disable top level windows which are child of the modal one,        // if they are enabled.        // An example is an aui toolbar which was moved        // or a dialog or an other frame or miniframe opened by the modal one.        wxWindowList wlist = GetChildren();        std::vector<wxWindow*> enabledTopLevelWindows;        for( unsigned ii = 0; ii < wlist.size(); ii++ )            if( wlist[ii]->IsTopLevel() && wlist[ii]->IsEnabled() )                enabledTopLevelWindows.push_back( wlist[ii] );        // exception safe way to disable all top level windows except the modal one,        // re-enables only those that were disabled on exit        wxWindowDisabler toggle( this );        for( unsigned ii = 0; ii < enabledTopLevelWindows.size(); ii++ )            enabledTopLevelWindows[ii]->Enable( true );        WX_EVENT_LOOP event_loop;        m_modal_loop = &event_loop;        event_loop.Run();    }   // End of scope for some variables.        // End nesting before setting focus below.    if( aResult )        *aResult = m_modal_string;    DBG(printf( "~%s: aResult:'%s'  ret:%d/n",            __func__, TO_UTF8( m_modal_string ), m_modal_ret_val );)    if( aResultantFocusWindow )
开发者ID:AlexanderBrevig,项目名称:kicad-source-mirror,代码行数:65,


示例7: do_logical_ChannelsMenuSelection

int do_logical_ChannelsMenuSelection(int chx, int chy){//LOGIQUE//if(window_focus_id==0 && index_over_A_window==0 && index_over_faderspace==0 && mouse_button==1 && mouse_released==0)if(window_focus_id==0 && index_over_faderspace==0 && mouse_button==1 && mouse_released==0){if( mouse_y>chy+1 && mouse_y<chy+1+18 && mouse_x>chx+70 && mouse_x<chx+70+60 ) { if(Midi_Faders_Affectation_Type!=0){  attribute_midi_solo_affectation(1644,Midi_Faders_Affectation_Mode);}else{ ClassicalChannelView=toggle(ClassicalChannelView);} mouse_released=1; }for(int lv=0;lv<2;lv++){for(int i=0;i<8;i++){if(mouse_x>chx+140+(i*15) && mouse_x<chx+140+(i*15)+10 && mouse_y>chy+1+(15*lv) && mouse_y<chy+1+(15*lv)+10){if(Midi_Faders_Affectation_Type!=0){  attribute_midi_to_control(1628+i+(lv*8),Midi_Faders_Affectation_Type,Midi_Faders_Affectation_Mode);}else{if(index_do_dock==0 && index_do_modify==0 && index_main_clear==0){if(ClassicalChannelView==1){ClassicalChannelView=0;if(Channel_View_MODE[i+(lv*8)]==0){Channel_View_MODE[i+(lv*8)]=1;}}else{Channel_View_MODE[i+(lv*8)]=toggle(Channel_View_MODE[i+(lv*8)]);ClassicalChannelView=0;}}else if(index_do_dock==1 && i+(lv*8)!=0)//=vue patch{channel_view_is=i+(lv*8);index_ask_record_selection_of_view=i+(lv*8);index_ask_confirm=1;}else if(index_do_modify==1 && i+(lv*8)!=0)//=vue patch{channel_view_is=i+(lv*8);index_ask_modify_selection_of_view=1;index_ask_confirm=1;}else if(index_main_clear==1 && i+(lv*8)!=0)//=vue patch{channel_view_is=i+(lv*8);index_ask_confirm=1;index_ask_clear_selection_of_view=1;}}mouse_released=1;}}}command_button_logical(chx+270,chy+1,index_blind,"Blind","Shift-F10",754,110);command_button_logical(chx+340,chy+1,index_direct_chan,"Direct CH.","",1333,111);command_button_logical(chx+410,chy+1,index_inspekt,"View","",1334,112);// int x, inty ,bool state, char *textedesc, int midiaffectationcommand_button_logical(chx+480,chy+1,index_do_hipass,"HiPass","",1542,113);// int x, inty ,bool state, char *textedesc, int midiaffectationcommand_button_logical(chx+550,chy+1,index_do_fgroup,"FGroup","",1592,114);// int x, inty ,bool state, char *textedesc, int midiaffectationcommand_button_logical(chx+620,chy+1,Midi_Faders_Affectation_Type,"MidiAffect","",1625,106);// int x, inty ,bool state, char *textedesc, int midiaffectationcommand_button_logical(chx+690,chy+1,index_midi_mute,"MidiMute","",1277,107);// int x, inty ,bool state, char *textedesc, int midiaffectationcommand_button_logical(chx+760,chy+1,index_global_midi_send_on_faders,"M.Out Fad.","",1593,109);// int x, inty ,bool state, char *textedesc, int midiaffectationcommand_button_logical(chx+830,chy+1,index_do_dock,"STORE","F1",743,102);// int x, inty ,bool state, char *textedesc, int midiaffectationcommand_button_logical(chx+900,chy+1,index_do_modify,"MODIFY","F2",744,103);command_button_logical(chx+970,chy+1,index_do_report,"REPORT","F3",745,104);command_button_logical(chx+1040,chy+1,index_main_clear,"CLEAR","F4",746,105);command_button_logical(chx+1110,chy+1,index_show_main_menu,"MENUS","RIGHT CLICK",1626,108);}//fin windows focusreturn(0);}
开发者ID:ChristophGuillermet,项目名称:WHITECAT_opensource,代码行数:83,


示例8: toggle

/** * Switches on / off the given layer.  * Listeners are notified. */void RS_LayerList::toggle(const QString& name) {    toggle(find(name));}
开发者ID:CrazyHeex,项目名称:sodacad,代码行数:7,


示例9: otg_update_isp

/* inputs going to ISP1301 */static void otg_update_isp(struct isp1301 *isp){	u32	otg_ctrl, otg_change;	u8	set = OTG1_DM_PULLDOWN, clr = OTG1_DM_PULLUP;	otg_ctrl = OTG_CTRL_REG;	otg_change = otg_ctrl ^ isp->last_otg_ctrl;	isp->last_otg_ctrl = otg_ctrl;	otg_ctrl = otg_ctrl & OTG_XCEIV_INPUTS;	switch (isp->otg.state) {	case OTG_STATE_B_IDLE:	case OTG_STATE_B_PERIPHERAL:	case OTG_STATE_B_SRP_INIT:		if (!(otg_ctrl & OTG_PULLUP)) {			// if (otg_ctrl & OTG_B_HNPEN) {			if (isp->otg.gadget->b_hnp_enable) {				isp->otg.state = OTG_STATE_B_WAIT_ACON;				pr_debug("  --> b_wait_acon/n");			}			goto pulldown;		}pullup:		set |= OTG1_DP_PULLUP;		clr |= OTG1_DP_PULLDOWN;		break;	case OTG_STATE_A_SUSPEND:	case OTG_STATE_A_PERIPHERAL:		if (otg_ctrl & OTG_PULLUP)			goto pullup;		/* FALLTHROUGH */	// case OTG_STATE_B_WAIT_ACON:	default:pulldown:		set |= OTG1_DP_PULLDOWN;		clr |= OTG1_DP_PULLUP;		break;	}#	define toggle(OTG,ISP) do { /		if (otg_ctrl & OTG) set |= ISP; /		else clr |= ISP; /		} while (0)	if (!(isp->otg.host))		otg_ctrl &= ~OTG_DRV_VBUS;	switch (isp->otg.state) {	case OTG_STATE_A_SUSPEND:		if (otg_ctrl & OTG_DRV_VBUS) {			set |= OTG1_VBUS_DRV;			break;		}		/* HNP failed for some reason (A_AIDL_BDIS timeout) */		notresponding(isp);		/* FALLTHROUGH */	case OTG_STATE_A_VBUS_ERR:		isp->otg.state = OTG_STATE_A_WAIT_VFALL;		pr_debug("  --> a_wait_vfall/n");		/* FALLTHROUGH */	case OTG_STATE_A_WAIT_VFALL:		/* FIXME usbcore thinks port power is still on ... */		clr |= OTG1_VBUS_DRV;		break;	case OTG_STATE_A_IDLE:		if (otg_ctrl & OTG_DRV_VBUS) {			isp->otg.state = OTG_STATE_A_WAIT_VRISE;			pr_debug("  --> a_wait_vrise/n");		}		/* FALLTHROUGH */	default:		toggle(OTG_DRV_VBUS, OTG1_VBUS_DRV);	}	toggle(OTG_PU_VBUS, OTG1_VBUS_CHRG);	toggle(OTG_PD_VBUS, OTG1_VBUS_DISCHRG);#	undef toggle	isp1301_set_bits(isp, ISP1301_OTG_CONTROL_1, set);	isp1301_clear_bits(isp, ISP1301_OTG_CONTROL_1, clr);	/* HNP switch to host or peripheral; and SRP */	if (otg_change & OTG_PULLUP) {		switch (isp->otg.state) {		case OTG_STATE_B_IDLE:			if (clr & OTG1_DP_PULLUP)				break;			isp->otg.state = OTG_STATE_B_PERIPHERAL;			pr_debug("  --> b_peripheral/n");			break;		case OTG_STATE_A_SUSPEND:			if (clr & OTG1_DP_PULLUP)				break;			isp->otg.state = OTG_STATE_A_PERIPHERAL;			pr_debug("  --> a_peripheral/n");			break;		default://.........这里部分代码省略.........
开发者ID:miettal,项目名称:armadillo420_standard,代码行数:101,


示例10: do_logical_Draw_Channel_Preset_Title

int do_logical_Draw_Channel_Preset_Title(int xchan, int ychan, int prst_v){ if(window_focus_id==0 && mouse_button==1  && mouse_released==0 && prst_v!=0 ) { if(mouse_y>ychan && mouse_y<ychan+20  ) { //TITRE VIEW if(mouse_x> xchan+40 && mouse_x<xchan+40+210) { if(prst_v>0 && index_type==1 ) { sprintf( channel_view_Name[prst_v],numeric); reset_numeric_entry(); numeric_postext=0; mouse_released=1; } } // Mem sel else if(mouse_x>  xchan+435 && mouse_x<xchan+435+20) { if(channel_view_type_of_behaviour[prst_v]!=1){channel_view_type_of_behaviour[prst_v]=1;} else{channel_view_type_of_behaviour[prst_v]=0;} mouse_released=1; } // fader sel else if(mouse_x>  xchan+460 && mouse_x<xchan+460+20 ) { if(channel_view_type_of_behaviour[prst_v]!=2){channel_view_type_of_behaviour[prst_v]=2;} else{channel_view_type_of_behaviour[prst_v]=0;} mouse_released=1; } //All sel  else if(mouse_x>  xchan+485 && mouse_x<xchan+485+30  ) { channel_view_mode_builder[prst_v]=toggle(channel_view_mode_builder[prst_v]); mouse_released=1; } //do build logique sortie car plantage grave à la reconstruction. il faut garder ca dans la boucle affichage/* else if(mouse_x>  xchan+520 && mouse_x<xchan+520+55 ) { channel_view_is=prst_v; if(index_do_dock==1) { if(channel_view_type_of_behaviour[channel_view_is]==0 &&  channel_view_mode_builder[channel_view_is]==0) {index_ask_record_selection_of_view=1 ; index_ask_confirm=1; mouse_released=1;} else  {index_ask_build_view=1; index_ask_confirm=1; mouse_released=1;  } } else if(index_do_modify==1) { index_ask_modify_selection_of_view=1 ;index_ask_confirm=1;   mouse_released=1; } else if(index_do_report==1) { index_ask_report_selection_of_view=1;index_ask_confirm=1;      mouse_released=1; } else if(index_main_clear==1) { index_ask_clear_selection_of_view=1;   mouse_released=1; } } */ } } return(0);}
开发者ID:ChristophGuillermet,项目名称:WHITECAT_opensource,代码行数:74,


示例11: toggle

void ofxSimpleGuiToggle::onKeyEnter() {	toggle();}
开发者ID:Giladx,项目名称:ofxSimpleGuiToo,代码行数:3,


示例12: main

main(int argc, char *argv[]){    toplevel = XtAppInitialize(&app, "Paperplane", NULL, 0, &argc, argv,                               fallbackResources, NULL, 0);    dpy = XtDisplay(toplevel);    /* find an OpenGL-capable RGB visual with depth buffer */    vi = glXChooseVisual(dpy, DefaultScreen(dpy), dblBuf);    if (vi == NULL) {        vi = glXChooseVisual(dpy, DefaultScreen(dpy), snglBuf);        if (vi == NULL)            XtAppError(app, "no RGB visual with depth buffer");        doubleBuffer = GL_FALSE;    }    /* create an OpenGL rendering context */    cx = glXCreateContext(dpy, vi, /* no display list sharing */ None,        /* favor direct */ GL_TRUE);    if (cx == NULL)        XtAppError(app, "could not create rendering context");    /* create an X colormap since probably not using default visual */#ifdef noGLwidget    cmap = XCreateColormap(dpy, RootWindow(dpy, vi->screen),        vi->visual, AllocNone);    /*     * Establish the visual, depth, and colormap of the toplevel     * widget _before_ the widget is realized.     */    XtVaSetValues(toplevel, XtNvisual, vi->visual, XtNdepth, vi->depth,                  XtNcolormap, cmap, NULL);#endif    XtAddEventHandler(toplevel, StructureNotifyMask, False,                      map_state_changed, NULL);    mainw = XmCreateMainWindow(toplevel, "mainw", NULL, 0);    XtManageChild(mainw);    /* create menu bar */    menubar = XmCreateMenuBar(mainw, "menubar", NULL, 0);    XtManageChild(menubar);#ifdef noGLwidget    /* Hack around Xt's unfortunate default visual inheritance. */    XtSetArg(menuPaneArgs[0], XmNvisual, vi->visual);    menupane = XmCreatePulldownMenu(menubar, "menupane", menuPaneArgs, 1);#else    menupane = XmCreatePulldownMenu(menubar, "menupane", NULL, 0);#endif    btn = XmCreatePushButton(menupane, "Quit", NULL, 0);    XtAddCallback(btn, XmNactivateCallback, quit, NULL);    XtManageChild(btn);    XtSetArg(args[0], XmNsubMenuId, menupane);    cascade = XmCreateCascadeButton(menubar, "File", args, 1);    XtManageChild(cascade);#ifdef noGLwidget    menupane = XmCreatePulldownMenu(menubar, "menupane", menuPaneArgs, 1);#else    menupane = XmCreatePulldownMenu(menubar, "menupane", NULL, 0);#endif    btn = XmCreateToggleButton(menupane, "Motion", NULL, 0);    XtAddCallback(btn, XmNvalueChangedCallback, (XtCallbackProc)toggle, NULL);    XtManageChild(btn);    btn = XmCreatePushButton(menupane, "Add plane", NULL, 0);    XtAddCallback(btn, XmNactivateCallback, (XtCallbackProc)add_plane, NULL);    XtManageChild(btn);    btn = XmCreatePushButton(menupane, "Remove plane", NULL, 0);    XtAddCallback(btn, XmNactivateCallback, (XtCallbackProc)remove_plane, NULL);    XtManageChild(btn);    XtSetArg(args[0], XmNsubMenuId, menupane);    cascade = XmCreateCascadeButton(menubar, "Planes", args, 1);    XtManageChild(cascade);    /* create framed drawing area for OpenGL rendering */    frame = XmCreateFrame(mainw, "frame", NULL, 0);    XtManageChild(frame);#ifdef noGLwidget    glxarea = XtVaCreateManagedWidget("glxarea", xmDrawingAreaWidgetClass,                                      frame, NULL);#else#ifdef noMotifGLwidget    /* notice glwDrawingAreaWidgetClass lacks an 'M' */    glxarea = XtVaCreateManagedWidget("glxarea", glwDrawingAreaWidgetClass,#else    glxarea = XtVaCreateManagedWidget("glxarea", glwMDrawingAreaWidgetClass,#endif                                      frame, GLwNvisualInfo, vi, NULL);#endif    XtAddCallback(glxarea, XmNexposeCallback, (XtCallbackProc)draw, NULL);    XtAddCallback(glxarea, XmNresizeCallback, resize, NULL);    XtAddCallback(glxarea, XmNinputCallback, input, NULL);    /* set up application's window layout */    XmMainWindowSetAreas(mainw, menubar, NULL, NULL, NULL, frame);    XtRealizeWidget(toplevel);    /*     * Once widget is realized (ie, associated with a created X window), we     * can bind the OpenGL rendering context to the window.     */    glXMakeCurrent(dpy, XtWindow(glxarea), cx);    made_current = GL_TRUE;    /* setup OpenGL state */    glClearDepth(1.0);    glClearColor(0.0, 0.0, 0.0, 0.0);    glMatrixMode(GL_PROJECTION);    glFrustum(-1.0, 1.0, -1.0, 1.0, 1.0, 20);    glMatrixMode(GL_MODELVIEW);    /* add three initial random planes *///.........这里部分代码省略.........
开发者ID:yhsesq,项目名称:yhs,代码行数:101,


示例13: mainWindow

void NetworkAnalyzerPanel::changeCurrentPage(){    bool enable = mainWindow()->currentTab()->page()->hasNetworkAnalyzerEnabled();    toggle(enable);}
开发者ID:wyuka,项目名称:rekonq,代码行数:5,


示例14: msg

void TransferServerConnection::onReceive(const Archive::ByteStream & message){	Archive::ReadIterator ri = message.begin();	const GameNetworkMessage msg(ri);	ri = message.begin();	if(msg.isType("UploadCharacterMessage"))	{		const UploadCharacterMessage ucm(ri);		CentralServer::getInstance().sendToGameServer(ucm.getFromGameServerId(), ucm, true);		LOG("TransferServerConnection", ("Received character data for SUID %lu for character object %s on game server %d", ucm.getStationId(), ucm.getFromCharacterId().getValueString().c_str(), ucm.getFromGameServerId()));	}	else if(msg.isType("CharacterTransferStatusMessage"))	{		const CharacterTransferStatusMessage ctsm(ri);		CentralServer::getInstance().sendToGameServer(ctsm.getGameServerId(), ctsm, true);	}	else if(msg.isType("TransferRequestCharacterList"))	{		// simply forward the request to any available login server		const GenericValueTypeMessage<TransferCharacterData> request(ri);		IGNORE_RETURN(CentralServer::getInstance().sendToArbitraryLoginServer(request));	}	else if(msg.isType("TransferRequestMoveValidation"))	{		const TransferRequestMoveValidation request(ri);		IGNORE_RETURN(CentralServer::getInstance().sendToArbitraryLoginServer(request));		LOG("CustomerService", ("CharacterTransfer: Received TransferRequestMoveValidation : %s on %s to %s on %s. Forwarding request to LoginServer.", request.getSourceCharacter().c_str(), request.getSourceGalaxy().c_str(), request.getDestinationCharacter().c_str(), request.getDestinationGalaxy().c_str()));	}	else if(msg.isType("TransferRequestKickConnectedClients"))	{		GenericValueTypeMessage<std::pair<unsigned int, unsigned int> > const request(ri);		// disconnect any clients with a connection to SWG services		GenericValueTypeMessage<unsigned int> kickSource("TransferKickConnectedClients", request.getValue().first);		GenericValueTypeMessage<unsigned int> kickDestination("TransferKickConnectedClients", request.getValue().second);		CentralServer::getInstance().sendToAllLoginServers(kickSource);		CentralServer::getInstance().sendToAllLoginServers(kickDestination);		CentralServer::getInstance().sendToAllConnectionServers(kickSource, true);		CentralServer::getInstance().sendToAllConnectionServers(kickDestination, true);	}	else if(msg.isType("TransferGetCharacterDataFromLoginServer"))	{		const GenericValueTypeMessage<TransferCharacterData> getCharacterData(ri);				// The transfer server has received a move request. The request doesn't		// contain the source id of the character, character's container or scene		// information. The LoginServer can retrieve the character ID for the 		// source station id + character name contained in character data.		// Forward the request to the login server. It will respond and the		// message can be routed back to the transfer server for further 		// processing		IGNORE_RETURN(CentralServer::getInstance().sendToArbitraryLoginServer(getCharacterData));		LOG("CustomerService", ("CharacterTransfer: ***CentralServer: received TransferGetCharacterDataFromLoginServer : %s)", getCharacterData.getValue().toString().c_str()));	}	else if(msg.isType("TransferGetLoginLocationData"))	{		GenericValueTypeMessage<TransferCharacterData> getLoginData(ri);		CentralServer::getInstance().sendToDBProcess(getLoginData, true);		LOG("CustomerService", ("CharacterTransfer: ***CentralServer: Received TransferGetLoginLocationData for %s/n", getLoginData.getValue().getSourceCharacterName().c_str()));	}	else if(msg.isType("TransferLoginCharacterToSourceServer"))	{		const GenericValueTypeMessage<TransferCharacterData> loginCharacter(ri);		ConnectionServerConnection * connectionServer = CentralServer::getInstance().getAnyConnectionServer();		if(connectionServer)		{			connectionServer->send(loginCharacter, true);			LOG("CustomerService", ("CharacterTransfer: ***CentralServer: Received TransferLoginCharacterToSourceServer request from Transfer Server. Sendint request to ConnectionServer : %s/n", loginCharacter.getValue().toString().c_str()));		}		else		{			LOG("CustomerService", ("CharacterTransfer: ***CentralServer: Couldn't find a connection server to satisfy the transfer request for %s/n", loginCharacter.getValue().toString().c_str()));		}	}	else if(msg.isType("TransferLoginCharacterToDestinationServer"))	{		const GenericValueTypeMessage<TransferCharacterData> loginCharacter(ri);		LOG("CustomerService", ("CharacterTransfer: ***CentralServer: Received TransferLoginCharacterToDestinationServer request from Transfer Server for %s/n", loginCharacter.getValue().toString().c_str()));		ConnectionServerConnection * connectionServer = CentralServer::getInstance().getAnyConnectionServer();		if(connectionServer)		{			connectionServer->send(loginCharacter, true);		}	}	else if(msg.isType("ToggleAvatarLoginStatus"))	{		ToggleAvatarLoginStatus toggle(ri);		LOG("CustomerService", ("CharacterTransfer: Received ToggleAvatarLoginStatus for station ID %d, Character Object %s", toggle.getStationId(), toggle.getCharacterId().getValueString().c_str()));		IGNORE_RETURN(CentralServer::getInstance().sendToArbitraryLoginServer(toggle));	}	else if(msg.isType("TransferRequestNameValidation"))	{		GenericValueTypeMessage<TransferCharacterData> request(ri);		LOG("CustomerService", ("CharacterTransfer: Received TransferRequestNameValidation from TransferServer. Forwarding request to a random GameServer. %s", request.getValue().toString().c_str()));		IGNORE_RETURN(CentralServer::getInstance().sendToRandomGameServer(request));	}	else if(msg.isType("TransferRenameCharacter"))	{		GenericValueTypeMessage<TransferCharacterData> renameRequest(ri);		LOG("CustomerService", ("CharacterTransfer: Received TransferRenameCharacter. Sending rename request to game database. %s", renameRequest.getValue().toString().c_str()));//.........这里部分代码省略.........
开发者ID:Mesagoppinmypants,项目名称:NGELinux,代码行数:101,


示例15: toggle_led

void toggle_led(uint8_t num){	if (num < 6){		toggle(led_portmap[num], led_pinmap[num]);	}}
开发者ID:buglabs,项目名称:bugswarm-renesas,代码行数:5,


示例16: toggle

void MButton::modelClick(){    toggle();    emit clicked(isChecked());}
开发者ID:arcean,项目名称:libmeegotouch-framework,代码行数:5,


示例17: main

int main(int argc, char *argv[]) {#if __TBB_FLOW_GRAPH_CPP11_FEATURES    try {        utility::thread_number_range threads(get_default_num_threads);        utility::parse_cli_arguments(argc, argv,                                     utility::cli_argument_pack()                                     //"-h" option for displaying help is present implicitly                                     .positional_arg(threads,"#threads",utility::thread_number_range_desc)                                     .arg(verbose,"verbose","   print diagnostic output to screen")                                     .arg(silent,"silent","    limits output to timing info; overrides verbose")        );        if (silent) verbose = false;  // make silent override verbose        tick_count start = tick_count::now();        for(int p = threads.first; p <= threads.last; p = threads.step(p)) {            task_scheduler_init init(p);            if (!silent)  cout << "graph test running on " << p << " threads./n";                        graph g;            { // test buffer: 0, 1                buffer b(g);                toggle input(g);                led output(g, "OUTPUT", false); // false means we will explicitly call display to see LED                                make_edge(input.get_out(), input_port<0>(b));                make_edge(output_port<0>(b), output.get_in());                                if (!silent) printf("Testing buffer.../n");                input.activate(); // 0                g.wait_for_all();                if (!silent) output.display();                assert(output.get_value() == low);                input.flip(); // 1                g.wait_for_all();                if (!silent) output.display();                assert(output.get_value() == high);            }            { // test not_gate: 0, 1                not_gate n(g);                toggle input(g);                led output(g, "OUTPUT", false);                                make_edge(input.get_out(), input_port<0>(n));                make_edge(output_port<0>(n), output.get_in());                                if (!silent) printf("Testing not_gate.../n");                input.activate(); // 0                g.wait_for_all();                if (!silent) output.display();                assert(output.get_value() == high);                input.flip(); // 1                g.wait_for_all();                if (!silent) output.display();                assert(output.get_value() == low);            }            { // test two-input and_gate: 00, 01, 10, 11                and_gate<2> a(g);                toggle input0(g);                toggle input1(g);                led output(g, "OUTPUT", false);                                make_edge(input0.get_out(), input_port<0>(a));                make_edge(input1.get_out(), input_port<1>(a));                make_edge(output_port<0>(a), output.get_in());                                if (!silent) printf("Testing and_gate.../n");                input1.activate();  input0.activate();  // 0 0                g.wait_for_all();                if (!silent) output.display();                assert(output.get_value() == low);                input0.flip();  // 0 1                g.wait_for_all();                if (!silent) output.display();                assert(output.get_value() == low);                input1.flip(); input0.flip();  // 1 0                g.wait_for_all();                if (!silent) output.display();                assert(output.get_value() == low);                input0.flip();  // 1 1                g.wait_for_all();                if (!silent) output.display();                assert(output.get_value() == high);            }            { // test three-input or_gate: 000, 001, 010, 100, 011, 101, 110, 111                or_gate<3> o(g);                toggle input0(g);                toggle input1(g);                toggle input2(g);                led output(g, "OUTPUT", false);                                make_edge(input0.get_out(), input_port<0>(o));                make_edge(input1.get_out(), input_port<1>(o));                make_edge(input2.get_out(), input_port<2>(o));                make_edge(output_port<0>(o), output.get_in());                //.........这里部分代码省略.........
开发者ID:BigR-Lab,项目名称:CodeRes_Cpp,代码行数:101,


示例18: read_byte

static unsigned8read_byte(device *me,	  hw_eeprom_device *eeprom,	  unsigned_word address){  /* may need multiple iterations of this */  while (1) {    switch (eeprom->state) {    case read_reset:      return eeprom->memory[address];    case autoselect:      if ((address & 0xff) == 0x00)	return eeprom->manufacture_code;      else if ((address & 0xff) == 0x01)	return eeprom->device_code;      else	return 0; /* not certain about this */    case byte_programming:      if (device_event_queue_time(me) > eeprom->program_finish_time) {	finish_programming_byte(me, eeprom);	eeprom->state = read_reset;	continue;      }      else if (address == eeprom->byte_program_address) {	return toggle(eeprom, eeprom->memory[address]);      }      else {	/* trash that memory location */	invalid_read(me, eeprom->state, address, "not byte program address");	eeprom->memory[address] = (eeprom->memory[address]				   & eeprom->byte_program_byte);	return toggle(eeprom, eeprom->memory[eeprom->byte_program_address]);      }    case chip_erase:      if (device_event_queue_time(me) > eeprom->program_finish_time) {	finish_erasing_chip(me, eeprom);	eeprom->state = read_reset;	continue;      }      else {	return toggle(eeprom, eeprom->memory[address]);      }    case sector_erase:      if (device_event_queue_time(me) > eeprom->program_finish_time) {	finish_erasing_sector(me, eeprom);	eeprom->state = read_reset;	continue;      }      else if (!eeprom->sectors[address / eeprom->sizeof_sector]) {	/* read to wrong sector */	invalid_read(me, eeprom->state, address, "sector not being erased");	return toggle(eeprom, eeprom->memory[address]) & ~0x8;      }      else if (device_event_queue_time(me) > eeprom->sector_start_time) {	return toggle(eeprom, eeprom->memory[address]) | 0x8;      }      else {	return toggle(eeprom, eeprom->memory[address]) & ~0x8;      }    case sector_erase_suspend:      if (!eeprom->sectors[address / eeprom->sizeof_sector]) {	return eeprom->memory[address];      }      else {	invalid_read(me, eeprom->state, address, "sector being erased");	return eeprom->memory[address];      }    default:      invalid_read(me, eeprom->state, address, "invalid state");      return eeprom->memory[address];    }  }  return 0;}
开发者ID:5kg,项目名称:gdb,代码行数:82,


示例19: addMenu

Menu::Menu() {    MenuWrapper * fileMenu = addMenu("File");#ifdef Q_OS_MAC    addActionToQMenuAndActionHash(fileMenu, MenuOption::AboutApp, 0, qApp, SLOT(aboutApp()), QAction::AboutRole);#endif    auto dialogsManager = DependencyManager::get<DialogsManager>();    AccountManager& accountManager = AccountManager::getInstance();    {        addActionToQMenuAndActionHash(fileMenu, MenuOption::Login);        // connect to the appropriate signal of the AccountManager so that we can change the Login/Logout menu item        connect(&accountManager, &AccountManager::profileChanged,                dialogsManager.data(), &DialogsManager::toggleLoginDialog);        connect(&accountManager, &AccountManager::logoutComplete,                dialogsManager.data(), &DialogsManager::toggleLoginDialog);    }    addDisabledActionAndSeparator(fileMenu, "Scripts");    addActionToQMenuAndActionHash(fileMenu, MenuOption::LoadScript, Qt::CTRL | Qt::Key_O,                                  qApp, SLOT(loadDialog()));    addActionToQMenuAndActionHash(fileMenu, MenuOption::LoadScriptURL,                                  Qt::CTRL | Qt::SHIFT | Qt::Key_O, qApp, SLOT(loadScriptURLDialog()));    addActionToQMenuAndActionHash(fileMenu, MenuOption::StopAllScripts, 0, qApp, SLOT(stopAllScripts()));    addActionToQMenuAndActionHash(fileMenu, MenuOption::ReloadAllScripts, Qt::CTRL | Qt::Key_R,                                  qApp, SLOT(reloadAllScripts()));    addActionToQMenuAndActionHash(fileMenu, MenuOption::RunningScripts, Qt::CTRL | Qt::Key_J,                                  qApp, SLOT(toggleRunningScriptsWidget()));    addDisabledActionAndSeparator(fileMenu, "Location");    qApp->getBookmarks()->setupMenus(this, fileMenu);    addActionToQMenuAndActionHash(fileMenu,                                  MenuOption::AddressBar,                                  Qt::CTRL | Qt::Key_L,                                  dialogsManager.data(),                                  SLOT(toggleAddressBar()));    auto addressManager = DependencyManager::get<AddressManager>();    addActionToQMenuAndActionHash(fileMenu, MenuOption::CopyAddress, 0,                                  addressManager.data(), SLOT(copyAddress()));    addActionToQMenuAndActionHash(fileMenu, MenuOption::CopyPath, 0,                                  addressManager.data(), SLOT(copyPath()));    addActionToQMenuAndActionHash(fileMenu,                                  MenuOption::Quit,                                  Qt::CTRL | Qt::Key_Q,                                  qApp,                                  SLOT(quit()),                                  QAction::QuitRole);    MenuWrapper* editMenu = addMenu("Edit");    QUndoStack* undoStack = qApp->getUndoStack();    QAction* undoAction = undoStack->createUndoAction(editMenu);    undoAction->setShortcut(Qt::CTRL | Qt::Key_Z);    addActionToQMenuAndActionHash(editMenu, undoAction);    QAction* redoAction = undoStack->createRedoAction(editMenu);    redoAction->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_Z);    addActionToQMenuAndActionHash(editMenu, redoAction);    addActionToQMenuAndActionHash(editMenu,                                  MenuOption::Preferences,                                  Qt::CTRL | Qt::Key_Comma,                                  dialogsManager.data(),                                  SLOT(editPreferences()),                                  QAction::PreferencesRole);    addActionToQMenuAndActionHash(editMenu, MenuOption::Attachments, 0,                                  dialogsManager.data(), SLOT(editAttachments()));    addActionToQMenuAndActionHash(editMenu, MenuOption::Animations, 0,                                  dialogsManager.data(), SLOT(editAnimations()));    MenuWrapper* toolsMenu = addMenu("Tools");    addActionToQMenuAndActionHash(toolsMenu, MenuOption::ScriptEditor,  Qt::ALT | Qt::Key_S,                                  dialogsManager.data(), SLOT(showScriptEditor()));#if defined(Q_OS_MAC) || defined(Q_OS_WIN)    auto speechRecognizer = DependencyManager::get<SpeechRecognizer>();    QAction* speechRecognizerAction = addCheckableActionToQMenuAndActionHash(toolsMenu, MenuOption::ControlWithSpeech,                                      Qt::CTRL | Qt::SHIFT | Qt::Key_C,                                      speechRecognizer->getEnabled(),                                      speechRecognizer.data(),                                      SLOT(setEnabled(bool)));    connect(speechRecognizer.data(), SIGNAL(enabledUpdated(bool)), speechRecognizerAction, SLOT(setChecked(bool)));#endif    addActionToQMenuAndActionHash(toolsMenu, MenuOption::Chat,                                  0, // QML Qt::Key_Backslash,                                  dialogsManager.data(), SLOT(showIRCLink()));    addActionToQMenuAndActionHash(toolsMenu, MenuOption::AddRemoveFriends, 0,                                  qApp, SLOT(showFriendsWindow()));    MenuWrapper* visibilityMenu = toolsMenu->addMenu("I Am Visible To");    {        QActionGroup* visibilityGroup = new QActionGroup(toolsMenu);        auto discoverabilityManager = DependencyManager::get<DiscoverabilityManager>();        QAction* visibleToEveryone = addCheckableActionToQMenuAndActionHash(visibilityMenu, MenuOption::VisibleToEveryone,//.........这里部分代码省略.........
开发者ID:polac,项目名称:hifi,代码行数:101,


示例20: addMenu

Menu::Menu() {    auto dialogsManager = DependencyManager::get<DialogsManager>();    AccountManager& accountManager = AccountManager::getInstance();    // File/Application menu ----------------------------------    MenuWrapper* fileMenu = addMenu("File");    // File > Login menu items    {        addActionToQMenuAndActionHash(fileMenu, MenuOption::Login);        // connect to the appropriate signal of the AccountManager so that we can change the Login/Logout menu item        connect(&accountManager, &AccountManager::profileChanged,                dialogsManager.data(), &DialogsManager::toggleLoginDialog);        connect(&accountManager, &AccountManager::logoutComplete,                dialogsManager.data(), &DialogsManager::toggleLoginDialog);    }    // File > Update -- FIXME: needs implementation    auto updateAction = addActionToQMenuAndActionHash(fileMenu, "Update");    updateAction->setDisabled(true);    // File > Help    addActionToQMenuAndActionHash(fileMenu, MenuOption::Help, 0, qApp, SLOT(showHelp()));    // File > Crash Reporter...-- FIXME: needs implementation    auto crashReporterAction = addActionToQMenuAndActionHash(fileMenu, "Crash Reporter...");    crashReporterAction->setDisabled(true);    // File > About    addActionToQMenuAndActionHash(fileMenu, MenuOption::AboutApp, 0, qApp, SLOT(aboutApp()), QAction::AboutRole);    // File > Quit    addActionToQMenuAndActionHash(fileMenu, MenuOption::Quit, Qt::CTRL | Qt::Key_Q, qApp, SLOT(quit()), QAction::QuitRole);    // Edit menu ----------------------------------    MenuWrapper* editMenu = addMenu("Edit");    // Edit > Undo    QUndoStack* undoStack = qApp->getUndoStack();    QAction* undoAction = undoStack->createUndoAction(editMenu);    undoAction->setShortcut(Qt::CTRL | Qt::Key_Z);    addActionToQMenuAndActionHash(editMenu, undoAction);    // Edit > Redo    QAction* redoAction = undoStack->createRedoAction(editMenu);    redoAction->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_Z);    addActionToQMenuAndActionHash(editMenu, redoAction);    // Edit > Running Sccripts    addActionToQMenuAndActionHash(editMenu, MenuOption::RunningScripts, Qt::CTRL | Qt::Key_J,        qApp, SLOT(toggleRunningScriptsWidget()));    // Edit > Open and Run Script from File... [advanced]    addActionToQMenuAndActionHash(editMenu, MenuOption::LoadScript, Qt::CTRL | Qt::Key_O,        qApp, SLOT(loadDialog()),        QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");    // Edit > Open and Run Script from Url... [advanced]    addActionToQMenuAndActionHash(editMenu, MenuOption::LoadScriptURL,        Qt::CTRL | Qt::SHIFT | Qt::Key_O, qApp, SLOT(loadScriptURLDialog()),        QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");    auto scriptEngines = DependencyManager::get<ScriptEngines>();    // Edit > Stop All Scripts... [advanced]    addActionToQMenuAndActionHash(editMenu, MenuOption::StopAllScripts, 0,         scriptEngines.data(), SLOT(stopAllScripts()),        QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");    // Edit > Reload All Scripts... [advanced]    addActionToQMenuAndActionHash(editMenu, MenuOption::ReloadAllScripts, Qt::CTRL | Qt::Key_R,        scriptEngines.data(), SLOT(reloadAllScripts()),        QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");    // Edit > Scripts Editor... [advanced]    addActionToQMenuAndActionHash(editMenu, MenuOption::ScriptEditor, Qt::ALT | Qt::Key_S,        dialogsManager.data(), SLOT(showScriptEditor()),        QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");    // Edit > Console... [advanced]    addActionToQMenuAndActionHash(editMenu, MenuOption::Console, Qt::CTRL | Qt::ALT | Qt::Key_J,        DependencyManager::get<StandAloneJSConsole>().data(),        SLOT(toggleConsole()),        QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");    // Edit > Reload All Content [advanced]    addActionToQMenuAndActionHash(editMenu, MenuOption::ReloadContent, 0, qApp, SLOT(reloadResourceCaches()),        QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");    // Edit > Package Model... [advanced]    addActionToQMenuAndActionHash(editMenu, MenuOption::PackageModel, 0,        qApp, SLOT(packageModel()),        QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");    // Audio menu ----------------------------------    MenuWrapper* audioMenu = addMenu("Audio");    auto audioIO = DependencyManager::get<AudioClient>();//.........这里部分代码省略.........
开发者ID:kevinmthomasse,项目名称:hifi,代码行数:101,


示例21: main

int main(int argc, char *argv[]){    int mode = SDL_HWSURFACE | SDL_HWACCEL |        SDL_DOUBLEBUF | SDL_OPENGL;    if (argc >= 2 && (! strcmp(argv[1], "-h") ||                      ! strcmp(argv[1], "--help"))) {        printf("Uso: %s [-fs] resolucao-x resolucao-y/n/n"               "Exemplo: ./walker 1024 768/n/n"               "Para mais informacoes, leia o README./n",               argv[0]);        exit(0);    }    int shift = 1;    if (argc >= 2 && ! strcmp(argv[1], "-fs")) {        mode |= SDL_FULLSCREEN;        res_x = 1360;        res_y = 768;        shift++;    }    if (argc >= 3) {        res_x = atoi(argv[shift]);        res_y = atoi(argv[shift+1]);    }    init_event_keys();    glutInit(&argc, argv);    initsdl(mode);    initgl();    carregar_texturas();    SDL_Event ev;    while (1)        if (! SDL_PollEvent(&ev)            || ev.type == SDL_MOUSEMOTION)            break;        else            event_handler(ev);    uint64_t old_time, new_time;    uint64_t old_border, new_border;    old_time = time_get();    old_border = time_in_secs(old_time);    float dt = 0;    int count = 0;    while (1) {        while (SDL_PollEvent(&ev))            event_handler(ev);        new_time = time_get();        new_border = time_in_secs(new_time);        dt = time_diff(new_time, old_time);        if (new_border > old_border) {            update_fps_str(count);            old_border = new_border;            count = 0;        }        old_time = new_time;        count++;        update_status_str();        toggle();        model(dt);        physics(dt);        update_map_pos();        draw();    }}
开发者ID:dlight,项目名称:walker,代码行数:78,


示例22: setQuitGame

void OptionsWindow::clicked( int mouseX, int mouseY, uint8_t mouseState ){	// check for quit and the other options	if( !isMouseOnFrame( mouseX, mouseY ) )	{		return;	}	int selectedEntry = -1;	if ( mouseX < posX + 64 || mouseX > posX + frameWidth  - 64 || posY + frameHeight - 64 < mouseY) {		selectedEntry = -1;	} else {		selectedEntry = (posY + frameHeight - 64 - mouseY) / static_cast<int>(font->getHeight()*1.5);		if ( (posY + frameHeight - 64 - mouseY) % static_cast<int>(font->getHeight()*1.5) > static_cast<int>(font->getHeight()) ) {			selectedEntry = -1;		}	}	if( selectedEntry == 0 )	{		setQuitGame();	}	else if( selectedEntry == 1 && utils::file_exists( "savegame.lua" ) == true )	{		// Load Game		// clear current game data		Globals::getCurrentZone()->purgeInteractionList();		Globals::getCurrentZone()->purgeInteractionRegionList();		questWindow->removeAllQuests();		for ( std::map< std::string, CZone* >::iterator it = Globals::allZones.begin(); it != Globals::allZones.end(); ++it ) {			delete it->second;			it->second = NULL;		}		Globals::allZones.clear();		Globals::getPlayer()->clearInventory();		// clear shop data		shopWindow = std::auto_ptr<Shop>( new Shop( Globals::getPlayer(), NULL ) );		// clear spellbook		spellbook->clear();		// clear action bar		actionBar->clear();		// clear cooldowns		Globals::getPlayer()->clearCooldownSpells();		// clear buffs		Globals::getPlayer()->clearActiveSpells();		// reenter map		// 1. Load all zones		// TODO: Load all zones		// 2. Restore lua variables		LuaFunctions::executeLuaScript( "loadGame( 'savegame' )" );		//CZone *newZone = Globals::allZones["data/zone1"];		//newZone->LoadZone("data/zone1");		LuaFunctions::executeLuaFile( "data/quests_wood.lua" );		DawnInterface::clearLogWindow();	}	else if( selectedEntry == 2 )	{		if( Globals::isSavingAllowed() )		{			// save Game			LuaFunctions::executeLuaScript( "saveGame( 'savegame' )" );			GLfloat yellow[] = { 1.0f, 1.0f, 0.0f };			DawnInterface::addTextToLogWindow( yellow, "Game saved.");		}	}	else if( selectedEntry == 3 )	{		toggle(); // close the window	}	else if( selectedEntry == 4 )	{		GLfloat yellow[] = { 1.0f, 1.0f, 0.0f };		if( Globals::isPaused() )		{			Globals::setPaused( false );			DawnInterface::addTextToLogWindow( yellow, "Game unpaused." );		}		else		{			Globals::setPaused( true );			DawnInterface::addTextToLogWindow( yellow, "Game paused." );		}	}}
开发者ID:Faultless,项目名称:Dawn,代码行数:87,


示例23: main

int main(void) {  //init USART serial connection  initUSART();  printString("USART Initialized!/r/n");    //blink LED  DDRB |= (1 << PB2);  toggle('B', 2);  _delay_ms(200);  toggle('B', 2);  _delay_ms(200);  toggle('B', 2);  _delay_ms(200);  toggle('B', 2);  _delay_ms(200);    uint8_t i;  uint32_t sum;    //init ADC  initADC();  uint16_t adcValue;    //moving average variables  uint8_t joystickValues = 10;  uint8_t slidepotValues = 20;  uint16_t verticalValue [joystickValues];  uint16_t horizontalValue [joystickValues];  uint16_t topSliderValue [slidepotValues];  uint16_t bottomSliderValue [slidepotValues];  uint16_t avgValue;  char valueString[15];    //init moving average values  for(i=0;i<joystickValues;i++){	  verticalValue[i] = 511;	  horizontalValue[i] = 511;  }   //init moving average values  for(i=0;i<slidepotValues;i++){	  topSliderValue[i] = 0;	  bottomSliderValue[i] = 0;  }    while(1) {         // ********** Read Vertical Joystick **********    adcValue = readADC(0);    // store new value, dump oldest    for(i=joystickValues-1;i>0;i--){		verticalValue[i] = verticalValue[i-1];	}	verticalValue[0] = adcValue;	//get average of all saved values    sum = 0;    for(i=0;i<joystickValues;i++){		sum = sum + verticalValue[i];	}	avgValue = sum/joystickValues;	//convert int to string    sprintf(valueString, "%d", avgValue);    //print value over USART    printString("V: ");    printString(valueString);        // ********** Read Horizontal Joystick **********    adcValue = readADC(1);    // store new value, dump oldest    for(i=joystickValues-1;i>0;i--){		horizontalValue[i] = horizontalValue[i-1];	}	horizontalValue[0] = adcValue;	//get average of all saved values    sum = 0;    for(i=0;i<joystickValues;i++){		sum = sum + horizontalValue[i];	}	avgValue = sum/joystickValues;	//convert int to string    sprintf(valueString, "%d", avgValue);    //print value over USART    printString(" H: ");    printString(valueString);        // ********** Read Top Slider **********    adcValue = readADC(2);    // store new value, dump oldest    for(i=slidepotValues-1;i>0;i--){		topSliderValue[i] = topSliderValue[i-1];	}	topSliderValue[0] = adcValue;	//get average of all saved values    sum = 0;    for(i=0;i<slidepotValues;i++){		sum = sum + topSliderValue[i];	}	avgValue = sum/slidepotValues;	//convert int to string//.........这里部分代码省略.........
开发者ID:cdvalenti,项目名称:temple-relief-bot,代码行数:101,


示例24: keyPressed

void ofxSimpleGuiButton::keyPressed( int key ) {	if(key==keyboardShortcut) toggle();}
开发者ID:LEDAangela,项目名称:ofxNetworkedParameters,代码行数:3,


示例25: dumb_output_handle_setting

bool dumb_output_handle_setting(const char *setting, bool show_cursor,				bool startup){  char *p;  int i;  if (!strncmp(setting, "pb", 2)) {    toggle(&show_pictures, setting[2]);    printf("Picture outlines display %s/n", show_pictures ? "ON" : "OFF");    if (startup)      return TRUE;    for (i = 0; i < screen_cells; i++)      screen_changes[i] = (cell_style(screen_data[i]) == PICTURE_STYLE);    dumb_show_screen(show_cursor);  } else if (!strncmp(setting, "vb", 2)) {    toggle(&visual_bell, setting[2]);    printf("Visual bell %s/n", visual_bell ? "ON" : "OFF");    os_beep(1); os_beep(2);  } else if (!strncmp(setting, "ln", 2)) {    toggle(&show_line_numbers, setting[2]);    printf("Line numbering %s/n", show_line_numbers ? "ON" : "OFF");  } else if (!strncmp(setting, "lt", 2)) {    toggle(&show_line_types, setting[2]);    printf("Line-type display %s/n", show_line_types ? "ON" : "OFF");  } else if (*setting == 'c') {    switch (setting[1]) {    case 'm': compression_mode = COMPRESSION_MAX; break;    case 's': compression_mode = COMPRESSION_SPANS; break;    case 'n': compression_mode = COMPRESSION_NONE; break;    case 'h': hide_lines = atoi(&setting[2]); break;    default: return FALSE;    }    printf("Compression mode %s, hiding top %d lines/n",	   compression_names[compression_mode], hide_lines);  } else if (*setting == 'r') {    switch (setting[1]) {    case 'n': rv_mode = RV_NONE; break;    case 'o': rv_mode = RV_DOUBLESTRIKE; break;    case 'u': rv_mode = RV_UNDERLINE; break;    case 'c': rv_mode = RV_CAPS; break;    case 'b': rv_blank_char = setting[2] ? setting[2] : ' '; break;    default: return FALSE;    }    printf("Reverse-video mode %s, blanks reverse to '%c': ",	   rv_names[rv_mode], rv_blank_char);    for (p = "sample reverse text"; *p; p++)      show_cell(make_cell(REVERSE_STYLE, *p));    putchar('/n');    for (i = 0; i < screen_cells; i++)      screen_changes[i] = (cell_style(screen_data[i]) == REVERSE_STYLE);    dumb_show_screen(show_cursor);  } else if (!strcmp(setting, "set")) {    printf("Compression Mode %s, hiding top %d lines/n",	   compression_names[compression_mode], hide_lines);    printf("Picture Boxes display %s/n", show_pictures ? "ON" : "OFF");    printf("Visual Bell %s/n", visual_bell ? "ON" : "OFF");    os_beep(1); os_beep(2);    printf("Line Numbering %s/n", show_line_numbers ? "ON" : "OFF");    printf("Line-Type display %s/n", show_line_types ? "ON" : "OFF");    printf("Reverse-Video mode %s, Blanks reverse to '%c': ",	   rv_names[rv_mode], rv_blank_char);    for (p = "sample reverse text"; *p; p++)      show_cell(make_cell(REVERSE_STYLE, *p));    putchar('/n');  } else    return FALSE;  return TRUE;}
开发者ID:HieuLsw,项目名称:iphonefrotz,代码行数:74,


示例26: QComboBox

AudioTest::AudioTest(){    QWidget *window = new QWidget;    QVBoxLayout* layout = new QVBoxLayout;    deviceBox = new QComboBox(this);    foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::availableDevices(QAudio::AudioOutput))        deviceBox->addItem(deviceInfo.deviceName(), qVariantFromValue(deviceInfo));    connect(deviceBox,SIGNAL(activated(int)),SLOT(deviceChanged(int)));    layout->addWidget(deviceBox);    button = new QPushButton(this);    button->setText(tr("Click for Push Mode"));    connect(button,SIGNAL(clicked()),SLOT(toggle()));    layout->addWidget(button);    button2 = new QPushButton(this);    button2->setText(tr("Click To Suspend"));    connect(button2,SIGNAL(clicked()),SLOT(togglePlay()));    layout->addWidget(button2);    window->setLayout(layout);    setCentralWidget(window);    window->show();    buffer = new char[BUFFER_SIZE];    gen = new Generator(this);    pullMode = true;    timer = new QTimer(this);    connect(timer,SIGNAL(timeout()),SLOT(writeMore()));    gen->start();    settings.setFrequency(SYSTEM_FREQ);    settings.setChannels(1);    settings.setSampleSize(16);    settings.setCodec("audio/pcm");    settings.setByteOrder(QAudioFormat::LittleEndian);    settings.setSampleType(QAudioFormat::SignedInt);    QAudioDeviceInfo info(QAudioDeviceInfo::defaultOutputDevice());    if (!info.isFormatSupported(settings)) {        qWarning()<<"default format not supported try to use nearest";        settings = info.nearestFormat(settings);    }    if(settings.sampleSize() != 16) {        qWarning()<<"audio device doesn't support 16 bit samples, example cannot run";        button->setDisabled(true);        button2->setDisabled(true);        audioOutput = 0;        return;    }    audioOutput = new QAudioOutput(settings,this);    connect(audioOutput,SIGNAL(notify()),SLOT(status()));    connect(audioOutput,SIGNAL(stateChanged(QAudio::State)),SLOT(state(QAudio::State)));    audioOutput->start(gen);}
开发者ID:FreeTymeKiyan,项目名称:BeagleBoard-exercises,代码行数:63,


示例27: def_debug

void def_debug() {	if(key_alt) 	{ 		diag_status(); 		return; 	}	if(key_shift) 	{		diag_status();		freeze_mode = !freeze_mode;		if (freeze_mode)		{			def_oldmouse = mouse_mode;			mouse_mode = 4;			mouse_pointer = 2;		}		else			mouse_mode = def_oldmouse;					while (freeze_mode)		{			if(mouse_left)			watched = mouse_ent;			wait(1);		}		return;	}	if (key_ctrl) {		toggle(viewMap,SHOW);		while is(viewMap,SHOW) {			vec_set(&viewMap->x,&camera->x);			viewMap->z += 10000;			wait(1);		}		return;	}	if(d3d_lines) {		reset(def_debug_pan,SHOW);		d3d_lines = 0;		diag_mode &= ~1;		} else {		if is(def_debug_pan,SHOW) {			d3d_lines = 3;			} else {			set(def_debug_pan,SHOW);			diag_mode |= 1;			while is(def_debug_pan,SHOW) {				def_dfps = 0.9*def_dfps+0.1/time_frame;				def_dtlv = time_level+time_sky;				def_dtcs = time_client+time_server;				def_dtrf = time_update+time_idle;				def_dtac = time_actions+time_pfuncs;				def_cang.pan = cycle(camera->pan,0,360); 				def_cang.tilt = cycle(camera->tilt,-180,180); 				def_cang.roll = cycle(camera->roll,-180,180); 								pan_setcolor(def_debug_pan, 1, 3, vector(0, 255, 0));								wait(1);			}		}	}}
开发者ID:Florastamine,项目名称:Gone-in-November,代码行数:66,


示例28: toggle

void StellarisPortPin::pulse(unsigned long micros) {	toggle();	ROM_SysCtlDelay((40 * micros) / 3);	toggle();}
开发者ID:swindonmakers,项目名称:StellarisLaunchpad,代码行数:5,



注:本文中的toggle函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ toggleHidden函数代码示例
C++ tofilep函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。