gschem
|
#include <config.h>
#include <math.h>
#include <stdio.h>
#include "gschem.h"
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_BOX_LEFT(w) min((w)->first_wx, (w)->second_wx) |
#define | GET_BOX_TOP(w) max((w)->first_wy, (w)->second_wy) |
Typedefs | |
typedef void(* | FILL_FUNC )(GSCHEM_TOPLEVEL *w_current, COLOR *color, BOX *box, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2) |
Functions | |
static void | o_box_fill_hollow (GSCHEM_TOPLEVEL *w_current, COLOR *color, BOX *box, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2) |
Placeholder filling function. | |
static void | o_box_fill_fill (GSCHEM_TOPLEVEL *w_current, COLOR *color, BOX *box, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2) |
Fill inside of box with a solid pattern. | |
static void | o_box_fill_hatch (GSCHEM_TOPLEVEL *w_current, COLOR *color, BOX *box, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2) |
Fill inside of box with single line pattern. | |
static void | o_box_fill_mesh (GSCHEM_TOPLEVEL *w_current, COLOR *color, BOX *box, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2) |
Fill inside of box with mesh pattern. | |
void | o_box_draw (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current) |
Draw a box on the screen. | |
void | o_box_invalidate_rubber (GSCHEM_TOPLEVEL *w_current) |
void | o_box_draw_place (GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_current) |
Draw a box described by OBJECT with translation. | |
void | o_box_start (GSCHEM_TOPLEVEL *w_current, int w_x, int w_y) |
Start process to input a new box. | |
void | o_box_end (GSCHEM_TOPLEVEL *w_current, int w_x, int w_y) |
End the input of a box. | |
void | o_box_motion (GSCHEM_TOPLEVEL *w_current, int w_x, int w_y) |
Draw temporary box while dragging edge. | |
void | o_box_draw_rubber (GSCHEM_TOPLEVEL *w_current) |
Draw box from GSCHEM_TOPLEVEL object. | |
void | o_box_draw_grips (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current) |
Draw grip marks on box. |
#define GET_BOX_WIDTH | ( | w | ) | abs((w)->second_wx - (w)->first_wx) |
#define GET_BOX_HEIGHT | ( | w | ) | abs((w)->second_wy - (w)->first_wy) |
typedef void(* FILL_FUNC)(GSCHEM_TOPLEVEL *w_current, COLOR *color, BOX *box, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2) |
static void o_box_fill_hollow | ( | GSCHEM_TOPLEVEL * | w_current, |
COLOR * | color, | ||
BOX * | box, | ||
gint | fill_width, | ||
gint | angle1, | ||
gint | pitch1, | ||
gint | angle2, | ||
gint | pitch2 | ||
) | [static] |
[in] | w_current | Schematic top level |
[in] | color | Box fill color. |
[in] | box | Box definition |
[in] | fill_width | BOX pattern fill width. |
[in] | angle1 | 1st angle for pattern. |
[in] | pitch1 | 1st pitch for pattern. |
[in] | angle2 | 2nd angle for pattern. |
[in] | pitch2 | 2nd pitch for pattern. |
static void o_box_fill_fill | ( | GSCHEM_TOPLEVEL * | w_current, |
COLOR * | color, | ||
BOX * | box, | ||
gint | fill_width, | ||
gint | angle1, | ||
gint | pitch1, | ||
gint | angle2, | ||
gint | pitch2 | ||
) | [static] |
The box is defined in the same way as it is in GDK : one point and the width and height of the box.
All parameters are given in pixel.
[in] | w_current | Schematic top level |
[in] | color | Box fill color. |
[in] | box | Box definition |
[in] | fill_width | BOX pattern fill width. |
[in] | angle1 | (unused) |
[in] | pitch1 | (unused) |
[in] | angle2 | (unused) |
[in] | pitch2 | (unused) |
static void o_box_fill_hatch | ( | GSCHEM_TOPLEVEL * | w_current, |
COLOR * | color, | ||
BOX * | box, | ||
gint | fill_width, | ||
gint | angle1, | ||
gint | pitch1, | ||
gint | angle2, | ||
gint | pitch2 | ||
) | [static] |
The box is defined in the same way as it is in GDK : one point and the width and height of the box.
All parameters are given in pixel.
Negative or null values for pitch1 are not allowed as it leads to an endless loop.
[in] | w_current | Schematic top level |
[in] | color | Box fill color. |
[in] | box | Box definition |
[in] | fill_width | BOX pattern fill width. |
[in] | angle1 | 1st angle for pattern. |
[in] | pitch1 | 1st pitch for pattern. |
[in] | angle2 | (unused) |
[in] | pitch2 | (unused) |
Definition at line 127 of file o_box.c.
static void o_box_fill_mesh | ( | GSCHEM_TOPLEVEL * | w_current, |
COLOR * | color, | ||
BOX * | box, | ||
gint | fill_width, | ||
gint | angle1, | ||
gint | pitch1, | ||
gint | angle2, | ||
gint | pitch2 | ||
) | [static] |
This function simply makes two successive calls to the function o_box_fill_hatch() respectively with angle1, pitch1 and angle2, pitch2 for parameters.
[in] | w_current | Schematic top level |
[in] | color | Box fill color. |
[in] | box | Box definition |
[in] | fill_width | BOX pattern fill width. |
[in] | angle1 | 1st angle for pattern. |
[in] | pitch1 | 1st pitch for pattern. |
[in] | angle2 | 2nd angle for pattern. |
[in] | pitch2 | 2nd pitch for pattern. |
Definition at line 176 of file o_box.c.
void o_box_draw | ( | GSCHEM_TOPLEVEL * | w_current, |
OBJECT * | o_current | ||
) |
It first checks if the OBJECT pointed is valid or not. If not it returns and do not output anything. That should never happen though.
[in] | w_current | The GSCHEM_TOPLEVEL object. |
[in] | o_current | BOX OBJECT to draw. |
Definition at line 200 of file o_box.c.
void o_box_invalidate_rubber | ( | GSCHEM_TOPLEVEL * | w_current | ) |
void o_box_draw_place | ( | GSCHEM_TOPLEVEL * | w_current, |
int | dx, | ||
int | dy, | ||
OBJECT * | o_current | ||
) |
The box is displayed with the color of the object.
[in] | w_current | The GSCHEM_TOPLEVEL object. |
[in] | dx | Delta x coordinate for box. |
[in] | dy | Delta y coordinate for box. |
[in] | o_current | Box OBJECT to draw. |
Definition at line 353 of file o_box.c.
void o_box_start | ( | GSCHEM_TOPLEVEL * | w_current, |
int | w_x, | ||
int | w_y | ||
) |
The first step is to input one corner of the box. This corner is (w_x,w_y) snapped to the grid and saved in w_current->first_wx and w_current->first_wy.
The other corner will be saved in (w_current->second_wx, w_current->second_wy).
[in] | w_current | The GSCHEM_TOPLEVEL object. |
[in] | w_x | Current x coordinate of pointer in world. |
[in] | w_y | Current y coordinate of pointer in world. |
Definition at line 386 of file o_box.c.
void o_box_end | ( | GSCHEM_TOPLEVEL * | w_current, |
int | w_x, | ||
int | w_y | ||
) |
The temporary box is erased ; a new box object is allocated, initialized and linked to the object list ; The object is finally drawn on the current sheet.
[in] | w_current | The GSCHEM_TOPLEVEL object. |
[in] | w_x | Current x coordinate of pointer in world units. |
[in] | w_y | Current y coordinate of pointer in world units. |
Definition at line 412 of file o_box.c.
void o_box_motion | ( | GSCHEM_TOPLEVEL * | w_current, |
int | w_x, | ||
int | w_y | ||
) |
The old values are inside the w_current pointed structure. Old width, height and left and top values are recomputed by the corresponding macros.
[in] | w_current | The GSCHEM_TOPLEVEL object. |
[in] | w_x | Current x coordinate of pointer in world units. |
[in] | w_y | Current y coordinate of pointer in world units. |
Definition at line 481 of file o_box.c.
void o_box_draw_rubber | ( | GSCHEM_TOPLEVEL * | w_current | ) |
[in] | w_current | The GSCHEM_TOPLEVEL object. |
Definition at line 515 of file o_box.c.
void o_box_draw_grips | ( | GSCHEM_TOPLEVEL * | w_current, |
OBJECT * | o_current | ||
) |