pcb 4.1.1
An interactive printed circuit board layout editor.

batch.c File Reference

This is a text-line "batch" HID, which exists for scripting and non-GUI needs. More...

#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "global.h"
#include "crosshair.h"
#include "hid.h"
#include "data.h"
#include "misc.h"
#include "hid_draw.h"
#include "../hidint.h"
#include "pcb-printf.h"
#include "hid/common/draw_helpers.h"
#include "hid/common/hidnogui.h"
#include "hid/common/actions.h"
#include "hid/common/hidinit.h"
#include "dolists.h"
#include "batch_lists.h"
Include dependency graph for batch.c:

Go to the source code of this file.

Data Structures

struct  hid_gc_struct

Typedefs

typedef struct hid_gc_struct hid_gc_struct

Functions

static HID_Attributebatch_get_export_options (int *n_ret)
static int nop (int argc, char **argv, Coord x, Coord y)
static int PCBChanged (int argc, char **argv, Coord x, Coord y)
static int help (int argc, char **argv, Coord x, Coord y)
static int info (int argc, char **argv, Coord x, Coord y)
static void batch_do_export (HID_Attr_Val *options)
static void batch_parse_arguments (int *argc, char ***argv)
static void batch_invalidate_lr (Coord l, Coord r, Coord t, Coord b)
static void batch_invalidate_all (void)
static int batch_set_layer (const char *name, int idx, int empty)
static hidGC batch_make_gc (void)
static void batch_destroy_gc (hidGC gc)
static void batch_use_mask (enum mask_mode mode)
static void batch_set_color (hidGC gc, const char *name)
static void batch_set_line_cap (hidGC gc, EndCapStyle style)
static void batch_set_line_width (hidGC gc, Coord width)
static void batch_set_draw_xor (hidGC gc, int xor_set)
static void batch_draw_line (hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
static void batch_draw_arc (hidGC gc, Coord cx, Coord cy, Coord width, Coord height, Angle start_angle, Angle end_angle)
static void batch_draw_rect (hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
static void batch_fill_circle (hidGC gc, Coord cx, Coord cy, Coord radius)
static void batch_fill_polygon (hidGC gc, int n_coords, Coord *x, Coord *y)
static void batch_fill_rect (hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
static void batch_calibrate (double xval, double yval)
static int batch_shift_is_pressed (void)
static int batch_control_is_pressed (void)
static int batch_mod1_is_pressed (void)
static void batch_get_coords (const char *msg, Coord *x, Coord *y)
static void batch_set_crosshair (int x, int y, int action)
static hidval batch_add_timer (void(*func)(hidval user_data), unsigned long milliseconds, hidval user_data)
static void batch_stop_timer (hidval timer)
hidval batch_watch_file (int fd, unsigned int condition, void(*func)(hidval watch, int fd, unsigned int condition, hidval user_data), hidval user_data)
void batch_unwatch_file (hidval data)
static hidval batch_add_block_hook (void(*func)(hidval data), hidval user_data)
static void batch_stop_block_hook (hidval mlpoll)
static int batch_attribute_dialog (HID_Attribute *attrs_, int n_attrs_, HID_Attr_Val *results_, const char *title_, const char *descr_)
static void batch_show_item (void *item)
void hid_batch_init ()

Variables

static char * prompt = "pcb"
HID_Action batch_action_list []
static HID batch_hid
static HID_DRAW batch_graphics

Detailed Description

This is a text-line "batch" HID, which exists for scripting and non-GUI needs.


Copyright.


PCB, interactive printed circuit board design

Copyright (C) 2006 DJ Delorie

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Contact addresses for paper mail and Email: Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany Thomas.Nau@rz.uni-ulm.de


Definition in file batch.c.


Typedef Documentation

typedef struct hid_gc_struct hid_gc_struct

Function Documentation

static hidval batch_add_block_hook ( void(*)(hidval data)  func,
hidval  user_data 
) [static]

Definition at line 335 of file batch.c.

References hidval::ptr.

Referenced by hid_batch_init().

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

Definition at line 307 of file batch.c.

References hidval::lval.

Referenced by hid_batch_init().

static int batch_attribute_dialog ( HID_Attribute attrs_,
int  n_attrs_,
HID_Attr_Val results_,
const char *  title_,
const char *  descr_ 
) [static]

Definition at line 348 of file batch.c.

Referenced by hid_batch_init().

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

Definition at line 274 of file batch.c.

Referenced by hid_batch_init().

static int batch_control_is_pressed ( void  ) [static]

Definition at line 285 of file batch.c.

Referenced by hid_batch_init().

static void batch_destroy_gc ( hidGC  gc) [static]

Definition at line 213 of file batch.c.

Referenced by hid_batch_init().

static void batch_do_export ( HID_Attr_Val options) [static]

Definition at line 156 of file batch.c.

References hid_parse_command(), line, and prompt.

Referenced by hid_batch_init().

Here is the call graph for this function:

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

Definition at line 248 of file batch.c.

Referenced by hid_batch_init().

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

Definition at line 243 of file batch.c.

Referenced by hid_batch_init().

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

Definition at line 254 of file batch.c.

Referenced by hid_batch_init().

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

Definition at line 259 of file batch.c.

Referenced by hid_batch_init().

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

Definition at line 264 of file batch.c.

Referenced by hid_batch_init().

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

Definition at line 269 of file batch.c.

Referenced by hid_batch_init().

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

Definition at line 297 of file batch.c.

Referenced by hid_batch_init().

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

Definition at line 71 of file batch.c.

Referenced by hid_batch_init().

static void batch_invalidate_all ( void  ) [static]

Definition at line 196 of file batch.c.

Referenced by hid_batch_init().

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

Definition at line 191 of file batch.c.

Referenced by hid_batch_init().

static hidGC batch_make_gc ( void  ) [static]

Definition at line 207 of file batch.c.

Referenced by hid_batch_init().

static int batch_mod1_is_pressed ( void  ) [static]

Definition at line 291 of file batch.c.

Referenced by hid_batch_init().

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

Definition at line 185 of file batch.c.

References hid_parse_command_line().

Referenced by hid_batch_init().

Here is the call graph for this function:

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

Definition at line 223 of file batch.c.

Referenced by hid_batch_init().

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

Definition at line 302 of file batch.c.

Referenced by hid_batch_init().

static void batch_set_draw_xor ( hidGC  gc,
int  xor_set 
) [static]

Definition at line 238 of file batch.c.

Referenced by hid_batch_init().

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

Definition at line 201 of file batch.c.

Referenced by hid_batch_init().

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

Definition at line 228 of file batch.c.

Referenced by hid_batch_init().

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

Definition at line 233 of file batch.c.

Referenced by hid_batch_init().

static int batch_shift_is_pressed ( void  ) [static]

Definition at line 279 of file batch.c.

Referenced by hid_batch_init().

static void batch_show_item ( void *  item) [static]

Definition at line 356 of file batch.c.

Referenced by hid_batch_init().

static void batch_stop_block_hook ( hidval  mlpoll) [static]

Definition at line 343 of file batch.c.

Referenced by hid_batch_init().

static void batch_stop_timer ( hidval  timer) [static]

Definition at line 316 of file batch.c.

Referenced by hid_batch_init().

void batch_unwatch_file ( hidval  data)

Definition at line 330 of file batch.c.

Referenced by hid_batch_init().

static void batch_use_mask ( enum mask_mode  mode) [static]

Definition at line 218 of file batch.c.

Referenced by hid_batch_init().

hidval batch_watch_file ( int  fd,
unsigned int  condition,
void(*)(hidval watch, int fd, unsigned int condition, hidval user_data)  func,
hidval  user_data 
)

Definition at line 321 of file batch.c.

References hidval::ptr.

Referenced by hid_batch_init().

static int help ( int  argc,
char **  argv,
Coord  x,
Coord  y 
) [static]

Definition at line 104 of file batch.c.

References print_actions().

Referenced by helper_advance(), and helper_advance_bcl().

Here is the call graph for this function:

void hid_batch_init ( )

Definition at line 366 of file batch.c.

References hid_st::add_block_hook, hid_st::add_timer, hid_st::attribute_dialog, batch_add_block_hook(), batch_add_timer(), batch_attribute_dialog(), batch_calibrate(), batch_control_is_pressed(), batch_destroy_gc(), batch_do_export(), batch_draw_arc(), batch_draw_line(), batch_draw_rect(), batch_fill_circle(), batch_fill_polygon(), batch_fill_rect(), batch_get_coords(), batch_get_export_options(), batch_graphics, batch_invalidate_all(), batch_invalidate_lr(), batch_make_gc(), batch_mod1_is_pressed(), batch_parse_arguments(), batch_set_color(), batch_set_crosshair(), batch_set_draw_xor(), batch_set_layer(), batch_set_line_cap(), batch_set_line_width(), batch_shift_is_pressed(), batch_show_item(), batch_stop_block_hook(), batch_stop_timer(), batch_unwatch_file(), batch_use_mask(), batch_watch_file(), hid_st::calibrate, common_draw_helpers_init(), common_nogui_init(), hid_st::control_is_pressed, hid_st::description, hid_draw_st::destroy_gc, hid_st::do_export, hid_draw_st::draw_arc, hid_draw_st::draw_line, hid_draw_st::draw_rect, hid_draw_st::fill_circle, hid_draw_st::fill_polygon, hid_draw_st::fill_rect, hid_st::get_coords, hid_st::get_export_options, hid_st::graphics, hid_st::gui, hid_register_hid(), hid_st::invalidate_all, hid_st::invalidate_lr, hid_draw_st::make_gc, hid_st::mod1_is_pressed, hid_st::name, hid_st::parse_arguments, hid_draw_st::set_color, hid_st::set_crosshair, hid_draw_st::set_draw_xor, hid_st::set_layer, hid_draw_st::set_line_cap, hid_draw_st::set_line_width, hid_st::shift_is_pressed, hid_st::show_item, hid_st::stop_block_hook, hid_st::stop_timer, hid_st::struct_size, hid_st::unwatch_file, hid_draw_st::use_mask, and hid_st::watch_file.

Here is the call graph for this function:

static int info ( int  argc,
char **  argv,
Coord  x,
Coord  y 
) [static]
static int nop ( int  argc,
char **  argv,
Coord  x,
Coord  y 
) [static]

Definition at line 81 of file batch.c.

static int PCBChanged ( int  argc,
char **  argv,
Coord  x,
Coord  y 
) [static]

Definition at line 87 of file batch.c.

References crosshair_update_range(), PCBType::Filename, PCB, and prompt.

Referenced by ghid_port_drawing_area_configure_event_cb(), and lesstif_do_export().

Here is the call graph for this function:


Variable Documentation

Initial value:
 {
  {"PCBChanged", 0, PCBChanged },
  {"RouteStylesChanged", 0, nop },
  {"NetlistChanged", 0, nop },
  {"LayersChanged", 0, nop },
  {"LibraryChanged", 0, nop },
  {"Busy", 0, nop },
  {"Help", 0, help },
  {"Info", 0, info }
}

Definition at line 139 of file batch.c.

Definition at line 363 of file batch.c.

Referenced by hid_batch_init().

HID batch_hid [static]

Definition at line 362 of file batch.c.

char* prompt = "pcb" [static]

Definition at line 78 of file batch.c.

Referenced by batch_do_export(), PCBChanged(), and Save().