gschem

o_grips.c File Reference

#include <config.h>
#include <stdio.h>
#include <math.h>
#include "gschem.h"
Include dependency graph for o_grips.c:

Go to the source code of this file.

Defines

#define GET_BOX_WIDTH(w)   abs((w)->second_wx - (w)->first_wx)
#define GET_BOX_HEIGHT(w)   abs((w)->second_wy - (w)->first_wy)
#define GET_PICTURE_WIDTH(w)   abs((w)->second_wx - (w)->first_wx)
#define GET_PICTURE_HEIGHT(w)   (w)->pixbuf_wh_ratio == 0 ? 0 : abs((w)->second_wx - (w)->first_wx)/(w)->pixbuf_wh_ratio
#define GET_PICTURE_LEFT(w)   min((w)->first_wx, (w)->second_wx)
#define GET_PICTURE_TOP(w)

Functions

OBJECT * o_grips_search_world (GSCHEM_TOPLEVEL *w_current, int x, int y, int *whichone)
 Check if point is inside grip.
static gboolean inside_grip (int x, int y, int grip_x, int grip_y, int size)
 Check if pointer is inside the grip region.
OBJECT * o_grips_search_arc_world (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current, int x, int y, int size, int *whichone)
 Check if pointer is inside arc grip.
OBJECT * o_grips_search_box_world (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current, int x, int y, int size, int *whichone)
 Check if pointer is inside box grip.
OBJECT * o_grips_search_path_world (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current, int x, int y, int size, int *whichone)
 Check if pointer is inside path grip.
OBJECT * o_grips_search_picture_world (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current, int x, int y, int size, int *whichone)
 Check if pointer is inside picture grip.
OBJECT * o_grips_search_circle_world (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current, int x, int y, int size, int *whichone)
 Check if pointer is inside circle grip.
OBJECT * o_grips_search_line_world (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current, int x, int y, int size, int *whichone)
 Check if pointer is inside line grip.
static void o_grips_start_arc (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current, int x, int y, int whichone)
 Initialize grip motion process for an arc.
static void o_grips_start_box (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current, int x, int y, int whichone)
 Initialize grip motion process for a box.
static void o_grips_start_path (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current, int x, int y, int whichone)
 Initialize grip motion process for a path.
static void o_grips_start_picture (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current, int x, int y, int whichone)
 Initialize grip motion process for a picture.
static void o_grips_start_circle (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current, int x, int y, int whichone)
 Initialize grip motion process for a circle.
static void o_grips_start_line (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current, int x, int y, int whichone)
 Initialize grip motion process for a line. This function starts the move of one of the two grips of the line object o_current.
int o_grips_start (GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
 Start process of modifiying one grip.
void o_grips_motion (GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
 Modify previously selected object according to mouse position.
void o_grips_cancel (GSCHEM_TOPLEVEL *w_current)
 Cancel process of modifying object with grip.
static void o_grips_end_arc (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current, int whichone)
 End process of modifying arc object with grip.
static void o_grips_end_box (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current, int whichone)
 End process of modifying box object with grip.
static void o_grips_end_path (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current, int whichone)
 End process of modifying path object with grip.
static void o_grips_end_picture (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current, int whichone)
 End process of modifying picture object with grip.
static void o_grips_end_circle (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current, int whichone)
 End process of modifying circle object with grip.
static void o_grips_end_line (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current, int whichone)
 End process of modifying line object with grip.
static void o_grips_end_net (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current, int whichone)
 End process of modifying net object with grip.
static void o_grips_end_pin (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current, int whichone)
 End process of modifying pin object with grip.
static void o_grips_end_bus (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current, int whichone)
 End process of modifying bus object with grip.
void o_grips_end (GSCHEM_TOPLEVEL *w_current)
 End process of modifying object with grip.
int o_grips_size (GSCHEM_TOPLEVEL *w_current)
 Get half the width and height of grip in screen units.
void o_grips_draw (GSCHEM_TOPLEVEL *w_current, int wx, int wy)
 Draw grip centered at x, y
void o_grips_draw_rubber (GSCHEM_TOPLEVEL *w_current)
 Draw objects being grip maniuplated from GSCHEM_TOPLEVEL object.

Define Documentation

#define GET_BOX_WIDTH (   w)    abs((w)->second_wx - (w)->first_wx)

Definition at line 31 of file o_grips.c.

#define GET_BOX_HEIGHT (   w)    abs((w)->second_wy - (w)->first_wy)

Definition at line 32 of file o_grips.c.

#define GET_PICTURE_WIDTH (   w)    abs((w)->second_wx - (w)->first_wx)

Definition at line 34 of file o_grips.c.

#define GET_PICTURE_HEIGHT (   w)    (w)->pixbuf_wh_ratio == 0 ? 0 : abs((w)->second_wx - (w)->first_wx)/(w)->pixbuf_wh_ratio

Definition at line 36 of file o_grips.c.

#define GET_PICTURE_LEFT (   w)    min((w)->first_wx, (w)->second_wx)

Definition at line 38 of file o_grips.c.

#define GET_PICTURE_TOP (   w)
Value:
(w)->first_wy > (w)->second_wy ? (w)->first_wy  :           \
  (w)->first_wy+abs((w)->second_wx - (w)->first_wx)/(w)->pixbuf_wh_ratio

Definition at line 40 of file o_grips.c.


Function Documentation

OBJECT* o_grips_search_world ( GSCHEM_TOPLEVEL w_current,
int  x,
int  y,
int *  whichone 
)
Function Description
This function is used to determine if the (x,y) point is inside a grip of one of the selected object on the current sheet. The selected object are in a list starting at w_current->toplevel->page_current->selection2_head. The x and y parameters are in world units. If the point is inside one grip, a pointer on the object it belongs to is returned and *whichone is set according to the position of the grip on the object. Else, *whichone is unchanged and the function returns NULL.

A specific search function is provided for every kind of graphical object. The list of selected object is covered : each object is tested with the appropriate function.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]xCurrent x coordinate of pointer in world units.
[in]yCurrent y coordinate of pointer in world units.
[out]whichoneWhich grip point is selected.
Returns:
Pointer to OBJECT the grip is on, NULL otherwise.

Definition at line 67 of file o_grips.c.

Here is the call graph for this function:

static gboolean inside_grip ( int  x,
int  y,
int  grip_x,
int  grip_y,
int  size 
) [static]
Function Description
This function checks if the point (x,y) is inside the grip centered at (grip_x,grip_y).
Parameters:
[in]xCurrent x coordinate of pointer in world units.
[in]yCurrent y coordinate of pointer in world units.
[in]grip_xCurrent x coordinate of grip center in world units.
[in]grip_yCurrent y coordinate of grip center in world units.
[in]sizeHalf the width of the grip square in world units.
Returns:
True / False whether the mouse pointer is inside the grip.

Definition at line 159 of file o_grips.c.

OBJECT* o_grips_search_arc_world ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current,
int  x,
int  y,
int  size,
int *  whichone 
)
Function Description
This function checks if the pointer event occuring at (x,y) is inside one of the grips of an o_current pointed arc object. If so the whichone pointed integer is set to the number of this grip and the return pointer is a pointer on this object. If the point is not inside a grip the function returns a NULL pointer and the whichone pointed integer is unset.

An arc object has three grips :

*
one at the center of the arc. This grip is used to modify the radius of the arc. If this one is selected, the whichone pointed integer is set to ARC_RADIUS.
*
one at one end of the arc. It corresponds to the starting angle of the arc. If this one is selected, the whichone pointed integer is set to ARC_START_ANGLE.
*
one at the other end of the arc. It corresponds to the ending angle of the arc. If this one is selected, the whichone pointed integer is set to ARC_END_ANGLE.

The x and y parameters are in world units.

The size parameter is the width (and height) of the square representing a grip in world units.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]o_currentArc OBJECT to check.
[in]xCurrent x coordinate of pointer in world units.
[in]yCurrent y coordinate of pointer in world units.
[in]sizeHalf the width of the grip square in world units.
[out]whichoneWhich grip point is selected.
Returns:
Pointer to OBJECT the grip is on, NULL otherwise.

Definition at line 206 of file o_grips.c.

Here is the call graph for this function:

OBJECT* o_grips_search_box_world ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current,
int  x,
int  y,
int  size,
int *  whichone 
)
Function Description
This function checks if the pointer event occuring at (x,y) is inside one of the grips of the o_current pointed box object. If so, the whichone pointed integer is set to the identifier of this grip and the returned pointer is a pointer on this object. If the point is not inside a grip the function returns a NULL pointer and the whichone pointed integer is unset.

A box object has four grips : one at each corner of the box. The identifiers of each corner are BOX_UPPER_LEFT, BOX_UPPER_RIGHT, BOX_LOWER_LEFT and BOX_LOWER_RIGHT.

The x and y parameters are in world units.

The size parameter is half the width (and half the height) of the square representing a grip in world units.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]o_currentBox OBJECT to check.
[in]xCurrent x coordinate of pointer in world units.
[in]yCurrent y coordinate of pointer in world units.
[in]sizeHalf the width of the grip square in world units.
[out]whichoneWhich grip point is selected.
Returns:
Pointer to OBJECT the grip is on, NULL otherwise.

Definition at line 271 of file o_grips.c.

Here is the call graph for this function:

OBJECT* o_grips_search_path_world ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current,
int  x,
int  y,
int  size,
int *  whichone 
)
Function Description
This function checks if the pointer event occuring at (x,y) is inside one of the grips of the o_current pointed path object. If so, the whichone pointed integer is set to the identifier of this grip and the returned pointer is a pointer on this object. If the point is not inside a grip the function returns a NULL pointer and the whichone pointed integer is unset.

A path object has four grips : one at each corner of the path. The identifiers of each corner are #PICTURE_UPPER_LEFT, #PICTURE_UPPER_RIGHT, #PICTURE_LOWER_LEFT and #PICTURE_LOWER_RIGHT.

The x and y parameters are in world units.

The size parameter is half the width (and half the height) of the square representing a grip in world units.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]o_currentPicture OBJECT to check.
[in]xCurrent x coordinate of pointer in world units.
[in]yCurrent y coordinate of pointer in world units.
[in]sizeHalf the width of the grip square in world units.
[out]whichoneWhich grip point is selected.
Returns:
Pointer to OBJECT the grip is on, NULL otherwise.

Definition at line 336 of file o_grips.c.

Here is the call graph for this function:

OBJECT* o_grips_search_picture_world ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current,
int  x,
int  y,
int  size,
int *  whichone 
)
Function Description
This function checks if the pointer event occuring at (x,y) is inside one of the grips of the o_current pointed picture object. If so, the whichone pointed integer is set to the identifier of this grip and the returned pointer is a pointer on this object. If the point is not inside a grip the function returns a NULL pointer and the whichone pointed integer is unset.

A picture object has four grips : one at each corner of the picture. The identifiers of each corner are #PICTURE_UPPER_LEFT, #PICTURE_UPPER_RIGHT, #PICTURE_LOWER_LEFT and #PICTURE_LOWER_RIGHT.

The x and y parameters are in world units.

The size parameter is half the width (and half the height) of the square representing a grip in world units.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]o_currentPicture OBJECT to check.
[in]xCurrent x coordinate of pointer in world units.
[in]yCurrent y coordinate of pointer in world units.
[in]sizeHalf the width of the grip square in world units.
[out]whichoneWhich grip point is selected.
Returns:
Pointer to OBJECT the grip is on, NULL otherwise.

Definition at line 406 of file o_grips.c.

Here is the call graph for this function:

OBJECT* o_grips_search_circle_world ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current,
int  x,
int  y,
int  size,
int *  whichone 
)
Function Description
This function determines if the (x,y) point is inside one of the grip of the circle object o_current. It computes the area covered by each grip and check if (x,y) is in one of these areas. If the event occured in one of the grip, a pointer on the object is returned and *whichone is set to the identifier of the grip. If not, the function returns a NULL pointer and *whichone is unchanged.

The parameter size is half the size of the grip in world units.

A circle has only one grip on the lower right corner of the box it is inscribed in. Moving this grip change the radius of the circle. The identifier of this grip is CIRCLE_RADIUS.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]o_currentCircle OBJECT to check.
[in]xCurrent x coordinate of pointer in world units.
[in]yCurrent y coordinate of pointer in world units.
[in]sizeHalf the width of the grip square in world units.
[out]whichoneWhich grip point is selected.
Returns:
Pointer to OBJECT the grip is on, NULL otherwise.

Definition at line 469 of file o_grips.c.

Here is the call graph for this function:

OBJECT* o_grips_search_line_world ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current,
int  x,
int  y,
int  size,
int *  whichone 
)
Function Description
This function determines if the (x,y) point is inside one of the grip of the line object o_current. It computes the area covered by each grip and check if (x,y) is in one of these areas. If the event occured in one of its grip, a pointer on the object is returned and *whichone is set to the identifier of the grip. If not, the function returns NULL pointer and *whichone is unchanged.

The parameter size is half the size of the grip in world units.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]o_currentLine OBJECT to check.
[in]xCurrent x coordinate of pointer in world units.
[in]yCurrent y coordinate of pointer in world units.
[in]sizeHalf the width of the grip square in world units.
[out]whichoneWhich grip point is selected.
Returns:
Pointer to OBJECT the grip is on, NULL otherwise.

Definition at line 504 of file o_grips.c.

Here is the call graph for this function:

static void o_grips_start_arc ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current,
int  x,
int  y,
int  whichone 
) [static]
Function Description
This function initializes the grip motion process for an arc. From the o_current pointed object, it stores into the GSCHEM_TOPLEVEL structure the coordinates of the center, the radius and the two angle that describes an arc. These variables are used in the grip process.

The coordinates of the center of the arc on x- and y-axis are stored into the first_wx and first_wy fields of the GSCHEM_TOPLEVEL structure in screen units.

The radius of the center is stored into the distance field of the GSCHEM_TOPLEVEL structure in screen units.

The two angles describing the arc on a circle are stored into the second_wx for the starting angle and second_wy for the ending angle. These angles are expressed in degrees.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]o_currentArc OBJECT to check.
[in]x(unused)
[in]y(unused)
[out]whichone(unused)

Definition at line 551 of file o_grips.c.

static void o_grips_start_box ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current,
int  x,
int  y,
int  whichone 
) [static]
Function Description
This function initializes the grip motion process for a box. From the o_current pointed object, it stores into the GSCHEM_TOPLEVEL structure the .... These variables are used in the grip process.

The function first erases the grips.

The coordinates of the selected corner are put in (w_current->second_wx,w_current->second_wx).

The coordinates of the opposite corner go in (w_current->first_wx,w_current->first_wy). They are not suppose to change during the action.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]o_currentBox OBJECT to check.
[in]x(unused)
[in]y(unused)
[out]whichoneWhich coordinate to check.

Definition at line 592 of file o_grips.c.

static void o_grips_start_path ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current,
int  x,
int  y,
int  whichone 
) [static]
Function Description
This function initializes the grip motion process for a path. From the o_current pointed object, it stores into the GSCHEM_TOPLEVEL structure the .... These variables are used in the grip process.

The function first erases the grips.

The coordinates of the selected corner are put in (w_current->second_wx,w_current->second_wy).

The coordinates of the opposite corner go in (w_current->first_wx,w_current->first_wy). They are not suppose to change during the action.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]o_currentPicture OBJECT to check.
[in]x(unused)
[in]y(unused)
[out]whichoneWhich coordinate to check.

Definition at line 655 of file o_grips.c.

static void o_grips_start_picture ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current,
int  x,
int  y,
int  whichone 
) [static]
Function Description
This function initializes the grip motion process for a picture. From the o_current pointed object, it stores into the GSCHEM_TOPLEVEL structure the .... These variables are used in the grip process.

The function first erases the grips.

The coordinates of the selected corner are put in (w_current->second_wx,w_current->second_wy).

The coordinates of the opposite corner go in (w_current->first_wx,w_current->first_wy). They are not suppose to change during the action.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]o_currentPicture OBJECT to check.
[in]x(unused)
[in]y(unused)
[out]whichoneWhich coordinate to check.

Definition at line 725 of file o_grips.c.

static void o_grips_start_circle ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current,
int  x,
int  y,
int  whichone 
) [static]
Function Description
This function initializes the grip motion process for a circle. From the o_current pointed object, it stores into the GSCHEM_TOPLEVEL structure the coordinate of the center and the radius. These variables are used in the grip process.

The function first erases the grips.

The coordinates of the center are put in (w_current->first_wx,w_current->first_wy). They are not suppose to change during the action.

The radius of the circle is stored in w_current->distance.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]o_currentCircle OBJECT to check.
[in]x(unused)
[in]y(unused)
[out]whichoneWhich coordinate to check.

Definition at line 793 of file o_grips.c.

static void o_grips_start_line ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current,
int  x,
int  y,
int  whichone 
) [static]

During the move of the grip, the line is described by (w_current->first_wx,w_current->first_wy) and (w_current->second_wx,w_current->second_wy).

The line end that corresponds to the moving grip is in (w_current->second_wx,w_current->second_wy).

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]o_currentLine OBJECT to check.
[in]x(unused)
[in]y(unused)
[out]whichoneWhich coordinate to check.

Definition at line 826 of file o_grips.c.

int o_grips_start ( GSCHEM_TOPLEVEL w_current,
int  w_x,
int  w_y 
)
Function Description
This function starts the process of modifying one grip of an object on the current sheet. The event occured in (w_x,w_y) in world unit. If this position is related to a grip of an object, the function prepares the modification of this grip thanks to the user input.

The function returns FALSE if an error occured or if no grip have been found under (w_x,w_y). It returns TRUE if a grip has been found and modification of the object has been started.

If a grip has been found, this function modifies the GSCHEM_TOPLEVEL variables which_grip and which_object with the identifier of the grip and the object it belongs to respectively.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]w_xCurrent x coordinate of pointer in world units.
[in]w_yCurrent y coordinate of pointer in world units.
Returns:
FALSE if an error occurred or no grip was found, TRUE otherwise.

Definition at line 862 of file o_grips.c.

Here is the call graph for this function:

void o_grips_motion ( GSCHEM_TOPLEVEL w_current,
int  w_x,
int  w_y 
)
Function Description
This function modify the previously selected object according to the mouse position in w_x and w_y. The grip under modification is updated and the temporary object displayed.

The object under modification is w_current->which_object and the grip concerned is w_current->which_grip.

Depending on the object type, a specific function is used. It erases the temporary object, updates its internal representation, and draws it again.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]w_xCurrent x coordinate of pointer in world units.
[in]w_yCurrent y coordinate of pointer in world units.

Definition at line 945 of file o_grips.c.

Here is the call graph for this function:

void o_grips_cancel ( GSCHEM_TOPLEVEL w_current)
Function Description
This function cancels the process of modifying a parameter of an object with a grip. It's main utility is to reset the dont_redraw flag on the object which was being modified.
Parameters:
[in,out]w_currentThe GSCHEM_TOPLEVEL object.

Definition at line 995 of file o_grips.c.

static void o_grips_end_arc ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current,
int  whichone 
) [static]
Function Description
This function ends the grips process specific to an arc object. It erases the old arc and write back to the object the new parameters of the arc. Depending on the grip selected and moved, the right fields are updated. The function handles the conversion from screen unit to world unit before updating and redrawing.

If the grip at the center of the arc has been moved - modifying the radius of the arc -, the new radius is calculated expressed in world unit (the center is unchanged). It is updated with the function #o_arc_modify().

If one of the end of arc grip has been moved - modifying one of the angles describing the arc -, this angle is updated with the #o_arc_modify() function.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]o_currentArc OBJECT to end modification on.
[in]whichoneWhich grip is pointed to.

Definition at line 1030 of file o_grips.c.

static void o_grips_end_box ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current,
int  whichone 
) [static]
Todo:
Finish function documentation!!!
Function Description
Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]o_currentBox OBJECT to end modification on.
[in]whichoneWhich grip is pointed to.

Definition at line 1078 of file o_grips.c.

Here is the call graph for this function:

static void o_grips_end_path ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current,
int  whichone 
) [static]
Todo:
Finish function documentation!!!
Function Description
Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]o_currentPicture OBJECT to end modification on.
[in]whichoneWhich grip is pointed to.

Definition at line 1107 of file o_grips.c.

static void o_grips_end_picture ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current,
int  whichone 
) [static]
Todo:
Finish function documentation!!!
Function Description
Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]o_currentPicture OBJECT to end modification on.
[in]whichoneWhich grip is pointed to.

Definition at line 1122 of file o_grips.c.

Here is the call graph for this function:

static void o_grips_end_circle ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current,
int  whichone 
) [static]
Function Description
This function ends the process of modifying the radius of the circle object *o_current. The modified circle is finally normally drawn.

A circle with a null radius is not allowed. In this case, the process is stopped and the circle is left unchanged.

The last value of the radius is in w_current->distance in screen units.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]o_currentCircle OBJECT to end modification on.
[in]whichoneWhich grip is pointed to.

Definition at line 1161 of file o_grips.c.

Here is the call graph for this function:

static void o_grips_end_line ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current,
int  whichone 
) [static]
Function Description
This function ends the process of modifying one end of the line object *o_current. This end is identified by whichone. The line object is modified according to the whichone parameter and the last position of the line end. The modified line is finally normally drawn.

A line with a null width, i.e. when both ends are identical, is not allowed. In this case, the process is stopped and the line unchanged.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]o_currentLine OBJECT to end modification on.
[in]whichoneWhich grip is pointed to.

Definition at line 1195 of file o_grips.c.

Here is the call graph for this function:

static void o_grips_end_net ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current,
int  whichone 
) [static]
Function Description
This function ends the process of modifying one end of the net object *o_current. This end is identified by whichone. The line object is modified according to the whichone parameter and the last position of the line end. The connections to the modified net are checked and recreated if neccessary.

A net with zero length, i.e. when both ends are identical, is not allowed. In this case, the process is stopped and the line unchanged.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]o_currentNet OBJECT to end modification on.
[in]whichoneWhich grip is pointed to.

Definition at line 1232 of file o_grips.c.

Here is the call graph for this function:

static void o_grips_end_pin ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current,
int  whichone 
) [static]
Function Description
This function ends the process of modifying one end of the pin object *o_current. This end is identified by whichone. The pin object is modified according to the whichone parameter and the last position of the pin end. The connections to the modified pin are checked and recreated if neccessary.

A pin with zero length, i.e. when both ends are identical, is not allowed. In this case, the process is stopped and the line unchanged.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]o_currentNet OBJECT to end modification on.
[in]whichoneWhich grip is pointed to.

Definition at line 1274 of file o_grips.c.

Here is the call graph for this function:

static void o_grips_end_bus ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current,
int  whichone 
) [static]
Function Description
This function ends the process of modifying one end of the bus object *o_current. This end is identified by whichone. The line object is modified according to the whichone parameter and the last position of the bus end. The connections to the modified bus are checked and recreated if neccessary.

A bus with zero length, i.e. when both ends are identical, is not allowed. In this case, the process is stopped and the bus unchanged.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]o_currentbus OBJECT to end modification on.
[in]whichoneWhich grip is pointed to.

Definition at line 1310 of file o_grips.c.

Here is the call graph for this function:

void o_grips_end ( GSCHEM_TOPLEVEL w_current)
Function Description
This function ends the process of modifying a parameter of an object with a grip. The temporary representation of the object is erased, the object is modified and finally drawn.

The object under modification is w_current->which_object and the grip concerned is w_current->which_grip.

Depending on the object type, a specific function is used. It erases the temporary object, updates the object and draws the modified object normally.

Parameters:
[in,out]w_currentThe GSCHEM_TOPLEVEL object.

Definition at line 1347 of file o_grips.c.

Here is the call graph for this function:

int o_grips_size ( GSCHEM_TOPLEVEL w_current)
Function Description
According to the current zoom level, the function returns half the width and height of a grip in screen units.

GRIP_SIZE1 and GRIP_SIZE2 and GRIP_SIZE3 are macros defined in gschem_defines.h. They are the half width/height of a grip in world unit for a determined range of zoom factors.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
Returns:
Half grip size in screen units.

Definition at line 1441 of file o_grips.c.

Here is the call graph for this function:

void o_grips_draw ( GSCHEM_TOPLEVEL w_current,
int  wx,
int  wy 
)
Function Description
This function draws a grip centered at (x,y). Its color is either the selection color or the overriding color from toplevel->override_color.

The size of the grip depends on the current zoom factor.

x and y are in screen unit.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]wxCenter x world coordinate for drawing grip.
[in]wyCenter y world coordinate for drawing grip.

Definition at line 1475 of file o_grips.c.

Here is the call graph for this function:

void o_grips_draw_rubber ( GSCHEM_TOPLEVEL w_current)
Function Description
This function draws the objects being grip manipulated.
Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.

Definition at line 1522 of file o_grips.c.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines