gschem

o_line.c File Reference

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

Go to the source code of this file.

Functions

void o_line_draw (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
 Draw a line on screen.
void o_line_invalidate_rubber (GSCHEM_TOPLEVEL *w_current)
void o_line_draw_place (GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_current)
 Draw a line object after applying translation.
void o_line_start (GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
 Start process to input a new line.
void o_line_end (GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
 End the input of a line.
void o_line_motion (GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
 Draw temporary line while dragging end.
void o_line_draw_rubber (GSCHEM_TOPLEVEL *w_current)
 Draw line from GSCHEM_TOPLEVEL object.
void o_line_draw_grips (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
 Draw grip marks on line.
int o_line_visible (GSCHEM_TOPLEVEL *w_current, LINE *line, int *x1, int *y1, int *x2, int *y2)

Function Documentation

void o_line_draw ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current 
)
Function Description
This function is used to draw a line on screen. The line is described in the object which is referred by o_current. The line is displayed according to the current state, described in the GSCHEM_TOPLEVEL object pointed by w_current.

It first checks if the object is valid or not. If not it returns and do not output anything. That should never happen though.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]o_currentThe line OBJECT to draw.

Definition at line 44 of file o_line.c.

Here is the call graph for this function:

void o_line_invalidate_rubber ( GSCHEM_TOPLEVEL w_current)
Todo:
Finish function documentation
Function Description

Definition at line 78 of file o_line.c.

Here is the call graph for this function:

void o_line_draw_place ( GSCHEM_TOPLEVEL w_current,
int  dx,
int  dy,
OBJECT *  o_current 
)
Function Description
This function is used to draw the line object described by *o_current after applying a translation on the two directions of dx and dy in world units.
Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]dxDelta x coordinate for line.
[in]dyDelta y coordinate for line.
[in]o_currentLine OBJECT to draw.

Definition at line 99 of file o_line.c.

Here is the call graph for this function:

void o_line_start ( GSCHEM_TOPLEVEL w_current,
int  w_x,
int  w_y 
)
Function Description
This function starts the process of interactively adding a line to the current sheet.

During all the process, the line is internally represented by the two ends of the line as (w_current->first_wx,w_current->first_wy) and (w_current->second_wx,w_current->second_wy).

A temporary line is drawn during the process with the selection color and changed according to the position of the mouse pointer.

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 129 of file o_line.c.

Here is the call graph for this function:

void o_line_end ( GSCHEM_TOPLEVEL w_current,
int  w_x,
int  w_y 
)
Function Description
This function ends the process of interactively adding a line to the current sheet.

It first erases the last temporary line displayed, calculates the corresponding world coordinates of the two ends of the line and finally adds a new initialized line object to the list of object of the current sheet.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]w_x(unused)
[in]w_y(unused)

Definition at line 153 of file o_line.c.

Here is the call graph for this function:

void o_line_motion ( GSCHEM_TOPLEVEL w_current,
int  w_x,
int  w_y 
)
Function Description
This function manages the erase/update/draw process of temporary line when modifying one end of the line. The line is described by four *w_current variables : the first end of the line is (first_wx,first_wy), the second end is (second_wx,second_wy). The first end is constant. The second end is updated to the (w_x,w_y).
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 196 of file o_line.c.

Here is the call graph for this function:

void o_line_draw_rubber ( GSCHEM_TOPLEVEL w_current)
Function Description
This function draws a line with an exclusive or function over the sheet. The color of the box is SELECT_COLOR. The line is described by the two points (w_current->first_wx, w_current->first_wy) and (w_current->second_wx,w_current->second_wy).
Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.

Definition at line 238 of file o_line.c.

Here is the call graph for this function:

void o_line_draw_grips ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current 
)
Function Description
This function draws the grips on the line object o_current.

A line has a grip at each end.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]o_currentLine OBJECT to draw grip points on.

Definition at line 258 of file o_line.c.

Here is the call graph for this function:

int o_line_visible ( GSCHEM_TOPLEVEL w_current,
LINE *  line,
int *  x1,
int *  y1,
int *  x2,
int *  y2 
)
Function Description
Parameters:
[in]w_currentThe TOPLEVEL object.
[in]line
[in]x1
[in]y1
[in]x2
[in]y2
Returns:
int

Definition at line 282 of file o_line.c.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines