pcb 4.1.1
An interactive printed circuit board layout editor.

hidnogui.c File Reference

#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include "global.h"
#include "hid.h"
#include "hid_draw.h"
Include dependency graph for hidnogui.c:

Go to the source code of this file.

Data Structures

struct  hid_gc_struct

Defines

#define CRASH   fprintf(stderr, "HID error: pcb called GUI function %s without having a GUI available.\n", __FUNCTION__); abort()
#define MAX_LINE_LENGTH   1024

Typedefs

typedef struct hid_gc_struct hid_gc_struct

Functions

static HID_Attributenogui_get_export_options (int *n_ret)
static void nogui_do_export (HID_Attr_Val *options)
static void nogui_parse_arguments (int *argc, char ***argv)
static void nogui_invalidate_lr (Coord l, Coord r, Coord t, Coord b)
static void nogui_invalidate_all (void)
static int nogui_set_layer (const char *name, int idx, int empty)
static void nogui_end_layer (void)
static hidGC nogui_make_gc (void)
static void nogui_destroy_gc (hidGC gc)
static void nogui_use_mask (enum mask_mode mode)
static void nogui_set_color (hidGC gc, const char *name)
static void nogui_set_line_cap (hidGC gc, EndCapStyle style)
static void nogui_set_line_width (hidGC gc, Coord width)
static void nogui_set_draw_xor (hidGC gc, int xor_)
static void nogui_set_draw_faded (hidGC gc, int faded)
static void nogui_draw_line (hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
static void nogui_draw_arc (hidGC gc, Coord cx, Coord cy, Coord width, Coord height, Angle start_angle, Angle end_angle)
static void nogui_draw_rect (hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
static void nogui_fill_circle (hidGC gc, Coord cx, Coord cy, Coord radius)
static void nogui_fill_polygon (hidGC gc, int n_coords, Coord *x, Coord *y)
static void nogui_draw_pcb_polygon (hidGC gc, PolygonType *poly, const BoxType *clip_box)
static void nogui_fill_pcb_pad (hidGC gc, PadType *pad, bool clear, bool mask)
static void nogui_thindraw_pcb_pad (hidGC gc, PadType *pad, bool clear, bool mask)
static void nogui_fill_pcb_pv (hidGC fg_gc, hidGC bg_gc, PinType *pad, bool drawHole, bool mask)
static void nogui_thindraw_pcb_pv (hidGC fg_gc, hidGC bg_gc, PinType *pad, bool drawHole, bool mask)
static void nogui_fill_rect (hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
static void nogui_calibrate (double xval, double yval)
static int nogui_shift_is_pressed (void)
static int nogui_control_is_pressed (void)
static int nogui_mod1_is_pressed (void)
static void nogui_get_coords (const char *msg, Coord *x, Coord *y)
static void nogui_set_crosshair (int x, int y, int action)
static hidval nogui_add_timer (void(*func)(hidval user_data), unsigned long milliseconds, hidval user_data)
static void nogui_stop_timer (hidval timer)
static hidval nogui_watch_file (int fd, unsigned int condition, void(*func)(hidval watch, int fd, unsigned int condition, hidval user_data), hidval user_data)
static void nogui_unwatch_file (hidval watch)
static hidval nogui_add_block_hook (void(*func)(hidval data), hidval data)
static void nogui_stop_block_hook (hidval block_hook)
static void nogui_log (const char *fmt,...)
static void nogui_logv (const char *fmt, va_list ap)
static char * read_stdin_line (void)
static int nogui_confirm_dialog (char *msg,...)
static int nogui_close_confirm_dialog ()
static void nogui_report_dialog (char *title, char *msg)
static char * nogui_prompt_for (const char *msg, const char *default_string)
static char * nogui_fileselect (const char *title, const char *descr, char *default_file, char *default_ext, const char *history_tag, int flags)
static int nogui_attribute_dialog (HID_Attribute *attrs, int n_attrs, HID_Attr_Val *results, const char *title, const char *descr)
static void nogui_show_item (void *item)
static void nogui_beep (void)
static int nogui_progress (int so_far, int total, const char *message)
static HID_DRAWnogui_request_debug_draw (void)
static void nogui_flush_debug_draw (void)
static void nogui_finish_debug_draw (void)
void common_nogui_init (HID *hid)
void common_nogui_graphics_init (HID_DRAW *graphics)
HIDhid_nogui_get_hid (void)

Variables

static HID nogui_hid
static HID_DRAW nogui_graphics

Define Documentation

#define MAX_LINE_LENGTH   1024

Definition at line 290 of file hidnogui.c.

Referenced by read_stdin_line().


Typedef Documentation

typedef struct hid_gc_struct hid_gc_struct

Function Documentation

void common_nogui_init ( HID hid)

Definition at line 450 of file hidnogui.c.

References hid_st::add_block_hook, hid_st::add_timer, hid_st::attribute_dialog, hid_st::beep, hid_st::calibrate, hid_st::close_confirm_dialog, hid_st::confirm_dialog, hid_st::control_is_pressed, hid_st::do_export, hid_st::end_layer, hid_st::fileselect, hid_st::finish_debug_draw, hid_st::flush_debug_draw, hid_st::get_coords, hid_st::get_export_options, hid_st::invalidate_all, hid_st::invalidate_lr, hid_st::log, hid_st::logv, hid_st::mod1_is_pressed, nogui_add_block_hook(), nogui_add_timer(), nogui_attribute_dialog(), nogui_beep(), nogui_calibrate(), nogui_close_confirm_dialog(), nogui_confirm_dialog(), nogui_control_is_pressed(), nogui_do_export(), nogui_end_layer(), nogui_fileselect(), nogui_finish_debug_draw(), nogui_flush_debug_draw(), nogui_get_coords(), nogui_get_export_options(), nogui_invalidate_all(), nogui_invalidate_lr(), nogui_log(), nogui_logv(), nogui_mod1_is_pressed(), nogui_parse_arguments(), nogui_progress(), nogui_prompt_for(), nogui_report_dialog(), nogui_request_debug_draw(), nogui_set_crosshair(), nogui_set_layer(), nogui_shift_is_pressed(), nogui_show_item(), nogui_stop_block_hook(), nogui_stop_timer(), nogui_unwatch_file(), nogui_watch_file(), hid_st::parse_arguments, hid_st::progress, hid_st::prompt_for, hid_st::report_dialog, hid_st::request_debug_draw, hid_st::set_crosshair, hid_st::set_layer, hid_st::shift_is_pressed, hid_st::show_item, hid_st::stop_block_hook, hid_st::stop_timer, hid_st::unwatch_file, and hid_st::watch_file.

Referenced by hid_batch_init(), hid_bom_init(), hid_eps_init(), hid_gcode_init(), hid_gerber_init(), hid_gsvit_init(), hid_ipcd356_init(), hid_lesstif_init(), hid_lpr_init(), hid_nelma_init(), hid_nogui_get_hid(), hid_png_init(), hid_ps_init(), and REGISTER_FLAGS().

Here is the call graph for this function:

HID* hid_nogui_get_hid ( void  )

Definition at line 516 of file hidnogui.c.

References common_nogui_graphics_init(), common_nogui_init(), hid_st::description, hid_st::graphics, hid_st::name, nogui_graphics, nogui_hid, and hid_st::struct_size.

Referenced by hid_init().

Here is the call graph for this function:

static hidval nogui_add_block_hook ( void(*)(hidval data)  func,
hidval  data 
) [static]

Definition at line 258 of file hidnogui.c.

References CRASH, and hidval::ptr.

Referenced by common_nogui_init().

static hidval nogui_add_timer ( void(*)(hidval user_data)  func,
unsigned long  milliseconds,
hidval  user_data 
) [static]

Definition at line 226 of file hidnogui.c.

References CRASH, and hidval::lval.

Referenced by common_nogui_init().

static int nogui_attribute_dialog ( HID_Attribute attrs,
int  n_attrs,
HID_Attr_Val results,
const char *  title,
const char *  descr 
) [static]

Definition at line 407 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_init().

static void nogui_beep ( void  ) [static]

Definition at line 421 of file hidnogui.c.

Referenced by common_nogui_init().

static void nogui_calibrate ( double  xval,
double  yval 
) [static]

Definition at line 188 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_init().

static int nogui_close_confirm_dialog ( ) [static]

Definition at line 357 of file hidnogui.c.

References _, and nogui_confirm_dialog().

Referenced by common_nogui_init().

Here is the call graph for this function:

static int nogui_confirm_dialog ( char *  msg,
  ... 
) [static]

Definition at line 318 of file hidnogui.c.

References args, and read_stdin_line().

Referenced by common_nogui_init(), and nogui_close_confirm_dialog().

Here is the call graph for this function:

static int nogui_control_is_pressed ( void  ) [static]

Definition at line 201 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_init().

static void nogui_destroy_gc ( hidGC  gc) [static]

Definition at line 81 of file hidnogui.c.

Referenced by common_nogui_graphics_init().

static void nogui_do_export ( HID_Attr_Val options) [static]

Definition at line 38 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_init().

static void nogui_draw_arc ( hidGC  gc,
Coord  cx,
Coord  cy,
Coord  width,
Coord  height,
Angle  start_angle,
Angle  end_angle 
) [static]

Definition at line 127 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_graphics_init().

static void nogui_draw_line ( hidGC  gc,
Coord  x1,
Coord  y1,
Coord  x2,
Coord  y2 
) [static]

Definition at line 121 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_graphics_init().

static void nogui_draw_pcb_polygon ( hidGC  gc,
PolygonType poly,
const BoxType clip_box 
) [static]

Definition at line 152 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_graphics_init().

static void nogui_draw_rect ( hidGC  gc,
Coord  x1,
Coord  y1,
Coord  x2,
Coord  y2 
) [static]

Definition at line 134 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_graphics_init().

static void nogui_end_layer ( void  ) [static]

Definition at line 70 of file hidnogui.c.

Referenced by common_nogui_init().

static char* nogui_fileselect ( const char *  title,
const char *  descr,
char *  default_file,
char *  default_ext,
const char *  history_tag,
int  flags 
) [static]

Definition at line 388 of file hidnogui.c.

References read_stdin_line().

Referenced by common_nogui_init().

Here is the call graph for this function:

static void nogui_fill_circle ( hidGC  gc,
Coord  cx,
Coord  cy,
Coord  radius 
) [static]

Definition at line 140 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_graphics_init().

static void nogui_fill_pcb_pad ( hidGC  gc,
PadType pad,
bool  clear,
bool  mask 
) [static]

Definition at line 158 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_graphics_init().

static void nogui_fill_pcb_pv ( hidGC  fg_gc,
hidGC  bg_gc,
PinType pad,
bool  drawHole,
bool  mask 
) [static]

Definition at line 170 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_graphics_init().

static void nogui_fill_polygon ( hidGC  gc,
int  n_coords,
Coord x,
Coord y 
) [static]

Definition at line 146 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_graphics_init().

static void nogui_fill_rect ( hidGC  gc,
Coord  x1,
Coord  y1,
Coord  x2,
Coord  y2 
) [static]

Definition at line 182 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_graphics_init().

static void nogui_finish_debug_draw ( void  ) [static]

Definition at line 445 of file hidnogui.c.

Referenced by common_nogui_init().

static void nogui_flush_debug_draw ( void  ) [static]

Definition at line 440 of file hidnogui.c.

Referenced by common_nogui_init().

static void nogui_get_coords ( const char *  msg,
Coord x,
Coord y 
) [static]

Definition at line 215 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_init().

static HID_Attribute* nogui_get_export_options ( int *  n_ret) [static]

Definition at line 31 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_init().

static void nogui_invalidate_all ( void  ) [static]

Definition at line 57 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_init().

static void nogui_invalidate_lr ( Coord  l,
Coord  r,
Coord  t,
Coord  b 
) [static]

Definition at line 50 of file hidnogui.c.

Referenced by common_nogui_init().

static void nogui_log ( const char *  fmt,
  ... 
) [static]

Definition at line 273 of file hidnogui.c.

Referenced by common_nogui_init().

static void nogui_logv ( const char *  fmt,
va_list  ap 
) [static]

Definition at line 282 of file hidnogui.c.

Referenced by common_nogui_init().

static hidGC nogui_make_gc ( void  ) [static]

Definition at line 75 of file hidnogui.c.

Referenced by common_nogui_graphics_init().

static int nogui_mod1_is_pressed ( void  ) [static]

Definition at line 208 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_init().

static void nogui_parse_arguments ( int *  argc,
char ***  argv 
) [static]

Definition at line 44 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_init().

static int nogui_progress ( int  so_far,
int  total,
const char *  message 
) [static]

Definition at line 428 of file hidnogui.c.

Referenced by common_nogui_init().

static char* nogui_prompt_for ( const char *  msg,
const char *  default_string 
) [static]

Definition at line 369 of file hidnogui.c.

References read_stdin_line().

Referenced by common_nogui_init().

Here is the call graph for this function:

static void nogui_report_dialog ( char *  title,
char *  msg 
) [static]

Definition at line 363 of file hidnogui.c.

Referenced by common_nogui_init().

static HID_DRAW* nogui_request_debug_draw ( void  ) [static]

Definition at line 434 of file hidnogui.c.

Referenced by common_nogui_init().

static void nogui_set_color ( hidGC  gc,
const char *  name 
) [static]

Definition at line 92 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_graphics_init().

static void nogui_set_crosshair ( int  x,
int  y,
int  action 
) [static]

Definition at line 221 of file hidnogui.c.

Referenced by common_nogui_init().

static void nogui_set_draw_faded ( hidGC  gc,
int  faded 
) [static]

Definition at line 116 of file hidnogui.c.

Referenced by common_nogui_graphics_init().

static void nogui_set_draw_xor ( hidGC  gc,
int  xor_ 
) [static]

Definition at line 110 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_graphics_init().

static int nogui_set_layer ( const char *  name,
int  idx,
int  empty 
) [static]

Definition at line 63 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_init().

static void nogui_set_line_cap ( hidGC  gc,
EndCapStyle  style 
) [static]

Definition at line 98 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_graphics_init().

static void nogui_set_line_width ( hidGC  gc,
Coord  width 
) [static]

Definition at line 104 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_graphics_init().

static int nogui_shift_is_pressed ( void  ) [static]

Definition at line 194 of file hidnogui.c.

Referenced by common_nogui_init().

static void nogui_show_item ( void *  item) [static]

Definition at line 415 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_init().

static void nogui_stop_block_hook ( hidval  block_hook) [static]

Definition at line 267 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_init().

static void nogui_stop_timer ( hidval  timer) [static]

Definition at line 236 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_init().

static void nogui_thindraw_pcb_pad ( hidGC  gc,
PadType pad,
bool  clear,
bool  mask 
) [static]

Definition at line 164 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_graphics_init().

static void nogui_thindraw_pcb_pv ( hidGC  fg_gc,
hidGC  bg_gc,
PinType pad,
bool  drawHole,
bool  mask 
) [static]

Definition at line 176 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_graphics_init().

static void nogui_unwatch_file ( hidval  watch) [static]

Definition at line 252 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_init().

static void nogui_use_mask ( enum mask_mode  mode) [static]

Definition at line 86 of file hidnogui.c.

References CRASH.

Referenced by common_nogui_graphics_init().

static hidval nogui_watch_file ( int  fd,
unsigned int  condition,
void(*)(hidval watch, int fd, unsigned int condition, hidval user_data)  func,
hidval  user_data 
) [static]

Definition at line 242 of file hidnogui.c.

References CRASH, and hidval::lval.

Referenced by common_nogui_init().

static char* read_stdin_line ( void  ) [static]

Definition at line 292 of file hidnogui.c.

References MAX_LINE_LENGTH, and s.

Referenced by nogui_confirm_dialog(), nogui_fileselect(), and nogui_prompt_for().


Variable Documentation

Definition at line 513 of file hidnogui.c.

Referenced by hid_nogui_get_hid().

HID nogui_hid [static]

Definition at line 512 of file hidnogui.c.

Referenced by hid_nogui_get_hid().