00001
00030 #ifdef HAVE_CONFIG_H
00031 # include <config.h>
00032 #endif
00033
00034 #include <gtk/gtk.h>
00035
00036 #include "callbacks.h"
00037 #include "interface.h"
00038 #include "support.h"
00039
00041 #define GUI 1
00042
00043 #include "../libfpw.c"
00044 #include "../packages.h"
00045 #include "dimensions_dialog.c"
00046 #include "preview_dialog.h"
00047 #include "select_exceptions_dialog.c"
00048
00049
00050 gboolean main_window_title_has_asterisk = FALSE;
00053 gboolean fpw_file_saved = FALSE;
00056 gchar *temp_dir = NULL;
00058 gchar *work_dir = NULL;
00081 int
00082 all_entries_need_updated (GtkWidget *widget)
00083 {
00084
00085 number_of_pins_has_changed (widget);
00086
00087
00088 if (footprint_type)
00089 {
00090 GtkWidget *footprint_type_entry = lookup_widget
00091 (GTK_WIDGET (widget), "footprint_type_entry");
00092 gtk_widget_set_sensitive (footprint_type_entry, TRUE);
00093 gtk_combo_box_set_active (GTK_COMBO_BOX
00094 (footprint_type_entry), package_type);
00095 }
00096
00097 if (footprint_name)
00098 {
00099 GtkWidget *footprint_name_entry = lookup_widget (GTK_WIDGET
00100 (widget), "footprint_name_entry");
00101 gtk_widget_set_sensitive (footprint_name_entry, TRUE);
00102 gtk_entry_set_text (GTK_ENTRY (footprint_name_entry),
00103 footprint_name);
00104 }
00105
00106 if (footprint_units)
00107 {
00108 GtkWidget *footprint_units_entry = lookup_widget (GTK_WIDGET
00109 (widget), "footprint_units_entry");
00110 gtk_widget_set_sensitive (footprint_units_entry, TRUE);
00111 update_units_variables ();
00112 gtk_combo_box_set_active (GTK_COMBO_BOX (footprint_units_entry),
00113 units_type);
00114 }
00115
00116
00117 if (footprint_refdes)
00118 {
00119 GtkWidget *footprint_refdes_entry = lookup_widget
00120 (GTK_WIDGET (widget), "footprint_refdes_entry");
00121 gtk_widget_set_sensitive (footprint_refdes_entry, TRUE);
00122 gtk_entry_set_text (GTK_ENTRY (footprint_refdes_entry),
00123 footprint_refdes);
00124 }
00125
00126 if (footprint_value)
00127 {
00128 GtkWidget *footprint_value_entry = lookup_widget
00129 (GTK_WIDGET (widget), "footprint_value_entry");
00130 gtk_widget_set_sensitive (footprint_value_entry, TRUE);
00131 gtk_entry_set_text (GTK_ENTRY (footprint_value_entry),
00132 footprint_value);
00133 }
00134
00135 if (package_body_length != 0.0)
00136 {
00137 GtkWidget *package_body_length_entry = lookup_widget (GTK_WIDGET (widget),
00138 "package_body_length_entry");
00139 gtk_widget_set_sensitive (package_body_length_entry, TRUE);
00140 gtk_entry_set_text (GTK_ENTRY (package_body_length_entry),
00141 g_strdup_printf ("%f", package_body_length));
00142 }
00143
00144 if (package_body_width != 0.0)
00145 {
00146 GtkWidget *package_body_width_entry = lookup_widget (GTK_WIDGET (widget),
00147 "package_body_width_entry");
00148 gtk_widget_set_sensitive (package_body_width_entry, TRUE);
00149 gtk_entry_set_text (GTK_ENTRY (package_body_width_entry),
00150 g_strdup_printf ("%f", package_body_width));
00151 }
00152
00153 if (package_body_height != 0.0)
00154 {
00155 GtkWidget *package_body_height_entry = lookup_widget (GTK_WIDGET (widget),
00156 "package_body_height_entry");
00157 gtk_widget_set_sensitive (package_body_height_entry, TRUE);
00158 gtk_entry_set_text (GTK_ENTRY (package_body_height_entry),
00159 g_strdup_printf ("%f", package_body_height));
00160 }
00161
00162 GtkWidget *package_is_radial_checkbutton = lookup_widget (GTK_WIDGET
00163 (widget), "package_is_radial_checkbutton");
00164 gtk_widget_set_sensitive (package_is_radial_checkbutton, TRUE);
00165 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
00166 (package_is_radial_checkbutton), package_is_radial);
00167
00168 GtkWidget *add_license_checkbutton = lookup_widget (GTK_WIDGET
00169 (widget), "add_license_checkbutton");
00170 gtk_widget_set_sensitive (add_license_checkbutton, TRUE);
00171 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
00172 (add_license_checkbutton), license_in_footprint);
00173
00174 GtkWidget *add_attribs_checkbutton = lookup_widget (GTK_WIDGET
00175 (widget), "add_attribs_checkbutton");
00176 gtk_widget_set_sensitive (add_attribs_checkbutton, TRUE);
00177 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
00178 (add_attribs_checkbutton), attributes_in_footprint);
00179
00180 if (footprint_author)
00181 {
00182 GtkWidget *footprint_author_entry = lookup_widget (GTK_WIDGET (widget),
00183 "footprint_author_entry");
00184 gtk_widget_set_sensitive (footprint_author_entry, TRUE);
00185 gtk_entry_set_text (GTK_ENTRY (footprint_author_entry),
00186 g_get_real_name ());
00187 }
00188
00189
00190 if (footprint_dist_license)
00191 {
00192 GtkWidget *footprint_dist_license_entry = lookup_widget
00193 (GTK_WIDGET (widget),
00194 "footprint_dist_license_entry");
00195 gtk_widget_set_sensitive (footprint_dist_license_entry, TRUE);
00196 gtk_entry_set_text (GTK_ENTRY (footprint_dist_license_entry),
00197 footprint_dist_license);
00198 }
00199
00200
00201 if (footprint_use_license)
00202 {
00203 GtkWidget *footprint_use_license_entry = lookup_widget
00204 (GTK_WIDGET (widget), "footprint_use_license_entry");
00205 gtk_widget_set_sensitive (footprint_use_license_entry, TRUE);
00206 gtk_entry_set_text (GTK_ENTRY (footprint_use_license_entry),
00207 footprint_use_license);
00208 }
00209
00210 if (footprint_status)
00211 {
00212 GtkWidget *footprint_status_entry = lookup_widget (GTK_WIDGET
00213 (widget), "footprint_status_entry");
00214 gtk_widget_set_sensitive (footprint_status_entry, TRUE);
00215 gtk_combo_box_set_active (GTK_COMBO_BOX (footprint_status_entry),
00216 status_type);
00217 }
00218
00219
00220 if (number_of_pins != 0)
00221 {
00222 GtkWidget *number_total_pins_entry = lookup_widget (GTK_WIDGET (widget),
00223 "number_total_pins_entry");
00224 gtk_widget_set_sensitive (number_total_pins_entry, TRUE);
00225 gtk_entry_set_text (GTK_ENTRY (number_total_pins_entry),
00226 g_strdup_printf ("%d", number_of_pins));
00227 }
00228
00229 if (number_of_rows != 0)
00230 {
00231 GtkWidget *number_of_rows_entry = lookup_widget (GTK_WIDGET (widget),
00232 "number_of_rows_entry");
00233 gtk_widget_set_sensitive (number_of_rows_entry, TRUE);
00234 gtk_entry_set_text (GTK_ENTRY (number_of_rows_entry),
00235 g_strdup_printf ("%d", number_of_rows));
00236 }
00237
00238 if (number_of_columns != 0)
00239 {
00240 GtkWidget *number_of_columns_entry = lookup_widget (GTK_WIDGET (widget),
00241 "number_of_columns_entry");
00242 gtk_widget_set_sensitive (number_of_columns_entry, TRUE);
00243 gtk_entry_set_text (GTK_ENTRY (number_of_columns_entry),
00244 g_strdup_printf ("%d", number_of_columns));
00245 }
00246
00247 if (pitch_x != 0.0)
00248 {
00249 GtkWidget *pitch_x_entry = lookup_widget (GTK_WIDGET (widget),
00250 "pitch_x_entry");
00251 gtk_widget_set_sensitive (pitch_x_entry, TRUE);
00252 gtk_entry_set_text (GTK_ENTRY (pitch_x_entry),
00253 g_strdup_printf ("%f", pitch_x));
00254 }
00255
00256 if (pitch_y != 0.0)
00257 {
00258 GtkWidget *pitch_y_entry = lookup_widget (GTK_WIDGET (widget),
00259 "pitch_y_entry");
00260 gtk_widget_set_sensitive (pitch_y_entry, TRUE);
00261 gtk_entry_set_text (GTK_ENTRY (pitch_y_entry),
00262 g_strdup_printf ("%f", pitch_y));
00263 }
00264
00265 if (count_x != 0)
00266 {
00267 GtkWidget *count_x_entry = lookup_widget (GTK_WIDGET (widget),
00268 "count_x_entry");
00269 gtk_widget_set_sensitive (count_x_entry, TRUE);
00270 gtk_entry_set_text (GTK_ENTRY (count_x_entry),
00271 g_strdup_printf ("%d", count_x));
00272 }
00273
00274 if (count_y != 0)
00275 {
00276 GtkWidget *count_y_entry = lookup_widget (GTK_WIDGET (widget),
00277 "count_y_entry");
00278 gtk_widget_set_sensitive (count_y_entry, TRUE);
00279 gtk_entry_set_text (GTK_ENTRY (count_y_entry),
00280 g_strdup_printf ("%d", count_y));
00281 }
00282
00283 if (pin_pad_exceptions_string || (!strcmp (pin_pad_exceptions_string, "")))
00284 {
00285 GtkWidget *pin_pad_exceptions_entry = lookup_widget
00286 (GTK_WIDGET (widget), "pin_pad_exceptions_entry");
00287 gtk_widget_set_sensitive (pin_pad_exceptions_entry, TRUE);
00288 gtk_entry_set_text (GTK_ENTRY (pin_pad_exceptions_entry),
00289 g_strdup_printf ("%s", pin_pad_exceptions_string));
00290 }
00291
00292 if (pin_1_position)
00293 {
00294 GtkWidget *pin_1_position_entry = lookup_widget (GTK_WIDGET (widget),
00295 "number_1_position_entry");
00296 gtk_widget_set_sensitive (pin_1_position_entry, TRUE);
00297 update_location_variables ();
00298 gtk_combo_box_set_active (GTK_COMBO_BOX (pin_1_position_entry),
00299 pin1_location);
00300 }
00301
00302 if (pad_diameter != 0.0)
00303 {
00304 GtkWidget *pad_diameter_entry = lookup_widget (GTK_WIDGET (widget),
00305 "pad_diameter_entry");
00306 gtk_widget_set_sensitive (pad_diameter_entry, TRUE);
00307 gtk_entry_set_text (GTK_ENTRY (pad_diameter_entry),
00308 g_strdup_printf ("%f", pad_diameter));
00309 }
00310
00311 if (pin_drill_diameter != 0.0)
00312 {
00313 GtkWidget *pin_drill_diameter_entry = lookup_widget (GTK_WIDGET (widget),
00314 "pin_drill_diameter_entry");
00315 gtk_widget_set_sensitive (pin_drill_diameter_entry, TRUE);
00316 gtk_entry_set_text (GTK_ENTRY (pin_drill_diameter_entry),
00317 g_strdup_printf ("%f", pin_drill_diameter));
00318 }
00319 GtkWidget *pin1_square_checkbutton = lookup_widget (GTK_WIDGET (widget),
00320 "pin_square_checkbutton");
00321 gtk_widget_set_sensitive (pin1_square_checkbutton, TRUE);
00322 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pin1_square_checkbutton),
00323 pin1_square);
00324
00325 if (pad_shape)
00326 {
00327 GtkWidget *pad_shape_entry = lookup_widget (GTK_WIDGET (widget),
00328 "pad_shape_entry");
00329 gtk_widget_set_sensitive (pad_shape_entry, TRUE);
00330 update_pad_shapes_variables ();
00331 gtk_combo_box_set_active (GTK_COMBO_BOX (pad_shape_entry), pad_shapes_type);
00332 }
00333
00334 if (pad_length != 0.0)
00335 {
00336 GtkWidget *pad_length_entry = lookup_widget (GTK_WIDGET (widget),
00337 "pad_length_entry");
00338 gtk_widget_set_sensitive (pad_length_entry, TRUE);
00339 gtk_entry_set_text (GTK_ENTRY (pad_length_entry),
00340 g_strdup_printf ("%f", pad_length));
00341 }
00342
00343 if (pad_width != 0.0)
00344 {
00345 GtkWidget *pad_width_entry = lookup_widget (GTK_WIDGET (widget),
00346 "pad_width_entry");
00347 gtk_widget_set_sensitive (pad_width_entry, TRUE);
00348 gtk_entry_set_text (GTK_ENTRY (pad_width_entry),
00349 g_strdup_printf ("%f", pad_width));
00350 }
00351
00352 if (pad_clearance != 0.0)
00353 {
00354 GtkWidget *pad_clearance_entry = lookup_widget (GTK_WIDGET (widget),
00355 "pad_clearance_entry");
00356 gtk_widget_set_sensitive (pad_clearance_entry, TRUE);
00357 gtk_entry_set_text (GTK_ENTRY (pad_clearance_entry),
00358 g_strdup_printf ("%f", pad_clearance));
00359 }
00360
00361 if (pad_solder_mask_clearance != 0.0)
00362 {
00363 GtkWidget *pad_solder_mask_clearance_entry = lookup_widget (GTK_WIDGET (widget),
00364 "pad_solder_mask_clearance_entry");
00365 gtk_widget_set_sensitive (pad_solder_mask_clearance_entry, TRUE);
00366 gtk_entry_set_text (GTK_ENTRY (pad_solder_mask_clearance_entry),
00367 g_strdup_printf ("%f", pad_solder_mask_clearance));
00368 }
00369
00370 GtkWidget *silkscreen_package_outline_checkbutton =
00371 lookup_widget (GTK_WIDGET (widget),
00372 "silkscreen_package_outline_checkbutton");
00373 gtk_widget_set_sensitive (silkscreen_package_outline_checkbutton, TRUE);
00374 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
00375 (silkscreen_package_outline_checkbutton),
00376 silkscreen_package_outline);
00377 GtkWidget *silkscreen_indicate_1_checkbutton =
00378 lookup_widget (GTK_WIDGET (widget),
00379 "silkscreen_indicate_1_checkbutton");
00380 gtk_widget_set_sensitive (silkscreen_indicate_1_checkbutton, TRUE);
00381 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
00382 (silkscreen_indicate_1_checkbutton),
00383 silkscreen_indicate_1);
00384
00385 if (courtyard_length != 0.0)
00386 {
00387 GtkWidget *courtyard_length_entry = lookup_widget (GTK_WIDGET
00388 (widget), "courtyard_length_entry");
00389 gtk_widget_set_sensitive (courtyard_length_entry, TRUE);
00390 gtk_entry_set_text (GTK_ENTRY
00391 (courtyard_length_entry),
00392 g_strdup_printf ("%f",
00393 courtyard_length));
00394 }
00395
00396 if (courtyard_width != 0.0)
00397 {
00398 GtkWidget *courtyard_width_entry = lookup_widget (GTK_WIDGET (widget),
00399 "courtyard_width_entry");
00400 gtk_widget_set_sensitive (courtyard_width_entry, TRUE);
00401 gtk_entry_set_text (GTK_ENTRY
00402 (courtyard_width_entry),
00403 g_strdup_printf ("%f",
00404 courtyard_width));
00405 }
00406
00407 if (courtyard_line_width != 0.0)
00408 {
00409 GtkWidget *courtyard_line_width_entry = lookup_widget (GTK_WIDGET (widget),
00410 "courtyard_line_width_entry");
00411 gtk_widget_set_sensitive (courtyard_line_width_entry, TRUE);
00412 gtk_entry_set_text (GTK_ENTRY
00413 (courtyard_line_width_entry),
00414 g_strdup_printf ("%f",
00415 courtyard_line_width));
00416 }
00417
00418 if (courtyard_clearance_with_package != 0.0)
00419 {
00420 GtkWidget *courtyard_clearance_with_package_entry =
00421 lookup_widget (GTK_WIDGET (widget),
00422 "courtyard_clearance_with_package_entry");
00423 gtk_widget_set_sensitive (courtyard_clearance_with_package_entry,
00424 TRUE);
00425 gtk_entry_set_text (GTK_ENTRY
00426 (courtyard_clearance_with_package_entry),
00427 g_strdup_printf ("%f",
00428 courtyard_clearance_with_package));
00429 }
00430
00431
00432 GtkWidget *thermal_checkbutton = lookup_widget (GTK_WIDGET (widget),
00433 "thermal_checkbutton");
00434 gtk_widget_set_sensitive (thermal_checkbutton, TRUE);
00435 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (thermal_checkbutton),
00436 thermal);
00437
00438 GtkWidget *thermal_nopaste_checkbutton = lookup_widget
00439 (GTK_WIDGET (widget), "thermal_nopaste_checkbutton");
00440 gtk_widget_set_sensitive (thermal_nopaste_checkbutton, TRUE);
00441 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
00442 (thermal_nopaste_checkbutton), thermal_nopaste);
00443
00444 if (thermal_length != 0.0)
00445 {
00446 GtkWidget *thermal_length_entry = lookup_widget
00447 (GTK_WIDGET (widget), "thermal_length_entry");
00448 gtk_widget_set_sensitive (thermal_length_entry, TRUE);
00449 gtk_entry_set_text (GTK_ENTRY (thermal_length_entry),
00450 g_strdup_printf ("%f", thermal_length));
00451 }
00452
00453 if (thermal_width != 0.0)
00454 {
00455 GtkWidget *thermal_width_entry = lookup_widget
00456 (GTK_WIDGET (widget), "thermal_width_entry");
00457 gtk_widget_set_sensitive (thermal_width_entry, TRUE);
00458 gtk_entry_set_text (GTK_ENTRY (thermal_width_entry),
00459 g_strdup_printf ("%f", thermal_width));
00460 }
00461
00462
00463 if (thermal_clearance != 0.0)
00464 {
00465 GtkWidget *thermal_clearance_entry = lookup_widget
00466 (GTK_WIDGET (widget), "thermal_clearance_entry");
00467 gtk_widget_set_sensitive (thermal_clearance_entry, TRUE);
00468 gtk_entry_set_text (GTK_ENTRY (thermal_clearance_entry),
00469 g_strdup_printf ("%f", thermal_clearance));
00470 }
00471
00472
00473 if (thermal_solder_mask_clearance != 0.0)
00474 {
00475 GtkWidget *thermal_solder_mask_clearance_entry =
00476 lookup_widget (GTK_WIDGET (widget),
00477 "thermal_solder_mask_clearance_entry");
00478 gtk_widget_set_sensitive (thermal_solder_mask_clearance_entry,
00479 TRUE);
00480 gtk_entry_set_text (GTK_ENTRY
00481 (thermal_solder_mask_clearance_entry),
00482 g_strdup_printf ("%f",
00483 thermal_solder_mask_clearance));
00484 }
00485 GtkWidget *fiducial_checkbutton = lookup_widget (GTK_WIDGET (widget),
00486 "fiducial_checkbutton");
00487 gtk_widget_set_sensitive (fiducial_checkbutton, TRUE);
00488 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (fiducial_checkbutton),
00489 fiducial);
00490
00491
00492 if (fiducial_pad_diameter != 0.0)
00493 {
00494 GtkWidget *fiducial_pad_diameter_entry = lookup_widget
00495 (GTK_WIDGET (widget), "fiducial_pad_diameter_entry");
00496 gtk_widget_set_sensitive (fiducial_pad_diameter_entry, TRUE);
00497 gtk_entry_set_text (GTK_ENTRY (fiducial_pad_diameter_entry),
00498 g_strdup_printf ("%f", fiducial_pad_diameter));
00499 }
00500
00501
00502 if (fiducial_pad_clearance != 0.0)
00503 {
00504 GtkWidget *fiducial_pad_clearance_entry =
00505 lookup_widget (GTK_WIDGET (widget),
00506 "fiducial_pad_clearance_entry");
00507 gtk_widget_set_sensitive (fiducial_pad_clearance_entry,
00508 TRUE);
00509 gtk_entry_set_text (GTK_ENTRY
00510 (fiducial_pad_clearance_entry),
00511 g_strdup_printf ("%f",
00512 fiducial_pad_clearance));
00513 }
00514
00515
00516 if (fiducial_pad_solder_mask_clearance != 0.0)
00517 {
00518 GtkWidget *fiducial_pad_solder_mask_clearance_entry =
00519 lookup_widget (GTK_WIDGET (widget),
00520 "fiducial_pad_solder_mask_clearance_entry");
00521 gtk_widget_set_sensitive (fiducial_pad_solder_mask_clearance_entry,
00522 TRUE);
00523 gtk_entry_set_text (GTK_ENTRY
00524 (fiducial_pad_solder_mask_clearance_entry),
00525 g_strdup_printf ("%f",
00526 fiducial_pad_solder_mask_clearance));
00527 }
00528
00529
00530 if (c1 != 0.0)
00531 {
00532 GtkWidget *C1_entry = lookup_widget (GTK_WIDGET (widget),
00533 "C1_entry");
00534 gtk_widget_set_sensitive (C1_entry, TRUE);
00535 gtk_entry_set_text (GTK_ENTRY (C1_entry),
00536 g_strdup_printf ("%f", c1));
00537 }
00538
00539 if (g1 != 0.0)
00540 {
00541 GtkWidget *G1_entry = lookup_widget (GTK_WIDGET (widget),
00542 "G1_entry");
00543 gtk_widget_set_sensitive (G1_entry, TRUE);
00544 gtk_entry_set_text (GTK_ENTRY (G1_entry),
00545 g_strdup_printf ("%f", g1));
00546 }
00547
00548 if (z1 != 0.0)
00549 {
00550 GtkWidget *Z1_entry = lookup_widget (GTK_WIDGET (widget),
00551 "Z1_entry");
00552 gtk_widget_set_sensitive (Z1_entry, TRUE);
00553 gtk_entry_set_text (GTK_ENTRY (Z1_entry),
00554 g_strdup_printf ("%f", z1));
00555 }
00556
00557 if (c2 != 0.0)
00558 {
00559 GtkWidget *C2_entry = lookup_widget (GTK_WIDGET (widget),
00560 "C2_entry");
00561 gtk_widget_set_sensitive (C2_entry, TRUE);
00562 gtk_entry_set_text (GTK_ENTRY (C2_entry),
00563 g_strdup_printf ("%f", c2));
00564 }
00565
00566 if (g2 != 0.0)
00567 {
00568 GtkWidget *G2_entry = lookup_widget (GTK_WIDGET (widget),
00569 "G2_entry");
00570 gtk_widget_set_sensitive (G2_entry, TRUE);
00571 gtk_entry_set_text (GTK_ENTRY (G2_entry),
00572 g_strdup_printf ("%f", g2));
00573 }
00574
00575 if (z2 != 0.0)
00576 {
00577 GtkWidget *Z2_entry = lookup_widget (GTK_WIDGET (widget),
00578 "Z2_entry");
00579 gtk_widget_set_sensitive (Z2_entry, TRUE);
00580 gtk_entry_set_text (GTK_ENTRY (Z2_entry),
00581 g_strdup_printf ("%f", z2));
00582 }
00583 }
00584
00585
00586
00594 int
00595 all_entries_to_default_sensitivity (GtkWidget *widget)
00596 {
00597
00598 GtkWidget *footprint_type_entry = lookup_widget (GTK_WIDGET (widget),
00599 "footprint_type_entry");
00600 gtk_widget_set_sensitive (footprint_type_entry, TRUE);
00601 GtkWidget *footprint_name_entry = lookup_widget (GTK_WIDGET (widget),
00602 "footprint_name_entry");
00603 gtk_widget_set_sensitive (footprint_name_entry, TRUE);
00604 GtkWidget *footprint_units_entry = lookup_widget (GTK_WIDGET (widget),
00605 "footprint_units_entry");
00606 gtk_widget_set_sensitive (footprint_units_entry, TRUE);
00607 GtkWidget *footprint_refdes_entry = lookup_widget (GTK_WIDGET (widget),
00608 "footprint_refdes_entry");
00609 gtk_widget_set_sensitive (footprint_refdes_entry, TRUE);
00610 GtkWidget *footprint_value_entry = lookup_widget (GTK_WIDGET (widget),
00611 "footprint_value_entry");
00612 gtk_widget_set_sensitive (footprint_value_entry, TRUE);
00613 GtkWidget *package_body_length_entry = lookup_widget (GTK_WIDGET (widget),
00614 "package_body_length_entry");
00615 gtk_widget_set_sensitive (package_body_length_entry, TRUE);
00616 GtkWidget *package_body_width_entry = lookup_widget (GTK_WIDGET (widget),
00617 "package_body_width_entry");
00618 gtk_widget_set_sensitive (package_body_width_entry, TRUE);
00619 GtkWidget *package_body_height_entry = lookup_widget (GTK_WIDGET (widget),
00620 "package_body_height_entry");
00621 gtk_widget_set_sensitive (package_body_height_entry, TRUE);
00622 GtkWidget *package_is_radial_checkbutton = lookup_widget (GTK_WIDGET (widget),
00623 "package_is_radial_checkbutton");
00624 gtk_widget_set_sensitive (package_is_radial_checkbutton, TRUE);
00625 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (package_is_radial_checkbutton), FALSE);
00626 GtkWidget *footprint_author_entry = lookup_widget (GTK_WIDGET (widget),
00627 "footprint_author_entry");
00628 gtk_widget_set_sensitive (footprint_author_entry, TRUE);
00629 GtkWidget *footprint_dist_license_entry = lookup_widget (GTK_WIDGET (widget),
00630 "footprint_dist_license_entry");
00631 gtk_widget_set_sensitive (footprint_dist_license_entry, TRUE);
00632 GtkWidget *footprint_use_license_entry = lookup_widget (GTK_WIDGET (widget),
00633 "footprint_use_license_entry");
00634 gtk_widget_set_sensitive (footprint_use_license_entry, TRUE);
00635 GtkWidget *footprint_status_entry = lookup_widget (GTK_WIDGET (widget),
00636 "footprint_status_entry");
00637 gtk_widget_set_sensitive (footprint_status_entry, TRUE);
00638
00639
00640 GtkWidget *number_total_pins_entry = lookup_widget (GTK_WIDGET (widget),
00641 "number_total_pins_entry");
00642 gtk_widget_set_sensitive (number_total_pins_entry, TRUE);
00643 GtkWidget *number_of_rows_entry = lookup_widget (GTK_WIDGET (widget),
00644 "number_of_rows_entry");
00645 gtk_widget_set_sensitive (number_of_rows_entry, TRUE);
00646 GtkWidget *number_of_columns_entry = lookup_widget (GTK_WIDGET (widget),
00647 "number_of_columns_entry");
00648 gtk_widget_set_sensitive (number_of_columns_entry, TRUE);
00649 GtkWidget *pitch_x_entry = lookup_widget (GTK_WIDGET (widget),
00650 "pitch_x_entry");
00651 gtk_widget_set_sensitive (pitch_x_entry, TRUE);
00652 GtkWidget *pitch_y_entry = lookup_widget (GTK_WIDGET (widget),
00653 "pitch_y_entry");
00654 gtk_widget_set_sensitive (pitch_y_entry, TRUE);
00655 GtkWidget *count_x_entry = lookup_widget (GTK_WIDGET (widget),
00656 "count_x_entry");
00657 gtk_widget_set_sensitive (count_x_entry, TRUE);
00658 GtkWidget *count_y_entry = lookup_widget (GTK_WIDGET (widget),
00659 "count_y_entry");
00660 gtk_widget_set_sensitive (count_y_entry, TRUE);
00661 GtkWidget *pad_shape_entry = lookup_widget (GTK_WIDGET (widget),
00662 "pad_shape_entry");
00663 gtk_widget_set_sensitive (pad_shape_entry, TRUE);
00664 GtkWidget *number_1_position_entry = lookup_widget (GTK_WIDGET (widget),
00665 "number_1_position_entry");
00666 gtk_widget_set_sensitive (number_1_position_entry, TRUE);
00667 GtkWidget *pin_pad_exceptions_button = lookup_widget (GTK_WIDGET (widget),
00668 "pin_pad_exceptions_button");
00669 gtk_widget_set_sensitive (pin_pad_exceptions_button, FALSE);
00670 GtkWidget *pad_diameter_entry = lookup_widget (GTK_WIDGET (widget),
00671 "pad_diameter_entry");
00672 gtk_widget_set_sensitive (pad_diameter_entry, TRUE);
00673 GtkWidget *pin_drill_diameter_entry = lookup_widget (GTK_WIDGET (widget),
00674 "pin_drill_diameter_entry");
00675 gtk_widget_set_sensitive (pin_drill_diameter_entry, TRUE);
00676 GtkWidget *pin1_square_checkbutton = lookup_widget (GTK_WIDGET (widget),
00677 "pin_square_checkbutton");
00678 gtk_widget_set_sensitive (pin1_square_checkbutton, TRUE);
00679 GtkWidget *pad_length_entry = lookup_widget (GTK_WIDGET (widget),
00680 "pad_length_entry");
00681 gtk_widget_set_sensitive (pad_length_entry, TRUE);
00682 GtkWidget *pad_width_entry = lookup_widget (GTK_WIDGET (widget),
00683 "pad_width_entry");
00684 gtk_widget_set_sensitive (pad_width_entry, TRUE);
00685 GtkWidget *pad_clearance_entry = lookup_widget (GTK_WIDGET (widget),
00686 "pad_clearance_entry");
00687 gtk_widget_set_sensitive (pad_clearance_entry, TRUE);
00688 GtkWidget *pad_solder_mask_clearance_entry = lookup_widget (GTK_WIDGET (widget),
00689 "pad_solder_mask_clearance_entry");
00690 gtk_widget_set_sensitive (pad_solder_mask_clearance_entry, TRUE);
00691
00692
00693 GtkWidget *silkscreen_package_outline_checkbutton = lookup_widget (GTK_WIDGET (widget),
00694 "silkscreen_package_outline_checkbutton");
00695 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (silkscreen_package_outline_checkbutton), FALSE);
00696 GtkWidget *silkscreen_line_width_entry = lookup_widget (GTK_WIDGET (widget),
00697 "silkscreen_line_width_entry");
00698 gtk_widget_set_sensitive (silkscreen_line_width_entry, FALSE);
00699 GtkWidget *silkscreen_indicate_1_checkbutton = lookup_widget (GTK_WIDGET (widget),
00700 "silkscreen_indicate_1_checkbutton");
00701 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (silkscreen_indicate_1_checkbutton), FALSE);
00702 GtkWidget *courtyard_checkbutton = lookup_widget (GTK_WIDGET (widget),
00703 "courtyard_checkbutton");
00704 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (courtyard_checkbutton), FALSE);
00705 GtkWidget *courtyard_length_entry = lookup_widget (GTK_WIDGET (widget),
00706 "courtyard_length_entry");
00707 gtk_widget_set_sensitive (courtyard_length_entry, FALSE);
00708 GtkWidget *courtyard_width_entry = lookup_widget (GTK_WIDGET (widget),
00709 "courtyard_width_entry");
00710 gtk_widget_set_sensitive (courtyard_width_entry, FALSE);
00711 GtkWidget *courtyard_line_width_entry = lookup_widget (GTK_WIDGET (widget),
00712 "courtyard_line_width_entry");
00713 gtk_widget_set_sensitive (courtyard_line_width_entry, FALSE);
00714 GtkWidget *courtyard_clearance_with_package_entry = lookup_widget (GTK_WIDGET (widget),
00715 "courtyard_clearance_with_package_entry");
00716 gtk_widget_set_sensitive (courtyard_clearance_with_package_entry, FALSE);
00717
00718
00719 GtkWidget *thermal_checkbutton = lookup_widget (GTK_WIDGET (widget),
00720 "thermal_checkbutton");
00721 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (thermal_checkbutton), FALSE);
00722 GtkWidget *thermal_nopaste_checkbutton = lookup_widget (GTK_WIDGET (widget),
00723 "thermal_nopaste_checkbutton");
00724 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (thermal_nopaste_checkbutton), FALSE);
00725 GtkWidget *thermal_length_entry = lookup_widget (GTK_WIDGET (widget),
00726 "thermal_length_entry");
00727 gtk_widget_set_sensitive (thermal_length_entry, FALSE);
00728 GtkWidget *thermal_width_entry = lookup_widget (GTK_WIDGET (widget),
00729 "thermal_width_entry");
00730 gtk_widget_set_sensitive (thermal_width_entry, FALSE);
00731 GtkWidget *thermal_clearance_entry = lookup_widget (GTK_WIDGET (widget),
00732 "thermal_clearance_entry");
00733 gtk_widget_set_sensitive (thermal_clearance_entry, FALSE);
00734 GtkWidget *thermal_solder_mask_clearance_entry = lookup_widget
00735 (GTK_WIDGET (widget), "thermal_solder_mask_clearance_entry");
00736 gtk_widget_set_sensitive (thermal_solder_mask_clearance_entry, FALSE);
00737 GtkWidget *fiducial_checkbutton = lookup_widget (GTK_WIDGET (widget),
00738 "fiducial_checkbutton");
00739 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (fiducial_checkbutton),
00740 FALSE);
00741 GtkWidget *fiducial_pad_diameter_entry = lookup_widget (GTK_WIDGET
00742 (widget), "fiducial_pad_diameter_entry");
00743 gtk_widget_set_sensitive (fiducial_pad_diameter_entry, FALSE);
00744 GtkWidget *fiducial_pad_clearance_entry = lookup_widget
00745 (GTK_WIDGET (widget), "fiducial_pad_clearance_entry");
00746 gtk_widget_set_sensitive (fiducial_pad_clearance_entry, FALSE);
00747 GtkWidget *fiducial_pad_solder_mask_clearance_entry = lookup_widget
00748 (GTK_WIDGET (widget), "fiducial_pad_solder_mask_clearance_entry");
00749 gtk_widget_set_sensitive (fiducial_pad_solder_mask_clearance_entry, FALSE);
00750
00751
00752 GtkWidget *C1_entry = lookup_widget (GTK_WIDGET (widget),
00753 "C1_entry");
00754 gtk_widget_set_sensitive (C1_entry, TRUE);
00755 GtkWidget *C2_entry = lookup_widget (GTK_WIDGET (widget),
00756 "C2_entry");
00757 gtk_widget_set_sensitive (C2_entry, TRUE);
00758 GtkWidget *G1_entry = lookup_widget (GTK_WIDGET (widget),
00759 "G1_entry");
00760 gtk_widget_set_sensitive (G1_entry, FALSE);
00761 GtkWidget *G2_entry = lookup_widget (GTK_WIDGET (widget),
00762 "G2_entry");
00763 gtk_widget_set_sensitive (G2_entry, FALSE);
00764 GtkWidget *Z1_entry = lookup_widget (GTK_WIDGET (widget),
00765 "Z1_entry");
00766 gtk_widget_set_sensitive (Z1_entry, FALSE);
00767 GtkWidget *Z2_entry = lookup_widget (GTK_WIDGET (widget),
00768 "Z2_entry");
00769 gtk_widget_set_sensitive (Z2_entry, FALSE);
00770 GtkWidget *C1_radiobutton = lookup_widget (GTK_WIDGET (widget),
00771 "C1_radiobutton");
00772 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (C1_radiobutton), TRUE);
00773 gtk_widget_set_sensitive (C1_radiobutton, TRUE);
00774 GtkWidget *C2_radiobutton = lookup_widget (GTK_WIDGET (widget),
00775 "C2_radiobutton");
00776 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (C2_radiobutton), TRUE);
00777 gtk_widget_set_sensitive (C2_radiobutton, TRUE);
00778 GtkWidget *G1_radiobutton = lookup_widget (GTK_WIDGET (widget),
00779 "G1_radiobutton");
00780 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (G1_radiobutton), FALSE);
00781 gtk_widget_set_sensitive (G1_radiobutton, TRUE);
00782 GtkWidget *G2_radiobutton = lookup_widget (GTK_WIDGET (widget),
00783 "G2_radiobutton");
00784 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (G2_radiobutton), FALSE);
00785 gtk_widget_set_sensitive (G2_radiobutton, TRUE);
00786 GtkWidget *Z1_radiobutton = lookup_widget (GTK_WIDGET (widget),
00787 "Z1_radiobutton");
00788 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (Z1_radiobutton), FALSE);
00789 gtk_widget_set_sensitive (Z1_radiobutton, TRUE);
00790 GtkWidget *Z2_radiobutton = lookup_widget (GTK_WIDGET (widget),
00791 "Z2_radiobutton");
00792 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (Z2_radiobutton), FALSE);
00793 gtk_widget_set_sensitive (Z2_radiobutton, TRUE);
00794 }
00795
00796
00807 int
00808 change_main_window_title (GtkWidget *widget, gchar *main_window_title)
00809 {
00810
00811 GtkWidget *main_window;
00812 main_window = lookup_widget (GTK_WIDGET (widget), "pcb_gfpw");
00813 gtk_window_set_title (GTK_WINDOW (main_window), main_window_title);
00814 }
00815
00816
00826 int
00827 entry_has_changed (GtkWidget *widget)
00828 {
00829 if (!main_window_title_has_asterisk)
00830 {
00831
00832 GtkWidget *main_window;
00833 main_window = lookup_widget (GTK_WIDGET (widget), "pcb_gfpw");
00834
00835 const gchar* main_window_title = gtk_window_get_title (GTK_WINDOW (main_window));
00836 if (!fpw_file_saved)
00837 {
00838
00839 change_main_window_title (GTK_WIDGET (main_window),
00840 g_strconcat (_("pcb-gfpw : Unsaved fpw file"),
00841 NULL));
00842 }
00843 else
00844 {
00845
00846
00847
00848
00849 change_main_window_title (GTK_WIDGET (main_window),
00850 g_strconcat ("[*] ",
00851 main_window_title, NULL));
00852 main_window_title_has_asterisk = TRUE;
00853 }
00854 }
00855 }
00856
00857
00866 int
00867 gui_constraints_disable_heel_and_toe_goals_tab_widgets (GtkWidget *widget)
00868 {
00869 GtkWidget *C1_entry = lookup_widget (GTK_WIDGET (widget),
00870 "C1_entry");
00871 gtk_entry_set_text (GTK_ENTRY (C1_entry), "");
00872 gtk_widget_set_sensitive (C1_entry, FALSE);
00873 GtkWidget *C2_entry = lookup_widget (GTK_WIDGET (widget),
00874 "C2_entry");
00875 gtk_entry_set_text (GTK_ENTRY (C2_entry), "");
00876 gtk_widget_set_sensitive (C2_entry, FALSE);
00877 GtkWidget *G1_entry = lookup_widget (GTK_WIDGET (widget),
00878 "G1_entry");
00879 gtk_entry_set_text (GTK_ENTRY (G1_entry), "");
00880 gtk_widget_set_sensitive (G1_entry, FALSE);
00881 GtkWidget *G2_entry = lookup_widget (GTK_WIDGET (widget),
00882 "G2_entry");
00883 gtk_entry_set_text (GTK_ENTRY (G2_entry), "");
00884 gtk_widget_set_sensitive (G2_entry, FALSE);
00885 GtkWidget *Z1_entry = lookup_widget (GTK_WIDGET (widget),
00886 "Z1_entry");
00887 gtk_entry_set_text (GTK_ENTRY (Z1_entry), "");
00888 gtk_widget_set_sensitive (Z1_entry, FALSE);
00889 GtkWidget *Z2_entry = lookup_widget (GTK_WIDGET (widget),
00890 "Z2_entry");
00891 gtk_entry_set_text (GTK_ENTRY (Z2_entry), "");
00892 gtk_widget_set_sensitive (Z2_entry, FALSE);
00893 GtkWidget * C1_radiobutton = lookup_widget (GTK_WIDGET (widget),
00894 "C1_radiobutton");
00895 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (C1_radiobutton), TRUE);
00896 gtk_widget_set_sensitive (C1_radiobutton, FALSE);
00897 GtkWidget * C2_radiobutton = lookup_widget (GTK_WIDGET (widget),
00898 "C2_radiobutton");
00899 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (C2_radiobutton), TRUE);
00900 gtk_widget_set_sensitive (C2_radiobutton, FALSE);
00901 GtkWidget * G1_radiobutton = lookup_widget (GTK_WIDGET (widget),
00902 "G1_radiobutton");
00903 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (G1_radiobutton), FALSE);
00904 gtk_widget_set_sensitive (G1_radiobutton, FALSE);
00905 GtkWidget * G2_radiobutton = lookup_widget (GTK_WIDGET (widget),
00906 "G2_radiobutton");
00907 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (G2_radiobutton), FALSE);
00908 gtk_widget_set_sensitive (G2_radiobutton, FALSE);
00909 GtkWidget * Z1_radiobutton = lookup_widget (GTK_WIDGET (widget),
00910 "Z1_radiobutton");
00911 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (Z1_radiobutton), FALSE);
00912 gtk_widget_set_sensitive (Z1_radiobutton, FALSE);
00913 GtkWidget * Z2_radiobutton = lookup_widget (GTK_WIDGET (widget),
00914 "Z2_radiobutton");
00915 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (Z2_radiobutton), FALSE);
00916 gtk_widget_set_sensitive (Z2_radiobutton, FALSE);
00917 }
00918
00919
00928 int
00929 gui_constraints_disable_thermal_tab_widgets (GtkWidget *widget)
00930 {
00931 GtkWidget *thermal_checkbutton = lookup_widget (GTK_WIDGET (widget),
00932 "thermal_checkbutton");
00933 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (thermal_checkbutton),
00934 FALSE);
00935 gtk_widget_set_sensitive (thermal_checkbutton, FALSE);
00936 GtkWidget *thermal_nopaste_checkbutton = lookup_widget
00937 (GTK_WIDGET (widget), "thermal_nopaste_checkbutton");
00938 gtk_widget_set_sensitive (GTK_WIDGET (thermal_nopaste_checkbutton),
00939 FALSE);
00940 GtkWidget *thermal_length_entry = lookup_widget (GTK_WIDGET (widget),
00941 "thermal_length_entry");
00942 gtk_widget_set_sensitive (thermal_length_entry, FALSE);
00943 GtkWidget *thermal_width_entry = lookup_widget (GTK_WIDGET (widget),
00944 "thermal_width_entry");
00945 gtk_widget_set_sensitive (thermal_width_entry, FALSE);
00946 GtkWidget *thermal_clearance_entry = lookup_widget (GTK_WIDGET
00947 (widget), "thermal_clearance_entry");
00948 gtk_widget_set_sensitive (thermal_clearance_entry, FALSE);
00949 GtkWidget *thermal_solder_mask_clearance_entry = lookup_widget
00950 (GTK_WIDGET (widget), "thermal_solder_mask_clearance_entry");
00951 gtk_widget_set_sensitive (thermal_solder_mask_clearance_entry, FALSE);
00952 GtkWidget *fiducial_checkbutton = lookup_widget (GTK_WIDGET (widget),
00953 "fiducial_checkbutton");
00954 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (fiducial_checkbutton),
00955 FALSE);
00956 gtk_widget_set_sensitive (fiducial_checkbutton, FALSE);
00957 GtkWidget *fiducial_pad_diameter_entry = lookup_widget
00958 (GTK_WIDGET (widget),
00959 "fiducial_pad_diameter_entry");
00960 gtk_widget_set_sensitive (fiducial_pad_diameter_entry, FALSE);
00961 GtkWidget *fiducial_pad_clearance_entry = lookup_widget
00962 (GTK_WIDGET (widget),
00963 "fiducial_pad_clearance_entry");
00964 gtk_widget_set_sensitive (fiducial_pad_clearance_entry,
00965 FALSE);
00966 GtkWidget *fiducial_pad_solder_mask_clearance_entry = lookup_widget
00967 (GTK_WIDGET (widget),
00968 "fiducial_pad_solder_mask_clearance_entry");
00969 gtk_widget_set_sensitive (fiducial_pad_solder_mask_clearance_entry,
00970 FALSE);
00971 }
00972
00973
00984 int
00985 message_to_statusbar (GtkWidget *widget, gchar *message)
00986 {
00987
00988 GtkStatusbar *statusbar = GTK_STATUSBAR (lookup_widget (GTK_WIDGET (widget),
00989 "statusbar"));
00990 guint context_id;
00991 guint message_id;
00992 context_id = gtk_statusbar_get_context_id (statusbar, message);
00993 message_id = gtk_statusbar_push (statusbar, context_id, message);
00994 }
00995
00996
01013 int
01014 number_of_pins_has_changed (GtkWidget *widget)
01015 {
01016
01017
01018 number_of_pins = get_total_number_of_pins ();
01019
01020 GtkWidget *number_total_pins_entry = lookup_widget (GTK_WIDGET (widget),
01021 "number_total_pins_entry");
01022 gtk_entry_set_text (GTK_ENTRY (number_total_pins_entry),
01023 g_strdup_printf ("%d", number_of_pins));
01024 }
01025
01026
01042 void
01043 on_C1_entry_changed (GtkEditable *editable,
01044 gpointer user_data)
01045 {
01046 gchar *leftovers;
01047 GtkWidget *C1_entry = lookup_widget (GTK_WIDGET (editable),
01048 "C1_entry");
01049 const gchar* C1_string = gtk_entry_get_text (GTK_ENTRY (C1_entry));
01050 c1 = g_ascii_strtod (C1_string, &leftovers);
01051 entry_has_changed (GTK_WIDGET (editable));
01052 }
01053
01054
01071 void
01072 on_C1_radiobutton_toggled (GtkToggleButton *togglebutton,
01073 gpointer user_data)
01074 {
01075 c1_state = gtk_toggle_button_get_active (togglebutton);
01076 g1_state = !c1_state;
01077 z1_state = !c1_state;
01078 GtkWidget *C1_entry = lookup_widget (GTK_WIDGET (togglebutton), "C1_entry");
01079 gtk_widget_set_sensitive (C1_entry, TRUE);
01080 GtkWidget *G1_entry = lookup_widget (GTK_WIDGET (togglebutton), "G1_entry");
01081 gtk_widget_set_sensitive (G1_entry, FALSE);
01082 GtkWidget *Z1_entry = lookup_widget (GTK_WIDGET (togglebutton), "Z1_entry");
01083 gtk_widget_set_sensitive (Z1_entry, FALSE);
01084 }
01085
01086
01102 void
01103 on_C2_entry_changed (GtkEditable *editable,
01104 gpointer user_data)
01105 {
01106 gchar *leftovers;
01107 GtkWidget *C2_entry = lookup_widget (GTK_WIDGET (editable),
01108 "C2_entry");
01109 const gchar* C2_string = gtk_entry_get_text (GTK_ENTRY (C2_entry));
01110 c2 = g_ascii_strtod (C2_string, &leftovers);
01111 entry_has_changed (GTK_WIDGET (editable));
01112 }
01113
01114
01131 void
01132 on_C2_radiobutton_toggled (GtkToggleButton *togglebutton,
01133 gpointer user_data)
01134 {
01135 c2_state = gtk_toggle_button_get_active (togglebutton);
01136 g2_state = !c2_state;
01137 z2_state = !c2_state;
01138 GtkWidget *C2_entry = lookup_widget (GTK_WIDGET (togglebutton), "C2_entry");
01139 gtk_widget_set_sensitive (C2_entry, TRUE);
01140 GtkWidget *G2_entry = lookup_widget (GTK_WIDGET (togglebutton), "G2_entry");
01141 gtk_widget_set_sensitive (G2_entry, FALSE);
01142 GtkWidget *Z2_entry = lookup_widget (GTK_WIDGET (togglebutton), "Z2_entry");
01143 gtk_widget_set_sensitive (Z2_entry, FALSE);
01144 }
01145
01146
01162 void
01163 on_G1_entry_changed (GtkEditable *editable,
01164 gpointer user_data)
01165 {
01166 gchar *leftovers;
01167 GtkWidget *G1_entry = lookup_widget (GTK_WIDGET (editable),
01168 "G1_entry");
01169 const gchar* G1_string = gtk_entry_get_text (GTK_ENTRY (G1_entry));
01170 g1 = g_ascii_strtod (G1_string, &leftovers);
01171 entry_has_changed (GTK_WIDGET (editable));
01172 }
01173
01174
01191 void
01192 on_G1_radiobutton_toggled (GtkToggleButton *togglebutton,
01193 gpointer user_data)
01194 {
01195 g1_state = gtk_toggle_button_get_active (togglebutton);
01196 c1_state = !g1_state;
01197 z1_state = !g1_state;
01198 GtkWidget *C1_entry = lookup_widget (GTK_WIDGET (togglebutton), "C1_entry");
01199 gtk_widget_set_sensitive (C1_entry, FALSE);
01200 GtkWidget *G1_entry = lookup_widget (GTK_WIDGET (togglebutton), "G1_entry");
01201 gtk_widget_set_sensitive (G1_entry, TRUE);
01202 GtkWidget *Z1_entry = lookup_widget (GTK_WIDGET (togglebutton), "Z1_entry");
01203 gtk_widget_set_sensitive (Z1_entry, FALSE);
01204 }
01205
01206
01222 void
01223 on_G2_entry_changed (GtkEditable *editable,
01224 gpointer user_data)
01225 {
01226 gchar *leftovers;
01227 GtkWidget *G2_entry = lookup_widget (GTK_WIDGET (editable),
01228 "G2_entry");
01229 const gchar* G2_string = gtk_entry_get_text (GTK_ENTRY (G2_entry));
01230 g2 = g_ascii_strtod (G2_string, &leftovers);
01231 entry_has_changed (GTK_WIDGET (editable));
01232 }
01233
01234
01251 void
01252 on_G2_radiobutton_toggled (GtkToggleButton *togglebutton,
01253 gpointer user_data)
01254 {
01255 g2_state = gtk_toggle_button_get_active (togglebutton);
01256 c2_state = !g2_state;
01257 z2_state = !g2_state;
01258 GtkWidget *C2_entry = lookup_widget (GTK_WIDGET (togglebutton), "C2_entry");
01259 gtk_widget_set_sensitive (C2_entry, FALSE);
01260 GtkWidget *G2_entry = lookup_widget (GTK_WIDGET (togglebutton), "G2_entry");
01261 gtk_widget_set_sensitive (G2_entry, TRUE);
01262 GtkWidget *Z2_entry = lookup_widget (GTK_WIDGET (togglebutton), "Z2_entry");
01263 gtk_widget_set_sensitive (Z2_entry, FALSE);
01264 }
01265
01266
01282 void
01283 on_Z1_entry_changed (GtkEditable *editable,
01284 gpointer user_data)
01285 {
01286 gchar *leftovers;
01287 GtkWidget *Z1_entry = lookup_widget (GTK_WIDGET (editable),
01288 "Z1_entry");
01289 const gchar* Z1_string = gtk_entry_get_text (GTK_ENTRY (Z1_entry));
01290 z1 = g_ascii_strtod (Z1_string, &leftovers);
01291 entry_has_changed (GTK_WIDGET (editable));
01292 }
01293
01294
01311 void
01312 on_Z1_radiobutton_toggled (GtkToggleButton *togglebutton,
01313 gpointer user_data)
01314 {
01315 z1_state = gtk_toggle_button_get_active (togglebutton);
01316 c1_state = !z1_state;
01317 g1_state = !z1_state;
01318 GtkWidget *C1_entry = lookup_widget (GTK_WIDGET (togglebutton), "C1_entry");
01319 gtk_widget_set_sensitive (C1_entry, FALSE);
01320 GtkWidget *G1_entry = lookup_widget (GTK_WIDGET (togglebutton), "G1_entry");
01321 gtk_widget_set_sensitive (G1_entry, FALSE);
01322 GtkWidget *Z1_entry = lookup_widget (GTK_WIDGET (togglebutton), "Z1_entry");
01323 gtk_widget_set_sensitive (Z1_entry, TRUE);
01324 }
01325
01326
01342 void
01343 on_Z2_entry_changed (GtkEditable *editable,
01344 gpointer user_data)
01345 {
01346 gchar *leftovers;
01347 GtkWidget *Z2_entry = lookup_widget (GTK_WIDGET (editable),
01348 "Z2_entry");
01349 const gchar* Z2_string = gtk_entry_get_text (GTK_ENTRY (Z2_entry));
01350 z2 = g_ascii_strtod (Z2_string, &leftovers);
01351 entry_has_changed (GTK_WIDGET (editable));
01352 }
01353
01354
01371 void
01372 on_Z2_radiobutton_toggled (GtkToggleButton *togglebutton,
01373 gpointer user_data)
01374 {
01375 z2_state = gtk_toggle_button_get_active (togglebutton);
01376 c2_state = !z2_state;
01377 g2_state = !z2_state;
01378 GtkWidget *C2_entry = lookup_widget (GTK_WIDGET (togglebutton), "C2_entry");
01379 gtk_widget_set_sensitive (C2_entry, FALSE);
01380 GtkWidget *G2_entry = lookup_widget (GTK_WIDGET (togglebutton), "G2_entry");
01381 gtk_widget_set_sensitive (G2_entry, FALSE);
01382 GtkWidget *Z2_entry = lookup_widget (GTK_WIDGET (togglebutton), "Z2_entry");
01383 gtk_widget_set_sensitive (Z2_entry, TRUE);
01384 }
01385
01386
01396 void
01397 on_about_dialog_close (GtkDialog *dialog,
01398 gint response_id,
01399 gpointer user_data)
01400 {
01401 GtkWidget *about_dialog = lookup_widget (GTK_WIDGET (dialog),
01402 "about_dialog");
01403 gtk_widget_destroy (about_dialog);
01404 }
01405
01406
01416 void
01417 on_about_dialog_destroy (GtkObject *object,
01418 gpointer user_data)
01419 {
01420 GtkWidget *about_dialog = lookup_widget (GTK_WIDGET (object),
01421 "about_dialog");
01422 gtk_widget_destroy (about_dialog);
01423 }
01424
01425
01440 void
01441 on_add_attribs_checkbutton_toggled (GtkToggleButton *togglebutton,
01442 gpointer user_data)
01443 {
01444 attributes_in_footprint = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton));
01445 }
01446
01447
01462 void
01463 on_add_license_checkbutton_toggled (GtkToggleButton *togglebutton,
01464 gpointer user_data)
01465 {
01466 license_in_footprint = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton));
01467 }
01468
01469
01488 void
01489 on_clear_button_clicked (GtkButton *button,
01490 gpointer user_data)
01491 {
01492 entry_has_changed (GTK_WIDGET (button));
01493
01494 GtkWidget *footprint_type_entry = lookup_widget (GTK_WIDGET (button),
01495 "footprint_type_entry");
01496 gtk_combo_box_set_active (GTK_COMBO_BOX (footprint_type_entry), 0);
01497 GtkWidget *footprint_name_entry = lookup_widget (GTK_WIDGET (button),
01498 "footprint_name_entry");
01499 gtk_entry_set_text (GTK_ENTRY (footprint_name_entry), "");
01500 GtkWidget *footprint_units_entry = lookup_widget (GTK_WIDGET (button),
01501 "footprint_units_entry");
01502 gtk_combo_box_set_active (GTK_COMBO_BOX (footprint_units_entry), 0);
01503 GtkWidget *footprint_refdes_entry = lookup_widget (GTK_WIDGET (button),
01504 "footprint_refdes_entry");
01505 gtk_entry_set_text (GTK_ENTRY (footprint_refdes_entry), "");
01506 GtkWidget *footprint_value_entry = lookup_widget (GTK_WIDGET (button),
01507 "footprint_value_entry");
01508 gtk_entry_set_text (GTK_ENTRY (footprint_value_entry), "");
01509 GtkWidget *package_body_length_entry = lookup_widget (GTK_WIDGET (button),
01510 "package_body_length_entry");
01511 gtk_entry_set_text (GTK_ENTRY (package_body_length_entry), "");
01512 GtkWidget *package_body_width_entry = lookup_widget (GTK_WIDGET (button),
01513 "package_body_width_entry");
01514 gtk_entry_set_text (GTK_ENTRY (package_body_width_entry), "");
01515 GtkWidget *package_body_height_entry = lookup_widget (GTK_WIDGET (button),
01516 "package_body_height_entry");
01517 gtk_entry_set_text (GTK_ENTRY (package_body_height_entry), "");
01518 GtkWidget *package_is_radial_checkbutton = lookup_widget (GTK_WIDGET (button),
01519 "package_is_radial_checkbutton");
01520 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (package_is_radial_checkbutton), FALSE);
01521 GtkWidget *footprint_author_entry = lookup_widget (GTK_WIDGET (button),
01522 "footprint_author_entry");
01523 gtk_entry_set_text (GTK_ENTRY (footprint_author_entry), "");
01524 GtkWidget *footprint_dist_license_entry = lookup_widget (GTK_WIDGET (button),
01525 "footprint_dist_license_entry");
01526 gtk_entry_set_text (GTK_ENTRY (footprint_dist_license_entry), "");
01527 GtkWidget *footprint_use_license_entry = lookup_widget (GTK_WIDGET (button),
01528 "footprint_use_license_entry");
01529 gtk_entry_set_text (GTK_ENTRY (footprint_use_license_entry), "");
01530 GtkWidget *footprint_status_entry = lookup_widget (GTK_WIDGET (button),
01531 "footprint_status_entry");
01532 gtk_combo_box_set_active (GTK_COMBO_BOX (footprint_status_entry), 0);
01533
01534
01535 GtkWidget *number_total_pins_entry = lookup_widget (GTK_WIDGET (button),
01536 "number_total_pins_entry");
01537 gtk_entry_set_text (GTK_ENTRY (number_total_pins_entry), "");
01538 GtkWidget *number_of_rows_entry = lookup_widget (GTK_WIDGET (button),
01539 "number_of_rows_entry");
01540 gtk_entry_set_text (GTK_ENTRY (number_of_rows_entry), "");
01541 GtkWidget *number_of_columns_entry = lookup_widget (GTK_WIDGET (button),
01542 "number_of_columns_entry");
01543 gtk_entry_set_text (GTK_ENTRY (number_of_columns_entry), "");
01544 GtkWidget *pitch_x_entry = lookup_widget (GTK_WIDGET (button),
01545 "pitch_x_entry");
01546 gtk_entry_set_text (GTK_ENTRY (pitch_x_entry), "");
01547 GtkWidget *pitch_y_entry = lookup_widget (GTK_WIDGET (button),
01548 "pitch_y_entry");
01549 gtk_entry_set_text (GTK_ENTRY (pitch_y_entry), "");
01550 GtkWidget *count_x_entry = lookup_widget (GTK_WIDGET (button),
01551 "count_x_entry");
01552 gtk_entry_set_text (GTK_ENTRY (count_x_entry), "");
01553 GtkWidget *count_y_entry = lookup_widget (GTK_WIDGET (button),
01554 "count_y_entry");
01555 gtk_entry_set_text (GTK_ENTRY (count_y_entry), "");
01556 GtkWidget *pad_shape_entry = lookup_widget (GTK_WIDGET (button),
01557 "pad_shape_entry");
01558 gtk_combo_box_set_active (GTK_COMBO_BOX (pad_shape_entry), 0);
01559 GtkWidget *number_1_position_entry = lookup_widget (GTK_WIDGET (button),
01560 "number_1_position_entry");
01561 gtk_combo_box_set_active (GTK_COMBO_BOX (number_1_position_entry), 0);
01562 GtkWidget *pad_diameter_entry = lookup_widget (GTK_WIDGET (button),
01563 "pad_diameter_entry");
01564 gtk_entry_set_text (GTK_ENTRY (pad_diameter_entry), "");
01565 GtkWidget *pin_drill_diameter_entry = lookup_widget (GTK_WIDGET (button),
01566 "pin_drill_diameter_entry");
01567 gtk_entry_set_text (GTK_ENTRY (pin_drill_diameter_entry), "");
01568 GtkWidget *pin1_square_checkbutton = lookup_widget (GTK_WIDGET (button),
01569 "pin_square_checkbutton");
01570 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pin1_square_checkbutton), FALSE);
01571 GtkWidget *pad_length_entry = lookup_widget (GTK_WIDGET (button),
01572 "pad_length_entry");
01573 gtk_entry_set_text (GTK_ENTRY (pad_length_entry), "");
01574 GtkWidget *pad_width_entry = lookup_widget (GTK_WIDGET (button),
01575 "pad_width_entry");
01576 gtk_entry_set_text (GTK_ENTRY (pad_width_entry), "");
01577 GtkWidget *pad_clearance_entry = lookup_widget (GTK_WIDGET (button),
01578 "pad_clearance_entry");
01579 gtk_entry_set_text (GTK_ENTRY (pad_clearance_entry), "");
01580 GtkWidget *pad_solder_mask_clearance_entry = lookup_widget (GTK_WIDGET (button),
01581 "pad_solder_mask_clearance_entry");
01582 gtk_entry_set_text (GTK_ENTRY (pad_solder_mask_clearance_entry), "");
01583
01584
01585 GtkWidget *thermal_checkbutton = lookup_widget (GTK_WIDGET (button),
01586 "thermal_checkbutton");
01587 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (thermal_checkbutton), FALSE);
01588 GtkWidget *thermal_nopaste_checkbutton = lookup_widget (GTK_WIDGET (button),
01589 "thermal_nopaste_checkbutton");
01590 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (thermal_nopaste_checkbutton), FALSE);
01591 GtkWidget *thermal_length_entry = lookup_widget (GTK_WIDGET (button),
01592 "thermal_length_entry");
01593 gtk_entry_set_text (GTK_ENTRY (thermal_length_entry), "");
01594 gtk_widget_set_sensitive (thermal_length_entry, FALSE);
01595 GtkWidget *thermal_width_entry = lookup_widget (GTK_WIDGET (button),
01596 "thermal_width_entry");
01597 gtk_entry_set_text (GTK_ENTRY (thermal_width_entry), "");
01598 gtk_widget_set_sensitive (thermal_width_entry, FALSE);
01599 GtkWidget *thermal_clearance_entry = lookup_widget (GTK_WIDGET (button),
01600 "thermal_clearance_entry");
01601 gtk_entry_set_text (GTK_ENTRY (thermal_clearance_entry), "");
01602 gtk_widget_set_sensitive (thermal_clearance_entry, FALSE);
01603 GtkWidget *thermal_solder_mask_clearance_entry = lookup_widget (GTK_WIDGET (button),
01604 "thermal_solder_mask_clearance_entry");
01605 gtk_entry_set_text (GTK_ENTRY (thermal_solder_mask_clearance_entry), "");
01606 gtk_widget_set_sensitive (thermal_solder_mask_clearance_entry, FALSE);
01607
01608
01609 GtkWidget *silkscreen_package_outline_checkbutton = lookup_widget (GTK_WIDGET (button),
01610 "silkscreen_package_outline_checkbutton");
01611 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (silkscreen_package_outline_checkbutton), FALSE);
01612 GtkWidget *silkscreen_line_width_entry = lookup_widget (GTK_WIDGET (button),
01613 "silkscreen_line_width_entry");
01614 gtk_entry_set_text (GTK_ENTRY (silkscreen_line_width_entry), "");
01615 GtkWidget *silkscreen_indicate_1_checkbutton = lookup_widget (GTK_WIDGET (button),
01616 "silkscreen_indicate_1_checkbutton");
01617 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (silkscreen_indicate_1_checkbutton), FALSE);
01618 GtkWidget *courtyard_checkbutton = lookup_widget (GTK_WIDGET (button),
01619 "courtyard_checkbutton");
01620 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (courtyard_checkbutton), FALSE);
01621 GtkWidget *courtyard_length_entry = lookup_widget (GTK_WIDGET (button),
01622 "courtyard_length_entry");
01623 gtk_entry_set_text (GTK_ENTRY (courtyard_length_entry), "");
01624 GtkWidget *courtyard_width_entry = lookup_widget (GTK_WIDGET (button),
01625 "courtyard_width_entry");
01626 gtk_entry_set_text (GTK_ENTRY (courtyard_width_entry), "");
01627 GtkWidget *courtyard_line_width_entry = lookup_widget (GTK_WIDGET (button),
01628 "courtyard_line_width_entry");
01629 gtk_entry_set_text (GTK_ENTRY (courtyard_line_width_entry), "");
01630 GtkWidget *courtyard_clearance_with_package_entry = lookup_widget (GTK_WIDGET (button),
01631 "courtyard_clearance_with_package_entry");
01632 gtk_entry_set_text (GTK_ENTRY (courtyard_clearance_with_package_entry), "");
01633
01634
01635 GtkWidget *C1_entry = lookup_widget (GTK_WIDGET (button),
01636 "C1_entry");
01637 gtk_entry_set_text (GTK_ENTRY (C1_entry), "");
01638 gtk_widget_set_sensitive (C1_entry, TRUE);
01639 GtkWidget *C2_entry = lookup_widget (GTK_WIDGET (button),
01640 "C2_entry");
01641 gtk_entry_set_text (GTK_ENTRY (C2_entry), "");
01642 gtk_widget_set_sensitive (C2_entry, TRUE);
01643 GtkWidget *G1_entry = lookup_widget (GTK_WIDGET (button),
01644 "G1_entry");
01645 gtk_entry_set_text (GTK_ENTRY (G1_entry), "");
01646 gtk_widget_set_sensitive (G1_entry, FALSE);
01647 GtkWidget *G2_entry = lookup_widget (GTK_WIDGET (button),
01648 "G2_entry");
01649 gtk_entry_set_text (GTK_ENTRY (G2_entry), "");
01650 gtk_widget_set_sensitive (G2_entry, FALSE);
01651 GtkWidget *Z1_entry = lookup_widget (GTK_WIDGET (button),
01652 "Z1_entry");
01653 gtk_entry_set_text (GTK_ENTRY (Z1_entry), "");
01654 gtk_widget_set_sensitive (Z1_entry, FALSE);
01655 GtkWidget *Z2_entry = lookup_widget (GTK_WIDGET (button),
01656 "Z2_entry");
01657 gtk_entry_set_text (GTK_ENTRY (Z2_entry), "");
01658 gtk_widget_set_sensitive (Z2_entry, FALSE);
01659 GtkWidget *C1_radiobutton = lookup_widget (GTK_WIDGET (button),
01660 "C1_radiobutton");
01661 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (C1_radiobutton), TRUE);
01662 GtkWidget *C2_radiobutton = lookup_widget (GTK_WIDGET (button),
01663 "C2_radiobutton");
01664 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (C2_radiobutton), TRUE);
01665 GtkWidget *G1_radiobutton = lookup_widget (GTK_WIDGET (button),
01666 "G1_radiobutton");
01667 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (G1_radiobutton), FALSE);
01668 GtkWidget *G2_radiobutton = lookup_widget (GTK_WIDGET (button),
01669 "G2_radiobutton");
01670 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (G2_radiobutton), FALSE);
01671 GtkWidget *Z1_radiobutton = lookup_widget (GTK_WIDGET (button),
01672 "Z1_radiobutton");
01673 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (Z1_radiobutton), FALSE);
01674 GtkWidget *Z2_radiobutton = lookup_widget (GTK_WIDGET (button),
01675 "Z2_radiobutton");
01676 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (Z2_radiobutton), FALSE);
01677 }
01678
01679
01691 void
01692 on_close_button_clicked (GtkButton *button,
01693 gpointer user_data)
01694 {
01695 gtk_main_quit();
01696 }
01697
01698
01714 void
01715 on_count_x_entry_changed (GtkEditable *editable,
01716 gpointer user_data)
01717 {
01718 gchar *leftovers;
01719 GtkWidget *count_x_entry = lookup_widget (GTK_WIDGET (editable),
01720 "count_x_entry");
01721 const gchar* count_x_string = gtk_entry_get_text (GTK_ENTRY (count_x_entry));
01722 count_x = (int) g_ascii_strtod (count_x_string, &leftovers);
01723 entry_has_changed (GTK_WIDGET (editable));
01724 number_of_pins_has_changed (GTK_WIDGET (editable));
01725 }
01726
01727
01743 void
01744 on_count_y_entry_changed (GtkEditable *editable,
01745 gpointer user_data)
01746 {
01747 gchar *leftovers;
01748 GtkWidget *count_y_entry = lookup_widget (GTK_WIDGET (editable),
01749 "count_y_entry");
01750 const gchar* count_y_string = gtk_entry_get_text (GTK_ENTRY (count_y_entry));
01751 count_y = (int) g_ascii_strtod (count_y_string, &leftovers);
01752 entry_has_changed (GTK_WIDGET (editable));
01753 number_of_pins_has_changed (GTK_WIDGET (editable));
01754 }
01755
01756
01771 void
01772 on_courtyard_checkbutton_toggled (GtkToggleButton *togglebutton,
01773 gpointer user_data)
01774 {
01775 courtyard = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton));
01776 GtkWidget *courtyard_line_width_entry = lookup_widget (GTK_WIDGET (togglebutton),
01777 "courtyard_line_width_entry");
01778 gtk_widget_set_sensitive (courtyard_line_width_entry, courtyard);
01779 GtkWidget *courtyard_length_entry = lookup_widget (GTK_WIDGET (togglebutton),
01780 "courtyard_length_entry");
01781 gtk_widget_set_sensitive (courtyard_length_entry, courtyard);
01782 GtkWidget *courtyard_width_entry = lookup_widget (GTK_WIDGET (togglebutton),
01783 "courtyard_width_entry");
01784 gtk_widget_set_sensitive (courtyard_width_entry, courtyard);
01785 GtkWidget *courtyard_clearance_with_package_entry = lookup_widget (GTK_WIDGET (togglebutton),
01786 "courtyard_clearance_with_package_entry");
01787 gtk_widget_set_sensitive (courtyard_clearance_with_package_entry, courtyard);
01788 entry_has_changed (GTK_WIDGET (togglebutton));
01789 }
01790
01791
01807 void
01808 on_courtyard_clearance_with_package_entry_changed
01809 (GtkEditable *editable,
01810 gpointer user_data)
01811 {
01812 gchar *leftovers;
01813 GtkWidget *courtyard_clearance_with_package_entry = lookup_widget (GTK_WIDGET (editable),
01814 "courtyard_clearance_with_package_entry");
01815 const gchar* courtyard_clearance_with_package_string = gtk_entry_get_text (GTK_ENTRY (courtyard_clearance_with_package_entry));
01816 courtyard_clearance_with_package = g_ascii_strtod (courtyard_clearance_with_package_string, &leftovers);
01817 entry_has_changed (GTK_WIDGET (editable));
01818 }
01819
01820
01836 void
01837 on_courtyard_length_entry_changed (GtkEditable *editable,
01838 gpointer user_data)
01839 {
01840 gchar *leftovers;
01841 GtkWidget *courtyard_length_entry = lookup_widget (GTK_WIDGET (editable),
01842 "courtyard_length_entry");
01843 const gchar* courtyard_length_string = gtk_entry_get_text (GTK_ENTRY (courtyard_length_entry));
01844 courtyard_length = g_ascii_strtod (courtyard_length_string, &leftovers);
01845 entry_has_changed (GTK_WIDGET (editable));
01846 }
01847
01848
01864 void
01865 on_courtyard_line_width_entry_changed (GtkEditable *editable,
01866 gpointer user_data)
01867 {
01868 gchar *leftovers;
01869 GtkWidget *courtyard_line_width_entry = lookup_widget (GTK_WIDGET (editable),
01870 "courtyard_line_width_entry");
01871 const gchar* courtyard_line_width_string = gtk_entry_get_text (GTK_ENTRY (courtyard_line_width_entry));
01872 courtyard_line_width = g_ascii_strtod (courtyard_line_width_string, &leftovers);
01873 entry_has_changed (GTK_WIDGET (editable));
01874 }
01875
01876
01892 void
01893 on_courtyard_width_entry_changed (GtkEditable *editable,
01894 gpointer user_data)
01895 {
01896 gchar *leftovers;
01897 GtkWidget *courtyard_width_entry = lookup_widget (GTK_WIDGET (editable),
01898 "courtyard_width_entry");
01899 const gchar* courtyard_width_string = gtk_entry_get_text (GTK_ENTRY (courtyard_width_entry));
01900 courtyard_width = g_ascii_strtod (courtyard_width_string, &leftovers);
01901 entry_has_changed (GTK_WIDGET (editable));
01902 }
01903
01904
01917 void
01918 on_dimensions_button_clicked (GtkButton *button,
01919 gpointer user_data)
01920 {
01921 gchar *image_filename = g_strconcat
01922 (
01923 "pixmaps/", footprint_type, ".xpm", NULL
01924 );
01925 if (g_file_test (image_filename, G_FILE_TEST_EXISTS))
01926 {
01927 if (verbose)
01928 g_log ("", G_LOG_LEVEL_INFO,
01929 g_strdup_printf (_("loading image file: %s"),
01930 image_filename));
01931 dimensions_create_window (image_filename, footprint_type);
01932 }
01933 else
01934 {
01935 if (verbose)
01936 g_log ("", G_LOG_LEVEL_WARNING,
01937 g_strdup_printf (_("image file: %s does not exist."), image_filename));
01938 }
01939 g_free (image_filename);
01940 }
01941
01942
01960 void
01961 on_fiducial_checkbutton_toggled (GtkToggleButton *togglebutton,
01962 gpointer user_data)
01963 {
01964 fiducial = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton));
01965 GtkWidget *fiducial_pad_diameter_entry = lookup_widget (GTK_WIDGET (togglebutton),
01966 "fiducial_pad_diameter_entry");
01967 gtk_widget_set_sensitive (fiducial_pad_diameter_entry, fiducial);
01968 GtkWidget *fiducial_pad_soldermask_clearance_entry = lookup_widget
01969 (GTK_WIDGET (togglebutton),
01970 "fiducial_pad_solder_mask_clearance_entry");
01971 gtk_widget_set_sensitive (fiducial_pad_soldermask_clearance_entry, fiducial);
01972 entry_has_changed (GTK_WIDGET (togglebutton));
01973 }
01974
01975
01992 void
01993 on_fiducial_pad_clearance_entry_changed
01994 (GtkEditable *editable,
01995 gpointer user_data)
01996 {
01997 gchar *leftovers;
01998 GtkWidget *fiducial_pad_clearance_entry = lookup_widget (GTK_WIDGET (editable),
01999 "fiducial_pad_clearance_entry");
02000 const gchar* fiducial_pad_clearance_string =
02001 gtk_entry_get_text (GTK_ENTRY (fiducial_pad_clearance_entry));
02002 fiducial_pad_clearance = g_ascii_strtod (fiducial_pad_clearance_string, &leftovers);
02003 entry_has_changed (GTK_WIDGET (editable));
02004
02005 }
02006
02007
02024 void
02025 on_fiducial_pad_diameter_entry_changed (GtkEditable *editable,
02026 gpointer user_data)
02027 {
02028 gchar *leftovers;
02029 GtkWidget *fiducial_pad_diameter_entry = lookup_widget (GTK_WIDGET (editable),
02030 "fiducial_pad_diameter_entry");
02031 const gchar* fiducial_pad_diameter_string =
02032 gtk_entry_get_text (GTK_ENTRY (fiducial_pad_diameter_entry));
02033 fiducial_pad_diameter = g_ascii_strtod (fiducial_pad_diameter_string, &leftovers);
02034 entry_has_changed (GTK_WIDGET (editable));
02035 }
02036
02037
02054 void
02055 on_fiducial_pad_solder_mask_clearance_entry_changed
02056 (GtkEditable *editable,
02057 gpointer user_data)
02058 {
02059 gchar *leftovers;
02060 GtkWidget *fiducial_pad_solder_mask_clearance_entry =
02061 lookup_widget (GTK_WIDGET (editable),
02062 "fiducial_pad_solder_mask_clearance_entry");
02063 const gchar* fiducial_pad_solder_mask_clearance_string =
02064 gtk_entry_get_text (GTK_ENTRY
02065 (fiducial_pad_solder_mask_clearance_entry));
02066 fiducial_pad_solder_mask_clearance = g_ascii_strtod
02067 (fiducial_pad_solder_mask_clearance_string, &leftovers);
02068 entry_has_changed (GTK_WIDGET (editable));
02069 }
02070
02071
02088 void
02089 on_filechooser_dialog_cancel_button_clicked
02090 (GtkButton *button,
02091 gpointer user_data)
02092 {
02093 GtkWidget *filechooser_dialog = lookup_widget (GTK_WIDGET (button),
02094 "filechooser_dialog");
02095 gtk_widget_destroy (filechooser_dialog);
02096 }
02097
02098
02113 void
02114 on_filechooser_dialog_close (GtkDialog *dialog,
02115 gpointer user_data)
02116 {
02117 GtkWidget *filechooser_dialog = lookup_widget (GTK_WIDGET (dialog),
02118 "filechooser_dialog");
02119 gtk_widget_destroy (filechooser_dialog);
02120 }
02121
02122
02123
02141 void
02142 on_filechooser_dialog_current_folder_changed
02143 (
02144 GtkFileChooser *filechooser,
02145 gpointer user_data
02146 )
02147 {
02148 GtkWidget *filechooser_dialog = lookup_widget (GTK_WIDGET (filechooser),
02149 "filechooser_dialog");
02150 gchar *current_folder = g_strdup (gtk_file_chooser_get_current_folder
02151 (GTK_FILE_CHOOSER (filechooser_dialog)));
02152
02153
02154 if (!current_folder)
02155 {
02156 if (verbose)
02157 g_log ("", G_LOG_LEVEL_WARNING,
02158 _("current folder is not initialised (null pointer)."));
02159 }
02160
02161
02162 else if (!strcmp (current_folder, ""))
02163 {
02164 if (verbose)
02165 g_log ("", G_LOG_LEVEL_WARNING,
02166 _("current folder contains an empty string."));
02167 }
02168
02169
02170 else if (g_file_test (current_folder, G_FILE_TEST_IS_DIR))
02171 {
02172 temp_dir = g_strdup (current_folder);
02173 if (verbose)
02174 g_log ("", G_LOG_LEVEL_INFO, _("Changed cwd to: %s"),
02175 current_folder);
02176 }
02177
02178 g_free (current_folder);
02179 }
02180
02181
02205 void
02206 on_filechooser_dialog_open_button_clicked
02207 (
02208 GtkButton *button,
02209 gpointer user_data
02210 )
02211 {
02212 GtkWidget *filechooser_dialog = lookup_widget (GTK_WIDGET (button),
02213 "filechooser_dialog");
02214 gchar *selected_filename = NULL;
02215 selected_filename = g_strdup (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (filechooser_dialog)));
02216
02217
02218 if (!selected_filename)
02219 {
02220 if (verbose)
02221 g_log ("", G_LOG_LEVEL_WARNING,
02222 _("selected filename is not initialised (NULL pointer)."));
02223 }
02224
02225
02226 else if (!strcmp (selected_filename, ""))
02227 {
02228 if (verbose)
02229 g_log ("", G_LOG_LEVEL_WARNING,
02230 _("selected filename contains an empty string."));
02231 }
02232
02233
02234
02235 else if (g_file_test (selected_filename, G_FILE_TEST_IS_DIR))
02236 {
02237 if (verbose)
02238 g_log ("", G_LOG_LEVEL_WARNING, _("selected filename is a directory."));
02239 }
02240 else
02241 {
02242
02243 gchar *fpw_filename = g_strdup (selected_filename);
02244 if (temp_dir)
02245 work_dir = g_strdup (temp_dir);
02246
02247 if (read_footprintwizard_file (fpw_filename) == EXIT_SUCCESS)
02248 {
02249 if (verbose)
02250 g_log ("", G_LOG_LEVEL_INFO, _("Read footprintwizard file %s."), fpw_filename);
02251
02252 GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (button));
02253 if (GTK_WIDGET_TOPLEVEL (toplevel))
02254 {
02255 all_entries_need_updated (GTK_WIDGET (toplevel));
02256 }
02257
02258 g_free (toplevel);
02259 }
02260 else
02261 {
02262 GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (button));
02263 if (GTK_WIDGET_TOPLEVEL (toplevel))
02264 {
02265 GtkWidget *dialog = gtk_message_dialog_new
02266 (
02267 GTK_WINDOW (toplevel),
02268 GTK_DIALOG_DESTROY_WITH_PARENT,
02269 GTK_MESSAGE_ERROR,
02270 GTK_BUTTONS_CLOSE,
02271 g_strdup_printf (_("ERROR: Unable to read footprint wizard file %s."), fpw_filename)
02272 );
02273 gtk_dialog_run (GTK_DIALOG (dialog));
02274 gtk_widget_destroy (dialog);
02275 g_free (dialog);
02276 return;
02277 }
02278 g_free (toplevel);
02279 }
02280
02281 g_free (fpw_filename);
02282 }
02283
02284 g_free (selected_filename);
02285 }
02286
02287
02303 void
02304 on_filechooser_dialog_selection_changed
02305 (GtkFileChooser *filechooser,
02306 gpointer user_data)
02307 {
02308
02309 }
02310
02311
02324 void
02325 on_filechooser_dialog_update_preview (GtkFileChooser *filechooser,
02326 gpointer user_data)
02327 {
02328
02329 }
02330
02331
02343 void
02344 on_footprint_author_entry_changed (GtkEditable *editable,
02345 gpointer user_data)
02346 {
02347 GtkWidget *footprint_author_entry = lookup_widget (GTK_WIDGET (editable),
02348 "footprint_author_entry");
02349 footprint_author = g_strdup (gtk_entry_get_text (GTK_ENTRY (footprint_author_entry)));
02350 entry_has_changed (GTK_WIDGET (editable));
02351 }
02352
02353
02373 void
02374 on_footprint_button_clicked (GtkButton *button,
02375 gpointer user_data)
02376 {
02377
02378
02379
02380 if (!footprint_name)
02381 {
02382 gchar *message = g_strdup_printf (_("ERROR: footprint name not initialised (null pointer)."));
02383 message_to_statusbar (GTK_WIDGET (button), message);
02384 return;
02385 }
02386
02387
02388
02389 else if (!strcmp (footprint_name, ""))
02390 {
02391 gchar *message = g_strdup_printf (_("ERROR: footprint name contains an empty string."));
02392 message_to_statusbar (GTK_WIDGET (button), message);
02393 return;
02394 }
02395 else
02396 {
02397 gchar *message = g_strdup_printf ("");
02398 message_to_statusbar (GTK_WIDGET (button), message);
02399 }
02400
02401 footprint_filename = g_strdup (footprint_name);
02402 if (g_str_has_suffix (footprint_filename, fp_suffix))
02403 {
02404
02405
02406 }
02407 else
02408 {
02409
02410
02411 footprint_filename = g_strconcat (footprint_filename, ".fp", NULL);
02412 }
02413
02414
02415 if (write_footprint () == EXIT_SUCCESS)
02416 {
02417 gchar *message = g_strdup_printf (_("Wrote footprint %s to file."), footprint_filename);
02418 message_to_statusbar (GTK_WIDGET (button), message);
02419 }
02420 else
02421 {
02422 gchar *message = g_strdup_printf (_("ERROR: Unable to write footprint %s to file."), footprint_filename);
02423 message_to_statusbar (GTK_WIDGET (button), message);
02424 }
02425 }
02426
02427
02439 void
02440 on_footprint_dist_license_entry_changed
02441 (GtkEditable *editable,
02442 gpointer user_data)
02443 {
02444 GtkWidget *footprint_dist_license_entry = lookup_widget (GTK_WIDGET (editable),
02445 "footprint_dist_license_entry");
02446 footprint_dist_license = g_strdup (gtk_entry_get_text (GTK_ENTRY (footprint_dist_license_entry)));
02447 entry_has_changed (GTK_WIDGET (editable));
02448 }
02449
02450
02462 void
02463 on_footprint_name_entry_changed (GtkEditable *editable,
02464 gpointer user_data)
02465 {
02466 GtkWidget *footprint_name_entry = lookup_widget (GTK_WIDGET (editable),
02467 "footprint_name_entry");
02468 footprint_name = g_strdup (gtk_entry_get_text (GTK_ENTRY (footprint_name_entry)));
02469 entry_has_changed (GTK_WIDGET (editable));
02470
02471
02472
02473 if (!footprint_name)
02474 {
02475 gchar *message = g_strdup_printf (_("ERROR: footprint name not initialised (null pointer)."));
02476 message_to_statusbar (GTK_WIDGET (editable), message);
02477 return;
02478 }
02479
02480
02481
02482 else if (!strcmp (footprint_name, ""))
02483 {
02484 gchar *message = g_strdup_printf (_("ERROR: footprint name contains an empty string."));
02485 message_to_statusbar (GTK_WIDGET (editable), message);
02486 return;
02487 }
02488 else if (g_str_has_prefix (footprint_name, "?"))
02489 {
02490 switch (package_type)
02491 {
02492 case BGA:
02493 {
02494 if (bga_get_default_footprint_values (footprint_name) == EXIT_SUCCESS)
02495 all_entries_need_updated (GTK_WIDGET (editable));
02496 return;
02497 }
02498 case CAPA:
02499 {
02500 if (capa_get_default_footprint_values (footprint_name) == EXIT_SUCCESS)
02501 all_entries_need_updated (GTK_WIDGET (editable));
02502 return;
02503 }
02504 case CAPC:
02505 {
02506 if (capc_get_default_footprint_values (footprint_name) == EXIT_SUCCESS)
02507 all_entries_need_updated (GTK_WIDGET (editable));
02508 return;
02509 }
02510 case CAPM:
02511 {
02512 if (capm_get_default_footprint_values (footprint_name) == EXIT_SUCCESS)
02513 all_entries_need_updated (GTK_WIDGET (editable));
02514 return;
02515 }
02516 case CAPMP:
02517 {
02518 if (capmp_get_default_footprint_values (footprint_name) == EXIT_SUCCESS)
02519 all_entries_need_updated (GTK_WIDGET (editable));
02520 return;
02521 }
02522 case CAPPR:
02523 {
02524 if (cappr_get_default_footprint_values (footprint_name) == EXIT_SUCCESS)
02525 all_entries_need_updated (GTK_WIDGET (editable));
02526 return;
02527 }
02528 case CON_DIL:
02529 {
02530 if (con_dil_get_default_footprint_values (footprint_name) == EXIT_SUCCESS)
02531 all_entries_need_updated (GTK_WIDGET (editable));
02532 return;
02533 }
02534 case CON_DIP:
02535 {
02536 if (con_dip_get_default_footprint_values (footprint_name) == EXIT_SUCCESS)
02537 all_entries_need_updated (GTK_WIDGET (editable));
02538 return;
02539 }
02540 case CON_HDR:
02541 {
02542 if (con_hdr_get_default_footprint_values (footprint_name) == EXIT_SUCCESS)
02543 all_entries_need_updated (GTK_WIDGET (editable));
02544 return;
02545 }
02546 case CON_SIL:
02547 {
02548 if (con_sil_get_default_footprint_values (footprint_name) == EXIT_SUCCESS)
02549 all_entries_need_updated (GTK_WIDGET (editable));
02550 return;
02551 }
02552 case DIOM:
02553 {
02554 if (diom_get_default_footprint_values (footprint_name) == EXIT_SUCCESS)
02555 all_entries_need_updated (GTK_WIDGET (editable));
02556 return;
02557 }
02558 case DIOMELF:
02559 {
02560 if (diomelf_get_default_footprint_values (footprint_name) == EXIT_SUCCESS)
02561 all_entries_need_updated (GTK_WIDGET (editable));
02562 return;
02563 }
02564 case DIP:
02565 {
02566 if (dip_get_default_footprint_values (footprint_name) == EXIT_SUCCESS)
02567 all_entries_need_updated (GTK_WIDGET (editable));
02568 return;
02569 }
02570 case DIPS:
02571 {
02572 if (dips_get_default_footprint_values (footprint_name) == EXIT_SUCCESS)
02573 all_entries_need_updated (GTK_WIDGET (editable));
02574 return;
02575 }
02576 case INDC:
02577 {
02578 if (indc_get_default_footprint_values (footprint_name) == EXIT_SUCCESS)
02579 all_entries_need_updated (GTK_WIDGET (editable));
02580 return;
02581 }
02582 case INDM:
02583 {
02584 if (indm_get_default_footprint_values (footprint_name) == EXIT_SUCCESS)
02585 all_entries_need_updated (GTK_WIDGET (editable));
02586 return;
02587 }
02588 case INDP:
02589 {
02590 if (indp_get_default_footprint_values (footprint_name) == EXIT_SUCCESS)
02591 all_entries_need_updated (GTK_WIDGET (editable));
02592 return;
02593 }
02594 case PGA:
02595 {
02596 if (pga_get_default_footprint_values (footprint_name) == EXIT_SUCCESS)
02597 all_entries_need_updated (GTK_WIDGET (editable));
02598 return;
02599 }
02600 case PLCC:
02601 {
02602 if (plcc_get_default_footprint_values (footprint_name) == EXIT_SUCCESS)
02603 all_entries_need_updated (GTK_WIDGET (editable));
02604 return;
02605 }
02606 case RES:
02607 {
02608 if (res_get_default_footprint_values (footprint_name) == EXIT_SUCCESS)
02609 all_entries_need_updated (GTK_WIDGET (editable));
02610 return;
02611 }
02612 case RESC:
02613 {
02614 if (resc_get_default_footprint_values (footprint_name) == EXIT_SUCCESS)
02615 all_entries_need_updated (GTK_WIDGET (editable));
02616 return;
02617 }
02618 case RESM:
02619 {
02620 if (resm_get_default_footprint_values (footprint_name) == EXIT_SUCCESS)
02621 all_entries_need_updated (GTK_WIDGET (editable));
02622 return;
02623 }
02624 case SIL:
02625 {
02626 if (sil_get_default_footprint_values (footprint_name) == EXIT_SUCCESS)
02627 all_entries_need_updated (GTK_WIDGET (editable));
02628 return;
02629 }
02630 case SIP:
02631 {
02632 if (sip_get_default_footprint_values (footprint_name) == EXIT_SUCCESS)
02633 all_entries_need_updated (GTK_WIDGET (editable));
02634 return;
02635 }
02636 case SOT:
02637 {
02638 if (sot_get_default_footprint_values (footprint_name) == EXIT_SUCCESS)
02639 all_entries_need_updated (GTK_WIDGET (editable));
02640 return;
02641 }
02642 case TO:
02643 {
02644 if (to_get_default_footprint_values (footprint_name) == EXIT_SUCCESS)
02645 all_entries_need_updated (GTK_WIDGET (editable));
02646 return;
02647 }
02648 default:
02649 {
02650 gchar *message = g_strdup_printf (_("ERROR: unknown or not yet implemented footprint type entered."));
02651 message_to_statusbar (GTK_WIDGET (editable), message);
02652 return;
02653 }
02654 }
02655 }
02656 else
02657 {
02658 gchar *message = g_strdup_printf ("");
02659 message_to_statusbar (GTK_WIDGET (editable), message);
02660 return;
02661 }
02662 }
02663
02664
02676 void
02677 on_footprint_refdes_entry_changed (GtkEditable *editable,
02678 gpointer user_data)
02679 {
02680 GtkWidget *footprint_refdes_entry = lookup_widget (GTK_WIDGET (editable),
02681 "footprint_refdes_entry");
02682 footprint_refdes = g_strdup (gtk_entry_get_text (GTK_ENTRY (footprint_refdes_entry)));
02683 entry_has_changed (GTK_WIDGET (editable));
02684 }
02685
02697 void
02698 on_footprint_status_entry_changed (GtkComboBox *combobox,
02699 gpointer user_data)
02700 {
02701 footprint_status = gtk_combo_box_get_active_text (GTK_COMBO_BOX (combobox));
02702 entry_has_changed (GTK_WIDGET (combobox));
02703
02704 if (get_status_type () == EXIT_FAILURE)
02705 {
02706 g_log ("", G_LOG_LEVEL_INFO,
02707 _("footprint status contains an unknown status type."));
02708 return;
02709 }
02710 else
02711 {
02712 if (verbose)
02713 g_log ("", G_LOG_LEVEL_INFO,
02714 _("determined the status type successfull."));
02715 }
02716 }
02717
02718
02735 void
02736 on_footprint_type_entry_changed (GtkComboBox *combobox,
02737 gpointer user_data)
02738 {
02739
02740
02741
02742
02743
02744
02745 if (!footprint_name ||
02746 (!strcmp (footprint_name, "")) ||
02747 (!strcmp (footprint_type, footprint_name)))
02748 {
02749 footprint_type = gtk_combo_box_get_active_text (GTK_COMBO_BOX (combobox));
02750 footprint_name = g_strdup (footprint_type);
02751 GtkWidget *footprint_name_entry = lookup_widget (GTK_WIDGET (combobox),
02752 "footprint_name_entry");
02753 gtk_entry_set_text (GTK_ENTRY (footprint_name_entry), footprint_name);
02754 }
02755 else
02756 {
02757 footprint_type = gtk_combo_box_get_active_text (GTK_COMBO_BOX (combobox));
02758 }
02759 entry_has_changed (GTK_WIDGET (combobox));
02760
02761 if (get_package_type () == EXIT_FAILURE)
02762 {
02763 g_log ("", G_LOG_LEVEL_CRITICAL,
02764 _("footprint type contains an unknown package type."));
02765 footprint_type = g_strdup ("");
02766 return;
02767 }
02768 else
02769 {
02770 if (verbose)
02771 g_log ("", G_LOG_LEVEL_INFO,
02772 _("determined the package type (%d) for footprint type %s successfull."),
02773 package_type, footprint_type);
02774 }
02775 switch (package_type)
02776 {
02777 case BGA:
02778 {
02779 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02780 bga_set_gui_constraints (GTK_WIDGET (combobox));
02781 break;
02782 }
02783 case CAPA:
02784 {
02785 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02786 capa_set_gui_constraints (GTK_WIDGET (combobox));
02787 break;
02788 }
02789 case CAPC:
02790 {
02791 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02792 capc_set_gui_constraints (GTK_WIDGET (combobox));
02793 break;
02794 }
02795 case CAPM:
02796 {
02797 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02798 capm_set_gui_constraints (GTK_WIDGET (combobox));
02799 break;
02800 }
02801 case CAPMP:
02802 {
02803 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02804 capmp_set_gui_constraints (GTK_WIDGET (combobox));
02805 break;
02806 }
02807 case CAPPR:
02808 {
02809 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02810 cappr_set_gui_constraints (GTK_WIDGET (combobox));
02811 break;
02812 }
02813 case CON_DIL:
02814 {
02815 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02816 con_dil_set_gui_constraints (GTK_WIDGET (combobox));
02817 break;
02818 }
02819 case CON_DIP:
02820 {
02821 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02822 con_dip_set_gui_constraints (GTK_WIDGET (combobox));
02823 break;
02824 }
02825 case CON_HDR:
02826 {
02827 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02828 con_hdr_set_gui_constraints (GTK_WIDGET (combobox));
02829 break;
02830 }
02831 case CON_SIL:
02832 {
02833 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02834 con_sil_set_gui_constraints (GTK_WIDGET (combobox));
02835 break;
02836 }
02837 case DIL:
02838 {
02839 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02840 dip_set_gui_constraints (GTK_WIDGET (combobox));
02841 break;
02842 }
02843 case DIOM:
02844 {
02845 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02846 diom_set_gui_constraints (GTK_WIDGET (combobox));
02847 break;
02848 }
02849 case DIOMELF:
02850 {
02851 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02852 diomelf_set_gui_constraints (GTK_WIDGET (combobox));
02853 break;
02854 }
02855 case DIP:
02856 {
02857 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02858 dip_set_gui_constraints (GTK_WIDGET (combobox));
02859 break;
02860 }
02861 case DIPS:
02862 {
02863 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02864 dips_set_gui_constraints (GTK_WIDGET (combobox));
02865 break;
02866 }
02867 case INDC:
02868 {
02869 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02870 indc_set_gui_constraints (GTK_WIDGET (combobox));
02871 break;
02872 }
02873 case INDM:
02874 {
02875 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02876 indm_set_gui_constraints (GTK_WIDGET (combobox));
02877 break;
02878 }
02879 case INDP:
02880 {
02881 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02882 indp_set_gui_constraints (GTK_WIDGET (combobox));
02883 break;
02884 }
02885 case PGA:
02886 {
02887 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02888 pga_set_gui_constraints (GTK_WIDGET (combobox));
02889 break;
02890 }
02891 case PLCC:
02892 {
02893 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02894 plcc_set_gui_constraints (GTK_WIDGET (combobox));
02895 break;
02896 }
02897 case QFN:
02898 {
02899 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02900 gchar *message = g_strdup_printf (_("ERROR: footprint type QFN is not yet implemented."));
02901 message_to_statusbar (GTK_WIDGET (combobox), message);
02902 break;
02903 }
02904 case QFP:
02905 {
02906 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02907 gchar *message = g_strdup_printf (_("ERROR: footprint type QFP is not yet implemented."));
02908 message_to_statusbar (GTK_WIDGET (combobox), message);
02909 break;
02910 }
02911 case RES:
02912 {
02913 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02914 res_set_gui_constraints (GTK_WIDGET (combobox));
02915 break;
02916 }
02917 case RESC:
02918 {
02919 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02920 resc_set_gui_constraints (GTK_WIDGET (combobox));
02921 break;
02922 }
02923 case RESM:
02924 {
02925 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02926 resm_set_gui_constraints (GTK_WIDGET (combobox));
02927 break;
02928 }
02929 case RESMELF:
02930 {
02931 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02932 resmelf_set_gui_constraints (GTK_WIDGET (combobox));
02933 break;
02934 }
02935 case SIL:
02936 {
02937 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02938 sil_set_gui_constraints (GTK_WIDGET (combobox));
02939 break;
02940 }
02941 case SIP:
02942 {
02943 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02944 sip_set_gui_constraints (GTK_WIDGET (combobox));
02945 break;
02946 }
02947 case SO:
02948 {
02949 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02950 gchar *message = g_strdup_printf (_("ERROR: footprint type SO is not yet implemented."));
02951 message_to_statusbar (GTK_WIDGET (combobox), message);
02952 break;
02953 }
02954 case SOT:
02955 {
02956 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02957 sot_set_gui_constraints (GTK_WIDGET (combobox));
02958 break;
02959 }
02960 case TO92:
02961 {
02962 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02963 to_set_gui_constraints (GTK_WIDGET (combobox));
02964 break;
02965 }
02966 case TO220:
02967 {
02968 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02969 to_set_gui_constraints (GTK_WIDGET (combobox));
02970 break;
02971 }
02972 case TO220S:
02973 {
02974 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02975 to_set_gui_constraints (GTK_WIDGET (combobox));
02976 break;
02977 }
02978 case TO220SW:
02979 {
02980 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02981 to_set_gui_constraints (GTK_WIDGET (combobox));
02982 break;
02983 }
02984 case TO220W:
02985 {
02986 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02987 to_set_gui_constraints (GTK_WIDGET (combobox));
02988 break;
02989 }
02990 default:
02991 {
02992 gchar *message = g_strdup_printf (_("ERROR: unknown or not yet implemented footprint type entered."));
02993 message_to_statusbar (GTK_WIDGET (combobox), message);
02994 break;
02995 }
02996 }
02997 }
02998
02999
03014 void
03015 on_footprint_units_entry_changed (GtkComboBox *combobox,
03016 gpointer user_data)
03017 {
03018 entry_has_changed (GTK_WIDGET (combobox));
03019 footprint_units = gtk_combo_box_get_active_text (GTK_COMBO_BOX (combobox));
03020
03021
03022
03023 if (!footprint_units)
03024 {
03025 gchar *message = g_strdup_printf (_("ERROR: footprint units not initialised (null pointer)."));
03026 message_to_statusbar (GTK_WIDGET (combobox), message);
03027 return;
03028 }
03029
03030
03031
03032 else if (!strcmp (footprint_units, ""))
03033 {
03034 gchar *message = g_strdup_printf (_("ERROR: footprint units contains an empty string."));
03035 message_to_statusbar (GTK_WIDGET (combobox), message);
03036 return;
03037 }
03038
03039 else if (update_units_variables () == EXIT_FAILURE)
03040 {
03041 gchar *message = g_strdup_printf (_("ERROR: footprint units contains an unknown units type."));
03042 message_to_statusbar (GTK_WIDGET (combobox), message);
03043 }
03044 else
03045 {
03046 gchar *message = g_strdup_printf ("");
03047 message_to_statusbar (GTK_WIDGET (combobox), message);
03048 }
03049 }
03050
03051
03063 void
03064 on_footprint_use_license_entry_changed (GtkEditable *editable,
03065 gpointer user_data)
03066 {
03067 GtkWidget *footprint_use_license_entry = lookup_widget (GTK_WIDGET (editable),
03068 "footprint_use_license_entry");
03069 footprint_use_license = g_strdup (gtk_entry_get_text (GTK_ENTRY (footprint_use_license_entry)));
03070 entry_has_changed (GTK_WIDGET (editable));
03071 }
03072
03073
03085 void
03086 on_footprint_value_entry_changed (GtkEditable *editable,
03087 gpointer user_data)
03088 {
03089 GtkWidget *footprint_value_entry = lookup_widget (GTK_WIDGET (editable),
03090 "footprint_value_entry");
03091 footprint_value = g_strdup (gtk_entry_get_text (GTK_ENTRY (footprint_value_entry)));
03092 entry_has_changed (GTK_WIDGET (editable));
03093 }
03094
03095
03107 void
03108 on_number_1_position_entry_changed
03109 (GtkComboBox *combobox,
03110 gpointer user_data)
03111 {
03112 pin_1_position = gtk_combo_box_get_active_text (GTK_COMBO_BOX (combobox));
03113 entry_has_changed (GTK_WIDGET (combobox));
03114 }
03115
03116
03131 void
03132 on_number_of_columns_entry_changed (GtkEditable *editable,
03133 gpointer user_data)
03134 {
03135 gchar *leftovers;
03136 GtkWidget *number_of_columns_entry = lookup_widget (GTK_WIDGET (editable),
03137 "number_of_columns_entry");
03138 const gchar* number_of_columns_string = gtk_entry_get_text (GTK_ENTRY (number_of_columns_entry));
03139 number_of_columns = (int) g_ascii_strtod (number_of_columns_string, &leftovers);
03140 entry_has_changed (GTK_WIDGET (editable));
03141 number_of_pins_has_changed (GTK_WIDGET (editable));
03142 }
03143
03144
03159 void
03160 on_number_of_rows_entry_changed (GtkEditable *editable,
03161 gpointer user_data)
03162 {
03163 gchar *leftovers;
03164 GtkWidget *number_of_rows_entry = lookup_widget (GTK_WIDGET (editable),
03165 "number_of_rows_entry");
03166 const gchar* number_of_rows_string = gtk_entry_get_text (GTK_ENTRY (number_of_rows_entry));
03167 number_of_rows = (int) g_ascii_strtod (number_of_rows_string, &leftovers);
03168 entry_has_changed (GTK_WIDGET (editable));
03169 number_of_pins_has_changed (GTK_WIDGET (editable));
03170 }
03171
03172
03187 void
03188 on_number_total_pins_entry_changed (GtkEditable *editable,
03189 gpointer user_data)
03190 {
03191 gchar *leftovers;
03192 GtkWidget *number_total_pins_entry = lookup_widget (GTK_WIDGET (editable),
03193 "number_total_pins_entry");
03194 const gchar* number_of_pins_string = gtk_entry_get_text (GTK_ENTRY (number_total_pins_entry));
03195 number_of_pins = (int) g_ascii_strtod (number_of_pins_string, &leftovers);
03196 entry_has_changed (GTK_WIDGET (editable));
03197 }
03198
03199
03215 void
03216 on_open_button_clicked (GtkButton *button,
03217 gpointer user_data)
03218 {
03219 GtkWidget *filechooser_dialog = create_filechooser_dialog ();
03220 GtkFileFilter *file_filter = gtk_file_filter_new ();
03221 gtk_file_filter_set_name (file_filter, "fpw filter");
03222 gtk_file_filter_add_pattern (GTK_FILE_FILTER (file_filter), "*.fpw");
03223 gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (filechooser_dialog),
03224 GTK_FILE_FILTER (file_filter));
03225 gtk_widget_show (filechooser_dialog);
03226 }
03227
03228
03244 void
03245 on_package_body_height_entry_changed (GtkEditable *editable,
03246 gpointer user_data)
03247 {
03248 gchar *leftovers;
03249 GtkWidget *package_body_height_entry = lookup_widget (GTK_WIDGET (editable),
03250 "package_body_height_entry");
03251 const gchar* package_body_height_string = gtk_entry_get_text (GTK_ENTRY (package_body_height_entry));
03252 package_body_height = g_ascii_strtod (package_body_height_string, &leftovers);
03253 entry_has_changed (GTK_WIDGET (editable));
03254 }
03255
03256
03272 void
03273 on_package_body_length_entry_changed (GtkEditable *editable,
03274 gpointer user_data)
03275 {
03276 gchar *leftovers;
03277 GtkWidget *package_body_length_entry = lookup_widget (GTK_WIDGET (editable),
03278 "package_body_length_entry");
03279 const gchar* package_body_length_string = gtk_entry_get_text (GTK_ENTRY (package_body_length_entry));
03280 package_body_length = g_ascii_strtod (package_body_length_string, &leftovers);
03281 entry_has_changed (GTK_WIDGET (editable));
03282 }
03283
03284
03300 void
03301 on_package_body_width_entry_changed (GtkEditable *editable,
03302 gpointer user_data)
03303 {
03304 gchar *leftovers;
03305 GtkWidget *package_body_width_entry = lookup_widget (GTK_WIDGET (editable),
03306 "package_body_width_entry");
03307 const gchar* package_body_width_string = gtk_entry_get_text (GTK_ENTRY (package_body_width_entry));
03308 package_body_width = g_ascii_strtod (package_body_width_string, &leftovers);
03309 entry_has_changed (GTK_WIDGET (editable));
03310 }
03311
03312
03325 void
03326 on_package_is_radial_checkbutton_toggled
03327 (GtkToggleButton *togglebutton,
03328 gpointer user_data)
03329 {
03330 package_is_radial = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton));
03331 entry_has_changed (GTK_WIDGET (togglebutton));
03332 }
03333
03334
03350 void
03351 on_pad_clearance_entry_changed (GtkEditable *editable,
03352 gpointer user_data)
03353 {
03354 gchar *leftovers;
03355 GtkWidget *pad_clearance_entry = lookup_widget (GTK_WIDGET (editable),
03356 "pad_clearance_entry");
03357 const gchar* pad_clearance_string = gtk_entry_get_text (GTK_ENTRY (pad_clearance_entry));
03358 pad_clearance = g_ascii_strtod (pad_clearance_string, &leftovers);
03359 entry_has_changed (GTK_WIDGET (editable));
03360 }
03361
03362
03377 void
03378 on_pad_diameter_entry_changed (GtkEditable *editable,
03379 gpointer user_data)
03380 {
03381 gchar *leftovers;
03382 GtkWidget *pad_diameter_entry = lookup_widget (GTK_WIDGET (editable),
03383 "pad_diameter_entry");
03384 const gchar* pad_diameter_string = gtk_entry_get_text (GTK_ENTRY (pad_diameter_entry));
03385 pad_diameter = g_ascii_strtod (pad_diameter_string, &leftovers);
03386 entry_has_changed (GTK_WIDGET (editable));
03387 }
03388
03389
03405 void
03406 on_pad_length_entry_changed (GtkEditable *editable,
03407 gpointer user_data)
03408 {
03409 gchar *leftovers;
03410 GtkWidget *pad_length_entry = lookup_widget (GTK_WIDGET (editable),
03411 "pad_length_entry");
03412 const gchar* pad_length_string = gtk_entry_get_text (GTK_ENTRY (pad_length_entry));
03413 pad_length = g_ascii_strtod (pad_length_string, &leftovers);
03414 entry_has_changed (GTK_WIDGET (editable));
03415 }
03416
03417
03432 void
03433 on_pad_shape_entry_changed (GtkComboBox *combobox,
03434 gpointer user_data)
03435 {
03436 pad_shape = gtk_combo_box_get_active_text (GTK_COMBO_BOX (combobox));
03437 entry_has_changed (GTK_WIDGET (combobox));
03438
03439
03440
03441 if (!pad_shape)
03442 {
03443 gchar *message = g_strdup_printf (_("ERROR: pad shape not initialised (null pointer)."));
03444 message_to_statusbar (GTK_WIDGET (combobox), message);
03445 return;
03446 }
03447
03448
03449
03450 else if (!strcmp (pad_shape, ""))
03451 {
03452 gchar *message = g_strdup_printf (_("ERROR: pad shape contains an empty string."));
03453 message_to_statusbar (GTK_WIDGET (combobox), message);
03454 return;
03455 }
03456
03457 else if (update_pad_shapes_variables () == EXIT_FAILURE)
03458 {
03459 gchar *message = g_strdup_printf (_("ERROR: pad shape contains an unknown pad shape type."));
03460 message_to_statusbar (GTK_WIDGET (combobox), message);
03461 }
03462 else
03463 {
03464 gchar *message = g_strdup_printf ("");
03465 message_to_statusbar (GTK_WIDGET (combobox), message);
03466 }
03467 }
03468
03469
03485 void
03486 on_pad_solder_mask_clearance_entry_changed
03487 (GtkEditable *editable,
03488 gpointer user_data)
03489 {
03490 gchar *leftovers;
03491 GtkWidget *pad_solder_mask_clearance_entry = lookup_widget (GTK_WIDGET (editable),
03492 "pad_solder_mask_clearance_entry");
03493 const gchar* pad_SMC_string = gtk_entry_get_text (GTK_ENTRY (pad_solder_mask_clearance_entry));
03494 pad_solder_mask_clearance = g_ascii_strtod (pad_SMC_string, &leftovers);
03495 entry_has_changed (GTK_WIDGET (editable));
03496 }
03497
03498
03514 void
03515 on_pad_width_entry_changed (GtkEditable *editable,
03516 gpointer user_data)
03517 {
03518 gchar *leftovers;
03519 GtkWidget *pad_width_entry = lookup_widget (GTK_WIDGET (editable),
03520 "pad_width_entry");
03521 const gchar* pad_width_string = gtk_entry_get_text (GTK_ENTRY (pad_width_entry));
03522 pad_width = g_ascii_strtod (pad_width_string, &leftovers);
03523 entry_has_changed (GTK_WIDGET (editable));
03524 }
03525
03526
03538 void
03539 on_pcb_gfpw_destroy (GtkObject *object,
03540 gpointer user_data)
03541 {
03542 gtk_main_quit();
03543 }
03544
03545
03561 void
03562 on_pin_drill_diameter_entry_changed (GtkEditable *editable,
03563 gpointer user_data)
03564 {
03565 gchar *leftovers;
03566 GtkWidget *pin_drill_diameter_entry = lookup_widget (GTK_WIDGET (editable),
03567 "pin_drill_diameter_entry");
03568 const gchar* pin_drill_diameter_string = gtk_entry_get_text (GTK_ENTRY (pin_drill_diameter_entry));
03569 pin_drill_diameter = g_ascii_strtod (pin_drill_diameter_string, &leftovers);
03570 entry_has_changed (GTK_WIDGET (editable));
03571 }
03572
03573
03594 void
03595 on_pin_pad_exceptions_button_clicked (GtkButton *button,
03596 gpointer user_data)
03597 {
03598 if ((number_of_rows < 1) ||
03599 (number_of_columns < 1))
03600 {
03601 gchar *message = g_strdup_printf (_("Number of rows or columns is 0."));
03602 message_to_statusbar (GTK_WIDGET (button), message);
03603 return;
03604 }
03605 else
03606 {
03607
03608
03609 gint i;
03610 gint j;
03611 SelectionButtonSet *selection_button;
03612 gint selection_button_index = 0;
03613 for (i = 0; (i < MAX_ROWS); i++)
03614 {
03615 for (j = 0; (j < MAX_COLUMNS); j++)
03616 {
03617 selection_button = &selection_buttons[selection_button_index];
03618 selection_button->active = FALSE;
03619 selection_button_index++;
03620 }
03621 }
03622
03623
03624
03625 selection_button_index = 0;
03626 for (i = 0; (i < number_of_rows); i++)
03627 {
03628 for (j = 0; (j < number_of_columns); j++)
03629 {
03630 selection_button = &selection_buttons[selection_button_index];
03631 selection_button->id = selection_button_index;
03632 gchar *selection_button_name = g_strdup_printf ("%s%d",
03633 (row_letters[i]), (j + 1));
03634 selection_button->name = g_strdup (selection_button_name);
03635 selection_button->active = !get_pin_pad_exception
03636 (selection_button_name);
03637 selection_button_index++;
03638 g_free (selection_button_name);
03639 }
03640 }
03641 gchar *message = g_strdup ("");
03642 message_to_statusbar (GTK_WIDGET (button), message);
03643 select_exceptions_create_window (number_of_rows,
03644 number_of_columns);
03645 }
03646
03647 }
03648
03649
03665 void
03666 on_pin_pad_exceptions_entry_changed (GtkEditable *editable,
03667 gpointer user_data)
03668 {
03669 GtkWidget *pin_pad_exceptions_entry = lookup_widget (GTK_WIDGET (editable),
03670 "pin_pad_exceptions_entry");
03671 pin_pad_exceptions_string = g_strdup_printf (gtk_entry_get_text (GTK_ENTRY (pin_pad_exceptions_entry)));
03672 entry_has_changed (GTK_WIDGET (editable));
03673
03674 }
03675
03688 void
03689 on_pin_square_checkbutton_toggled (GtkToggleButton *togglebutton,
03690 gpointer user_data)
03691 {
03692
03693 pin1_square = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton));
03694 entry_has_changed (GTK_WIDGET (togglebutton));
03695 }
03696
03711 void
03712 on_pitch_x_entry_changed (GtkEditable *editable,
03713 gpointer user_data)
03714 {
03715 gchar *leftovers;
03716 GtkWidget *pitch_x_entry = lookup_widget (GTK_WIDGET (editable),
03717 "pitch_x_entry");
03718 const gchar* pitch_x_string = gtk_entry_get_text (GTK_ENTRY (pitch_x_entry));
03719 pitch_x = g_ascii_strtod (pitch_x_string, &leftovers);
03720 entry_has_changed (GTK_WIDGET (editable));
03721 }
03722
03723
03738 void
03739 on_pitch_y_entry_changed (GtkEditable *editable,
03740 gpointer user_data)
03741 {
03742 gchar *leftovers;
03743 GtkWidget *pitch_y_entry = lookup_widget (GTK_WIDGET (editable),
03744 "pitch_y_entry");
03745 const gchar* pitch_y_string = gtk_entry_get_text (GTK_ENTRY (pitch_y_entry));
03746 pitch_y = g_ascii_strtod (pitch_y_string, &leftovers);
03747 entry_has_changed (GTK_WIDGET (editable));
03748 }
03749
03750
03786 void
03787 on_preview_button_clicked (GtkButton *button,
03788 gpointer user_data)
03789 {
03793 }
03794
03795
03807 void
03808 on_refresh_button_clicked (GtkButton *button,
03809 gpointer user_data)
03810 {
03811 all_entries_need_updated (GTK_WIDGET (button));
03812 }
03813
03838 void
03839 on_save_button_clicked (GtkButton *button,
03840 gpointer user_data)
03841 {
03842
03843
03844
03845 if (!footprint_name)
03846 {
03847 gchar *message = g_strdup_printf (_("ERROR: footprint name not initialised (null pointer)."));
03848 message_to_statusbar (GTK_WIDGET (button), message);
03849 return;
03850 }
03851
03852
03853
03854 else if (!strcmp (footprint_name, ""))
03855 {
03856 gchar *message = g_strdup_printf (_("ERROR: footprint name contains an empty string."));
03857 message_to_statusbar (GTK_WIDGET (button), message);
03858 return;
03859 }
03860 else
03861 {
03862 gchar *message = g_strdup_printf ("");
03863 message_to_statusbar (GTK_WIDGET (button), message);
03864 }
03865
03866 footprint_filename = g_strdup (footprint_name);
03867 if (g_str_has_suffix (footprint_filename, fp_suffix))
03868 {
03869
03870
03871 }
03872 else
03873 {
03874
03875
03876 footprint_filename = g_strconcat (footprint_filename, ".fp", NULL);
03877 }
03878
03879 gchar *fpw_filename = g_strdup (footprint_name);
03880 if (g_str_has_suffix (fpw_filename, fp_suffix))
03881 {
03882
03883
03884
03885 fpw_filename = g_strconcat (fpw_filename, "w", NULL);
03886 }
03887 else
03888 {
03889 if (g_str_has_suffix (fpw_filename, fpw_suffix))
03890 {
03891
03892
03893
03894 }
03895 else
03896 {
03897
03898
03899 fpw_filename = g_strconcat (fpw_filename, ".fpw", NULL);
03900 }
03901 }
03902
03903
03904 if (write_footprintwizard_file (fpw_filename) == EXIT_SUCCESS)
03905 {
03906 change_main_window_title (GTK_WIDGET (button),
03907 g_strconcat ("pcb-gfpw : ",
03908 fpw_filename, NULL));
03909 main_window_title_has_asterisk = FALSE;
03910 fpw_file_saved = TRUE;
03911 }
03912 else
03913 {
03914 gchar *message = g_strdup_printf (_("ERROR: Unable to write footprintwizard file %s."), footprint_filename);
03915 message_to_statusbar (GTK_WIDGET (button), message);
03916 }
03917 }
03918
03919
03932 void
03933 on_silkscreen_indicate_1_checkbutton_toggled
03934 (GtkToggleButton *togglebutton,
03935 gpointer user_data)
03936 {
03937 silkscreen_indicate_1 = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton));
03938 entry_has_changed (GTK_WIDGET (togglebutton));
03939 }
03940
03941
03957 void
03958 on_silkscreen_line_width_entry_changed (GtkEditable *editable,
03959 gpointer user_data)
03960 {
03961 gchar *leftovers;
03962 GtkWidget *silkscreen_line_width_entry = lookup_widget (GTK_WIDGET (editable),
03963 "silkscreen_line_width_entry");
03964 const gchar* silkscreen_line_width_string = gtk_entry_get_text (GTK_ENTRY (silkscreen_line_width_entry));
03965 silkscreen_line_width = g_ascii_strtod (silkscreen_line_width_string, &leftovers);
03966 entry_has_changed (GTK_WIDGET (editable));
03967 }
03968
03969
03988 void
03989 on_silkscreen_package_outline_checkbutton_toggled
03990 (GtkToggleButton *togglebutton,
03991 gpointer user_data)
03992 {
03993
03994 silkscreen_package_outline = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton));
03995
03996 GtkWidget *silkscreen_line_width_entry = lookup_widget (GTK_WIDGET (togglebutton), "silkscreen_line_width_entry");
03997
03998
03999 gtk_widget_set_sensitive (silkscreen_line_width_entry, silkscreen_package_outline);
04000 entry_has_changed (GTK_WIDGET (togglebutton));
04001 }
04002
04003
04024 void
04025 on_thermal_checkbutton_toggled (GtkToggleButton *togglebutton,
04026 gpointer user_data)
04027 {
04028
04029 thermal = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton));
04030 entry_has_changed (GTK_WIDGET (togglebutton));
04031 number_of_pins_has_changed (GTK_WIDGET (togglebutton));
04032
04033 GtkWidget *thermal_nopaste_checkbutton = lookup_widget (GTK_WIDGET (togglebutton),
04034 "thermal_nopaste_checkbutton");
04035 GtkWidget *thermal_length_entry = lookup_widget (GTK_WIDGET (togglebutton),
04036 "thermal_length_entry");
04037 GtkWidget *thermal_width_entry = lookup_widget (GTK_WIDGET (togglebutton),
04038 "thermal_width_entry");
04039 GtkWidget *thermal_clearance_entry = lookup_widget (GTK_WIDGET (togglebutton),
04040 "thermal_clearance_entry");
04041 GtkWidget *thermal_solder_mask_clearance_entry = lookup_widget (GTK_WIDGET (togglebutton),
04042 "thermal_solder_mask_clearance_entry");
04043
04044
04045 gtk_widget_set_sensitive (thermal_nopaste_checkbutton, thermal);
04046 gtk_widget_set_sensitive (thermal_length_entry, thermal);
04047 gtk_widget_set_sensitive (thermal_width_entry, thermal);
04048 gtk_widget_set_sensitive (thermal_clearance_entry, thermal);
04049 gtk_widget_set_sensitive (thermal_solder_mask_clearance_entry, thermal);
04050
04051
04052
04053
04054 gtk_toggle_button_set_active ((void *) thermal_nopaste_checkbutton, thermal);
04055 }
04056
04057
04073 void
04074 on_thermal_clearance_entry_changed (GtkEditable *editable,
04075 gpointer user_data)
04076 {
04077 gchar *leftovers;
04078 GtkWidget *thermal_clearance_entry = lookup_widget (GTK_WIDGET (editable),
04079 "thermal_clearance_entry");
04080 const gchar* thermal_clearance_string = gtk_entry_get_text (GTK_ENTRY (thermal_clearance_entry));
04081 thermal_clearance = g_ascii_strtod (thermal_clearance_string, &leftovers);
04082 entry_has_changed (GTK_WIDGET (editable));
04083 }
04084
04085
04101 void
04102 on_thermal_length_entry_changed (GtkEditable *editable,
04103 gpointer user_data)
04104 {
04105 gchar *leftovers;
04106 GtkWidget *thermal_length_entry = lookup_widget (GTK_WIDGET (editable),
04107 "thermal_length_entry");
04108 const gchar* thermal_length_string = gtk_entry_get_text (GTK_ENTRY (thermal_length_entry));
04109 thermal_length = g_ascii_strtod (thermal_length_string, &leftovers);
04110 entry_has_changed (GTK_WIDGET (editable));
04111 }
04112
04113
04126 void
04127 on_thermal_nopaste_checkbutton_toggled (GtkToggleButton *togglebutton,
04128 gpointer user_data)
04129 {
04130 thermal_nopaste = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton));
04131 entry_has_changed (GTK_WIDGET (togglebutton));
04132 }
04133
04134
04150 void
04151 on_thermal_solder_mask_clearance_entry_changed
04152 (GtkEditable *editable,
04153 gpointer user_data)
04154 {
04155 gchar *leftovers;
04156 GtkWidget *thermal_solder_mask_clearance_entry = lookup_widget (GTK_WIDGET (editable),
04157 "thermal_solder_mask_clearance_entry");
04158 const gchar* SMC_string = gtk_entry_get_text (GTK_ENTRY (thermal_solder_mask_clearance_entry));
04159 thermal_solder_mask_clearance = g_ascii_strtod (SMC_string, &leftovers);
04160 entry_has_changed (GTK_WIDGET (editable));
04161 }
04162
04163
04179 void
04180 on_thermal_width_entry_changed (GtkEditable *editable,
04181 gpointer user_data)
04182 {
04183 gchar *leftovers;
04184 GtkWidget *thermal_width_entry = lookup_widget (GTK_WIDGET (editable),
04185 "thermal_width_entry");
04186 const gchar* thermal_width_string = gtk_entry_get_text (GTK_ENTRY (thermal_width_entry));
04187 thermal_width = g_ascii_strtod (thermal_width_string, &leftovers);
04188 entry_has_changed (GTK_WIDGET (editable));
04189 }
04190
04191