void _mk_it_scroller(QSP_ARG_DECL Screen_Obj *sop,Item_Type *itp) { List *lp; Node *np; int i; int n=0; const char **sp; const char *string_arr[MAX_STRINGS]; Item *ip; lp=item_list(itp); if( lp == NULL ) return; np=QLIST_HEAD(lp); while(np!=NULL){ ip=(Item *)np->n_data; if( n < MAX_STRINGS ) string_arr[n]=ip->item_name; n++; np = np->n_next; } set_scroller_list(sop,string_arr,n); SET_SOB_SELECTORS(sop, (const char **)getbuf( n * sizeof(char *) )); sp = SOB_SELECTORS(sop); for(i=0;i<n;i++) sp[i]=string_arr[i]; }
//--------------------------------------------------------------------------------------------------- bool parser::json_validate(const char *json,const std::size_t &len, object_t &members ) { _s.init(json, len); advance(); return match(JTK_OPEN_KEY) && item_list(members) && match(JTK_CLOSE_KEY); }
void ElementFile::optimizeOrdering() { if (numElements < 1) return; util::ValueAndIndexList item_list(numElements); index_t* index = new index_t[numElements]; ElementFile* out = new ElementFile(etype, MPIInfo); out->allocTable(numElements); #pragma omp parallel for for (index_t e = 0; e < numElements; e++) { std::pair<index_t,index_t> entry(Nodes[INDEX2(0, e, numNodes)], e); for (int i = 1; i < numNodes; i++) entry.first = std::min(entry.first, Nodes[INDEX2(i, e, numNodes)]); item_list[e] = entry; } util::sortValueAndIndex(item_list); #pragma omp parallel for for (index_t e = 0; e < numElements; e++) index[e] = item_list[e].second; out->gather(index, this); swapTable(out); delete out; delete[] index; }
Node *first_panel_node(SINGLE_QSP_ARG_DECL) { List *lp; lp=item_list(panel_obj_itp); if( lp==NULL ) return NULL; else return(QLIST_HEAD(lp)); }
//---------------------------------------------------------------------------------------------------------------------- // WM INIT //---------------------------------------------------------------------------------------------------------------------- void cDlgView::wm_init () { const int iMargin = 9; const int iLeftMargin = 0; //-------------------------------- // MAIN LIST VIEW CONTROL //-------------------------------- pListView->hwnd = GetDlgItem ( hwnd, ID_LIST_VIEW ); register_child ( pListView, nAnchor::left, 0, iLeftMargin, nAnchor::top, 0, iMargin * 1 + s_iStripDimY, nAnchor::right, 0, -iMargin, nAnchor::bottom, 0, -iMargin ); //-------------------------------- // SMALL TOGGLE VIEW BUTTON //-------------------------------- ToggleView.hwnd = GetDlgItem ( hwnd, ID_TOGGLE_VIEW ); register_child ( &ToggleView, nAnchor::right, 0, - ( iMargin * 2 + s_iStripButtonDimX ), nAnchor::top, 0, iMargin + 1, nAnchor::right, 0, -( iMargin * 2 ), nAnchor::top, 0, iMargin + s_iStripDimY - 1 ); //-------------------------------- // SMALL ADD BUTTON //-------------------------------- Add.hwnd = GetDlgItem ( hwnd, ID_ADD ); register_child ( &Add, nAnchor::right, 0, - ( iMargin * 3 + s_iStripButtonDimX * 2), nAnchor::top, 0, iMargin + 1, nAnchor::right, 0, -( iMargin * 3 + s_iStripButtonDimX ), nAnchor::top, 0, iMargin + s_iStripDimY - 1 ); ShowWindow ( pListView->hwnd, TRUE ); pListView->init(); pListView->populate ( item_list() ); }
//--------------------------------------------------------------------------------------------------- bool parser::item_list(object_t &members) { if(_tk == JTK_CLOSE_KEY) return true; if( item(members) ) { if(_tk == JTK_COMMA ) { advance(); return item_list(members); } return true; } return false; }
/** * \brief Get the sprites representing the item. * \param visuals (out) The sprites of the item, and their positions. */ void bear::reflecting_decoration::get_visual ( std::list<engine::scene_visual>& visuals ) const { items_list::const_iterator it; items_list item_list(m_items_list); item_list.sort( reflecting_decoration::z_item_position_compare() ); for ( it = item_list.begin(); it != item_list.end(); ++it ) if ( it->get_item() != NULL ) { std::list<engine::scene_visual> scenes; (*it)->get_visual(scenes); scenes.sort(engine::scene_visual::z_position_compare()); if ( !scenes.empty() ) { visual::scene_element_sequence e; visual::position_type origin ( scenes.front().scene_element.get_position() ); e.set_position( origin + get_gap() ); for ( ; !scenes.empty() ; scenes.pop_front() ) { visual::scene_element elem( scenes.front().scene_element ); elem.set_position( elem.get_position() - origin ); e.push_back( elem ); } e.get_rendering_attributes().combine( get_rendering_attributes() ); visuals.push_back( engine::scene_visual(e, get_z_position()) ); } } } // reflecting_decoration::get_visual()
List *_dobj_list(SINGLE_QSP_ARG_DECL) { return item_list(dobj_itp); }
//--------------------------------------------------------------------------------------------------- bool parser::value( array_t &elemets) { if( _tk == JTK_INTEGER || _tk == JTK_REAL || _tk == JTK_STRING_LITERAL || _tk == JTK_TRUE || _tk == JTK_FALSE || _tk == JTK_NULL ) //literals { /** * Add value into the vector */ jsonpack::value vpos = _s.get_last_value(_tk == JTK_STRING_LITERAL); vpos._pos._type = _tk; elemets.push_back(vpos); advance(); return true; } if( _tk == JTK_OPEN_KEY ) { advance(); object_t* new_obj = new object_t(); // create obj bool object_ok = item_list(*new_obj); //fill obj if(object_ok) { jsonpack::value p; //create value width field _obj p._obj = new_obj; p._field = _OBJ; elemets.push_back(p); // add to the map return match(JTK_CLOSE_KEY); } delete_object(new_obj); return false; } if( _tk == JTK_OPEN_BRACKET ) { advance(); array_t* new_array = new array_t(); // create arr bool array_ok = array_list(*new_array); // fill arr if(array_ok) { jsonpack::value p; //create value width field _arr p._arr = new_array; p._field = _ARR; elemets.push_back(p); // add to the vector return match(JTK_CLOSE_BRACKET); } delete_array(new_array); return false; } return false; }
List *displays_list(SINGLE_QSP_ARG_DECL) { if( disp_obj_itp == NO_ITEM_TYPE ) return(NO_LIST); return( item_list(QSP_ARG disp_obj_itp) ); }