Ejemplo n.º 1
0
void PseudoStateCanvas::save(QTextStream & st, bool ref, QString & warning) const {
  if (ref) {
    st << "pseudostatecanvas_ref " << get_ident() << " // "
      << browser_node->full_name();
  }
  else {
    nl_indent(st);
    st << "pseudostatecanvas " << get_ident() << ' ';
    browser_node->save(st, TRUE, warning);
    indent(+1);
    nl_indent(st);
    if (horiz)
      st << "horizontal ";
    if (manual_size)
      save_xyzwh(st, this, " xyzwh");
    else
      save_xyz(st, this, " xyz");
    if (label != 0)
      save_xy(st, label, " label_xy");
    save_stereotype_property(st, warning);
    indent(-1);
    nl_indent(st);
    st << "end";
  }
}
Ejemplo n.º 2
0
void SdLostFoundMsgSupportCanvas::save(QTextStream & st, bool ref, QString &) const {
    if (ref)
        st << "lostfoundmsgsupport_ref " << get_ident();
    else {
        nl_indent(st);
        st << "lostfoundmsgsupport " << get_ident();
        save_xyz(st, this, " xyz");
    }
}
Ejemplo n.º 3
0
void HubCanvas::save(QTextStream & st, bool ref, QString &) const
{
    if (ref)
        st << "hubcanvas_ref " << get_ident();
    else {
        nl_indent(st);
        st << "hubcanvas " << get_ident();
        save_xyz(st, this, " xyz");
    }
}
Ejemplo n.º 4
0
void SdDurationCanvas::save(Q3TextStream & st, bool ref, QString & warning) const {
  if (ref)
    st << "durationcanvas_ref " << get_ident();
  else if (!support->isaDuration()) {
    nl_indent(st);
    st << "durationcanvas " << get_ident() << ' ';
    ((DiagramCanvas *) ((SdLifeLineCanvas *) support)->get_obj())->save(st, TRUE, warning);
    save_internal(st);
  }
}
Ejemplo n.º 5
0
void NoteCanvas::save(Q3TextStream & st, bool ref, QString &) const {
  if (ref) {
    st << "note_ref " << get_ident();
  }
  else {
    nl_indent(st);
    
    st << "note " << get_ident() << ' ';
    save_internal(st);
  }
}
Ejemplo n.º 6
0
void InfoCanvas::save(QTextStream & st, bool ref, QString &) const {
  if (ref) {
    st << "information_ref " << get_ident();
  }
  else {
    nl_indent(st);
    
    st << "information " << get_ident() << ' ';
    save_internal(st);
  }
}
Ejemplo n.º 7
0
void ImageCanvas::save(QTextStream & st, bool ref, QString &) const {
    if (ref) {
        st << "image_ref " << get_ident();
    }
    else {
        nl_indent(st);

        st << "image " << get_ident() << ' ';
        save_string(fromUnicode(path), st);
        save_xyz(st, this, " xyz");
        st << " end";
    }
}
Ejemplo n.º 8
0
void FlowCanvas::save(Q3TextStream & st, bool ref, QString & warning) const {
  if (ref)
    st << "flowcanvas_ref " << get_ident();
  else if (begin->type() != UmlArrowPoint) {
    // relation canvas start
    nl_indent(st);
    st << "flowcanvas " << get_ident() << ' ';
    data->get_start()->save(st, TRUE, warning);	// data doesn't have id
    indent(+1);
    if (geometry != NoGeometry) {
      nl_indent(st);
      st << "geometry " << stringify(geometry);
      if (!fixed_geometry)
	st << " unfixed";
    }
    if (decenter_begin >= 0) {
      // float output/input bugged
      nl_indent(st);
      st << "decenter_begin " << ((int) (decenter_begin * 1000));
    }
    if (decenter_end >= 0) {
      // float output/input bugged
      nl_indent(st);
      st << "decenter_end " << ((int) (decenter_end * 1000));
    }
    nl_indent(st);
    (const FlowCanvas *) ArrowCanvas::save_lines(st, TRUE, TRUE, warning);
    settings.save(st);
    st << " write_horizontally " << stringify(write_horizontally);

    if (selection != 0) {
      nl_indent(st);
      st << "selection ";
      selection->save(st, FALSE, warning);
    }
    
    if (transformation != 0) {
      nl_indent(st);
      st << "transformation ";
      transformation->save(st, FALSE, warning);
    }
    
    if (stereotypeproperties != 0)
      stereotypeproperties->save(st, FALSE, warning);
    
    indent(-1);
    nl_indent(st);
    st << "end";
  }
}
Ejemplo n.º 9
0
BrowserColDiagram::~BrowserColDiagram()
{
    if (deletedp() && !modifiedp()) {
        QString fn;

        fn.sprintf("%d.diagram", get_ident());

        QDir d = BrowserView::get_dir();

        QFile::remove(d.absFilePath(fn));
    }

    all.remove(get_ident());
    delete def;
}
Ejemplo n.º 10
0
void StereotypePropertiesCanvas::save(QTextStream & st, bool ref, QString &) const
{
    if (ref) {
        st << "stereotypeproperties_ref " << get_ident();
    }
    else {
        nl_indent(st);

        st << "stereotypeproperties " << get_ident();
        indent(+1);
        nl_indent(st);
        save_internal(st);
        indent(-1);
    }
}
Ejemplo n.º 11
0
void SubjectCanvas::save(Q3TextStream & st, bool ref, QString &) const {
  if (ref) {
    st << "subject_ref " << get_ident();
  }
  else {
    nl_indent(st);
    
    st << "subject " << get_ident() << ' ';
    save_string(fromUnicode(name), st);
    nl_indent(st);
    if (itscolor != UmlDefaultColor)
      st << "  color " << stringify(itscolor);
    save_xyzwh(st, this, "  xyzwh");
  }
}
Ejemplo n.º 12
0
BrowserFlow::~BrowserFlow()
{
    all.remove(get_ident());

    if (def)
        delete def;
}
Ejemplo n.º 13
0
BrowserSimpleRelation::~BrowserSimpleRelation()
{
    all.remove(get_ident());

    if (def)
        delete def;
}
Ejemplo n.º 14
0
void
pack_report(object *obj, int print_message, char *message)
{
    /* Notify the user */

    if (print_message)
    {
        if (!terse)
            addmsg(message);

        msg("(%c%c) %s.", obj->o_type, print_letters[get_ident(obj)],
            inv_name(obj, !terse));
    }

    if (obj->o_type == ARTIFACT)
    {
        has_artifact |= (1 << obj->o_which);
        picked_artifact |= (1 << obj->o_which);

        if (!(obj->ar_flags & ISUSED))
        {
            obj->ar_flags |= ISUSED;
            pstats.s_exp += arts[obj->o_which].ar_worth / 10;
            check_level();
        }
    }

    updpack();

    return;
}
Ejemplo n.º 15
0
int bt_l2cap_chan_disconnect(struct bt_l2cap_chan *chan)
{
	struct bt_conn *conn = chan->conn;
	struct net_buf *buf;
	struct bt_l2cap_disconn_req *req;
	struct bt_l2cap_le_chan *ch;

	if (!conn) {
		return -ENOTCONN;
	}

	if (IS_ENABLED(CONFIG_BLUETOOTH_BREDR) &&
	    conn->type == BT_CONN_TYPE_BR) {
		return bt_l2cap_br_chan_disconnect(chan);
	}

	ch = BT_L2CAP_LE_CHAN(chan);

	BT_DBG("chan %p scid 0x%04x dcid 0x%04x", chan, ch->rx.cid,
	       ch->tx.cid);

	ch->chan.ident = get_ident();

	buf = l2cap_create_le_sig_pdu(BT_L2CAP_DISCONN_REQ, ch->chan.ident,
				      sizeof(*req));

	req = net_buf_add(buf, sizeof(*req));
	req->dcid = sys_cpu_to_le16(ch->tx.cid);
	req->scid = sys_cpu_to_le16(ch->rx.cid);

	l2cap_chan_send_req(ch, buf, L2CAP_DISC_TIMEOUT);
	bt_l2cap_chan_set_state(chan, BT_L2CAP_DISCONNECT);

	return 0;
}
Ejemplo n.º 16
0
int bt_l2cap_update_conn_param(struct bt_conn *conn,
			       const struct bt_le_conn_param *param)
{
	struct bt_l2cap_sig_hdr *hdr;
	struct bt_l2cap_conn_param_req *req;
	struct net_buf *buf;

	buf = bt_l2cap_create_pdu(&le_sig);
	if (!buf) {
		return -ENOBUFS;
	}

	hdr = net_buf_add(buf, sizeof(*hdr));
	hdr->code = BT_L2CAP_CONN_PARAM_REQ;
	hdr->ident = get_ident();
	hdr->len = sys_cpu_to_le16(sizeof(*req));

	req = net_buf_add(buf, sizeof(*req));
	req->min_interval = sys_cpu_to_le16(param->interval_min);
	req->max_interval = sys_cpu_to_le16(param->interval_max);
	req->latency = sys_cpu_to_le16(param->latency);
	req->timeout = sys_cpu_to_le16(param->timeout);

	bt_l2cap_send(conn, BT_L2CAP_CID_LE_SIG, buf);

	return 0;
}
Ejemplo n.º 17
0
BrowserTransition::~BrowserTransition()
{
    all.remove(get_ident());

    if (def)
        delete def;
}
Ejemplo n.º 18
0
Archivo: main.c Proyecto: cyrozap/misoc
static void ident(void)
{
	char buffer[IDENT_SIZE];

	get_ident(buffer);
	printf("Ident: %s\n", buffer);
}
Ejemplo n.º 19
0
static void l2cap_chan_update_credits(struct bt_l2cap_le_chan *chan)
{
	struct net_buf *buf;
	struct bt_l2cap_le_credits *ev;
	uint16_t credits;

	/* Only give more credits if it went bellow the defined threshold */
	if (k_sem_count_get(&chan->rx.credits) >
	    L2CAP_LE_CREDITS_THRESHOLD(chan->rx.init_credits)) {
		goto done;
	}

	/* Restore credits */
	credits = chan->rx.init_credits - k_sem_count_get(&chan->rx.credits);
	l2cap_chan_rx_give_credits(chan, credits);

	buf = l2cap_create_le_sig_pdu(BT_L2CAP_LE_CREDITS, get_ident(),
				      sizeof(*ev));

	ev = net_buf_add(buf, sizeof(*ev));
	ev->cid = sys_cpu_to_le16(chan->rx.cid);
	ev->credits = sys_cpu_to_le16(credits);

	bt_l2cap_send(chan->chan.conn, BT_L2CAP_CID_LE_SIG, buf);

done:
	BT_DBG("chan %p credits %u", chan, k_sem_count_get(&chan->rx.credits));
}
Ejemplo n.º 20
0
void BrowserRelation::prepare_update_lib() const
{
    all.memo_id_oid(get_ident(), original_id);

    if (def->is_a(this))
        def->prepare_update_lib();
}
Ejemplo n.º 21
0
void
c_common_write_pch (void)
{
  timevar_push (TV_PCH_SAVE);

  targetm.prepare_pch_save ();

  (*debug_hooks->handle_pch) (1);

  cpp_write_pch_deps (parse_in, pch_outfile);

  gt_pch_save (pch_outfile);

  timevar_push (TV_PCH_CPP_SAVE);
  cpp_write_pch_state (parse_in, pch_outfile);
  timevar_pop (TV_PCH_CPP_SAVE);

  if (fseek (pch_outfile, 0, SEEK_SET) != 0
      || fwrite (get_ident (), IDENT_LENGTH, 1, pch_outfile) != 1)
    fatal_error ("can%'t write %s: %m", pch_file);

  fclose (pch_outfile);

  timevar_pop (TV_PCH_SAVE);
}
Ejemplo n.º 22
0
void IconCanvas::save(Q3TextStream & st, bool, QString & warning) const {
  nl_indent(st);
  st << "iconcanvas " << get_ident() << ' ';
  browser_node->save(st, TRUE, warning);
  nl_indent(st);
  save_xyz(st, this, "  xyz");
}
Ejemplo n.º 23
0
BrowserRelation::~BrowserRelation()
{
    all.remove(get_ident());

    if (def)
        def->garbage(this);
}
Ejemplo n.º 24
0
void TextCanvas::save(QTextStream & st, bool ref, QString &) const {
    if (ref)
        st << "textcanvas_ref " << get_ident();
    else {
        nl_indent(st);
        st << "textcanvas " << get_ident() << ' ';
        save_string(fromUnicode(text), st);
        nl_indent(st);
        if (itsfont != UmlNormalFont)
            st << "  font " << stringify(itsfont);
        if (fg_c != UmlBlack)
            st << "  fg " << stringify(fg_c);
        if (bg_c != UmlTransparent)
            st << "  bg " << stringify(bg_c);
        save_xyzwh(st, this, "  xyzwh");
    }
}
Ejemplo n.º 25
0
void BrowserArtifact::prepare_update_lib() const
{
    all.memo_id_oid(get_ident(), original_id);
    for (BrowserNode * child = firstChild();
         child != 0;
         child = child->nextSibling())
        ((BrowserNode *) child)->prepare_update_lib();
}
Ejemplo n.º 26
0
void ArrowJunctionCanvas::save(Q3TextStream & st, bool, QString & warning) const {
  nl_indent(st);
  st << "arrowjunctioncanvas " << get_ident() << ' ';
  interface->save(st, TRUE, warning);
  nl_indent(st);
  save_xyz(st, this, "  xyz");
  save_xy(st, label, " label_xy");
}
Ejemplo n.º 27
0
void Attribute::display(string& output) 
{
	//std::cout << get_name() << "(" << get_ident() << ")  \t";
	char temp[5];
	itoa(get_ident(), temp, 10);

	output.append(get_name()); output.append("(");
	output.append(temp); output.append(")");
 }
Ejemplo n.º 28
0
BrowserObjectDiagram::~BrowserObjectDiagram()
{
    if (deletedp() && !modifiedp()) {
        QString fn;

        fn.sprintf("%d.diagram", get_ident());

        QDir d = BrowserView::get_dir();

        QFile::remove(d.absFilePath(fn));
    }
    on_close();
//    if(window)
//        window->set_browser_diagram(0);

    all.remove(get_ident());
    delete def;
}
Ejemplo n.º 29
0
void ParameterSetCanvas::save(QTextStream & st, bool ref, QString & warning) const {
    if (ref) {
        st << "parametersetcanvas_ref " << get_ident() << " // "
           << browser_node->full_name();
    }
    else {
        nl_indent(st);
        st << "parametersetcanvas " << get_ident() << ' ';
        browser_node->save(st, TRUE, warning);
        nl_indent(st);
        if (itscolor != UmlDefaultColor)
            st << "  color " << stringify(itscolor);
        save_xyz(st, this, "  xyz");
        save_stereotype_property(st, warning);
        nl_indent(st);
        st << "end";
    }
}
Ejemplo n.º 30
0
void UcClassCanvas::save(Q3TextStream & st, bool ref, QString & warning) const {
  if (ref)
    st << "classcanvas_ref " << get_ident() << " // " << browser_node->get_name();
  else {
    nl_indent(st);
    st << "classcanvas " << get_ident() << ' ';
    browser_node->save(st, TRUE, warning);
    indent(+1);
    settings.save(st);
    nl_indent(st);
    if (itscolor != UmlDefaultColor)
      st << "color " << stringify(itscolor) << ' ';
    save_xyz(st, this, "xyz");
    save_stereotype_property(st, warning);
    indent(-1);
    nl_indent(st);
    st << "end";
  }
}