DockCont::DockCont() { dragging = false; dockstate = STATE_NONE; base = NULL; waitsync = false; ignoreminsize = false; usersize.cx = usersize.cy = Null; BackPaint(); #ifdef PLATFORM_WIN32 ToolWindow(); #endif NoCenter().Sizeable(true).MaximizeBox(false).MinimizeBox(false); AddFrame(FieldFrame()); AddFrame(tabbar); AddFrame(handle); tabbar.AutoHideMin(1); tabbar.WhenCursor = THISBACK(TabSelected); tabbar.WhenDrag = THISBACK(TabDragged); tabbar.WhenContext = THISBACK(TabContext); tabbar.WhenClose = THISBACK(TabClosed); tabbar.WhenCloseAll = THISBACK(RefreshLayout); tabbar.SetBottom(); handle << close << autohide << windowpos; handle.WhenContext = THISBACK(WindowMenu); handle.WhenLeftDrag = THISBACK(MoveBegin); close.Tip(t_("Close")) <<= THISBACK(CloseAll); autohide.Tip(t_("Auto-Hide")) <<= THISBACK(AutoHide); windowpos.Tip(t_("Window Menu")) <<= THISBACK(WindowMenu); WhenClose = THISBACK(CloseAll); }
Apple::Apple(int rXPx, int rYPx) { APPLESZX = GI("APPLESZX"); APPLESZY = GI("APPLESZY"); APPLE_BRTM = GF("APPLE_BRTM"); mSizeX = APPLESZX; mSizeY = APPLESZY; mX = rXPx; mY = rYPx; mZ = 1.0f; mNo = 0; mTimer = 0.0f; mBaseStatus = NORMAL; // あたり判定 AddFrame(FR_NORMAL); AddCircle(FR_NORMAL, SP->GRID_BOGYO, 20, 20, 15); AddFrame(FR_DISABLE); SetCurFrame(FR_DISABLE); }
RtMainFrame::RtMainFrame(const TGWindow* p) : TGMainFrame(p, 800, 600) { // Create canvas TRootEmbeddedCanvas* eCanvas = new TRootEmbeddedCanvas("Embedded canvas",this,800,600); m_canvas = eCanvas->GetCanvas(); AddFrame(eCanvas, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10, 10, 10, 1)); // ======================================== // Tooltip m_canvas->Connect("ProcessedEvent(Int_t,Int_t,Int_t,TObject*)", "RtMainFrame", this, "eventHandler(Int_t,Int_t,Int_t,TObject*)"); m_tip = new TGToolTip( gClient->GetDefaultRoot(), eCanvas, "", 0 ); // ======================================== // Buttons TGHorizontalFrame *hframe= new TGHorizontalFrame(this, 200,40); // Exit button hframe->AddFrame( new TGTextButton(hframe, "&Quit", "gApplication->Terminate()") , new TGLayoutHints(kLHintsCenterX,5,5,3,4)); // Save button TGTextButton* buttonPDF = new TGTextButton(hframe, "Save &PDF"); TQObject::Connect(buttonPDF, "Clicked()", "RtMainFrame", this, "savePDF()" ); hframe->AddFrame( buttonPDF , new TGLayoutHints(kLHintsCenterX,5,5,3,4)); AddFrame(hframe,new TGLayoutHints(kLHintsCenterX,2,2,2,2)); // Sets window name and shows the main frame SetWindowName("RT-Biplot"); MapSubwindows(); Resize(GetDefaultSize()); MapWindow(); }
void AtmelSWIAnalyzer::ParsePacket(const SWI_Block& block, size_t block_ndx, const std::vector<std::pair<U64, U64> >& ByteSamples) { const U8 Count = block.GetCount(); // is this a status/response block? if (Count == 4) { // make a status block frame AddFrame(ByteSamples[1].first, ByteSamples[1].second, FramePacketSegment, 0, 0x100000000ull | (U64)block_ndx); } else { int offset = 1; // I/O block offset - we are skipping the Count byte int param_cnt = 0; SWI_PacketParam* param; for (param_cnt = 0; PacketParams[param_cnt].Name != NULL; ++param_cnt) { param = PacketParams + param_cnt; if (param->IsCommand == block.IsCommand && param->ForOpcode == block.Opcode && (Count == param->ValidIfCount || param->ValidIfCount == 0)) { // pack the offset and block index into mData2 U64 data2 = offset; data2 <<= 32; data2 |= block_ndx; AddFrame(ByteSamples[offset].first, ByteSamples[offset + param->Length - 1].second, FramePacketSegment, param_cnt, data2); offset += param->Length; } param++; } } }
Puzzle::Puzzle() { size = Size(4, 4); AddFrame(menu); AddFrame(status); lang = LNG_ENGLISH; Init(); }
void ZFrame_MemoryMonitor::AddedToFrameCallback(ZFrame * Frame) { ULong i; for (i=0;i<8;i++) AddFrame(&Digits[i]); for (i=0;i<ZFRAME_MEMORYMONITOR_DISPLAYLINES;i++) AddFrame(&MemLines[i]); for (i=0;i<3;i++) AddFrame(&DispSize[i]); }
GtkWidget * AddDialogFrame( GtkWidget * parent ) { GtkWidget * frame; frame=AddFrame( NULL,GTK_SHADOW_IN,parent,1 ); gtk_container_set_border_width( GTK_CONTAINER( frame ),1 ); frame=AddFrame( NULL,GTK_SHADOW_NONE,frame,1 ); frame=AddFrame( NULL,GTK_SHADOW_ETCHED_OUT,frame,1 ); frame=AddFrame( NULL,GTK_SHADOW_NONE,frame,1 ); return frame; }
void Animation::LoadFromFile(std::string _file) { Parser parser(_file); int isSpriteSheet = parser.retrieveContent("isSpriteSheet").getInt(); int nbFrames = parser.retrieveContent("nbFrames").getInt(); if( parser.retrieveContent("isLoop").getInt() ) m_isLoop = true; else m_isLoop = false; if( isSpriteSheet ) { ParserContent spriteSheetConfig = parser.retrieveContent("spriteSheetConfig"); int width = spriteSheetConfig.getInt(); int height = spriteSheetConfig.getInt(); int nbWidth = spriteSheetConfig.getInt(); int nbHeight = spriteSheetConfig.getInt(); int w = width / nbWidth; int h = height / nbHeight; ParserContent frames = parser.retrieveContent("frames"); for( int i = 0; i < nbFrames; i++ ) { ParserContent frame = frames.getLineAsContent(); std::string filePath = frame.getString(); float duration = frame.getFloat(); int x = i%nbWidth; int y = i / nbWidth; AddFrame(filePath, duration, sf::IntRect(x * w, y * h, w, h)); } } else { ParserContent frames = parser.retrieveContent("frames"); for( int i = 0; i < nbFrames; i++ ) { ParserContent frame = frames.getLineAsContent(); std::string filePath = frame.getString(); float duration = frame.getFloat(); AddFrame(filePath, duration); } } }
void FileTabsExample::OnAllAlign() { if (allalign) { for (int i = 1; i < 4; i++) AddFrame(bar[i]); } else { for (int i = 0; i < 4; i++) bar[i].Remove(); ClearFrames(); AddFrame(bar[0]); } }
void DockBase::InitFrameWork() { panesize = GetSize(); int cx = panesize.cx / 4; int cy = panesize.cy / 3; AddFrame(hide[0]); AddFrame(hide[1]); AddFrame(hide[2]); AddFrame(hide[3]); hide[0].SetLayout(DockCtrlCustomFrame::LAYOUT_LEFT); hide[2].SetLayout(DockCtrlCustomFrame::LAYOUT_RIGHT); hide[1].SetLayout(DockCtrlCustomFrame::LAYOUT_TOP); hide[3].SetLayout(DockCtrlCustomFrame::LAYOUT_BOTTOM); AddFrame(pane[0]); AddFrame(pane[2]); AddFrame(pane[1]); AddFrame(pane[3]); pane[0].SetLayout(this, PaneFrame::LEFT, cx); pane[2].SetLayout(this, PaneFrame::RIGHT, cx); pane[1].SetLayout(this, PaneFrame::TOP, cy); pane[3].SetLayout(this, PaneFrame::BOTTOM, cy); }
void CMoveList::NewMove( const CBotMove& rMove, const CVector& vDelta ) { CMoveData* pNewMoveData; double nRenderTime; CVector vTemp; // Deal with the rendering time nRenderTime = m_tLastSent.Elapsed(); m_tLastSent.SetCurrent(); m_nTotalTime += (float)nRenderTime; m_nTotalMoves++; // Prepare the new CMoveData object pNewMoveData = new CMoveData; rMove.PrepareMoveData( pNewMoveData, vDelta ); pNewMoveData->SetMilliseconds( (BYTE)(nRenderTime * 1000) ); AddFrame( pNewMoveData ); // If this CBotMove moves the bot, record with a CSentMove if ( rMove.GetMove().Length() ) { CSentMove* pNewSentMove = new CSentMove( rMove ); pNewSentMove->SetDuration( nRenderTime ); pNewSentMove->Delta( vTemp ); m_vDeltaOrigin += vTemp; m_lstSentMoves.AddTail( pNewSentMove ); } }
void IKTimelineModel::AddData(float time, float mix, bool isBlendPositive, Math::TweenType tweenType, const List<float>& args) { mMixes.Add(mix); mBlendPositives.Add(isBlendPositive); AddFrame(time, (uint)mMixes.Count() - 1, tweenType, args); }
Animation::Animation() { max_width = 0.0f; max_height = 0.0f; error_frame = AddFrame(0,0,0,0,0,0, true); }
// Parse a 'TILE' chunk and any image bearing chunks that immediately follow. // 'tile_chunk_size' is the previously validated, padded chunk size. static ParseStatus ParseTile(WebPDemuxer* const dmux, uint32_t tile_chunk_size) { const int has_tiles = !!(dmux->feature_flags_ & TILE_FLAG); const uint32_t min_size = tile_chunk_size + CHUNK_HEADER_SIZE; int added_tile = 0; MemBuffer* const mem = &dmux->mem_; Frame* frame; ParseStatus status = NewFrame(mem, min_size, TILE_CHUNK_SIZE, tile_chunk_size, &frame); if (status != PARSE_OK) return status; frame->is_tile_ = 1; frame->x_offset_ = 2 * GetLE24s(mem); frame->y_offset_ = 2 * GetLE24s(mem); Skip(mem, tile_chunk_size - TILE_CHUNK_SIZE); // skip any trailing data. // Store a (potentially partial) tile only if the tile flag is set // and the tile contains some data. status = StoreFrame(dmux->num_frames_, mem, frame); if (status != PARSE_ERROR && has_tiles && frame->frame_num_ > 0) { // Note num_frames_ is incremented only when all tiles have been consumed. added_tile = AddFrame(dmux, frame); if (!added_tile) status = PARSE_ERROR; } if (!added_tile) free(frame); return status; }
HelpViewer::HelpViewer() { // adds toolbar AddFrame(toolBar); // setups splitter and its contents Add(splitter); splitter.Horz(tocPane, contentsPane).SetPos(2500); contentsPane.AutoHideSb(); contentsPane.SetZoom(Zoom(1,1)); contentsPane.HMargins(20); tocPane.Add(mainTocTree.NoRoot().SizePos()); // setup TOC link callback mainTocTree.WhenSel = THISBACK(tocLinkCb); contentsPane.WhenLink << THISBACK(contentLinkCb); // initialize link stack stack.Clear(); tos = -1; Sizeable().Zoomable(); // loads toolbar toolBar.Set(THISBACK(toolBarCb)); }
void QModelRAW::Import() { QFrame *pNewFrame = new QFrame(m_pEngine,1); // Crea frame con espacio para 1 QMalla QMesh *pNewMesh = new QMesh(1); // Crea QMalla con espacio para una QPrimitiva // Crea primitiva : QTriangleList basado en los datos leidos QTriangleList *pNewTriangleList = new QTriangleList(m_pEngine,NumVertex,pVertexList, NumTriangles,pTriangleList,0,NULL); // Crea lista de triangulos // Añadir primitiva a la QMalla pNewMesh->AddPrimitive(pNewTriangleList); // Añadir QMalla a QFrame pNewFrame->AddMesh(pNewMesh); // Añadir el QFrame final AddFrame(pNewFrame); // IMPORTANTE // SE CREAN AQUILAS MESHES //QMesh *pMesh = new QMesh(MAX_PRIMITIVES_PER_MESH,m_pEngine,NumVertex,pVertexList, NumTriangles,pTriangleList); //m_pMeshes[m_NumMeshes] = pMesh; //m_NumMeshes++; // delete pMesh; NO, porque se destruye en pmeshes }
void CTaskDialog::LayoutControls(void) { // layout controls int cx_buttons = 0; int cx_width = CalculateDialogWidth(cx_buttons); int cy_height = 0; int x = cx_margin; int y = cy_margin; // add content area { if (config_.pszMainInstruction != 0 || config_.pszMainIcon != 0) y += cy_spacing + AddMainInstruction(x, y, cx_width - cx_margin - cx_margin); if (config_.pszContent != 0) y += cy_spacing + AddContent(x, y, cx_width - cx_margin - cx_margin); if (config_.cRadioButtons != 0) y += cy_spacing + AddRadioButtons(x, y, cx_width - cx_margin - cx_margin); if (HasFlag(TDF_SHOW_PROGRESS_BAR)) y += cy_spacing + AddProgressBar(x, y, cx_width - cx_margin - cx_margin); cy_height = y; } { y = AddFrame(0, 0, cx_width, cy_height); y += AddDividingLine(0, y, cx_width); y += cy_spacing; } // add row of buttons { y += cy_spacing + AddButtons(cx_margin + cx_width - cx_buttons, y, cx_width); } // add verification text if (config_.pszVerificationText != 0) { y += cy_spacing + AddVerificationCheckBox(cx_margin, y, cx_width - cx_margin - cx_margin); } // add footer area if (config_.pszFooter != 0 || config_.pszFooterIcon != 0) { y += cy_spacing + AddFooterDividingLine(0, y, cx_width); y += cy_spacing + AddFooter(cx_margin, y, cx_width - cx_margin - cy_margin); } y += cy_margin - cy_spacing; y += ::GetSystemMetrics(SM_CYCAPTION); // update dialog dimension RECT rect = { 0, 0, cx_width, y }; SetWindowPos(0, &rect, SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER); }
MainDlg::MainDlg() { ::CtrlLayout( *this, "I18n Layout Test" ); AddFrame( m_menu ); m_menu.Set( THISBACK(OnMenu) ); AddFrame( InsetFrame() ); m_file <<= THISBACK(OnFile); m_pallette <<= THISBACK(OnPallette); m_printer <<= THISBACK(OnPrinter); OnChangeLanguage( ::GetCurrentLanguage() ); m_close <<= Rejector( IDCANCEL ); }
ICCItem *CCodeChainCtx::RunLambda (ICCItem *pCode) // RunLambda // // Runs a piece of code or a lambda expression // and returns a result (which must be discarded by the caller) { DEBUG_TRY AddFrame(); // If this is a lambda expression, then eval as if // it were an expression with no arguments ICCItem *pResult; if (pCode->IsFunction()) pResult = m_CC.Apply(pCode, m_CC.CreateNil(), this); else pResult = m_CC.TopLevel(pCode, this); // Done RemoveFrame(); return pResult; DEBUG_CATCH }
void MediaRecorder::Stop() { if(oc) { if(in_audio_buf2) AddFrame((u16 *)0); av_write_trailer(oc); avformat_free_context(oc); oc = NULL; } if(audio_buf) { free(audio_buf); audio_buf = NULL; } if(video_buf) { free(video_buf); video_buf = NULL; } if(audio_buf2) { free(audio_buf2); audio_buf2 = NULL; } if(convpic) { avpicture_free((AVPicture *)convpic); av_free(convpic); convpic = NULL; } if(converter) { sws_freeContext(converter); converter = NULL; } }
bool mitk::MovieGenerator::WriteCurrentFrameToMovie() { if (m_renderer) { m_renderer->GetRenderWindow()->MakeCurrent(); if(!m_initialized) { RenderingManager::GetInstance()->ForceImmediateUpdate(m_renderer->GetRenderWindow()); m_initialized = InitGenerator(); } if (!m_initialized) { TerminateGenerator(); return false; } int imgSize = 3 * m_width * m_height; GLbyte *data = new GLbyte[imgSize]; RenderingManager::GetInstance()->ForceImmediateUpdate(m_renderer->GetRenderWindow()); glReadPixels( 5, 5, m_width, m_height, GL_BGR, GL_UNSIGNED_BYTE, (void*)data ); AddFrame( data ); delete[] data; } return true; }
AppPreview::AppPreview() { SetFrame(ViewFrame()); AddFrame(sb); sb <<= THISBACK(Scroll); NoWantFocus(); }
static ParseStatus CreateRawImageDemuxer(MemBuffer* const mem, WebPDemuxer** demuxer) { WebPBitstreamFeatures features; const VP8StatusCode status = WebPGetFeatures(mem->buf_, mem->buf_size_, &features); *demuxer = NULL; if (status != VP8_STATUS_OK) { return (status == VP8_STATUS_NOT_ENOUGH_DATA) ? PARSE_NEED_MORE_DATA : PARSE_ERROR; } { WebPDemuxer* const dmux = (WebPDemuxer*)WebPSafeCalloc(1ULL, sizeof(*dmux)); Frame* const frame = (Frame*)WebPSafeCalloc(1ULL, sizeof(*frame)); if (dmux == NULL || frame == NULL) goto Error; InitDemux(dmux, mem); SetFrameInfo(0, mem->buf_size_, 1 /*frame_num*/, 1 /*complete*/, &features, frame); if (!AddFrame(dmux, frame)) goto Error; dmux->state_ = WEBP_DEMUX_DONE; dmux->canvas_width_ = frame->width_; dmux->canvas_height_ = frame->height_; dmux->feature_flags_ |= frame->has_alpha_ ? ALPHA_FLAG : 0; dmux->num_frames_ = 1; assert(IsValidSimpleFormat(dmux)); *demuxer = dmux; return PARSE_OK; Error: WebPSafeFree(dmux); WebPSafeFree(frame); return PARSE_ERROR; } }
void Sprite::LoadFromText(const char *text) { TextParser parser; parser.Parse(text); TextParser::NODE *node = NULL; if ((node = parser.GetNode("FILETYPE")) && node->values[0] == "SPRITE") { if ((node = parser.GetNode("RESOURCE"))) { _texture = static_cast<Texture*>(LE_ResourceManager.GetResourceWithRegister(node->values[0].GetCharPtr())->data); } if ((node = parser.GetNode("FRAMES"))) { for (size_t i = 0; i<node->children.count(); i++) { TextParser::NODE *child = node->children[i]; if (child) { TextParser::NODE *node_rect = child->FindChild("RECT"); if (node_rect) { AddFrame(iRect(node_rect->values[0].ToInt(), node_rect->values[1].ToInt(), node_rect->values[2].ToInt(), node_rect->values[3].ToInt() )); } } } } } }
// Parse a 'FRGM' chunk and any image bearing chunks that immediately follow. // 'fragment_chunk_size' is the previously validated, padded chunk size. static ParseStatus ParseFragment(WebPDemuxer* const dmux, uint32_t fragment_chunk_size) { const int frame_num = 1; // All fragments belong to the 1st (and only) frame. const int is_fragmented = !!(dmux->feature_flags_ & FRAGMENTS_FLAG); const uint32_t frgm_payload_size = fragment_chunk_size - FRGM_CHUNK_SIZE; int added_fragment = 0; MemBuffer* const mem = &dmux->mem_; Frame* frame; ParseStatus status = NewFrame(mem, FRGM_CHUNK_SIZE, fragment_chunk_size, &frame); if (status != PARSE_OK) return status; frame->is_fragment_ = 1; frame->x_offset_ = 2 * ReadLE24s(mem); frame->y_offset_ = 2 * ReadLE24s(mem); // Store a fragment only if the 'fragments' flag is set and there is some // data available. status = StoreFrame(frame_num, frgm_payload_size, mem, frame); if (status != PARSE_ERROR && is_fragmented && frame->frame_num_ > 0) { added_fragment = AddFrame(dmux, frame); if (!added_fragment) { status = PARSE_ERROR; } else { dmux->num_frames_ = 1; } } if (!added_fragment) free(frame); return status; }
NAMESPACE_UPP #define LLOG(x) // LOG(x) #define LTIMING(x) // RTIMING(x) LineEdit::LineEdit() { isdrag = false; nohbar = false; showtabs = false; tabsize = 4; font = CourierZ(12); SetFrame(ViewFrame()); sb.NoBox(); AddFrame(sb); sb.WhenScroll = THISBACK(Scroll); cutline = true; bordercolumn = -1; bordercolor = Null; overwrite = false; filter = NULL; showspaces = false; showlines = false; showreadonly = true; dorectsel = false; hline = Null; warnwhitespace = false; }
KaeruKing::KaeruKing(int rXPx, int rYPx) { KAERUKSX = GI("KAERUKSX"); KAERUKSY = GI("KAERUKSY"); KTAIKI_TIME = GF("KTAIKI_TIME"); KJUMPSTART_TIME = GF("KJUMPSTART_TIME"); KJMPSPX = GF("KJMPSPX"); KJMPTAKASA = GF("KJMPTAKASA"); mX = rXPx; mY = rYPx - sMapAtHanteiY[0][0] + SP->CHSZY; mSizeX = KAERUKSX; mSizeY = KAERUKSY; mStatus = JUMP; mTaikiTimer = 0.0f; mCurAshiba = NULL; // 当たり判定 AddFrame(0); AddCircle(0, SP->GRID_BOGYO, 44, 44, 44); AddIndexedRect(0, SP->GRID_BOUND, TBOUND_IDX, 10, 12, 73, 85); SetCurFrame(0); }
FileTabsExample::FileTabsExample() { CtrlLayout(*this, "FileTabs Example"); Sizeable().Zoomable(); for (int i = 0; i < 4; i++) bar[i].SetAlign((i+1) % 4); AddFrame(bar[0]); bar[0] <<= THISBACK(OnCursor); addfile <<= THISBACK(OnAdd); insert <<= THISBACK(OnInsert); grouping <<= THISBACK(OnGrouping); groupsort <<= THISBACK(OnGroupSort); separators <<= THISBACK(OnSeparators); stacking <<= THISBACK(OnStacking); normalicons <<= THISBACK(OnIcons); stackedicons <<= THISBACK(OnIcons); prompt <<= THISBACK(OnPrompt); allalign <<= THISBACK(OnAllAlign); valuesort <<= THISBACK(OnValueSort); keysort <<= THISBACK(OnKeySort); grouping <<= true; inactive <<= true; normalicons <<= true; OnInsert(); OnCursor(); }
std::unique_ptr<Entity> EntityFactory::CreateFlyingEnemy(int x, int y, Entity *target) { auto e = BaseEnemy(x, y); e->AddComponent(ComponentType::AI, std::unique_ptr<FlyingAiComponent>(new FlyingAiComponent(target))); auto g = static_cast<GraphicsComponent *>(e->GetComponent(ComponentType::GRAPHICS)); auto c = static_cast<CollisionComponent *>(e->GetComponent(ComponentType::COLLISION)); g->AddFrame(0, 200028, 5); g->AddFrame(0, 200032, 5); c->AddHitbox(0,0,70,35, HitboxType::SOLID); c->AddHitbox(0,0,70,35, HitboxType::TRIGGER); std::unique_ptr<SoundComponent> sound(new SoundComponent()); sound->AddSoundEffect(SoundEffectType::DEATH, SOUND_MONSTER_DEATH); e->AddComponent(ComponentType::SOUND, std::move(sound)); auto spawnHealthPickupOnDeathScript = Compiler::Compile("data/scripts/SpawnHealthPickupOnDeathScript.txt"); RegisterNativeBindings(spawnHealthPickupOnDeathScript); e->AddVmScript(std::move(spawnHealthPickupOnDeathScript)); return e; }
void NFTHistos::Init() { fCanvas = new TRootEmbeddedCanvas("Canvas", this, 400, 400); AddFrame(fCanvas,new TGLayoutHints(kLHintsRight | kLHintsExpandX | kLHintsExpandY, 0, 0, 1, 1)); fCanvas->GetCanvas()->cd(); histo2 = new TH1F("histo2","Histo 2",200,-100,100); histo2->Draw(); }