pcb 4.1.1
An interactive printed circuit board layout editor.

styles.c File Reference

#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include "xincludes.h"
#include "compat.h"
#include "global.h"
#include "data.h"
#include "set.h"
#include "misc.h"
#include "mymem.h"
#include "pcb-printf.h"
#include "hid.h"
#include "../hidint.h"
#include "lesstif.h"
Include dependency graph for styles.c:

Go to the source code of this file.

Data Structures

struct  StyleButtons

Defines

#define stdarg(t, v)   XtSetArg(args[n], t, v); n++

Enumerations

enum  StyleValues {
  SSthick, SSdiam, SShole, SSkeep,
  SSNUM
}

Functions

static int hash (char *cp)
static int RouteStylesChanged (int argc, char **argv, Coord x, Coord y)
static void update_one_value (int i, Coord v)
static void update_values ()
void lesstif_styles_update_values ()
static void update_style_buttons ()
static void style_value_cb (Widget w, int i, void *cbs)
static void units_cb ()
static Widget style_value (int i)
static void style_name_cb (Widget w, int i, XmToggleButtonCallbackStruct *cbs)
static void style_set_cb (Widget w, int i, XmToggleButtonCallbackStruct *cbs)
static void style_selected (Widget w, int i, XmToggleButtonCallbackStruct *cbs)
static Widget style_button (int i)
static int AdjustStyle (int argc, char **argv, Coord x, Coord y)
void lesstif_insert_style_buttons (Widget menu)

Variables

static Arg args [30]
static int n
static Widget style_dialog = 0
static Widget style_values [SSNUM]
static Widget style_pb [NUM_STYLES]
static Widget units_pb [NUM_STYLES]
static int name_hashes [NUM_STYLES]
static Widget value_form
static Widget value_labels
static Widget value_texts
static Widget units_form
static int local_update = 0
XmString xms_mm
XmString xms_mil
static const Unitunit = 0
static XmString ustr
static StyleButtonsstyle_button_list = 0
static int num_style_buttons = 0
static char * value_names []
static const char adjuststyle_syntax [] = "AdjustStyle()"
static const char adjuststyle_help [] = "Displays the route style adjustment window."
HID_Action lesstif_styles_action_list []

Define Documentation

#define stdarg (   t,
 
)    XtSetArg(args[n], t, v); n++

Enumeration Type Documentation

Enumerator:
SSthick 
SSdiam 
SShole 
SSkeep 
SSNUM 

Definition at line 50 of file styles.c.


Function Documentation

static int AdjustStyle ( int  argc,
char **  argv,
Coord  x,
Coord  y 
) [static]
void lesstif_insert_style_buttons ( Widget  menu)

Definition at line 440 of file styles.c.

References args, n, RouteStyleType::Name, num_style_buttons, PCB, realloc(), PCBType::RouteStyle, s, stdarg, style_selected(), update_style_buttons(), StyleButtons::w, and XmStringCreatePCB().

Referenced by add_resource_to_menu().

Here is the call graph for this function:

void lesstif_styles_update_values ( )

Definition at line 120 of file styles.c.

References SettingType::grid_unit, lesstif_update_status_line(), Settings, style_dialog, unit::suffix, update_values(), and ustr.

Referenced by SetUnits().

Here is the call graph for this function:

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

Definition at line 413 of file styles.c.

References args, hash(), n, RouteStyleType::Name, name_hashes, num_style_buttons, PCB, PCBType::RouteStyle, stdarg, style_dialog, style_pb, update_style_buttons(), update_values(), and XmStringCreatePCB().

Referenced by style_name_cb().

Here is the call graph for this function:

static Widget style_button ( int  i) [static]

Definition at line 295 of file styles.c.

References args, n, RouteStyleType::Name, PCB, PCBType::RouteStyle, stdarg, style_dialog, style_name_cb(), style_pb, style_selected(), style_set_cb(), value_form, and XmStringCreatePCB().

Referenced by AdjustStyle().

Here is the call graph for this function:

static void style_name_cb ( Widget  w,
int  i,
XmToggleButtonCallbackStruct *  cbs 
) [static]

Definition at line 240 of file styles.c.

References lesstif_prompt_for(), RouteStyleType::Name, PCB, PCBType::RouteStyle, and RouteStylesChanged().

Referenced by style_button().

Here is the call graph for this function:

static void style_selected ( Widget  w,
int  i,
XmToggleButtonCallbackStruct *  cbs 
) [static]
static void style_set_cb ( Widget  w,
int  i,
XmToggleButtonCallbackStruct *  cbs 
) [static]
static Widget style_value ( int  i) [static]

Definition at line 196 of file styles.c.

References args, n, stdarg, style_value_cb(), units_cb(), units_form, units_pb, ustr, value_labels, value_names, and value_texts.

Referenced by AdjustStyle().

Here is the call graph for this function:

static void style_value_cb ( Widget  w,
int  i,
void *  cbs 
) [static]
static void units_cb ( ) [static]

Definition at line 185 of file styles.c.

References get_unit_struct(), unit::suffix, update_values(), and ustr.

Referenced by style_value().

Here is the call graph for this function:

static void update_one_value ( int  i,
Coord  v 
) [static]

Definition at line 96 of file styles.c.

References unit::allow, args, n, pcb_snprintf(), stdarg, style_values, units_pb, and ustr.

Referenced by update_values().

Here is the call graph for this function:

static void update_style_buttons ( ) [static]

Definition at line 133 of file styles.c.

References hid_get_flag(), n, num_style_buttons, style_dialog, and style_pb.

Referenced by AdjustStyle(), lesstif_insert_style_buttons(), RouteStylesChanged(), style_set_cb(), and style_value_cb().

Here is the call graph for this function:


Variable Documentation

const char adjuststyle_help[] = "Displays the route style adjustment window." [static]

Definition at line 339 of file styles.c.

const char adjuststyle_syntax[] = "AdjustStyle()" [static]

Definition at line 336 of file styles.c.

Initial value:

Definition at line 466 of file styles.c.

int local_update = 0 [static]

Definition at line 62 of file styles.c.

Referenced by style_value_cb(), and update_values().

int name_hashes[NUM_STYLES] [static]

Definition at line 60 of file styles.c.

Referenced by AdjustStyle(), and RouteStylesChanged().

Definition at line 86 of file styles.c.

Widget style_pb[NUM_STYLES] [static]
Widget style_values[SSNUM] [static]

Definition at line 57 of file styles.c.

Referenced by AdjustStyle(), and update_one_value().

const Unit* unit = 0 [static]
Widget units_form

Definition at line 61 of file styles.c.

Referenced by AdjustStyle(), and style_value().

Widget units_pb[NUM_STYLES] [static]

Definition at line 59 of file styles.c.

Referenced by style_value(), and update_one_value().

XmString ustr [static]
Widget value_form [static]

Definition at line 61 of file styles.c.

Referenced by AdjustStyle(), and style_button().

Widget value_labels

Definition at line 61 of file styles.c.

Referenced by AdjustStyle(), and style_value().

char* value_names[] [static]
Initial value:
 {
  "Thickness", "Diameter", "Hole", "Keepaway"
}

Definition at line 89 of file styles.c.

Referenced by style_value().

Widget value_texts

Definition at line 61 of file styles.c.

Referenced by AdjustStyle(), and style_value().

XmString xms_mil

Definition at line 63 of file styles.c.

XmString xms_mm

Definition at line 63 of file styles.c.