コード例 #1
0
ファイル: register.c プロジェクト: levenkov/olver
Interactions* getGatheredInteractions()
{
Interactions* res;

  gatherReactions();
  
  lock_interactions_register();
  res = interactions;
  interactions = NULL;
  unlock_interactions_register();

  if (res == NULL)
    return createInteractions();
  checkConsistencyInteractions(res);
  return res;
}
コード例 #2
0
ファイル: register.c プロジェクト: levenkov/olver
static
void registerInteraction( 
         ChannelID       chid,
         bool            is_native,
         const char*     name,
         SpecificationID specID,
         Object*         data,
         TimeInterval    interval
                        )
{
  if (isValidInteraction( specID, data, interval ))
   {
    lock_interactions_register();
  
    if (interactions == NULL)
      interactions = createInteractions();
    appendInteraction( interactions, chid, is_native, name, specID, data, interval );

    unlock_interactions_register();
   }
}
コード例 #3
0
ファイル: dglmainwindow.cpp プロジェクト: scygan/debugler
DGLMainWindow::DGLMainWindow(QWidget *_parent, Qt::WindowFlags flags)
        : QMainWindow(_parent, flags), m_BusyDialog(this), m_ProjectSaved(false) {

#pragma warning(push)
#pragma warning(disable : 4127)    // conditional expression is constant
    Q_INIT_RESOURCE(dglmainwindow);
#pragma warning(pop)

    boost::shared_ptr<OsIcon> icon(Os::createIcon());
#ifdef _WIN32
    setWindowIcon(QIcon(HICON_TO_QPIXMAP((HICON)icon->get())));
#endif

    // load designer UI

    m_ui.setupUi(this);
    setDockNestingEnabled(true);

    // create all widgets, actions iteractions etc...

    createActions();
    createMenus();
    createToolBars();
    createStatusBar();
    createDockWindows();
    createInteractions();

    // read QSettings

    readSettings();

    showConfig();

    if (QCoreApplication::arguments().size() == 2) {
        openProjectFromFile(QCoreApplication::arguments()[1]);
    }
}
コード例 #4
0
ファイル: register.c プロジェクト: levenkov/olver
void registerWrongReaction(const char* info)
{
char* buff;

  lock_interactions_register();

  if (interactions == NULL)
    interactions = createInteractions();
  if (interactions->is_correct)
   {// Put wrong reaction description
    interactions->is_correct = false;
    interactions->defect_description = clone_string_with_default( info, "Wrong reaction has been catched" );
   }
  else if (info != NULL)
   {// Append wrong reaction description to old ones
    buff = (char*)calloc(strlen(interactions->defect_description)+strlen(info)+16,sizeof(char));
    assertion( buff!=NULL, "registerWrongReaction#not enough memory" );
    sprintf(buff,"%s\n-----\n%s",interactions->defect_description,info);
    free(interactions->defect_description);
    interactions->defect_description = buff;
   }

  unlock_interactions_register();
}