Example #1
0
void UmlItem::setUseless()
{
    QByteArray dummy;

    if (propertyValue("STM generated", dummy))
        set_PropertyValue("STM generated", "0");

    const QVector<UmlItem*> v = children();

    for (unsigned index = v.count(); index != 0; index -= 1)
        v[index - 1]->setUseless();
}
Example #2
0
/**
 * Make PropertyRow record with empty value and PT_ERROR flag for PropTag.
 * We should return such rows when client requests an MId we can't find.
 */
static void dcesrv_make_ptyp_error_property_row(TALLOC_CTX* mem_ctx,
						struct SPropTagArray* pPropTags,
						struct PropertyRow_r* aRow)
{
	int i;
	uint32_t ulPropTag;
	aRow->Reserved = 0x0;
	aRow->cValues = pPropTags->cValues;
	aRow->lpProps = talloc_array(mem_ctx, struct PropertyValue_r, aRow->cValues);
	for (i = 0; i < aRow->cValues; i++) {
		ulPropTag = pPropTags->aulPropTag[i];
		ulPropTag = (ulPropTag & 0xFFFF0000) | PT_ERROR;

		aRow->lpProps[i].ulPropTag = (enum MAPITAGS) ulPropTag;
		aRow->lpProps[i].dwAlignPad = 0x0;
		set_PropertyValue(&(aRow->lpProps[i]), NULL);
	}
}
Example #3
0
void UmlPackage::packageImport(FileIn & in, Token & tk)
{
    if (! tk.closed()) {
        WrapperStr id = tk.xmiId();
        WrapperStr k = tk.what();
        const char * kstr = k;

        while (in.read(), !tk.close(kstr)) {
            if (tk.what() == "importedpackage") {
                if (tk.xmiType() == "uml:Model") {
                    WrapperStr v;

                    if (propertyValue("metamodelReference", v) && (v == id)) {
                        WrapperStr href = tk.valueOf("href");
                        int index = href.find('#');

                        set_PropertyValue("metamodelReference",
                                          (index == -1)
                                          ? href : href.left(index));
                    }
                }
                else if (tk.xmiType() == "uml:Profile") {
                    WrapperStr s = tk.xmiIdref();
                    UmlPackage * pf = 0;

                    if (!s.isEmpty()) {
                        QMap<WrapperStr, UmlItem *>::Iterator it = All.find(s);

                        if (it == All.end())
                            UnresolvedRelation::add(4, this->id(), s, "", "");
                        else if ((*it)->kind() == aPackage)
                            pf = (UmlPackage *) *it;
                    }
                    else
                        pf = importProfile(in, tk.valueOf("href"));

                    if (pf != 0) {
                        UmlNcRelation * ncr = UmlNcRelation::create(aDependency, this, pf);

                        if (ncr != 0)
                            ncr->set_Stereotype("import");
                    }
                }
            }
            else if (tk.what() == "importedelement") {
                WrapperStr v;

                if (propertyValue("metaclassReference", v) && (v == id)) {
                    WrapperStr href = tk.valueOf("href");
                    int index = href.find('#');

                    set_PropertyValue("metaclassReference",
                                      (index == -1)
                                      ? href : href.left(index));
                }
            }

            if (! tk.closed())
                in.finish(tk.what());
        }
    }
}
Example #4
0
void UmlArtifact::gen_app(const Q3CString & path) {
  Q3CString target;
  Q3CString pro;

  propertyValue("genpro target", target);
  propertyValue("genpro pro", pro);

  if (target.isEmpty()) {
    if ((target = name()) == "executable")
      target = UmlPackage::getProject()->name();
#ifdef WIN32
    target += ".exe";
#endif
  }

  if (pro.isEmpty()) {
    pro = target;
#ifdef WIN32
    if (pro.right(4) == ".exe")
      pro.resize(pro.length() - 4);
#endif
    
    QDir d(path);
    
    pro = d.absFilePath(pro + ".pro");
  }

  Q3CString tmplt;
  Q3CString config;
  Q3CString defines;
  Q3CString includepath;
  Q3CString dependpath;
  Q3CString objectsdir;
  Q3CString footer;

  if (!propertyValue("genpro tmplt", tmplt))
    tmplt = "app";
  if (!propertyValue("genpro config", config))
    config = "debug warn_on qt";
  if (!propertyValue("genpro defines", defines))
    defines = "WITHCPP WITHJAVA WITHPHP WITHPYTHON WITHIDL";
  else if (defines.find("WITHPHP") == -1) {
    int n = 0;
    
    if (defines.find("WITHCPP") != -1)
      n += 1;
    
    if (defines.find("WITHJAVA") != -1)
      n += 1;
    
    if (defines.find("WITHIDL") != -1)
      n += 1;
    
    if (n > 1)
      defines += " WITHPHP WITHPYTHON";
  }
  else if (defines.find("WITHPYTHON") == -1) {
    int n = 0;
    
    if (defines.find("WITHCPP") != -1)
      n += 1;
    
    if (defines.find("WITHJAVA") != -1)
      n += 1;
    
    if (defines.find("WITHIDL") != -1)
      n += 1;
    
    if (defines.find("WITHPHP") != -1)
      n += 1;
    
    if (n > 1)
      defines += " WITHPYTHON";
  }
  propertyValue("genpro includepath", includepath);
  propertyValue("genpro dependpath", dependpath);
  propertyValue("genpro objectsdir", objectsdir);
  propertyValue("genpro footer", footer);
  
  for (;;) {
    Dialog dialog(this, path, pro, target, tmplt, config, defines,
		  includepath, dependpath, objectsdir, footer);
    
    if (dialog.exec() != QDialog::Accepted)
      return;
    
    set_PropertyValue("genpro pro", pro);
    set_PropertyValue("genpro path", path);
    set_PropertyValue("genpro target", target);
    set_PropertyValue("genpro tmplt", tmplt);
    set_PropertyValue("genpro config", config);
    set_PropertyValue("genpro defines", defines);
    set_PropertyValue("genpro includepath", includepath);
    set_PropertyValue("genpro dependpath", dependpath);
    set_PropertyValue("genpro objectsdir", objectsdir);
    set_PropertyValue("genpro footer", footer);

    QFile f(pro);
    
    if (! f.open(QIODevice::WriteOnly))
      QMessageBox::critical((QWidget *) 0, "Error", "Cannot open " + QString(pro));
    else {
      Q3TextStream t(&f);
      QFileInfo tfi(target);
      QFileInfo pfi(pro);
      
      t << "TEMPLATE\t= " << tmplt << '\n';
      t << "TARGET\t\t= " << tfi.fileName() << '\n';
      if ((target.find('/') != -1) &&
	  (pro.find('/') != -1) &&
	  (tfi.dirPath(TRUE) != pfi.dirPath(TRUE)))
	t << "DESTDIR\t\t= " << tfi.dirPath(TRUE) << '\n';
      if (! objectsdir.isEmpty())
	t << "OBJECTS_DIR\t= " << objectsdir << '\n';
      t << "CONFIG\t\t+= " << config << '\n';
      if (!includepath.isEmpty())
	t << "INCLUDEPATH\t= " << includepath << '\n';
      if (!dependpath.isEmpty())
	t << "DEPENDPATH\t= " << dependpath << '\n';
      if (!defines.isEmpty())
	t << "DEFINES\t\t= " << defines << '\n';
      
      QString prodir = pfi.dirPath(TRUE);
      const Q3PtrVector<UmlArtifact> & arts = associatedArtifacts();
      unsigned index;
      const char * sep;
      Q3CString ext;
      
      ext = CppSettings::headerExtension();
      sep = "HEADERS\t\t= ";
      for (index = 0; index != arts.count(); index += 1) {
	UmlArtifact * art = arts[index];
	
	if ((art->stereotype() == "source") && !art->cppHeader().isEmpty()) {
	  QString s = art->way(prodir, TRUE);
	  
	  if (! s.isEmpty()) {
	    t << sep << s << art->name() << '.' << ext;
	    sep = " \\\n\t\t  ";
	  }
	}
      }
      
      t << '\n';
      
      ext = CppSettings::sourceExtension();
      sep = "SOURCES\t\t= ";
      for (index = 0; index != arts.count(); index += 1) {
	UmlArtifact * art = arts[index];
	
	if ((art->stereotype() != "source") || !art->cppSource().isEmpty()) {
	  QString s = art->way(prodir, FALSE);
	  
	  if (! s.isEmpty()) {
	    t << sep << s << art->name();
	    if (art->stereotype() == "source")
	      t << '.' << ext;
	    sep = " \\\n\t\t  ";
	  }
	}
      }
      
      t << '\n' << footer << '\n';
      
      f.close();
      return;
    }
  }
}
Example #5
0
void UmlItem::setUsed()
{
    set_PropertyValue("STM generated", "");
}