コード例 #1
0
ファイル: Material.cpp プロジェクト: ziyebuboka/xgame
	void MaterialLayer::endPass(IRenderSystem *pRenderSystem)
	{
		PP_BY_NAME("MaterialLayer::endPass");
		PP_BY_NAME_START("MaterialLayer::endPass::loadContext");
		loadContext(pRenderSystem);
		PP_BY_NAME_STOP();
	}
コード例 #2
0
ファイル: SCallTip.cpp プロジェクト: SteelTitanium/SLADE
// -----------------------------------------------------------------------------
// Open the previous (cyclic) arg set in the current function
// -----------------------------------------------------------------------------
void SCallTip::prevArgSet()
{
	if (context_current_ == 0)
		context_current_ = function_->contexts().size() - 1;
	else
		--context_current_;
	loadContext(context_current_);
}
コード例 #3
0
QgsHelpViewer::QgsHelpViewer( const QString &contextId, QWidget *parent,
                              Qt::WFlags fl )
    : QDialog( parent, fl )
{
  setupUi( this );
  restorePosition();
  loadContext( contextId );
}
コード例 #4
0
void QgsHelpViewer::setContext( const QString &contextId )
{
#ifndef WIN32
  setWindowState( windowState() & ~Qt::WindowMinimized );
#endif
  raise();
  activateWindow();
  loadContext( contextId );
}
コード例 #5
0
ファイル: SCallTip.cpp プロジェクト: SteelTitanium/SLADE
// -----------------------------------------------------------------------------
// Opens [function] in the call tip, with [arg] highlighted
// -----------------------------------------------------------------------------
void SCallTip::openFunction(TLFunction* function, int arg)
{
	// Set current function
	function_ = function;
	if (!function)
		return;

	// Init with first arg set
	context_current_ = 0;
	arg_current_     = arg;
	loadContext(context_current_);
}
コード例 #6
0
ファイル: Root.cpp プロジェクト: etherealvisage/pineseed
bool Root::loadFrom(std::string name) {
    auto xml =
        Kriti::ResourceRegistry::get<Kriti::XMLResource>("conv/" + name);

    if(!xml) return false;

    auto objects = xml->doc().first_element_by_path("/conversation/objects");

    // First pass to create objects.
    for(auto c = objects.first_child(); c ; c = c.next_sibling()) {
        int id = c.attribute("id").as_int();
        if(!std::strcmp(c.name(), "node")) {
            m_nodeMap[id] = boost::make_shared<Node>();
        }
        else if(!std::strcmp(c.name(), "context")) {
            m_contextMap[id] = boost::make_shared<Context>();
        }
        else if(!std::strcmp(c.name(), "link")) {
            m_linkMap[id] = boost::make_shared<Link>();
        }
        else {
            Message3(Game, Debug, "Unknown object type " << c.name());
        }
    }

    // Second pass to parse objects.
    for(auto c = objects.first_child(); c ; c = c.next_sibling()) {
        int id = c.attribute("id").as_int();
        if(!std::strcmp(c.name(), "node")) {
            loadNode(id, c);
        }
        else if(!std::strcmp(c.name(), "context")) {
            loadContext(id, c);
        }
        else if(!std::strcmp(c.name(), "link")) {
            loadLink(id, c);
        }
        else {
            Message3(Game, Debug, "Unknown object type " << c.name());
        }
    }

    if(!m_rootNode) {
        Message3(Game, Error, "Couldn't load conversation \"" << name
            << "\": no root node");
        return false;
    }

    return true;
}
コード例 #7
0
ファイル: tasks.c プロジェクト: Manaswi31/OS_Scheduler
void scheduler(node *head){
//load context
//get signal or interrupt



if(head->TCB.taskState == 0x00 || head->TCB.taskState == 0x01 || head->TCB.taskState == 0x03){ // ready, running or terminated
loadContext(head);
return;
}

//save context
//get signal or interrupt

else
saveContext(head);


}
コード例 #8
0
ファイル: devSiSyncChrono.c プロジェクト: emayssat/epics-iocs
static long dsetInit_devSiSyncChrono(stringinRecord *psi) {
  CONTEXT *p_myContext;
  
  dsetLog(3, __FILE__ "[%d] -> %s(%s)\n", __LINE__, __func__, psi->name);

  p_myContext=(CONTEXT *)calloc(1,sizeof(CONTEXT));
  psi->dpvt=(void *)p_myContext;

  if (strcmp(psi->val,"")==0) {
    if (loadContext(psi)<=ERROR) {
      strncpy(psi->val,"RESET", BUFLEN);
    }
  } else {
    dsetLog(5, __FILE__ "[%d] VAL is set to %s in db file\n",
		  __LINE__, psi->val);
  }

  dsetLog(3, __FILE__ "[%d] <- %s\n", __LINE__, __func__ );
  return(SUCCESS);
}
コード例 #9
0
ファイル: view.cpp プロジェクト: KDE/calligra
View::View( Part *part,  QWidget *parent, KActionCollection *collection )
    : QStackedWidget( parent ),
    m_part( part ),
    m_scheduleActionGroup( new QActionGroup( this ) ),
    m_manager( 0 )
{
    m_readWrite = part->isReadWrite();
    debugPlanWork<<m_readWrite;

    // Add sub views
    createViews();

    // The menu items
    // ------ Edit
    actionRemoveSelectedPackages  = new QAction(koIcon("edit-delete"), i18n("Remove Packages"), this);
    collection->addAction("package_remove_selected", actionRemoveSelectedPackages );
    connect( actionRemoveSelectedPackages, SIGNAL(triggered(bool)), SLOT(slotRemoveSelectedPackages()) );

    actionRemoveCurrentPackage  = new QAction(koIcon("edit-delete"), i18n("Remove Package"), this);
    collection->addAction("package_remove_current", actionRemoveCurrentPackage );
    connect( actionRemoveCurrentPackage, SIGNAL(triggered(bool)), SLOT(slotRemoveCurrentPackage()) );

    actionViewList  = new QAction(koIcon("view-list-tree"), i18n("List"), this);
    actionViewList->setToolTip( i18nc( "@info:tooltip", "Select task list" ) );
    collection->addAction("view_list", actionViewList );
    connect( actionViewList, SIGNAL(triggered(bool)), SLOT(slotViewList()) );

    actionViewGantt  = new QAction(koIcon("view-time-schedule"), i18n("Gantt"), this);
    actionViewGantt->setToolTip( i18nc( "@info:tooltip", "Select timeline" ) );
    collection->addAction("view_gantt", actionViewGantt );
    connect( actionViewGantt, SIGNAL(triggered(bool)), SLOT(slotViewGantt()) );

//     actionTaskProgress  = new QAction(koIcon("document-edit"), i18n("Progress..."), this);
//     collection->addAction("task_progress", actionTaskProgress );
//     connect( actionTaskProgress, SIGNAL(triggered(bool)), SLOT(slotTaskProgress()) );

    //------ Settings
    actionConfigure  = new QAction(koIcon("configure"), i18n("Configure PlanWork..."), this);
    collection->addAction("configure", actionConfigure );
    connect( actionConfigure, SIGNAL(triggered(bool)), SLOT(slotConfigure()) );

    //------ Popups
    actionEditDocument  = new QAction(koIcon("document-edit"), i18n("Edit..."), this);
    collection->addAction("edit_document", actionEditDocument );
    connect( actionEditDocument, SIGNAL(triggered(bool)), SLOT(slotEditDocument()) );

    actionViewDocument  = new QAction(koIcon("document-preview"), i18nc( "@verb", "View..."), this);
    collection->addAction("view_document", actionViewDocument );
    connect( actionViewDocument, SIGNAL(triggered(bool)), SLOT(slotViewDocument()) );

    // FIXME remove UndoText::removeDocument() when string freeze is lifted
    actionRemoveDocument = new QAction(koIcon("list-remove"), UndoText::removeDocument().toString(), this);
    collection->addAction("remove_document", actionRemoveDocument );
    connect( actionRemoveDocument, SIGNAL(triggered(bool)), SLOT(slotRemoveDocument()) );

    actionSendPackage  = new QAction(koIcon("mail-send"), i18n("Send Package..."), this);
    collection->addAction("edit_sendpackage", actionSendPackage );
    connect( actionSendPackage, SIGNAL(triggered(bool)), SLOT(slotSendPackage()) );

    actionPackageSettings  = new QAction(koIcon("document-properties"), i18n("Package Settings..."), this);
    collection->addAction("edit_packagesettings", actionPackageSettings );
    connect( actionPackageSettings, SIGNAL(triggered(bool)), SLOT(slotPackageSettings()) );

    actionTaskCompletion  = new QAction(koIcon("document-edit"), i18n("Edit Progress..."), this);
    collection->addAction("task_progress", actionTaskCompletion );
    connect( actionTaskCompletion, SIGNAL(triggered(bool)), SLOT(slotTaskCompletion()) );

    actionViewDescription  = new QAction(/*koIcon("document_view"),*/ i18n("View Description..."), this);
    collection->addAction("task_description", actionViewDescription );
    connect( actionViewDescription, SIGNAL(triggered(bool)), SLOT(slotTaskDescription()) );


    updateReadWrite( m_readWrite );
    //debugPlanWork<<" end";

    loadContext();
    slotCurrentChanged( currentIndex() );
    connect( this, SIGNAL(currentChanged(int)), SLOT(slotCurrentChanged(int)) );

    slotSelectionChanged();
}
コード例 #10
0
int main(int argc, char** argv) {
    sgs_context *context;
    sgs_connection *connection;
    sgs_connection *session;

    /* Begin by initializing the read sets for reading,
     * writing, and exceptions; these sets are all sets
     * of file descriptors
     */
    FD_ZERO(&g_master_readset);
    FD_ZERO(&g_master_writeset);
    FD_ZERO(&g_master_exceptset);

    /* Now, initialize all of the flags that will be
     * used to keep track of which tests pass and which
     * tests fail
     */
    loginFailFail = loginDisconnectFail = loginFail = 1;
    channelJoinFail = channelLeaveFail = channelMessageFail = 1;
    sessionMessageFail = 1;

    /* Get any command line argumentss, and
     * set the appropriate (global) variables. Currently,
     * the command line can only specify the host and port
     * of the server, and ask for the usage message
     * to be printed
     */
    g_hostname = DEFAULT_HOST;
    g_port = DEFAULT_PORT;
    getCommandArgs(argc, argv);

    /* Create a context object, and load it up with the right set
     * of callbacks. The register_fd and unregister_fd callbacks
     * are loaded as part of the create call for historical purposes
     */
    context = sgs_ctx_create(g_hostname, g_port, register_fd_cb, unregister_fd_cb);
    if (context == NULL) {
        printf("error in context create\n");
        exit(1);
    }
    loadContext(context);
    /*Now, create a connection to the server; if this doesn't work things
     * are messed up enough to require simply printing an error message
     * and getting out
     */
    connection = sgs_connection_create(context);
    if (connection == NULL){
        printf ("error in creating a connection to the server\n");
        exit(1);
    }

    if (testLogin(connection) != 0) {
        printf ("Failed at least one login test\n");
        exit(1);
    }

    sgs_connection_login(connection, loginName, loginName);

    waitForInput(connection);

    return(printResults());
}
コード例 #11
0
ファイル: SCallTip.cpp プロジェクト: SteelTitanium/SLADE
// -----------------------------------------------------------------------------
// Open the next (cyclic) arg set in the current function
// -----------------------------------------------------------------------------
void SCallTip::nextArgSet()
{
	if (++context_current_ >= function_->contexts().size())
		context_current_ = 0;
	loadContext(context_current_);
}