Beispiel #1
0
static DiaObject *
zigzagline_copy(Zigzagline *zigzagline)
{
  Zigzagline *newzigzagline;
  OrthConn *orth, *neworth;
  
  orth = &zigzagline->orth;
 
  newzigzagline = g_malloc0(sizeof(Zigzagline));
  neworth = &newzigzagline->orth;

  orthconn_copy(orth, neworth);

  newzigzagline->line_color = zigzagline->line_color;
  newzigzagline->line_width = zigzagline->line_width;
  newzigzagline->line_style = zigzagline->line_style;
  newzigzagline->line_join = zigzagline->line_join;
  newzigzagline->line_caps = zigzagline->line_caps;
  newzigzagline->dashlength = zigzagline->dashlength;
  newzigzagline->start_arrow = zigzagline->start_arrow;
  newzigzagline->end_arrow = zigzagline->end_arrow;
  newzigzagline->corner_radius = zigzagline->corner_radius;

  zigzagline_update_data(newzigzagline);

  return &newzigzagline->orth.object;
}
Beispiel #2
0
static DiaObject *
participation_copy(Participation *participation)
{
  Participation *newparticipation;
  OrthConn *orth, *neworth;
  
  orth = &participation->orth;
  
  newparticipation = g_malloc0(sizeof(Participation));
  neworth = &newparticipation->orth;

  orthconn_copy(orth, neworth);

  newparticipation->total = participation->total;
  
  participation_update_data(newparticipation);
  
  return &newparticipation->orth.object;
}
static Object *
participation_copy(Participation *participation)
{
  Participation *newparticipation;
  OrthConn *orth, *neworth;
  Object *newobj;
  
  orth = &participation->orth;
  
  newparticipation = g_malloc(sizeof(Participation));
  neworth = &newparticipation->orth;
  newobj = (Object *) newparticipation;

  orthconn_copy(orth, neworth);

  newparticipation->total = participation->total;
  newparticipation->properties_dialog = NULL;
  
  participation_update_data(newparticipation);
  
  return (Object *)newparticipation;
}
Beispiel #4
0
static DiaObject *
association_copy(Association *assoc)
{
  Association *newassoc;
  OrthConn *orth, *neworth;
  DiaObject *newobj;
  int i;
  
  orth = &assoc->orth;
  
  newassoc = g_malloc0(sizeof(Association));
  neworth = &newassoc->orth;
  newobj = &neworth->object;

  orthconn_copy(orth, neworth);

  newassoc->name = g_strdup(assoc->name);
  newassoc->direction = assoc->direction;
  newassoc->show_direction = assoc->show_direction;
  newassoc->assoc_type = assoc->assoc_type;
  newassoc->text_color = assoc->text_color;
  newassoc->line_color = assoc->line_color;
  for (i=0;i<2;i++) {
    newassoc->end[i] = assoc->end[i];
    newassoc->end[i].role =
      (assoc->end[i].role != NULL)?g_strdup(assoc->end[i].role):NULL;
    newassoc->end[i].multiplicity =
      (assoc->end[i].multiplicity != NULL)?g_strdup(assoc->end[i].multiplicity):NULL;
  }

  newassoc->text_width = assoc->text_width;
  
  association_update_data(newassoc);
  
  return &newassoc->orth.object;
}
static Object *
generalization_copy(Generalization *genlz)
{
  Generalization *newgenlz;
  OrthConn *orth, *neworth;
  Object *newobj;
  
  orth = &genlz->orth;
  
  newgenlz = g_malloc(sizeof(Generalization));
  neworth = &newgenlz->orth;
  newobj = (Object *) newgenlz;

  orthconn_copy(orth, neworth);

  newgenlz->name = (genlz->name != NULL)? strdup(genlz->name):NULL;
  newgenlz->stereotype = (genlz->stereotype != NULL)? strdup(genlz->stereotype):NULL;
  newgenlz->text_width = genlz->text_width;
  newgenlz->properties_dialog = NULL;
  
  generalization_update_data(newgenlz);
  
  return (Object *)newgenlz;
}