void Client::demandAttention( bool set ) { if( isActive()) set = false; if( demands_attention == set ) return; demands_attention = set; if( demands_attention ) { // Demand attention flag is often set right from manage(), when focus stealing prevention // steps in. At that time the window has no taskbar entry yet, so KNotify cannot place // e.g. the passive popup next to it. So wait up to 1 second for the icon geometry // to be set. // Delayed call to KNotify also solves the problem of having X server grab in manage(), // which may deadlock when KNotify (or KLauncher when launching KNotify) need to access X. // Setting the demands attention state needs to be done directly in KWin, because // KNotify would try to set it, resulting in a call to KNotify again, etc. info->setState( set ? NET::DemandsAttention : 0, NET::DemandsAttention ); if( demandAttentionKNotifyTimer == NULL ) { demandAttentionKNotifyTimer = new QTimer( this ); demandAttentionKNotifyTimer->setSingleShot( true ); connect( demandAttentionKNotifyTimer, SIGNAL( timeout()), SLOT( demandAttentionKNotify())); } demandAttentionKNotifyTimer->start( 1000 ); } else info->setState( set ? NET::DemandsAttention : 0, NET::DemandsAttention ); workspace()->clientAttentionChanged( this, set ); }
int main() { Flexlay flexlay; flexlay.init(); Editor editor; GUIManager* gui = editor.get_gui_manager(); new CL_Button(CL_Rect(CL_Point(50, 50), CL_Size(100, 25)), "Hello World", gui->get_component()); EditorMap m; Tileset tileset(32); TilemapLayer tilemap(tileset, 20, 10); m.add_layer(tilemap.to_layer()); TilemapLayer::set_current(tilemap); EditorMapComponent editor_map(CL_Rect(0, 0, 799, 599), gui->get_component()); Workspace workspace(799, 599); editor_map.set_workspace(workspace); workspace.set_map(m); new CL_Button(CL_Rect(CL_Point(50, 150), CL_Size(100, 25)), "Quit", gui->get_component()); gui->run(); flexlay.deinit(); }
static std::ptrdiff_t invoke( const char jobz, MatrixAB& ab, VectorW& w, MatrixZ& z, minimal_workspace ) { namespace bindings = ::boost::numeric::bindings; typedef typename result_of::uplo_tag< MatrixAB >::type uplo; bindings::detail::array< real_type > tmp_work( min_size_work( bindings::size_column(ab) ) ); return invoke( jobz, ab, w, z, workspace( tmp_work ) ); }
static std::ptrdiff_t invoke( const char norm, const MatrixAP& ap, minimal_workspace ) { namespace bindings = ::boost::numeric::bindings; typedef typename result_of::uplo_tag< MatrixAP >::type uplo; bindings::detail::array< real_type > tmp_work( min_size_work( norm, bindings::size_column(ap) ) ); return invoke( norm, ap, workspace( tmp_work ) ); }
static std::ptrdiff_t invoke( const fortran_int_t n, const fortran_int_t ilo, const fortran_int_t ihi, MatrixA& a, const VectorTAU& tau, minimal_workspace ) { namespace bindings = ::boost::numeric::bindings; bindings::detail::array< real_type > tmp_work( min_size_work( ihi, ilo ) ); return invoke( n, ilo, ihi, a, tau, workspace( tmp_work ) ); }
static void invoke( integer_t const n, MatrixAP& ap, MatrixAFP& afp, VectorIPIV& ipiv, MatrixB& b, MatrixX& x, VectorFERR& ferr, VectorBERR& berr, integer_t& info, minimal_workspace work ) { traits::detail::array< value_type > tmp_work( min_size_work( n ) ); traits::detail::array< real_type > tmp_rwork( min_size_rwork( n ) ); invoke( n, ap, afp, ipiv, b, x, ferr, berr, info, workspace( tmp_work, tmp_rwork ) ); }
static void invoke( char const jobz, MatrixA& a, VectorW& w, integer_t& info, minimal_workspace work ) { traits::detail::array< real_type > tmp_work( min_size_work( jobz, traits::matrix_num_columns(a) ) ); traits::detail::array< integer_t > tmp_iwork( min_size_iwork( jobz, traits::matrix_num_columns(a) ) ); invoke( jobz, a, w, info, workspace( tmp_work, tmp_iwork ) ); }
static std::ptrdiff_t invoke( const fortran_int_t n, VectorX& x, real_type& est, fortran_int_t& kase, minimal_workspace ) { namespace bindings = ::boost::numeric::bindings; bindings::detail::array< real_type > tmp_v( min_size_v( n ) ); bindings::detail::array< fortran_int_t > tmp_isgn( min_size_isgn( n ) ); return invoke( n, x, est, kase, workspace( tmp_v, tmp_isgn ) ); }
static std::ptrdiff_t invoke( const MatrixAP& ap, const VectorIPIV& ipiv, const real_type anorm, real_type& rcond, minimal_workspace ) { namespace bindings = ::boost::numeric::bindings; typedef typename result_of::uplo_tag< MatrixAP >::type uplo; bindings::detail::array< value_type > tmp_work( min_size_work( bindings::size_column(ap) ) ); return invoke( ap, ipiv, anorm, rcond, workspace( tmp_work ) ); }
static void invoke( char const compz, integer_t const n, VectorD& d, VectorE& e, MatrixZ& z, integer_t& info, minimal_workspace work ) { traits::detail::array< real_type > tmp_work( min_size_work( $CALL_MIN_SIZE ) ); traits::detail::array< integer_t > tmp_iwork( min_size_iwork( compz, n ) ); invoke( compz, n, d, e, z, info, workspace( tmp_work, tmp_iwork ) ); }
Deleted::~Deleted() { if (delete_refcount != 0) kError(1212) << "Deleted client has non-zero reference count (" << delete_refcount << ")"; assert(delete_refcount == 0); workspace()->removeDeleted(this); deleteEffectWindow(); }
static void invoke( char const job, integer_t const n, MatrixA& a, MatrixB& b, integer_t& ilo, integer_t& ihi, VectorLSCALE& lscale, VectorRSCALE& rscale, integer_t& info, minimal_workspace work ) { traits::detail::array< real_type > tmp_work( min_size_work( $CALL_MIN_SIZE ) ); invoke( job, n, a, b, ilo, ihi, lscale, rscale, info, workspace( tmp_work ) ); }
void WorkspacesView::_DrawWorkspace(DrawingEngine* drawingEngine, BRegion& redraw, int32 index) { BRect rect = _WorkspaceAt(index); Workspace workspace(*Window()->Desktop(), index); bool active = workspace.IsCurrent(); if (active) { // draw active frame rgb_color black = (rgb_color){ 0, 0, 0, 255 }; drawingEngine->StrokeRect(rect, black); } else if (index == fSelectedWorkspace) { rgb_color gray = (rgb_color){ 80, 80, 80, 255 }; drawingEngine->StrokeRect(rect, gray); } rect.InsetBy(1, 1); rgb_color color = workspace.Color(); if (!active) _DarkenColor(color); // draw windows BRegion backgroundRegion = redraw; // TODO: would be nice to get the real update region here BRect screenFrame = _ScreenFrame(index); BRegion workspaceRegion(rect); backgroundRegion.IntersectWith(&workspaceRegion); drawingEngine->ConstrainClippingRegion(&backgroundRegion); ServerFont font = fDrawState->Font(); font.SetSize(fWindow->ServerWindow()->App()->PlainFont().Size()); float reducedSize = ceilf(max_c(8.0f, min_c(Frame().Height(), Frame().Width()) / 15)); if (font.Size() > reducedSize) font.SetSize(reducedSize); fDrawState->SetFont(font); drawingEngine->SetFont(font); // We draw from top down and cut the window out of the clipping region // which reduces the flickering ::Window* window; BPoint leftTop; while (workspace.GetPreviousWindow(window, leftTop) == B_OK) { _DrawWindow(drawingEngine, rect, screenFrame, window, leftTop, backgroundRegion, active); } // draw background drawingEngine->FillRect(rect, color); drawingEngine->ConstrainClippingRegion(&redraw); }
static std::ptrdiff_t invoke( const char jobz, const fortran_int_t n, VectorD& d, VectorE& e, MatrixZ& z, minimal_workspace ) { namespace bindings = ::boost::numeric::bindings; bindings::detail::array< real_type > tmp_work( min_size_work( jobz, n ) ); bindings::detail::array< fortran_int_t > tmp_iwork( min_size_iwork( jobz, n ) ); return invoke( jobz, n, d, e, z, workspace( tmp_work, tmp_iwork ) ); }
static std::ptrdiff_t invoke( const Side side, const MatrixA& a, const VectorTAU& tau, MatrixC& c, minimal_workspace ) { namespace bindings = ::boost::numeric::bindings; typedef typename result_of::data_order< MatrixC >::type order; typedef typename result_of::trans_tag< MatrixA, order >::type trans; bindings::detail::array< real_type > tmp_work( min_size_work( side, bindings::size_row(c), bindings::size_column(c) ) ); return invoke( side, a, tau, c, workspace( tmp_work ) ); }
void MainWindow::saveSettings() { QSettings settings("Blooming Flower", "Blooming Flower"); QString workspace(workspace_.c_str()); settings.setValue("workspace", workspace); return; }
void Group::lostLeader() { assert(!_members.contains(leader_client)); leader_client = NULL; if (_members.isEmpty()) { workspace()->removeGroup(this); delete this; } }
static std::ptrdiff_t invoke( const fortran_int_t itype, const char jobz, MatrixAP& ap, MatrixBP& bp, VectorW& w, MatrixZ& z, minimal_workspace ) { namespace bindings = ::boost::numeric::bindings; typedef typename result_of::uplo_tag< MatrixAP >::type uplo; bindings::detail::array< real_type > tmp_work( min_size_work( bindings::size_column(ap) ) ); return invoke( itype, jobz, ap, bp, w, z, workspace( tmp_work ) ); }
static std::ptrdiff_t invoke( const Side side, const char uplo, const VectorAP& ap, const VectorTAU& tau, MatrixC& c, minimal_workspace ) { namespace bindings = ::boost::numeric::bindings; typedef tag::column_major order; typedef typename result_of::trans_tag< VectorAP, order >::type trans; bindings::detail::array< real_type > tmp_work( min_size_work( side, bindings::size_row(c), bindings::size_column(c) ) ); return invoke( side, uplo, ap, tau, c, workspace( tmp_work ) ); }
static std::ptrdiff_t invoke( const char norm, const MatrixA& a, const real_type anorm, real_type& rcond, minimal_workspace ) { namespace bindings = ::boost::numeric::bindings; bindings::detail::array< value_type > tmp_work( min_size_work( bindings::size_column(a) ) ); bindings::detail::array< real_type > tmp_rwork( min_size_rwork( bindings::size_column(a) ) ); return invoke( norm, a, anorm, rcond, workspace( tmp_work, tmp_rwork ) ); }
void CanvasTabWidget::insertCanvas(int index, Canvas *canvas) { if (canvas->workspace() != workspace()) { auto originalCanvas = canvas; canvas = new Canvas(canvas, workspace()); originalCanvas->closeCanvas(); } canvas->memorizeNavigation(); workspace()->addCanvas(canvas); if (!canvas->viewController()) new CanvasViewController(canvas); DockTabWidget::insertTab(index, canvas->view(), canvasTabText(canvas)); canvas->restoreNavigation(); }
/*! Create list of desktops, starting with desktop start */ void TabBox::createDesktopList(QList< int > &list, int start, SortOrder order) { list.clear(); int iDesktop = start; for( int i = 1; i <= workspace()->numberOfDesktops(); i++ ) { list.append( iDesktop ); if ( order == StaticOrder ) { iDesktop = workspace()->nextDesktopStatic( iDesktop ); } else { // MostRecentlyUsedOrder iDesktop = workspace()->nextDesktopFocusChain( iDesktop ); } } }
static std::ptrdiff_t invoke( const char uplo, const char compq, const fortran_int_t n, VectorD& d, VectorE& e, MatrixU& u, MatrixVT& vt, VectorQ& q, VectorIQ& iq, minimal_workspace ) { namespace bindings = ::boost::numeric::bindings; bindings::detail::array< real_type > tmp_work( min_size_work( compq, n ) ); bindings::detail::array< fortran_int_t > tmp_iwork( min_size_iwork( n ) ); return invoke( uplo, compq, n, d, e, u, vt, q, iq, workspace( tmp_work, tmp_iwork ) ); }
/* * Square a BigInt */ BigInt square(const BigInt& x) { const size_t x_sw = x.sig_words(); BigInt z(BigInt::Positive, round_up<size_t>(2*x_sw, 16)); SecureVector<word> workspace(z.size()); bigint_sqr(z.get_reg(), z.size(), workspace, x.data(), x.size(), x_sw); return z; }
static void invoke( MatrixA& a, VectorTAU& tau, integer_t& info, optimal_workspace work ) { value_type opt_size_work; detail::geqrf( traits::matrix_num_rows(a), traits::matrix_num_columns(a), traits::matrix_storage(a), traits::leading_dimension(a), traits::vector_storage(tau), &opt_size_work, -1, info ); traits::detail::array< value_type > tmp_work( traits::detail::to_int( opt_size_work ) ); invoke( a, tau, info, workspace( tmp_work ) ); }
static std::ptrdiff_t invoke( MatrixA& a, VectorTAU& tau, optimal_workspace ) { namespace bindings = ::boost::numeric::bindings; value_type opt_size_work; detail::geqrf( bindings::size_row(a), bindings::size_column(a), bindings::begin_value(a), bindings::stride_major(a), bindings::begin_value(tau), &opt_size_work, -1 ); bindings::detail::array< value_type > tmp_work( traits::detail::to_int( opt_size_work ) ); return invoke( a, tau, workspace( tmp_work ) ); }
static std::ptrdiff_t invoke( const Side side, const char eigsrc, const char initv, VectorSELECT& select, const MatrixH& h, VectorWR& wr, const VectorWI& wi, MatrixVL& vl, MatrixVR& vr, const fortran_int_t mm, fortran_int_t& m, VectorIFAILL& ifaill, VectorIFAILR& ifailr, minimal_workspace ) { namespace bindings = ::boost::numeric::bindings; bindings::detail::array< real_type > tmp_work( min_size_work( bindings::size_column(h) ) ); return invoke( side, eigsrc, initv, select, h, wr, wi, vl, vr, mm, m, ifaill, ifailr, workspace( tmp_work ) ); }
static void invoke( char const vect, integer_t const m, integer_t const n, integer_t const k, MatrixA& a, VectorTAU& tau, integer_t& info, optimal_workspace work ) { value_type opt_size_work; detail::ungbr( vect, m, n, k, traits::matrix_storage(a), traits::leading_dimension(a), traits::vector_storage(tau), &opt_size_work, -1, info ); traits::detail::array< value_type > tmp_work( traits::detail::to_int( opt_size_work ) ); invoke( vect, m, n, k, a, tau, info, workspace( tmp_work ) ); }
Montgomery_Exponentation_State::Montgomery_Exponentation_State(const BigInt& g, const BigInt& p, const Modular_Reducer& mod_p, size_t window_bits) : m_p(p), m_p_words(p.sig_words()), m_window_bits(window_bits) { if(p.is_positive() == false || p.is_even()) throw Invalid_Argument("Cannot use Montgomery reduction on even or negative integer"); if(window_bits > 12) // really even 8 is too large ... throw Invalid_Argument("Montgomery window bits too large"); m_mod_prime = monty_inverse(m_p.word_at(0)); const BigInt r = BigInt::power_of_2(m_p_words * BOTAN_MP_WORD_BITS); m_R_mod = mod_p.reduce(r); m_R2_mod = mod_p.square(m_R_mod); m_g.resize(1U << m_window_bits); BigInt z(BigInt::Positive, 2 * (m_p_words + 1)); secure_vector<word> workspace(z.size()); m_g[0] = 1; bigint_monty_mul(z, m_g[0], m_R2_mod, m_p.data(), m_p_words, m_mod_prime, workspace.data()); m_g[0] = z; m_g[1] = mod_p.reduce(g); bigint_monty_mul(z, m_g[1], m_R2_mod, m_p.data(), m_p_words, m_mod_prime, workspace.data()); m_g[1] = z; const BigInt& x = m_g[1]; for(size_t i = 2; i != m_g.size(); ++i) { const BigInt& y = m_g[i-1]; bigint_monty_mul(z, x, y, m_p.data(), m_p_words, m_mod_prime, workspace.data()); m_g[i] = z; m_g[i].shrink_to_fit(); m_g[i].grow_to(m_p_words); } }
static void invoke( char const fact, MatrixA& a, MatrixAF& af, char& equed, VectorS& s, MatrixB& b, MatrixX& x, real_type& rcond, VectorFERR& ferr, VectorBERR& berr, integer_t& info, minimal_workspace work ) { traits::detail::array< value_type > tmp_work( min_size_work( traits::matrix_num_columns(a) ) ); traits::detail::array< real_type > tmp_rwork( min_size_rwork( traits::matrix_num_columns(a) ) ); invoke( fact, a, af, equed, s, b, x, rcond, ferr, berr, info, workspace( tmp_work, tmp_rwork ) ); }