gschem

o_text.c File Reference

#include <config.h>
#include <stdio.h>
#include <sys/stat.h>
#include <math.h>
#include "gschem.h"
Include dependency graph for o_text.c:

Go to the source code of this file.

Defines

#define MINIMUM_MARK_SMALL_DIST   1
#define FONT_NAME   "Arial"
#define I_OFFSET   10
#define I_SMALL_DIST   20
#define X_SMALL_DIST   10

Functions

char * unescape_text_and_overbars (char *text, PangoAttrList *attrs)
static void calculate_position (OBJECT *object, PangoFontMetrics *font_metrics, PangoRectangle logical_rect, PangoRectangle inked_rect, double *x, double *y)
static PangoFontMetrics * setup_pango_return_metrics (GSCHEM_TOPLEVEL *w_current, PangoLayout *layout, double scale_factor, OBJECT *o_current)
static void rotate_vector (double x, double y, double angle, double *rx, double *ry)
static void expand_bounds (int *left, int *top, int *right, int *bottom, int new_x, int new_y)
int o_text_get_rendered_bounds (void *user_data, OBJECT *o_current, int *min_x, int *min_y, int *max_x, int *max_y)
static void o_text_draw_lowlevel (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current, int dx, int dy, COLOR *color)
void o_text_draw (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
void o_text_draw_place (GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_current)
void o_text_prepare_place (GSCHEM_TOPLEVEL *w_current, char *text)
void o_text_edit (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
void o_text_edit_end (GSCHEM_TOPLEVEL *w_current, char *string, int len, int text_size, int text_alignment)
void o_text_change (GSCHEM_TOPLEVEL *w_current, OBJECT *object, char *string, int visibility, int show)

Define Documentation

#define MINIMUM_MARK_SMALL_DIST   1

Definition at line 38 of file o_text.c.

#define FONT_NAME   "Arial"

Definition at line 41 of file o_text.c.

#define I_OFFSET   10
Todo:
Finish function documentation!!!
Function Description

Definition at line 435 of file o_text.c.

#define I_SMALL_DIST   20

Definition at line 436 of file o_text.c.

#define X_SMALL_DIST   10

Definition at line 437 of file o_text.c.


Function Documentation

char* unescape_text_and_overbars ( char *  text,
PangoAttrList *  attrs 
)

Definition at line 49 of file o_text.c.

Here is the call graph for this function:

static void calculate_position ( OBJECT *  object,
PangoFontMetrics *  font_metrics,
PangoRectangle  logical_rect,
PangoRectangle  inked_rect,
double *  x,
double *  y 
) [static]

Note:
Ideally, we would be using just font / logical metrics for vertical alignment, however this way seems to be more backward compatible with the old gschem rendering.

Lower alignment is at the baseline of the bottom text line, whereas middle and upper alignment is based upon the inked extents of the entire text block.

Definition at line 101 of file o_text.c.

static PangoFontMetrics* setup_pango_return_metrics ( GSCHEM_TOPLEVEL w_current,
PangoLayout *  layout,
double  scale_factor,
OBJECT *  o_current 
) [static]

Definition at line 153 of file o_text.c.

Here is the call graph for this function:

static void rotate_vector ( double  x,
double  y,
double  angle,
double *  rx,
double *  ry 
) [static]

Definition at line 195 of file o_text.c.

static void expand_bounds ( int *  left,
int *  top,
int *  right,
int *  bottom,
int  new_x,
int  new_y 
) [static]

Definition at line 206 of file o_text.c.

int o_text_get_rendered_bounds ( void *  user_data,
OBJECT *  o_current,
int *  min_x,
int *  min_y,
int *  max_x,
int *  max_y 
)
Todo:
Finish function documentation!!!
Function Description

Definition at line 221 of file o_text.c.

Here is the call graph for this function:

static void o_text_draw_lowlevel ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current,
int  dx,
int  dy,
COLOR *  color 
) [static]
Todo:
Finish function documentation!!!
Function Description

Definition at line 372 of file o_text.c.

Here is the call graph for this function:

void o_text_draw ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current 
)

Definition at line 438 of file o_text.c.

Here is the call graph for this function:

void o_text_draw_place ( GSCHEM_TOPLEVEL w_current,
int  dx,
int  dy,
OBJECT *  o_current 
)
Todo:
Finish function documentation!!!
Function Description

Definition at line 529 of file o_text.c.

Here is the call graph for this function:

void o_text_prepare_place ( GSCHEM_TOPLEVEL w_current,
char *  text 
)
Todo:
Finish function documentation!!!
Function Description

Definition at line 566 of file o_text.c.

Here is the call graph for this function:

void o_text_edit ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current 
)
Todo:
Finish function documentation!!!
Function Description

Definition at line 603 of file o_text.c.

Here is the call graph for this function:

void o_text_edit_end ( GSCHEM_TOPLEVEL w_current,
char *  string,
int  len,
int  text_size,
int  text_alignment 
)
Todo:
Finish function documentation!!!
Function Description

Definition at line 617 of file o_text.c.

Here is the call graph for this function:

void o_text_change ( GSCHEM_TOPLEVEL w_current,
OBJECT *  object,
char *  string,
int  visibility,
int  show 
)
Todo:
Finish function documentation!!!
Function Description
Note:
The object passed in should be the REAL object, NOT any copy in any selection list

Definition at line 670 of file o_text.c.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines