예제 #1
0
Boolean ChangeObjectThermal( int Type, void *Ptr1, void *Ptr2, void *Ptr3, int therm_type )
{
  Boolean change;
  Absolute = therm_type;
  Delta = therm_type;
  change = ObjectOperation( &ChangeThermalFunctions, Type, Ptr1, Ptr2, Ptr3 ) != 0;
  if ( ObjectOperation( &ChangeThermalFunctions, Type, Ptr1, Ptr2, Ptr3 ) )
  {
    Draw( );
    IncrementUndoSerialNumber( );
  }
  return change;
}
예제 #2
0
Boolean ChangeObjectMaskSize( int Type, void *Ptr1, void *Ptr2, void *Ptr3, LocationType Difference, Boolean fixIt )
{
  Boolean change;
  Difference = 0;
  Absolute = fixIt != 0 ? Difference : Difference;
  Delta = Difference;
  change = ObjectOperation( &ChangeMaskSizeFunctions, Type, Ptr1, Ptr2, Ptr3 ) != 0;
  if ( ObjectOperation( &ChangeMaskSizeFunctions, Type, Ptr1, Ptr2, Ptr3 ) )
  {
    Draw( );
    IncrementUndoSerialNumber( );
  }
  return change;
}
예제 #3
0
파일: move.c 프로젝트: fruoff/pcb-fruoff
/* ---------------------------------------------------------------------------
 * moves the object identified by its data pointers and the type
 * as well as all attached rubberband lines
 */
void *
MoveObjectAndRubberband (int Type, void *Ptr1, void *Ptr2, void *Ptr3,
			 Coord DX, Coord DY)
{
  RubberbandTypePtr ptr;
  void *ptr2;

  /* setup offset */
  DeltaX = DX;
  DeltaY = DY;
  if (DX == 0 && DY == 0)
    return (NULL);

  /* move all the lines... and reset the counter */
  ptr = Crosshair.AttachedObject.Rubberband;
  while (Crosshair.AttachedObject.RubberbandN)
    {
      /* first clear any marks that we made in the line flags */
      CLEAR_FLAG (RUBBERENDFLAG, ptr->Line);
      AddObjectToMoveUndoList (LINEPOINT_TYPE,
			       ptr->Layer, ptr->Line, ptr->MovedPoint, DX,
			       DY);
      MoveLinePoint (ptr->Layer, ptr->Line, ptr->MovedPoint);
      Crosshair.AttachedObject.RubberbandN--;
      ptr++;
    }

  AddObjectToMoveUndoList (Type, Ptr1, Ptr2, Ptr3, DX, DY);
  ptr2 = ObjectOperation (&MoveFunctions, Type, Ptr1, Ptr2, Ptr3);
  IncrementUndoSerialNumber ();
  return (ptr2);
}
예제 #4
0
파일: remove.c 프로젝트: bert/pcb-rnd
/* ---------------------------------------------------------------------------
 * remove object as referred by pointers and type
 * allocated memory is destroyed assumed to already be erased
 */
void *
DestroyObject (DataTypePtr Target, int Type, void *Ptr1,
	       void *Ptr2, void *Ptr3)
{
  DestroyTarget = Target;
  return (ObjectOperation (&DestroyFunctions, Type, Ptr1, Ptr2, Ptr3));
}
예제 #5
0
void *ChangeObjectName( int Type, void *Ptr1, void *Ptr2, void *Ptr3, char *Name )
{
  void *result;
  NewName = Name;
  result = ObjectOperation( &ChangeNameFunctions, Type, Ptr1, Ptr2, Ptr3 );
  Draw( );
  return result;
}
예제 #6
0
파일: buffer.c 프로젝트: bgamari/geda-pcb
/* ----------------------------------------------------------------------
 * Adds the passed object to the passed buffer
 */
void *
CopyObjectToBuffer (DataType *Destination, DataType *Src,
		    int Type, void *Ptr1, void *Ptr2, void *Ptr3)
{
  /* setup local identifiers used by Add operations */
  Dest = Destination;
  Source = Src;
  return (ObjectOperation (&AddBufferFunctions, Type, Ptr1, Ptr2, Ptr3));
}
예제 #7
0
Boolean ClrObjectOctagon( int Type, void *Ptr1, void *Ptr2, void *Ptr3 )
{
  if ( ObjectOperation( &ClrOctagonFunctions, Type, Ptr1, Ptr2, Ptr3 ) )
  {
    Draw( );
    IncrementUndoSerialNumber( );
  }
  return 1;
}
예제 #8
0
Boolean SetObjectSquare( int Type, void *Ptr1, void *Ptr2, void *Ptr3 )
{
  if ( ObjectOperation( &SetSquareFunctions, Type, Ptr1, Ptr2, Ptr3 ) )
  {
    Draw( );
    IncrementUndoSerialNumber( );
  }
  return 1;
}
예제 #9
0
Boolean ChangeObjectJoin( int Type, void *Ptr1, void *Ptr2, void *Ptr3 )
{
  if ( ObjectOperation( &ChangeJoinFunctions, Type, Ptr1, Ptr2, Ptr3 ) )
  {
    Draw( );
    IncrementUndoSerialNumber( );
  }
  return 1;
}
예제 #10
0
파일: move.c 프로젝트: fruoff/pcb-fruoff
/* ---------------------------------------------------------------------------
 * moves the object identified by its data pointers and the type
 * not we don't bump the undo serial number
 */
void *
MoveObject (int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord DX, Coord DY)
{
  void *result;
  /* setup offset */
  DeltaX = DX;
  DeltaY = DY;
  AddObjectToMoveUndoList (Type, Ptr1, Ptr2, Ptr3, DX, DY);
  result = ObjectOperation (&MoveFunctions, Type, Ptr1, Ptr2, Ptr3);
  return (result);
}
예제 #11
0
파일: move.c 프로젝트: fruoff/pcb-fruoff
/* ---------------------------------------------------------------------------
 * moves the object identified by its data pointers and the type
 * to a new layer without changing it's position
 */
void *
MoveObjectToLayer (int Type, void *Ptr1, void *Ptr2, void *Ptr3,
		   LayerTypePtr Target, bool enmasse)
{
  void *result;

  /* setup global identifiers */
  Dest = Target;
  MoreToCome = enmasse;
  result = ObjectOperation (&MoveToLayerFunctions, Type, Ptr1, Ptr2, Ptr3);
  IncrementUndoSerialNumber ();
  return (result);
}
예제 #12
0
파일: copy.c 프로젝트: bgamari/geda-pcb
/* ---------------------------------------------------------------------------
 * copies the object identified by its data pointers and the type
 * the new objects is moved by DX,DY
 * I assume that the appropriate layer ... is switched on
 */
void *
CopyObject (int Type, void *Ptr1, void *Ptr2, void *Ptr3,
	    Coord DX, Coord DY)
{
  void *ptr;

  /* setup movement vector */
  DeltaX = DX;
  DeltaY = DY;

  /* the subroutines add the objects to the undo-list */
  ptr = ObjectOperation (&CopyFunctions, Type, Ptr1, Ptr2, Ptr3);
  IncrementUndoSerialNumber ();
  return (ptr);
}
예제 #13
0
Boolean ChangeObjectClearSize( int Type, void *Ptr1, void *Ptr2, void *Ptr3, LocationType Difference, Boolean fixIt )
{
  int ecx;
  int ebx;
  int esi;
  int edi;
  Boolean change;
  Difference = 0;
  Absolute = fixIt != 0 ? Difference : Difference;
  Delta = Difference;
  change = ObjectOperation( &ChangeClearSizeFunctions, Type, Ptr1, Ptr2, Ptr3 ) != 0;
  if ( change & 255 )
  {
    Draw( );
    IncrementUndoSerialNumber( );
  }
  return change;
}
예제 #14
0
파일: insert.c 프로젝트: thequux/pcb
/* ---------------------------------------------------------------------------
 * inserts point into objects
 */
void *
InsertPointIntoObject (int Type, void *Ptr1, void *Ptr2, Cardinal * Ptr3,
		       LocationType DX, LocationType DY, bool Force,
		       bool insert_last)
{
  void *ptr;

  /* setup offset */
  InsertX = DX;
  InsertY = DY;
  InsertAt = *Ptr3;
  InsertLast = insert_last;
  Forcible = Force;

  /* the operation insert the points to the undo-list */
  ptr = ObjectOperation (&InsertFunctions, Type, Ptr1, Ptr2, Ptr3);
  if (ptr != NULL)
    IncrementUndoSerialNumber ();
  return (ptr);
}
예제 #15
0
파일: remove.c 프로젝트: bert/pcb-rnd
/* ---------------------------------------------------------------------------
 * remove object as referred by pointers and type,
 * allocated memory is passed to the 'remove undo' list
 */
void *
RemoveObject (int Type, void *Ptr1, void *Ptr2, void *Ptr3)
{
  void *ptr = ObjectOperation (&RemoveFunctions, Type, Ptr1, Ptr2, Ptr3);
  return (ptr);
}