pcb 4.1.1
An interactive printed circuit board layout editor.
|
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include "global.h"
#include "hid.h"
#include "hid_draw.h"
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_Attribute * | nogui_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_DRAW * | nogui_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) |
HID * | hid_nogui_get_hid (void) |
Variables | |
static HID | nogui_hid |
static HID_DRAW | nogui_graphics |
#define CRASH fprintf(stderr, "HID error: pcb called GUI function %s without having a GUI available.\n", __FUNCTION__); abort() |
Definition at line 23 of file hidnogui.c.
Referenced by nogui_add_block_hook(), nogui_add_timer(), nogui_attribute_dialog(), nogui_calibrate(), nogui_control_is_pressed(), nogui_do_export(), nogui_draw_arc(), nogui_draw_line(), nogui_draw_pcb_polygon(), nogui_draw_rect(), nogui_fill_circle(), nogui_fill_pcb_pad(), nogui_fill_pcb_pv(), nogui_fill_polygon(), nogui_fill_rect(), nogui_get_coords(), nogui_get_export_options(), nogui_invalidate_all(), nogui_mod1_is_pressed(), nogui_parse_arguments(), nogui_set_color(), nogui_set_draw_xor(), nogui_set_layer(), nogui_set_line_cap(), nogui_set_line_width(), nogui_show_item(), nogui_stop_block_hook(), nogui_stop_timer(), nogui_thindraw_pcb_pad(), nogui_thindraw_pcb_pv(), nogui_unwatch_file(), nogui_use_mask(), and nogui_watch_file().
#define MAX_LINE_LENGTH 1024 |
Definition at line 290 of file hidnogui.c.
Referenced by read_stdin_line().
typedef struct hid_gc_struct hid_gc_struct |
void common_nogui_graphics_init | ( | HID_DRAW * | graphics | ) |
Definition at line 488 of file hidnogui.c.
References hid_draw_st::destroy_gc, hid_draw_st::draw_arc, hid_draw_st::draw_line, hid_draw_st::draw_pcb_polygon, hid_draw_st::draw_rect, hid_draw_st::fill_circle, hid_draw_st::fill_pcb_pad, hid_draw_st::fill_pcb_pv, hid_draw_st::fill_polygon, hid_draw_st::fill_rect, hid_draw_st::make_gc, nogui_destroy_gc(), nogui_draw_arc(), nogui_draw_line(), nogui_draw_pcb_polygon(), nogui_draw_rect(), nogui_fill_circle(), nogui_fill_pcb_pad(), nogui_fill_pcb_pv(), nogui_fill_polygon(), nogui_fill_rect(), nogui_make_gc(), nogui_set_color(), nogui_set_draw_faded(), nogui_set_draw_xor(), nogui_set_line_cap(), nogui_set_line_width(), nogui_thindraw_pcb_pad(), nogui_thindraw_pcb_pv(), nogui_use_mask(), hid_draw_st::set_color, hid_draw_st::set_draw_faded, hid_draw_st::set_draw_xor, hid_draw_st::set_line_cap, hid_draw_st::set_line_width, hid_draw_st::thindraw_pcb_pad, hid_draw_st::thindraw_pcb_pv, and hid_draw_st::use_mask.
Referenced by hid_nogui_get_hid().
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().
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().
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] |
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] |
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().
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().
static int nogui_control_is_pressed | ( | void | ) | [static] |
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] |
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().
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().
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().
Definition at line 140 of file hidnogui.c.
References CRASH.
Referenced by common_nogui_graphics_init().
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().
Definition at line 146 of file hidnogui.c.
References CRASH.
Referenced by common_nogui_graphics_init().
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 HID_Attribute* nogui_get_export_options | ( | int * | n_ret | ) | [static] |
static void nogui_invalidate_all | ( | void | ) | [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] |
static void nogui_parse_arguments | ( | int * | argc, |
char *** | argv | ||
) | [static] |
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().
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] |
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().
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] |
static void nogui_stop_block_hook | ( | hidval | block_hook | ) | [static] |
static void nogui_stop_timer | ( | hidval | timer | ) | [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] |
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().
HID_DRAW nogui_graphics [static] |
Definition at line 513 of file hidnogui.c.
Referenced by hid_nogui_get_hid().
Definition at line 512 of file hidnogui.c.
Referenced by hid_nogui_get_hid().