Rect Transform::transform(const Rect& bounds) const { Rect r; vec2 lt( bounds.left, bounds.top ); vec2 rt( bounds.right, bounds.top ); vec2 lb( bounds.left, bounds.bottom ); vec2 rb( bounds.right, bounds.bottom ); lt = transform(lt); rt = transform(rt); lb = transform(lb); rb = transform(rb); r.left = floorf(min(lt[0], rt[0], lb[0], rb[0]) + 0.5f); r.top = floorf(min(lt[1], rt[1], lb[1], rb[1]) + 0.5f); r.right = floorf(max(lt[0], rt[0], lb[0], rb[0]) + 0.5f); r.bottom = floorf(max(lt[1], rt[1], lb[1], rb[1]) + 0.5f); return r; }
const char* ARMv7DOpcodeLoadStoreRegisterImmediate::format() { const char* instructionName = opName(); if (!instructionName) return defaultFormat(); appendInstructionName(opName()); appendRegisterName(rt()); appendSeparator(); appendCharacter('['); appendRegisterName(rn()); if (immediate5()) { appendSeparator(); appendUnsignedImmediate(immediate5() << scale()); } appendCharacter(']'); return m_formatBuffer; }
void CAlmanacDiagramCtrl::DrawStarPos(CDC *pDc, const CRect &rect) { ASSERT(pDc != NULL); if (pDc==NULL || m_strDir.GetLength()!=4) { return; } CFont *OldFont = (CFont*)pDc->SelectObject(&m_TextFont); for (int j=90; j<=360; j+=90) { POINT pt; pt.x = m_centerCircle.x + m_iRadius * sin(j*PI/180); pt.y = m_centerCircle.y - m_iRadius * cos(j*PI/180); CRect rt; rt.SetRect(pt.x-7, pt.y-7, pt.x+7, pt.y+7); CString str; str = m_strDir.Mid(j/90-1, 1); pDc->DrawText(str, &rt, DT_SINGLELINE|DT_CENTER|DT_VCENTER); } pDc->SetBkMode(TRANSPARENT); pDc->SelectObject(&m_StarFont); for (int i=0; i<m_iStarNum; i++) { POINT pt = CalStarPos(m_StarData[i]); if (m_StarData[i].tracked == 1) { pDc->DrawIcon(pt.x-Icon_Size/2, pt.y-Icon_Size/2, m_hSigStrong); } else { pDc->DrawIcon(pt.x-Icon_Size/2, pt.y-Icon_Size/2, m_hSigWeak); } CRect rt(pt.x-Icon_Size/2, pt.y-Icon_Size/2, pt.x+Icon_Size/2, pt.y+Icon_Size/2); CString str; str.Format(_T("%d"), m_StarData[i].id); pDc->DrawText(str, &rt, DT_SINGLELINE|DT_CENTER|DT_VCENTER); } pDc->SelectObject(OldFont); }
int main(int, char**) { bool not_done = true; dds::Runtime rt(""); dds::Topic<TempSensorType> topic("TempSensorTopic"); dds::DataReader<TempSensorType> dr(topic); //[NOTE #1]: Create an instance of the handler TempSensorDataHandler handler; auto func = boost::bind(TempSensorDataHandler::handle_data, &handler, _1); //[NOTE #2]: Register the handler for the relevant event auto connection = dr.connect<on_data_available>(func); return 0; }
void FcitxQtConnectionPrivate::initialize() { m_serviceWatcher->setConnection(QDBusConnection::sessionBus()); m_serviceWatcher->addWatchedService(m_serviceName); QFileInfo info(socketFile()); QDir dir(info.path()); if (!dir.exists()) { QDir rt(QDir::root()); rt.mkpath(info.path()); } m_watcher->addPath(info.path()); if (info.exists()) { m_watcher->addPath(info.filePath()); } connect(m_watcher, &QFileSystemWatcher::fileChanged, this, &FcitxQtConnectionPrivate::socketFileChanged); connect(m_watcher, &QFileSystemWatcher::directoryChanged, this, &FcitxQtConnectionPrivate::socketFileChanged); m_initialized = true; }
TEST(Type, RuntimeType) { HPHP::Transl::RuntimeType rt(new StringData()); Type t = Type::fromRuntimeType(rt); EXPECT_TRUE(t.subtypeOf(Type::Str)); EXPECT_FALSE(t.subtypeOf(Type::Int)); rt = HPHP::Transl::RuntimeType(HphpArray::GetStaticEmptyArray()); t = Type::fromRuntimeType(rt); EXPECT_TRUE(t.subtypeOf(Type::Arr)); EXPECT_FALSE(t.subtypeOf(Type::Str)); rt = HPHP::Transl::RuntimeType(true); t = Type::fromRuntimeType(rt); EXPECT_TRUE(t.subtypeOf(Type::Bool)); EXPECT_FALSE(t.subtypeOf(Type::Obj)); rt = HPHP::Transl::RuntimeType((int64_t) 1); t = Type::fromRuntimeType(rt); EXPECT_TRUE(t.subtypeOf(Type::Int)); EXPECT_FALSE(t.subtypeOf(Type::Dbl)); rt = HPHP::Transl::RuntimeType(DataType::KindOfObject, DataType::KindOfInvalid); rt = rt.setKnownClass(SystemLib::s_TraversableClass); t = Type::fromRuntimeType(rt); EXPECT_TRUE(t.subtypeOf(Type::Obj)); EXPECT_FALSE(Type::Obj.subtypeOf(t)); EXPECT_FALSE(Type::Int.subtypeOf(t)); HPHP::Transl::RuntimeType rt1 = HPHP::Transl::RuntimeType(DataType::KindOfObject, DataType::KindOfInvalid); rt1 = rt1.setKnownClass(SystemLib::s_IteratorClass); Type t1 = Type::fromRuntimeType(rt1); EXPECT_TRUE(t1.subtypeOf(Type::Obj)); EXPECT_TRUE(t1.subtypeOf(t)); EXPECT_FALSE(Type::Obj.subtypeOf(t1)); EXPECT_FALSE(t.subtypeOf(t1)); EXPECT_FALSE(t.subtypeOf(Type::Str)); EXPECT_FALSE(Type::Int.subtypeOf(t)); }
sk_sp<GrRenderTargetContext> GrDrawingManager::makeRenderTargetContext( sk_sp<GrRenderTargetProxy> rtp, sk_sp<SkColorSpace> colorSpace, const SkSurfaceProps* surfaceProps) { if (this->wasAbandoned()) { return nullptr; } // SkSurface catches bad color space usage at creation. This check handles anything that slips // by, including internal usage. We allow a null color space here, for read/write pixels and // other special code paths. If a color space is provided, though, enforce all other rules. if (colorSpace && !SkSurface_Gpu::Valid(fContext, rtp->config(), colorSpace.get())) { SkDEBUGFAIL("Invalid config and colorspace combination"); return nullptr; } bool useDIF = false; if (surfaceProps) { useDIF = surfaceProps->isUseDeviceIndependentFonts(); } if (useDIF && fContext->caps()->shaderCaps()->pathRenderingSupport() && rtp->isStencilBufferMultisampled()) { // TODO: defer stencil buffer attachment for PathRenderingDrawContext sk_sp<GrRenderTarget> rt(sk_ref_sp(rtp->instantiate(fContext->textureProvider()))); GrStencilAttachment* sb = fContext->resourceProvider()->attachStencilAttachment(rt.get()); if (sb) { return sk_sp<GrRenderTargetContext>(new GrPathRenderingRenderTargetContext( fContext, this, std::move(rtp), std::move(colorSpace), surfaceProps, fContext->getAuditTrail(), fSingleOwner)); } } return sk_sp<GrRenderTargetContext>(new GrRenderTargetContext(fContext, this, std::move(rtp), std::move(colorSpace), surfaceProps, fContext->getAuditTrail(), fSingleOwner)); }
/////////////////////////////////////////////////////////////////////// // priority abp scheduler: local priority deques for each OS thread, // with work stealing from the "bottom" of each. int run_priority_abp(startup_function_type const& startup, shutdown_function_type const& shutdown, util::command_line_handling& cfg, bool blocking) { ensure_hierarchy_arity_compatibility(cfg.vm_); ensure_hwloc_compatibility(cfg.vm_); std::size_t num_high_priority_queues = cfg.num_threads_; if (cfg.vm_.count("hpx:high-priority-threads")) { num_high_priority_queues = cfg.vm_["hpx:high-priority-threads"].as<std::size_t>(); } bool numa_sensitive = false; if (cfg.vm_.count("hpx:numa-sensitive")) numa_sensitive = true; // scheduling policy typedef hpx::threads::policies::abp_priority_queue_scheduler abp_priority_queue_policy; abp_priority_queue_policy::init_parameter_type init( cfg.num_threads_, num_high_priority_queues, 1000, numa_sensitive); // Build and configure this runtime instance. typedef hpx::runtime_impl<abp_priority_queue_policy> runtime_type; HPX_STD_UNIQUE_PTR<hpx::runtime> rt( new runtime_type(cfg.rtcfg_, cfg.mode_, cfg.num_threads_, init)); if (blocking) { return run(*rt, cfg.hpx_main_f_, cfg.vm_, cfg.mode_, startup, shutdown); } // non-blocking version start(*rt, cfg.hpx_main_f_, cfg.vm_, cfg.mode_, startup, shutdown); rt.release(); // pointer to runtime is stored in TLS return 0; }
int main(int argc, char** argv) { try { std::string script = LoadScript(argc, argv); rs::jsapi::Runtime rt(1024 * 1024 * 1024, true, true); auto app = new Application(rt, "com.ripcordsoftware.examples.gtk", 1, argv); rs::jsapi::Global::DefineProperty(rt, "app", *app); auto builder = new Builder(rt); rs::jsapi::Global::DefineProperty(rt, "builder", *builder); rs::jsapi::Global::DefineFunction(rt, "trace", [](const std::vector<rs::jsapi::Value>& args, rs::jsapi::Value& result){ for (auto arg : args) { std::cout << arg.ToString(); } if (args.size() > 0) { std::cout << std::endl; } return true; }); rt.Evaluate(script.c_str()); //rs::jsapi::Script scr(rt, script.c_str()); //scr.Compile(); //scr.Execute(); } catch (const rs::jsapi::ScriptException& ex) { std::cerr << "ERROR: line " << ex.lineno << std::endl << ex.what() << std::endl << ex.linebuf << std::endl; } return 0; }
QSize K3ActiveLabel::minimumSizeHint() const { QSize ms = minimumSize(); if ((ms.width() > 0) && (ms.height() > 0)) return ms; int w = 400; if (ms.width() > 0) w = ms.width(); QString txt = toHtml(); Q3SimpleRichText rt(txt, font()); rt.setWidth(w - 2*frameWidth() - 10); w = 10 + rt.widthUsed() + 2*frameWidth(); if (w < ms.width()) w = ms.width(); int h = rt.height() + 2*frameWidth(); if ( h < ms.height()) h = ms.height(); return QSize(w, h); }
void MainWindow::newCellTest() { QString rts("root"), rrts("right of root and quite long at that"), lrts("left of root"); ZZCell rt((cellID)1, 0, rts), rrt((cellID)2, 0, rrts), lrt((cellID)3, 0, lrts); // QHash should make a copy for us // since these guys will be dead soon world.insert(1, rt); world.insert(2, rrt); world.insert(3, lrt); // Construct our top-level squares QGraphicsRectItem *rt_rect = new QGraphicsRectItem(0,0,100,20), *rrt_rect = new QGraphicsRectItem(0,0,100,20), *lrt_rect = new QGraphicsRectItem(0,0,100,20); QGraphicsTextItem *rt_text = new QGraphicsTextItem(rt.getContent(), rt_rect), *rrt_text = new QGraphicsTextItem(rrt.getContent(), rrt_rect), *lrt_text = new QGraphicsTextItem(lrt.getContent(), lrt_rect); rt_rect->setPos(420, 420); rrt_rect->setPos(530, 420); lrt_rect->setPos(310, 420); // Add our toplevel squares to our scene scene->addItem(rt_rect); scene->addItem(rrt_rect); scene->addItem(lrt_rect); scene->update(); ui->zzViewWidget->show(); }
bool RegexSourceSink::StartAcquisition(QString dev) { QRegExp rx("(.+)/(.+)(\\..+)"); int pos=0; pos=rx.indexIn(dev); dir=rx.cap(1); basename=rx.cap(2); extension=rx.cap(3); QRegExp rt("(\\d+$)"); pos=rt.indexIn(basename); basename.truncate(pos); // qDebug()<<dir<<basename<<rt.cap(1)<<extension; QString regexString=basename+"\\d+"+extension; // qDebug()<<"Will load files that match"<<regexString; QRegExp movieRegex(regexString); QDir basedir(dir); if (!basedir.exists()) qDebug()<<"Extracted dir does not exist"<<dir; QStringList filt; filt<<"*"+extension; basedir.setNameFilters(filt); QStringList files=basedir.entryList(); goodFiles=new QStringList; for (int i=0;i<files.count();i++) { if (movieRegex.indexIn(files.at(i))!=-1) { goodFiles->append(files.at(i)); } } if (goodFiles->count()==0) qDebug()<<"No matching files found"; index=0; nFrames=goodFiles->count(); return true; }
virtual void clientMouseMove(const twPoint& pt){ if(m_drag!=-1){ twRect rt(twPoint(0,0),getClientRect().size()); bool newHover=rt&&pt; int newDrag=pt.y/m_rowHeight; if(newDrag<0) newDrag=0; if(newDrag>=(int)items().size()) newDrag=items().size()-1; if(newHover!=m_hover || newDrag!=m_drag){ invalidateClientRect(rectForItem(m_drag)); invalidateClientRect(rectForItem(newDrag)); m_hover=newHover; m_drag=newDrag; } } }
std::list<pBlock> ClearInterval:: discardOutside(Signal::Interval& I) { std::list<pBlock> discarded; BlockCache::cache_t C = cache_->clone(); for (BlockCache::cache_t::value_type itr : C) { pBlock block(itr.second); Signal::Interval blockInterval = block->getInterval(); Signal::Interval toKeep = I & blockInterval; bool remove_entire_block = toKeep == Signal::Interval(); bool keep_entire_block = toKeep == blockInterval; if ( remove_entire_block ) { discarded.push_back (block); } else if ( keep_entire_block ) { } else { // clear partial block if( I.first <= blockInterval.first && I.last < blockInterval.last ) { Region ir = block->getRegion (); ResampleTexture rt(block->glblock->glTexture ()->getOpenGlTextureId ()); ResampleTexture::Area A(ir.a.time, ir.a.scale, ir.b.time, ir.b.scale); GlFrameBuffer::ScopeBinding sb = rt.enable(A); float t = I.last / block->block_layout ().targetSampleRate(); A.x1 = t; rt.drawColoredArea (A, 0.f); (void)sb; // RAII } } } return discarded; }
void Ski_area_gui::draw_lines() const { int r = sa->get_r(); int c = sa->get_c(); for (int i = 0; i < r; ++i){ for (int j = 0; j < c; ++j){ Graph_lib::Rectangle rt(Point(pos.x + j*width, pos.y + i*height), width, height); ostringstream oss; oss << sa->get_height(i + 1, j + 1); if (comment[i][j] != ""){ oss << '(' << comment[i][j] << ')'; } Graph_lib::Text t(Point(pos.x + j*width + width / 2, pos.y + i*height + height), oss.str()); if (hl[i][j]){ t.set_color(Graph_lib::Color::white); rt.set_fill_color(Graph_lib::Color::black); } rt.draw(); t.draw(); } } }
PlayRequest Session::play( const PlayRequest & rq ) throw( RTSP::Exception::ManagedError ) { try { Session::Lock lk( *this ); Log::debug( "%s: pre-play", getLogName() ); // guess common parameters PlayRequest rt( rq ); BOOST_FOREACH( SessionMap::iterator::reference sess, _sessions ) { rt.merge( sess->second->eval( rq ) ); Log::debug("%s: merge: %s", getLogName(), rt.toString().c_str() ); } Log::debug( "%s: play setup with %s", getLogName(), rt.toString().c_str() ); // set it up BOOST_FOREACH( SessionMap::iterator::reference sess, _sessions ) sess->second->play( rt ); _playIssued = true; return rt; }
bool operator()(iterator texta, iterator texte, uint64_t pb) const { assert ( fs ); pb %= fs; typename factory_type::wrapper_ptr_type cwb(factory_type::construct(filename,pb)); while ( texta != texte ) { typename factory_type::int_type const ca = *(texta++); typename factory_type::int_type const cb = cwb->get(); assert ( ca != factory_type::base_istream_type::traits_type::eof() ); assert ( cb != factory_type::base_istream_type::traits_type::eof() ); if ( ca != cb ) return ca < cb; } std::runtime_error rt("CircularSuffixComparator::operator(iterator,iterator,uint64_t): comparison extends beyond end of given text."); throw rt; }
void ListViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) { if (text(column).isNull()) { K3ListViewItem::paintCell(p, cg, column, width, alignment); int pad = 0; if (pixmap(column)) { pad = pixmap(column)->width() + 5; } Q3SimpleRichText rt(m_richText[column], p->font()); rt.draw(p, pad, 0, QRect(pad, 0, width, height()), cg); } else if (m_colors.contains(column)) { /*QColorGroup _cg(cg); QColor c = _cg.text(); _cg.setColor(QColorGroup::Text, m_colors[column]);*/ K3ListViewItem::paintCell(p, cg, column, width, alignment); //_cg.setColor(QColorGroup::Text, c); } else { K3ListViewItem::paintCell(p, cg, column, width, alignment); } }
void worker_proc() { Runtime rt(NULL); AsyncEvent* p; m_idleWorkers.dec(); while (true) { if (m_idleWorkers.inc() > m_max_idle) { if (m_idleWorkers.dec() > 0) break; m_idleWorkers.inc(); } p = m_pool.get(); if (m_idleWorkers.dec() == 0) if (m_idleWorkers.CompareAndSwap(0, 1) == 0) new_worker(); p->invoke(); } }
//! Start subscriptions for this resource. void ResourceCached::startSubscriptions() { OsSysLog::add(FAC_RLS, PRI_DEBUG, "ResourceCached::startSubscriptions URI = '%s'", data()); // Create the ContactSet. mContactSetP = new ContactSet(this, // The URI, which is the UtlString-nature // of a RecourceCached. *(static_cast <UtlString*> (this)) ); // Start the refresh timer. // Choose a random time between 1/2 and 1 times // ResourceListServer::getRefreshInterval(). int refresh_time = (int) ((1.0 + ((float) sRandom.rand()) / RAND_MAX) / 2.0 * getResourceListServer()->getRefreshInterval()); OsSysLog::add(FAC_RLS, PRI_DEBUG, "ResourceCached::startSubscriptions refresh_time = %d", refresh_time); OsTime rt(refresh_time, 0); mRefreshTimer.oneshotAfter(rt); }
TooN::SO3<> computeMeanOrientation( const std::vector<TooN::SO3<> > & r){ const size_t N = r.size(); std::vector<TooN::SO3<> > rt(N); TooN::SO3<> base = r.front(); TooN::SO3<> baseInv = base.inverse(); TooN::Vector<3> center = TooN::Zeros; for(unsigned int i = 0; i < N; i++){ rt[i] = r[i] * baseInv; center += rt[i].ln(); } center /= N; TooN::SO3<> mean(center); do { center = TooN::Zeros; for(unsigned int i = 0; i < N; i++){ TooN::SO3<> diff = rt[i] * mean.inverse(); center += diff.ln(); } center /= N; mean = TooN::SO3<>::exp(center) * mean; } while(center * center > 1e-12); return mean * base; }
static sk_sp<GrDrawContext> random_draw_context(GrContext* context, SkRandom* random, const GrCaps* caps) { GrSurfaceOrigin origin = random->nextBool() ? kTopLeft_GrSurfaceOrigin : kBottomLeft_GrSurfaceOrigin; int sampleCnt = random->nextBool() ? SkTMin(4, caps->maxSampleCount()) : 0; GrUniqueKey key; static const GrUniqueKey::Domain kDomain = GrUniqueKey::GenerateDomain(); GrUniqueKey::Builder builder(&key, kDomain, 2); builder[0] = origin; builder[1] = sampleCnt; builder.finish(); sk_sp<GrTexture> texture(context->textureProvider()->findAndRefTextureByUniqueKey(key)); if (texture) { sk_sp<GrRenderTarget> rt(sk_ref_sp(texture->asRenderTarget())); return context->drawContext(std::move(rt)); } sk_sp<GrDrawContext> drawContext(context->newDrawContext(SkBackingFit::kExact, kRenderTargetWidth, kRenderTargetHeight, kRGBA_8888_GrPixelConfig, sampleCnt, origin)); if (!drawContext) { return nullptr; } // TODO: need a real way to do this via the drawContext texture = drawContext->asTexture(); context->textureProvider()->assignUniqueKeyToTexture(key, texture.get()); return drawContext; }
static void rtbox(double r,double theta,double wtheta,const char *label) { coord v[4]; double htheta,hr; htheta=wtheta/2; hr=r*htheta; v[0]=rt(r-hr,theta-htheta); v[1]=rt(r+hr,theta-htheta); v[2]=rt(r+hr,theta+htheta); v[3]=rt(r-hr,theta+htheta); startgroup(); printf("<path "LT" d=\"M%f %f L%f %f L%f %f L%f %f Z\"/>\n", XY(v[0]),XY(v[1]),XY(v[2]),XY(v[3])); crosshair(rt(r,theta),5); text_cen(rt(r+0.8*hr,theta),theta,24,label); endgroup(); }
iterator at( unsigned int pos_) {iterator rt(this); return rt+pos_;}
const_iterator at( unsigned int pos_) const {const_iterator rt(this); return rt+pos_;}
iterator begin() {iterator rt(this); return rt;}
const_iterator begin() const {const_iterator rt(this); return rt;}
void JamoTest::TestRealText() { // Test text taken from the Unicode web site static const char* const WHAT_IS_UNICODE[] = { "\\uc720\\ub2c8\\ucf54\\ub4dc\\uc5d0", "\\ub300\\ud574", "?", "\\uc5b4\\ub5a4", "\\ud50c\\ub7ab\\ud3fc,", "\\uc5b4\\ub5a4", "\\ud504\\ub85c\\uadf8\\ub7a8,", "\\uc5b4\\ub5a4", "\\uc5b8\\uc5b4\\uc5d0\\ub3c4", "\\uc0c1\\uad00\\uc5c6\\uc774", "\\uc720\\ub2c8\\ucf54\\ub4dc\\ub294", "\\ubaa8\\ub4e0", "\\ubb38\\uc790\\uc5d0", "\\ub300\\ud574", "\\uace0\\uc720", "\\ubc88\\ud638\\ub97c", "\\uc81c\\uacf5\\ud569\\ub2c8\\ub2e4.", "\\uae30\\ubcf8\\uc801\\uc73c\\ub85c", "\\ucef4\\ud4e8\\ud130\\ub294", "\\uc22b\\uc790\\ub9cc", "\\ucc98\\ub9ac\\ud569\\ub2c8\\ub2e4.", "\\uae00\\uc790\\ub098", "\\ub2e4\\ub978", "\\ubb38\\uc790\\uc5d0\\ub3c4", "\\uc22b\\uc790\\ub97c", "\\uc9c0\\uc815\\ud558\\uc5ec", "\\uc800\\uc7a5\\ud569\\ub2c8\\ub2e4.", "\\uc720\\ub2c8\\ucf54\\ub4dc\\uac00", "\\uac1c\\ubc1c\\ub418\\uae30", "\\uc804\\uc5d0\\ub294", "\\uc774\\ub7ec\\ud55c", "\\uc22b\\uc790\\ub97c", "\\uc9c0\\uc815\\ud558\\uae30", "\\uc704\\ud574", "\\uc218\\ubc31", "\\uac00\\uc9c0\\uc758", "\\ub2e4\\ub978", "\\uae30\\ud638\\ud654", "\\uc2dc\\uc2a4\\ud15c\\uc744", "\\uc0ac\\uc6a9\\ud588\\uc2b5\\ub2c8\\ub2e4.", "\\ub2e8\\uc77c", "\\uae30\\ud638\\ud654", "\\ubc29\\ubc95\\uc73c\\ub85c\\ub294", "\\ubaa8\\ub4e0", "\\ubb38\\uc790\\ub97c", "\\ud3ec\\ud568\\ud560", "\\uc218", "\\uc5c6\\uc5c8\\uc2b5\\ub2c8\\ub2e4.", "\\uc608\\ub97c", "\\ub4e4\\uc5b4", "\\uc720\\ub7fd", "\\uc5f0\\ud569\\uc5d0\\uc11c\\ub9cc", "\\ubcf4\\ub354\\ub77c\\ub3c4", "\\ubaa8\\ub4e0", "\\uac01", "\\ub098\\ub77c\\ubcc4", "\\uc5b8\\uc5b4\\ub97c", "\\ucc98\\ub9ac\\ud558\\ub824\\uba74", "\\uc5ec\\ub7ec", "\\uac1c\\uc758", "\\ub2e4\\ub978", "\\uae30\\ud638\\ud654", "\\ubc29\\ubc95\\uc774", "\\ud544\\uc694\\ud569\\ub2c8\\ub2e4.", "\\uc601\\uc5b4\\uc640", "\\uac19\\uc740", "\\ub2e8\\uc77c", "\\uc5b8\\uc5b4\\uc758", "\\uacbd\\uc6b0\\ub3c4", "\\uacf5\\ud1b5\\uc801\\uc73c\\ub85c", "\\uc0ac\\uc6a9\\ub418\\ub294", "\\ubaa8\\ub4e0", "\\uae00\\uc790,", "\\ubb38\\uc7a5", "\\ubd80\\ud638", "\\ubc0f", "\\ud14c\\ud06c\\ub2c8\\uceec", "\\uae30\\ud638\\uc5d0", "\\ub9de\\ub294", "\\ub2e8\\uc77c", "\\uae30\\ud638\\ud654", "\\ubc29\\ubc95\\uc744", "\\uac16\\uace0", "\\uc788\\uc9c0", "\\ubabb\\ud558\\uc600\\uc2b5\\ub2c8\\ub2e4.", "\\uc774\\ub7ec\\ud55c", "\\uae30\\ud638\\ud654", "\\uc2dc\\uc2a4\\ud15c\\uc740", "\\ub610\\ud55c", "\\ub2e4\\ub978", "\\uae30\\ud638\\ud654", "\\uc2dc\\uc2a4\\ud15c\\uacfc", "\\ucda9\\ub3cc\\ud569\\ub2c8\\ub2e4.", "\\uc989", "\\ub450", "\\uac00\\uc9c0", "\\uae30\\ud638\\ud654", "\\ubc29\\ubc95\\uc774", "\\ub450", "\\uac1c\\uc758", "\\ub2e4\\ub978", "\\ubb38\\uc790\\uc5d0", "\\ub300\\ud574", "\\uac19\\uc740", "\\ubc88\\ud638\\ub97c", "\\uc0ac\\uc6a9\\ud558\\uac70\\ub098", "\\uac19\\uc740", "\\ubb38\\uc790\\uc5d0", "\\ub300\\ud574", "\\ub2e4\\ub978", "\\ubc88\\ud638\\ub97c", "\\uc0ac\\uc6a9\\ud560", "\\uc218", "\\uc788\\uc2b5\\ub2c8\\ub2e4.", "\\uc8fc\\uc5b4\\uc9c4", "\\ubaa8\\ub4e0", "\\ucef4\\ud4e8\\ud130(\\ud2b9\\ud788", "\\uc11c\\ubc84)\\ub294", "\\uc11c\\ub85c", "\\ub2e4\\ub978", "\\uc5ec\\ub7ec", "\\uac00\\uc9c0", "\\uae30\\ud638\\ud654", "\\ubc29\\ubc95\\uc744", "\\uc9c0\\uc6d0\\ud574\\uc57c", "\\ud569\\ub2c8\\ub2e4.", "\\uadf8\\ub7ec\\ub098,", "\\ub370\\uc774\\ud130\\ub97c", "\\uc11c\\ub85c", "\\ub2e4\\ub978", "\\uae30\\ud638\\ud654", "\\ubc29\\ubc95\\uc774\\ub098", "\\ud50c\\ub7ab\\ud3fc", "\\uac04\\uc5d0", "\\uc804\\ub2ec\\ud560", "\\ub54c\\ub9c8\\ub2e4", "\\uadf8", "\\ub370\\uc774\\ud130\\ub294", "\\ud56d\\uc0c1", "\\uc190\\uc0c1\\uc758", "\\uc704\\ud5d8\\uc744", "\\uacaa\\uac8c", "\\ub429\\ub2c8\\ub2e4.", "\\uc720\\ub2c8\\ucf54\\ub4dc\\ub85c", "\\ubaa8\\ub4e0", "\\uac83\\uc744", "\\ud574\\uacb0\\ud560", "\\uc218", "\\uc788\\uc2b5\\ub2c8\\ub2e4!", "\\uc720\\ub2c8\\ucf54\\ub4dc\\ub294", "\\uc0ac\\uc6a9", "\\uc911\\uc778", "\\ud50c\\ub7ab\\ud3fc,", "\\ud504\\ub85c\\uadf8\\ub7a8,", "\\uc5b8\\uc5b4\\uc5d0", "\\uad00\\uacc4\\uc5c6\\uc774", "\\ubb38\\uc790\\ub9c8\\ub2e4", "\\uace0\\uc720\\ud55c", "\\uc22b\\uc790\\ub97c", "\\uc81c\\uacf5\\ud569\\ub2c8\\ub2e4.", "\\uc720\\ub2c8\\ucf54\\ub4dc", "\\ud45c\\uc900\\uc740", // "Apple, HP, IBM, JustSystem, Microsoft, Oracle, SAP, " // "Sun, Sybase, Unisys " "\\ubc0f", "\\uae30\\ud0c0", "\\uc5ec\\ub7ec", "\\ud68c\\uc0ac\\uc640", "\\uac19\\uc740", "\\uc5c5\\uacc4", "\\uc120\\ub450\\uc8fc\\uc790\\uc5d0", "\\uc758\\ud574", "\\ucc44\\ud0dd\\ub418\\uc5c8\\uc2b5\\ub2c8\\ub2e4.", "\\uc720\\ub2c8\\ucf54\\ub4dc\\ub294", // "XML, Java, ECMAScript(JavaScript), LDAP, CORBA 3.0, WML " "\\ub4f1\\uacfc", "\\uac19\\uc774", "\\ud604\\uc7ac", "\\ub110\\ub9ac", "\\uc0ac\\uc6a9\\ub418\\ub294", "\\ud45c\\uc900\\uc5d0\\uc11c", "\\ud544\\uc694\\ud558\\uba70", "\\uc774\\ub294", // "ISO/IEC", "10646\\uc744", "\\uad6c\\ud604\\ud558\\ub294", "\\uacf5\\uc2dd\\uc801\\uc778", "\\ubc29\\ubc95\\uc785\\ub2c8\\ub2e4.", "\\uc774\\ub294", "\\ub9ce\\uc740", "\\uc6b4\\uc601", "\\uccb4\\uc81c,", "\\uc694\\uc998", "\\uc0ac\\uc6a9\\ub418\\ub294", "\\ubaa8\\ub4e0", "\\ube0c\\ub77c\\uc6b0\\uc800", "\\ubc0f", "\\uae30\\ud0c0", "\\ub9ce\\uc740", "\\uc81c\\ud488\\uc5d0\\uc11c", "\\uc9c0\\uc6d0\\ub429\\ub2c8\\ub2e4.", "\\uc720\\ub2c8\\ucf54\\ub4dc", "\\ud45c\\uc900\\uc758", "\\ubd80\\uc0c1\\uacfc", "\\uc774\\ub97c", "\\uc9c0\\uc6d0\\ud558\\ub294", "\\ub3c4\\uad6c\\uc758", "\\uac00\\uc6a9\\uc131\\uc740", "\\ucd5c\\uadfc", "\\uc804", "\\uc138\\uacc4\\uc5d0", "\\ubd88\\uace0", "\\uc788\\ub294", "\\uae30\\uc220", "\\uacbd\\ud5a5\\uc5d0\\uc11c", "\\uac00\\uc7a5", "\\uc911\\uc694\\ud55c", "\\ubd80\\ubd84\\uc744", "\\ucc28\\uc9c0\\ud558\\uace0", "\\uc788\\uc2b5\\ub2c8\\ub2e4.", "\\uc720\\ub2c8\\ucf54\\ub4dc\\ub97c", // Replaced a hyphen with a space to make the test case work with CLDR1.5 //"\\ud074\\ub77c\\uc774\\uc5b8\\ud2b8-\\uc11c\\ubc84", "\\ub610\\ub294", "\\ud074\\ub77c\\uc774\\uc5b8\\ud2b8 \\uc11c\\ubc84", "\\ub610\\ub294", // Replaced a hyphen with a space. //"\\ub2e4\\uc911-\\uc5f0\\uacb0", "\\uc751\\uc6a9", "\\ud504\\ub85c\\uadf8\\ub7a8\\uacfc", "\\ub2e4\\uc911 \\uc5f0\\uacb0", "\\uc751\\uc6a9", "\\ud504\\ub85c\\uadf8\\ub7a8\\uacfc", "\\uc6f9", "\\uc0ac\\uc774\\ud2b8\\uc5d0", "\\ud1b5\\ud569\\ud558\\uba74", "\\ub808\\uac70\\uc2dc", "\\ubb38\\uc790", "\\uc138\\ud2b8", "\\uc0ac\\uc6a9\\uc5d0", "\\uc788\\uc5b4\\uc11c", "\\uc0c1\\ub2f9\\ud55c", "\\ube44\\uc6a9", "\\uc808\\uac10", "\\ud6a8\\uacfc\\uac00", "\\ub098\\ud0c0\\ub0a9\\ub2c8\\ub2e4.", "\\uc720\\ub2c8\\ucf54\\ub4dc\\ub97c", "\\ud1b5\\ud574", "\\ub9ac\\uc5d4\\uc9c0\\ub2c8\\uc5b4\\ub9c1", "\\uc5c6\\uc774", "\\ub2e4\\uc911", "\\ud50c\\ub7ab\\ud3fc,", "\\uc5b8\\uc5b4", "\\ubc0f", "\\uad6d\\uac00", "\\uac04\\uc5d0", "\\ub2e8\\uc77c", "\\uc18c\\ud504\\ud2b8\\uc6e8\\uc5b4", "\\ud50c\\ub7ab\\ud3fc", "\\ub610\\ub294", "\\ub2e8\\uc77c", "\\uc6f9", "\\uc0ac\\uc774\\ud2b8\\ub97c", "\\ubaa9\\ud45c\\ub85c", "\\uc0bc\\uc744", "\\uc218", "\\uc788\\uc2b5\\ub2c8\\ub2e4.", "\\uc774\\ub97c", "\\uc0ac\\uc6a9\\ud558\\uba74", "\\ub370\\uc774\\ud130\\ub97c", "\\uc190\\uc0c1", "\\uc5c6\\uc774", "\\uc5ec\\ub7ec", "\\uc2dc\\uc2a4\\ud15c\\uc744", "\\ud1b5\\ud574", "\\uc804\\uc1a1\\ud560", "\\uc218", "\\uc788\\uc2b5\\ub2c8\\ub2e4.", "\\uc720\\ub2c8\\ucf54\\ub4dc", "\\ucf58\\uc18c\\uc2dc\\uc5c4\\uc5d0", "\\ub300\\ud574", "\\uc720\\ub2c8\\ucf54\\ub4dc", "\\ucf58\\uc18c\\uc2dc\\uc5c4\\uc740", "\\ube44\\uc601\\ub9ac", "\\uc870\\uc9c1\\uc73c\\ub85c\\uc11c", "\\ud604\\ub300", "\\uc18c\\ud504\\ud2b8\\uc6e8\\uc5b4", "\\uc81c\\ud488\\uacfc", "\\ud45c\\uc900\\uc5d0\\uc11c", "\\ud14d\\uc2a4\\ud2b8\\uc758", "\\ud45c\\ud604\\uc744", "\\uc9c0\\uc815\\ud558\\ub294", "\\uc720\\ub2c8\\ucf54\\ub4dc", "\\ud45c\\uc900\\uc758", "\\uc0ac\\uc6a9\\uc744", "\\uac1c\\ubc1c\\ud558\\uace0", "\\ud655\\uc7a5\\ud558\\uba70", "\\uc7a5\\ub824\\ud558\\uae30", "\\uc704\\ud574", "\\uc138\\uc6cc\\uc84c\\uc2b5\\ub2c8\\ub2e4.", "\\ucf58\\uc18c\\uc2dc\\uc5c4", "\\uba64\\ubc84\\uc27d\\uc740", "\\ucef4\\ud4e8\\ud130\\uc640", "\\uc815\\ubcf4", "\\ucc98\\ub9ac", "\\uc0b0\\uc5c5\\uc5d0", "\\uc885\\uc0ac\\ud558\\uace0", "\\uc788\\ub294", "\\uad11\\ubc94\\uc704\\ud55c", "\\ud68c\\uc0ac", "\\ubc0f", "\\uc870\\uc9c1\\uc758", "\\ubc94\\uc704\\ub97c", "\\ub098\\ud0c0\\ub0c5\\ub2c8\\ub2e4.", "\\ucf58\\uc18c\\uc2dc\\uc5c4\\uc758", "\\uc7ac\\uc815\\uc740", "\\uc804\\uc801\\uc73c\\ub85c", "\\ud68c\\ube44\\uc5d0", "\\uc758\\ud574", "\\ucda9\\ub2f9\\ub429\\ub2c8\\ub2e4.", "\\uc720\\ub2c8\\ucf54\\ub4dc", "\\ucee8\\uc18c\\uc2dc\\uc5c4\\uc5d0\\uc11c\\uc758", "\\uba64\\ubc84\\uc27d\\uc740", "\\uc804", "\\uc138\\uacc4", "\\uc5b4\\ub290", "\\uacf3\\uc5d0\\uc11c\\ub098", "\\uc720\\ub2c8\\ucf54\\ub4dc", "\\ud45c\\uc900\\uc744", "\\uc9c0\\uc6d0\\ud558\\uace0", "\\uadf8", "\\ud655\\uc7a5\\uacfc", "\\uad6c\\ud604\\uc744", "\\uc9c0\\uc6d0\\ud558\\uace0\\uc790\\ud558\\ub294", "\\uc870\\uc9c1\\uacfc", "\\uac1c\\uc778\\uc5d0\\uac8c", "\\uac1c\\ubc29\\ub418\\uc5b4", "\\uc788\\uc2b5\\ub2c8\\ub2e4.", "\\ub354", "\\uc790\\uc138\\ud55c", "\\ub0b4\\uc6a9\\uc740", "\\uc6a9\\uc5b4\\uc9d1,", "\\uc608\\uc81c", "\\uc720\\ub2c8\\ucf54\\ub4dc", "\\uc0ac\\uc6a9", "\\uac00\\ub2a5", "\\uc81c\\ud488,", "\\uae30\\uc220", "\\uc815\\ubcf4", "\\ubc0f", "\\uae30\\ud0c0", "\\uc720\\uc6a9\\ud55c", "\\uc815\\ubcf4\\ub97c", "\\ucc38\\uc870\\ud558\\uc2ed\\uc2dc\\uc624." }; enum { WHAT_IS_UNICODE_length = sizeof(WHAT_IS_UNICODE) / sizeof(WHAT_IS_UNICODE[0]) }; UParseError parseError; UErrorCode status = U_ZERO_ERROR; Transliterator* latinJamo = Transliterator::createInstance("Latin-Jamo", UTRANS_FORWARD, parseError, status); Transliterator* jamoHangul = Transliterator::createInstance("NFC(NFD)", UTRANS_FORWARD, parseError, status); if (latinJamo == 0 || jamoHangul == 0 || U_FAILURE(status)) { delete latinJamo; delete jamoHangul; dataerrln("FAIL: createInstance returned NULL - %s", u_errorName(status)); return; } Transliterator* jamoLatin = latinJamo->createInverse(status); Transliterator* hangulJamo = jamoHangul->createInverse(status); if (jamoLatin == 0 || hangulJamo == 0) { errln("FAIL: createInverse returned NULL"); delete latinJamo; delete jamoLatin; delete jamoHangul; delete hangulJamo; return; } Transliterator* tarray[4] = { hangulJamo, jamoLatin, latinJamo, jamoHangul }; CompoundTransliterator rt(tarray, 4); UnicodeString buf; int32_t total = 0; int32_t errors = 0; int32_t i; for (i=0; i < WHAT_IS_UNICODE_length; ++i) { ++total; UnicodeString hangul = UnicodeString(WHAT_IS_UNICODE[i], -1, US_INV); hangul = hangul.unescape(); // Parse backslash-u escapes UnicodeString hangulX = hangul; rt.transliterate(hangulX); if (hangul != hangulX) { ++errors; UnicodeString jamo = hangul; hangulJamo->transliterate(jamo); UnicodeString latin = jamo; jamoLatin->transliterate(latin); UnicodeString jamo2 = latin; latinJamo->transliterate(jamo2); UnicodeString hangul2 = jamo2; jamoHangul->transliterate(hangul2); buf.remove(0); buf.append("FAIL: "); if (hangul2 != hangulX) { buf.append((UnicodeString)"(Weird: " + hangulX + " != " + hangul2 + ")"); } // The Hangul-Jamo conversion is not usually the // bug here, so we hide it from display. // Uncomment lines to see the Hangul. buf.append(//hangul + " => " + jamoToName(jamo) + " => " + latin + " => " + jamoToName(jamo2) //+ " => " + hangul2 ); errln(prettify(buf)); } } if (errors != 0) { errln((UnicodeString)"Test word failures: " + errors + " out of " + total); } else { logln((UnicodeString)"All " + total + " test words passed"); } delete latinJamo; delete jamoLatin; delete jamoHangul; delete hangulJamo; }
// CLASS METHOD: Interpreter::exec_load_store_instr() // PURPOSE: Load/store instructions move data between memory and the // general registers. They are all encoded as "I-Type" // instructions, and the only addressing mode implemented is base // register plus signed, immediate offset. This directly enables // the use of three distinct addressing modes: register plus // offset; register direct; and immediate. // // ARGUMENTS: None. // RETURNS: None. void Interpreter::exec_load_store_instr(void) { Word vaddr, paddr; switch (op(curr_instr)) { // LB -- Load Byte // // Sign-extend 16-bit `offset` and add to contents of register `base` to // form address. Sign-extend contents of addressed byte and load into // `rt`. case LB: vaddr = gpr[base(curr_instr)] + sign_ext(curr_instr); paddr = translate_address(align(vaddr)); do_load(LOADREG, rt(curr_instr), sign_ext_byte(mem->read(vaddr, paddr), bytepos(vaddr))); break; // LBU -- Load Byte Unsigned // // Sign-extend 16-bit `offse` and add to contents of register `base` to // form address. Zero-extend contents of addressed byte and load into // `rt`. case LBU: vaddr = gpr[base(curr_instr)] + sign_ext(curr_instr); paddr = translate_address(align(vaddr)); do_load(LOADREG, rt(curr_instr), zero_ext_byte(mem->read(vaddr, paddr), bytepos(vaddr))); break; // LH -- Load Halfword // // Sign-extend 16-bit `offset` and add to contents of register `base` to // form address. Sign-extend contents of addressed byte and load into // `rt`. case LH: vaddr = gpr[base(curr_instr)] + sign_ext(curr_instr); paddr = translate_address(align(vaddr)); do_load(LOADREG, rt(curr_instr), sign_ext_hword(mem->read(vaddr, paddr), hwordpos(vaddr))); break; // LHU -- Load Halfword Unsigned // // Sign-extend 16-bit `offset` and add to contents of register `base` to // form address. Zero-extend contents of addressed byte and load into // `rt`. case LHU: vaddr = gpr[base(curr_instr)] + sign_ext(curr_instr); paddr = translate_address(align(vaddr)); do_load(LOADREG, rt(curr_instr), zero_ext_hword(mem->read(vaddr, paddr), hwordpos(vaddr))); break; // LW -- Load Word // // Sign-extend 16-bit `offset` and add to contents of register `base` to // form address. Load contents of addressed word into register `rt`. case LW: vaddr = gpr[base(curr_instr)] + sign_ext(curr_instr); paddr = translate_address(align(vaddr)); do_load(LOADREG, rt(curr_instr), mem->read(vaddr, paddr)); break; // LWL -- Load Word Left // // Sign-extend 16-bit `offset` and add to contents of register `base` to // form address. Shift addressed word left so that addressed byte is // leftmost byte of a word. Merge bytes from memory with contents of // register `rt` and load result into register `rt`. case LWL: vaddr = gpr[base(curr_instr)] + sign_ext(curr_instr); paddr = translate_address(align(vaddr)); do_load(LOADREG, rt(curr_instr), merge(gpr[rt(curr_instr)], mem->read(vaddr, paddr), bytepos(vaddr), true)); break; // LWR -- Load Word Right // // Sign-extend 16-bit `offset` and add to contents of register `base` to // form address. Shfit addressed word right so that addressed byte is // rightmost byte of a word. Merge bytes from memory with contents of // register `rt` and load result into register `rt`. case LWR: vaddr = gpr[base(curr_instr)] + sign_ext(curr_instr); paddr = translate_address(align(vaddr)); do_load(LOADREG, rt(curr_instr), merge(gpr[rt(curr_instr)], mem->read(vaddr, paddr), bytepos(vaddr), false)); break; // SB -- Store Byte // // Sign-extend 16-bit `offset` and add to contents of register `base` to // form address. Store least significant byte of register `rt` at // addressed location. } }
NotesTransferDialog::NotesTransferDialog(int dummy) { notestransferdialog = gtk_dialog_new(); gtk_window_set_title(GTK_WINDOW(notestransferdialog), _("Transfer To Project Notes")); gtk_window_set_position(GTK_WINDOW(notestransferdialog), GTK_WIN_POS_CENTER_ON_PARENT); gtk_window_set_modal(GTK_WINDOW(notestransferdialog), TRUE); dialog_vbox1 = gtk_dialog_get_content_area (GTK_DIALOG(notestransferdialog)); gtk_widget_show(dialog_vbox1); vbox1 = gtk_vbox_new(FALSE, 5); gtk_widget_show(vbox1); gtk_box_pack_start(GTK_BOX(dialog_vbox1), vbox1, FALSE, FALSE, 0); label1 = gtk_label_new(_("This will transfer all text from the currently opened project into the Project notes.")); gtk_widget_show(label1); gtk_box_pack_start(GTK_BOX(vbox1), label1, FALSE, FALSE, 0); gtk_label_set_line_wrap(GTK_LABEL(label1), TRUE); gtk_misc_set_alignment(GTK_MISC(label1), 0, 0.5); hbox1 = gtk_hbox_new(FALSE, 5); gtk_widget_show(hbox1); gtk_box_pack_start(GTK_BOX(vbox1), hbox1, TRUE, TRUE, 0); label2 = gtk_label_new(_("The notes will be put into category")); gtk_widget_show(label2); gtk_box_pack_start(GTK_BOX(hbox1), label2, FALSE, FALSE, 0); combobox1 = gtk_combo_box_new_text(); gtk_widget_show(combobox1); gtk_box_pack_start(GTK_BOX(hbox1), combobox1, TRUE, TRUE, 0); label3 = gtk_label_new(_("The transfer cannot be undone.")); gtk_widget_show(label3); gtk_box_pack_start(GTK_BOX(vbox1), label3, FALSE, FALSE, 0); gtk_misc_set_alignment(GTK_MISC(label3), 0, 0.5); dialog_action_area1 = gtk_dialog_get_action_area (GTK_DIALOG(notestransferdialog)); gtk_widget_show(dialog_action_area1); gtk_button_box_set_layout(GTK_BUTTON_BOX(dialog_action_area1), GTK_BUTTONBOX_END); new InDialogHelp(notestransferdialog, NULL, NULL, NULL); cancelbutton = gtk_button_new_from_stock("gtk-cancel"); gtk_widget_show(cancelbutton); gtk_dialog_add_action_widget(GTK_DIALOG(notestransferdialog), cancelbutton, GTK_RESPONSE_CANCEL); gtk_widget_set_can_default (GTK_WIDGET (cancelbutton), true); okbutton = gtk_button_new_from_stock("gtk-ok"); gtk_widget_show(okbutton); gtk_dialog_add_action_widget(GTK_DIALOG(notestransferdialog), okbutton, GTK_RESPONSE_OK); gtk_widget_set_can_default (GTK_WIDGET (okbutton), true); g_signal_connect((gpointer) okbutton, "clicked", G_CALLBACK(on_okbutton_clicked), gpointer(this)); // Read all the categories and add amy new ones from the database. ReadText rt(notes_categories_filename()); notes_categories_add_from_database(rt.lines); combobox_set_strings(combobox1, rt.lines); if (!rt.lines.empty()) combobox_set_string(combobox1, rt.lines[0]); }