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.c"
00046 #include "preview.h"
00047 #include "select_exceptions.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_fiducial_widgets (GtkWidget *widget)
00868 {
00869 GtkWidget *fiducial_checkbutton = lookup_widget (GTK_WIDGET (widget),
00870 "fiducial_checkbutton");
00871 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (fiducial_checkbutton),
00872 FALSE);
00873 gtk_widget_set_sensitive (fiducial_checkbutton, FALSE);
00874 GtkWidget *fiducial_pad_diameter_entry = lookup_widget
00875 (GTK_WIDGET (widget),
00876 "fiducial_pad_diameter_entry");
00877 gtk_widget_set_sensitive (fiducial_pad_diameter_entry, FALSE);
00878 GtkWidget *fiducial_pad_clearance_entry = lookup_widget
00879 (GTK_WIDGET (widget),
00880 "fiducial_pad_clearance_entry");
00881 gtk_widget_set_sensitive (fiducial_pad_clearance_entry,
00882 FALSE);
00883 GtkWidget *fiducial_pad_solder_mask_clearance_entry = lookup_widget
00884 (GTK_WIDGET (widget),
00885 "fiducial_pad_solder_mask_clearance_entry");
00886 gtk_widget_set_sensitive (fiducial_pad_solder_mask_clearance_entry,
00887 FALSE);
00888 }
00889
00890
00899 int
00900 gui_constraints_disable_heel_and_toe_goals_tab_widgets (GtkWidget *widget)
00901 {
00902 GtkWidget *C1_entry = lookup_widget (GTK_WIDGET (widget),
00903 "C1_entry");
00904 gtk_entry_set_text (GTK_ENTRY (C1_entry), "");
00905 gtk_widget_set_sensitive (C1_entry, FALSE);
00906 GtkWidget *C2_entry = lookup_widget (GTK_WIDGET (widget),
00907 "C2_entry");
00908 gtk_entry_set_text (GTK_ENTRY (C2_entry), "");
00909 gtk_widget_set_sensitive (C2_entry, FALSE);
00910 GtkWidget *G1_entry = lookup_widget (GTK_WIDGET (widget),
00911 "G1_entry");
00912 gtk_entry_set_text (GTK_ENTRY (G1_entry), "");
00913 gtk_widget_set_sensitive (G1_entry, FALSE);
00914 GtkWidget *G2_entry = lookup_widget (GTK_WIDGET (widget),
00915 "G2_entry");
00916 gtk_entry_set_text (GTK_ENTRY (G2_entry), "");
00917 gtk_widget_set_sensitive (G2_entry, FALSE);
00918 GtkWidget *Z1_entry = lookup_widget (GTK_WIDGET (widget),
00919 "Z1_entry");
00920 gtk_entry_set_text (GTK_ENTRY (Z1_entry), "");
00921 gtk_widget_set_sensitive (Z1_entry, FALSE);
00922 GtkWidget *Z2_entry = lookup_widget (GTK_WIDGET (widget),
00923 "Z2_entry");
00924 gtk_entry_set_text (GTK_ENTRY (Z2_entry), "");
00925 gtk_widget_set_sensitive (Z2_entry, FALSE);
00926 GtkWidget * C1_radiobutton = lookup_widget (GTK_WIDGET (widget),
00927 "C1_radiobutton");
00928 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (C1_radiobutton), TRUE);
00929 gtk_widget_set_sensitive (C1_radiobutton, FALSE);
00930 GtkWidget * C2_radiobutton = lookup_widget (GTK_WIDGET (widget),
00931 "C2_radiobutton");
00932 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (C2_radiobutton), TRUE);
00933 gtk_widget_set_sensitive (C2_radiobutton, FALSE);
00934 GtkWidget * G1_radiobutton = lookup_widget (GTK_WIDGET (widget),
00935 "G1_radiobutton");
00936 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (G1_radiobutton), FALSE);
00937 gtk_widget_set_sensitive (G1_radiobutton, FALSE);
00938 GtkWidget * G2_radiobutton = lookup_widget (GTK_WIDGET (widget),
00939 "G2_radiobutton");
00940 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (G2_radiobutton), FALSE);
00941 gtk_widget_set_sensitive (G2_radiobutton, FALSE);
00942 GtkWidget * Z1_radiobutton = lookup_widget (GTK_WIDGET (widget),
00943 "Z1_radiobutton");
00944 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (Z1_radiobutton), FALSE);
00945 gtk_widget_set_sensitive (Z1_radiobutton, FALSE);
00946 GtkWidget * Z2_radiobutton = lookup_widget (GTK_WIDGET (widget),
00947 "Z2_radiobutton");
00948 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (Z2_radiobutton), FALSE);
00949 gtk_widget_set_sensitive (Z2_radiobutton, FALSE);
00950 }
00951
00952
00961 int
00962 gui_constraints_disable_thermal_pad_widgets (GtkWidget *widget)
00963 {
00964 GtkWidget *thermal_checkbutton = lookup_widget (GTK_WIDGET (widget),
00965 "thermal_checkbutton");
00966 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (thermal_checkbutton),
00967 FALSE);
00968 gtk_widget_set_sensitive (thermal_checkbutton, FALSE);
00969 GtkWidget *thermal_nopaste_checkbutton = lookup_widget
00970 (GTK_WIDGET (widget), "thermal_nopaste_checkbutton");
00971 gtk_widget_set_sensitive (GTK_WIDGET (thermal_nopaste_checkbutton),
00972 FALSE);
00973 GtkWidget *thermal_length_entry = lookup_widget (GTK_WIDGET (widget),
00974 "thermal_length_entry");
00975 gtk_widget_set_sensitive (thermal_length_entry, FALSE);
00976 GtkWidget *thermal_width_entry = lookup_widget (GTK_WIDGET (widget),
00977 "thermal_width_entry");
00978 gtk_widget_set_sensitive (thermal_width_entry, FALSE);
00979 GtkWidget *thermal_clearance_entry = lookup_widget (GTK_WIDGET
00980 (widget), "thermal_clearance_entry");
00981 gtk_widget_set_sensitive (thermal_clearance_entry, FALSE);
00982 GtkWidget *thermal_solder_mask_clearance_entry = lookup_widget
00983 (GTK_WIDGET (widget), "thermal_solder_mask_clearance_entry");
00984 gtk_widget_set_sensitive (thermal_solder_mask_clearance_entry, FALSE);
00985 }
00986
00987
00996 int
00997 gui_constraints_disable_thermal_tab_widgets (GtkWidget *widget)
00998 {
00999 GtkWidget *thermal_checkbutton = lookup_widget (GTK_WIDGET (widget),
01000 "thermal_checkbutton");
01001 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (thermal_checkbutton),
01002 FALSE);
01003 gtk_widget_set_sensitive (thermal_checkbutton, FALSE);
01004 GtkWidget *thermal_nopaste_checkbutton = lookup_widget
01005 (GTK_WIDGET (widget), "thermal_nopaste_checkbutton");
01006 gtk_widget_set_sensitive (GTK_WIDGET (thermal_nopaste_checkbutton),
01007 FALSE);
01008 GtkWidget *thermal_length_entry = lookup_widget (GTK_WIDGET (widget),
01009 "thermal_length_entry");
01010 gtk_widget_set_sensitive (thermal_length_entry, FALSE);
01011 GtkWidget *thermal_width_entry = lookup_widget (GTK_WIDGET (widget),
01012 "thermal_width_entry");
01013 gtk_widget_set_sensitive (thermal_width_entry, FALSE);
01014 GtkWidget *thermal_clearance_entry = lookup_widget (GTK_WIDGET
01015 (widget), "thermal_clearance_entry");
01016 gtk_widget_set_sensitive (thermal_clearance_entry, FALSE);
01017 GtkWidget *thermal_solder_mask_clearance_entry = lookup_widget
01018 (GTK_WIDGET (widget), "thermal_solder_mask_clearance_entry");
01019 gtk_widget_set_sensitive (thermal_solder_mask_clearance_entry, FALSE);
01020 GtkWidget *fiducial_checkbutton = lookup_widget (GTK_WIDGET (widget),
01021 "fiducial_checkbutton");
01022 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (fiducial_checkbutton),
01023 FALSE);
01024 gtk_widget_set_sensitive (fiducial_checkbutton, FALSE);
01025 GtkWidget *fiducial_pad_diameter_entry = lookup_widget
01026 (GTK_WIDGET (widget),
01027 "fiducial_pad_diameter_entry");
01028 gtk_widget_set_sensitive (fiducial_pad_diameter_entry, FALSE);
01029 GtkWidget *fiducial_pad_clearance_entry = lookup_widget
01030 (GTK_WIDGET (widget),
01031 "fiducial_pad_clearance_entry");
01032 gtk_widget_set_sensitive (fiducial_pad_clearance_entry,
01033 FALSE);
01034 GtkWidget *fiducial_pad_solder_mask_clearance_entry = lookup_widget
01035 (GTK_WIDGET (widget),
01036 "fiducial_pad_solder_mask_clearance_entry");
01037 gtk_widget_set_sensitive (fiducial_pad_solder_mask_clearance_entry,
01038 FALSE);
01039 }
01040
01041
01052 int
01053 message_to_statusbar (GtkWidget *widget, gchar *message)
01054 {
01055
01056 GtkStatusbar *statusbar = GTK_STATUSBAR (lookup_widget (GTK_WIDGET (widget),
01057 "statusbar"));
01058 guint context_id;
01059 guint message_id;
01060 context_id = gtk_statusbar_get_context_id (statusbar, message);
01061 message_id = gtk_statusbar_push (statusbar, context_id, message);
01062 }
01063
01064
01081 int
01082 number_of_pins_has_changed (GtkWidget *widget)
01083 {
01084
01085
01086 number_of_pins = get_total_number_of_pins ();
01087
01088 GtkWidget *number_total_pins_entry = lookup_widget (GTK_WIDGET (widget),
01089 "number_total_pins_entry");
01090 gtk_entry_set_text (GTK_ENTRY (number_total_pins_entry),
01091 g_strdup_printf ("%d", number_of_pins));
01092 }
01093
01094
01110 void
01111 on_C1_entry_changed (GtkEditable *editable,
01112 gpointer user_data)
01113 {
01114 gchar *leftovers;
01115 GtkWidget *C1_entry = lookup_widget (GTK_WIDGET (editable),
01116 "C1_entry");
01117 const gchar* C1_string = gtk_entry_get_text (GTK_ENTRY (C1_entry));
01118 c1 = g_ascii_strtod (C1_string, &leftovers);
01119 entry_has_changed (GTK_WIDGET (editable));
01120 }
01121
01122
01139 void
01140 on_C1_radiobutton_toggled (GtkToggleButton *togglebutton,
01141 gpointer user_data)
01142 {
01143 c1_state = gtk_toggle_button_get_active (togglebutton);
01144 g1_state = !c1_state;
01145 z1_state = !c1_state;
01146 GtkWidget *C1_entry = lookup_widget (GTK_WIDGET (togglebutton), "C1_entry");
01147 gtk_widget_set_sensitive (C1_entry, TRUE);
01148 GtkWidget *G1_entry = lookup_widget (GTK_WIDGET (togglebutton), "G1_entry");
01149 gtk_widget_set_sensitive (G1_entry, FALSE);
01150 GtkWidget *Z1_entry = lookup_widget (GTK_WIDGET (togglebutton), "Z1_entry");
01151 gtk_widget_set_sensitive (Z1_entry, FALSE);
01152 }
01153
01154
01170 void
01171 on_C2_entry_changed (GtkEditable *editable,
01172 gpointer user_data)
01173 {
01174 gchar *leftovers;
01175 GtkWidget *C2_entry = lookup_widget (GTK_WIDGET (editable),
01176 "C2_entry");
01177 const gchar* C2_string = gtk_entry_get_text (GTK_ENTRY (C2_entry));
01178 c2 = g_ascii_strtod (C2_string, &leftovers);
01179 entry_has_changed (GTK_WIDGET (editable));
01180 }
01181
01182
01199 void
01200 on_C2_radiobutton_toggled (GtkToggleButton *togglebutton,
01201 gpointer user_data)
01202 {
01203 c2_state = gtk_toggle_button_get_active (togglebutton);
01204 g2_state = !c2_state;
01205 z2_state = !c2_state;
01206 GtkWidget *C2_entry = lookup_widget (GTK_WIDGET (togglebutton), "C2_entry");
01207 gtk_widget_set_sensitive (C2_entry, TRUE);
01208 GtkWidget *G2_entry = lookup_widget (GTK_WIDGET (togglebutton), "G2_entry");
01209 gtk_widget_set_sensitive (G2_entry, FALSE);
01210 GtkWidget *Z2_entry = lookup_widget (GTK_WIDGET (togglebutton), "Z2_entry");
01211 gtk_widget_set_sensitive (Z2_entry, FALSE);
01212 }
01213
01214
01230 void
01231 on_G1_entry_changed (GtkEditable *editable,
01232 gpointer user_data)
01233 {
01234 gchar *leftovers;
01235 GtkWidget *G1_entry = lookup_widget (GTK_WIDGET (editable),
01236 "G1_entry");
01237 const gchar* G1_string = gtk_entry_get_text (GTK_ENTRY (G1_entry));
01238 g1 = g_ascii_strtod (G1_string, &leftovers);
01239 entry_has_changed (GTK_WIDGET (editable));
01240 }
01241
01242
01259 void
01260 on_G1_radiobutton_toggled (GtkToggleButton *togglebutton,
01261 gpointer user_data)
01262 {
01263 g1_state = gtk_toggle_button_get_active (togglebutton);
01264 c1_state = !g1_state;
01265 z1_state = !g1_state;
01266 GtkWidget *C1_entry = lookup_widget (GTK_WIDGET (togglebutton), "C1_entry");
01267 gtk_widget_set_sensitive (C1_entry, FALSE);
01268 GtkWidget *G1_entry = lookup_widget (GTK_WIDGET (togglebutton), "G1_entry");
01269 gtk_widget_set_sensitive (G1_entry, TRUE);
01270 GtkWidget *Z1_entry = lookup_widget (GTK_WIDGET (togglebutton), "Z1_entry");
01271 gtk_widget_set_sensitive (Z1_entry, FALSE);
01272 }
01273
01274
01290 void
01291 on_G2_entry_changed (GtkEditable *editable,
01292 gpointer user_data)
01293 {
01294 gchar *leftovers;
01295 GtkWidget *G2_entry = lookup_widget (GTK_WIDGET (editable),
01296 "G2_entry");
01297 const gchar* G2_string = gtk_entry_get_text (GTK_ENTRY (G2_entry));
01298 g2 = g_ascii_strtod (G2_string, &leftovers);
01299 entry_has_changed (GTK_WIDGET (editable));
01300 }
01301
01302
01319 void
01320 on_G2_radiobutton_toggled (GtkToggleButton *togglebutton,
01321 gpointer user_data)
01322 {
01323 g2_state = gtk_toggle_button_get_active (togglebutton);
01324 c2_state = !g2_state;
01325 z2_state = !g2_state;
01326 GtkWidget *C2_entry = lookup_widget (GTK_WIDGET (togglebutton), "C2_entry");
01327 gtk_widget_set_sensitive (C2_entry, FALSE);
01328 GtkWidget *G2_entry = lookup_widget (GTK_WIDGET (togglebutton), "G2_entry");
01329 gtk_widget_set_sensitive (G2_entry, TRUE);
01330 GtkWidget *Z2_entry = lookup_widget (GTK_WIDGET (togglebutton), "Z2_entry");
01331 gtk_widget_set_sensitive (Z2_entry, FALSE);
01332 }
01333
01334
01350 void
01351 on_Z1_entry_changed (GtkEditable *editable,
01352 gpointer user_data)
01353 {
01354 gchar *leftovers;
01355 GtkWidget *Z1_entry = lookup_widget (GTK_WIDGET (editable),
01356 "Z1_entry");
01357 const gchar* Z1_string = gtk_entry_get_text (GTK_ENTRY (Z1_entry));
01358 z1 = g_ascii_strtod (Z1_string, &leftovers);
01359 entry_has_changed (GTK_WIDGET (editable));
01360 }
01361
01362
01379 void
01380 on_Z1_radiobutton_toggled (GtkToggleButton *togglebutton,
01381 gpointer user_data)
01382 {
01383 z1_state = gtk_toggle_button_get_active (togglebutton);
01384 c1_state = !z1_state;
01385 g1_state = !z1_state;
01386 GtkWidget *C1_entry = lookup_widget (GTK_WIDGET (togglebutton), "C1_entry");
01387 gtk_widget_set_sensitive (C1_entry, FALSE);
01388 GtkWidget *G1_entry = lookup_widget (GTK_WIDGET (togglebutton), "G1_entry");
01389 gtk_widget_set_sensitive (G1_entry, FALSE);
01390 GtkWidget *Z1_entry = lookup_widget (GTK_WIDGET (togglebutton), "Z1_entry");
01391 gtk_widget_set_sensitive (Z1_entry, TRUE);
01392 }
01393
01394
01410 void
01411 on_Z2_entry_changed (GtkEditable *editable,
01412 gpointer user_data)
01413 {
01414 gchar *leftovers;
01415 GtkWidget *Z2_entry = lookup_widget (GTK_WIDGET (editable),
01416 "Z2_entry");
01417 const gchar* Z2_string = gtk_entry_get_text (GTK_ENTRY (Z2_entry));
01418 z2 = g_ascii_strtod (Z2_string, &leftovers);
01419 entry_has_changed (GTK_WIDGET (editable));
01420 }
01421
01422
01439 void
01440 on_Z2_radiobutton_toggled (GtkToggleButton *togglebutton,
01441 gpointer user_data)
01442 {
01443 z2_state = gtk_toggle_button_get_active (togglebutton);
01444 c2_state = !z2_state;
01445 g2_state = !z2_state;
01446 GtkWidget *C2_entry = lookup_widget (GTK_WIDGET (togglebutton), "C2_entry");
01447 gtk_widget_set_sensitive (C2_entry, FALSE);
01448 GtkWidget *G2_entry = lookup_widget (GTK_WIDGET (togglebutton), "G2_entry");
01449 gtk_widget_set_sensitive (G2_entry, FALSE);
01450 GtkWidget *Z2_entry = lookup_widget (GTK_WIDGET (togglebutton), "Z2_entry");
01451 gtk_widget_set_sensitive (Z2_entry, TRUE);
01452 }
01453
01454
01464 void
01465 on_about_dialog_close (GtkDialog *dialog,
01466 gint response_id,
01467 gpointer user_data)
01468 {
01469 GtkWidget *about_dialog = lookup_widget (GTK_WIDGET (dialog),
01470 "about_dialog");
01471 gtk_widget_destroy (about_dialog);
01472 }
01473
01474
01484 void
01485 on_about_dialog_destroy (GtkObject *object,
01486 gpointer user_data)
01487 {
01488 GtkWidget *about_dialog = lookup_widget (GTK_WIDGET (object),
01489 "about_dialog");
01490 gtk_widget_destroy (about_dialog);
01491 }
01492
01493
01508 void
01509 on_add_attribs_checkbutton_toggled (GtkToggleButton *togglebutton,
01510 gpointer user_data)
01511 {
01512 attributes_in_footprint = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton));
01513 }
01514
01515
01530 void
01531 on_add_license_checkbutton_toggled (GtkToggleButton *togglebutton,
01532 gpointer user_data)
01533 {
01534 license_in_footprint = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton));
01535 }
01536
01537
01556 void
01557 on_clear_button_clicked (GtkButton *button,
01558 gpointer user_data)
01559 {
01560 entry_has_changed (GTK_WIDGET (button));
01561
01562 GtkWidget *footprint_type_entry = lookup_widget (GTK_WIDGET (button),
01563 "footprint_type_entry");
01564 gtk_combo_box_set_active (GTK_COMBO_BOX (footprint_type_entry), 0);
01565 GtkWidget *footprint_name_entry = lookup_widget (GTK_WIDGET (button),
01566 "footprint_name_entry");
01567 gtk_entry_set_text (GTK_ENTRY (footprint_name_entry), "");
01568 GtkWidget *footprint_units_entry = lookup_widget (GTK_WIDGET (button),
01569 "footprint_units_entry");
01570 gtk_combo_box_set_active (GTK_COMBO_BOX (footprint_units_entry), 0);
01571 GtkWidget *footprint_refdes_entry = lookup_widget (GTK_WIDGET (button),
01572 "footprint_refdes_entry");
01573 gtk_entry_set_text (GTK_ENTRY (footprint_refdes_entry), "");
01574 GtkWidget *footprint_value_entry = lookup_widget (GTK_WIDGET (button),
01575 "footprint_value_entry");
01576 gtk_entry_set_text (GTK_ENTRY (footprint_value_entry), "");
01577 GtkWidget *package_body_length_entry = lookup_widget (GTK_WIDGET (button),
01578 "package_body_length_entry");
01579 gtk_entry_set_text (GTK_ENTRY (package_body_length_entry), "");
01580 GtkWidget *package_body_width_entry = lookup_widget (GTK_WIDGET (button),
01581 "package_body_width_entry");
01582 gtk_entry_set_text (GTK_ENTRY (package_body_width_entry), "");
01583 GtkWidget *package_body_height_entry = lookup_widget (GTK_WIDGET (button),
01584 "package_body_height_entry");
01585 gtk_entry_set_text (GTK_ENTRY (package_body_height_entry), "");
01586 GtkWidget *package_is_radial_checkbutton = lookup_widget (GTK_WIDGET (button),
01587 "package_is_radial_checkbutton");
01588 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (package_is_radial_checkbutton), FALSE);
01589 GtkWidget *footprint_author_entry = lookup_widget (GTK_WIDGET (button),
01590 "footprint_author_entry");
01591 gtk_entry_set_text (GTK_ENTRY (footprint_author_entry), "");
01592 GtkWidget *footprint_dist_license_entry = lookup_widget (GTK_WIDGET (button),
01593 "footprint_dist_license_entry");
01594 gtk_entry_set_text (GTK_ENTRY (footprint_dist_license_entry), "");
01595 GtkWidget *footprint_use_license_entry = lookup_widget (GTK_WIDGET (button),
01596 "footprint_use_license_entry");
01597 gtk_entry_set_text (GTK_ENTRY (footprint_use_license_entry), "");
01598 GtkWidget *footprint_status_entry = lookup_widget (GTK_WIDGET (button),
01599 "footprint_status_entry");
01600 gtk_combo_box_set_active (GTK_COMBO_BOX (footprint_status_entry), 0);
01601
01602
01603 GtkWidget *number_total_pins_entry = lookup_widget (GTK_WIDGET (button),
01604 "number_total_pins_entry");
01605 gtk_entry_set_text (GTK_ENTRY (number_total_pins_entry), "");
01606 GtkWidget *number_of_rows_entry = lookup_widget (GTK_WIDGET (button),
01607 "number_of_rows_entry");
01608 gtk_entry_set_text (GTK_ENTRY (number_of_rows_entry), "");
01609 GtkWidget *number_of_columns_entry = lookup_widget (GTK_WIDGET (button),
01610 "number_of_columns_entry");
01611 gtk_entry_set_text (GTK_ENTRY (number_of_columns_entry), "");
01612 GtkWidget *pitch_x_entry = lookup_widget (GTK_WIDGET (button),
01613 "pitch_x_entry");
01614 gtk_entry_set_text (GTK_ENTRY (pitch_x_entry), "");
01615 GtkWidget *pitch_y_entry = lookup_widget (GTK_WIDGET (button),
01616 "pitch_y_entry");
01617 gtk_entry_set_text (GTK_ENTRY (pitch_y_entry), "");
01618 GtkWidget *count_x_entry = lookup_widget (GTK_WIDGET (button),
01619 "count_x_entry");
01620 gtk_entry_set_text (GTK_ENTRY (count_x_entry), "");
01621 GtkWidget *count_y_entry = lookup_widget (GTK_WIDGET (button),
01622 "count_y_entry");
01623 gtk_entry_set_text (GTK_ENTRY (count_y_entry), "");
01624 GtkWidget *pad_shape_entry = lookup_widget (GTK_WIDGET (button),
01625 "pad_shape_entry");
01626 gtk_combo_box_set_active (GTK_COMBO_BOX (pad_shape_entry), 0);
01627 GtkWidget *number_1_position_entry = lookup_widget (GTK_WIDGET (button),
01628 "number_1_position_entry");
01629 gtk_combo_box_set_active (GTK_COMBO_BOX (number_1_position_entry), 0);
01630 GtkWidget *pad_diameter_entry = lookup_widget (GTK_WIDGET (button),
01631 "pad_diameter_entry");
01632 gtk_entry_set_text (GTK_ENTRY (pad_diameter_entry), "");
01633 GtkWidget *pin_drill_diameter_entry = lookup_widget (GTK_WIDGET (button),
01634 "pin_drill_diameter_entry");
01635 gtk_entry_set_text (GTK_ENTRY (pin_drill_diameter_entry), "");
01636 GtkWidget *pin1_square_checkbutton = lookup_widget (GTK_WIDGET (button),
01637 "pin_square_checkbutton");
01638 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pin1_square_checkbutton), FALSE);
01639 GtkWidget *pad_length_entry = lookup_widget (GTK_WIDGET (button),
01640 "pad_length_entry");
01641 gtk_entry_set_text (GTK_ENTRY (pad_length_entry), "");
01642 GtkWidget *pad_width_entry = lookup_widget (GTK_WIDGET (button),
01643 "pad_width_entry");
01644 gtk_entry_set_text (GTK_ENTRY (pad_width_entry), "");
01645 GtkWidget *pad_clearance_entry = lookup_widget (GTK_WIDGET (button),
01646 "pad_clearance_entry");
01647 gtk_entry_set_text (GTK_ENTRY (pad_clearance_entry), "");
01648 GtkWidget *pad_solder_mask_clearance_entry = lookup_widget (GTK_WIDGET (button),
01649 "pad_solder_mask_clearance_entry");
01650 gtk_entry_set_text (GTK_ENTRY (pad_solder_mask_clearance_entry), "");
01651
01652
01653 GtkWidget *thermal_checkbutton = lookup_widget (GTK_WIDGET (button),
01654 "thermal_checkbutton");
01655 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (thermal_checkbutton), FALSE);
01656 GtkWidget *thermal_nopaste_checkbutton = lookup_widget (GTK_WIDGET (button),
01657 "thermal_nopaste_checkbutton");
01658 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (thermal_nopaste_checkbutton), FALSE);
01659 GtkWidget *thermal_length_entry = lookup_widget (GTK_WIDGET (button),
01660 "thermal_length_entry");
01661 gtk_entry_set_text (GTK_ENTRY (thermal_length_entry), "");
01662 gtk_widget_set_sensitive (thermal_length_entry, FALSE);
01663 GtkWidget *thermal_width_entry = lookup_widget (GTK_WIDGET (button),
01664 "thermal_width_entry");
01665 gtk_entry_set_text (GTK_ENTRY (thermal_width_entry), "");
01666 gtk_widget_set_sensitive (thermal_width_entry, FALSE);
01667 GtkWidget *thermal_clearance_entry = lookup_widget (GTK_WIDGET (button),
01668 "thermal_clearance_entry");
01669 gtk_entry_set_text (GTK_ENTRY (thermal_clearance_entry), "");
01670 gtk_widget_set_sensitive (thermal_clearance_entry, FALSE);
01671 GtkWidget *thermal_solder_mask_clearance_entry = lookup_widget (GTK_WIDGET (button),
01672 "thermal_solder_mask_clearance_entry");
01673 gtk_entry_set_text (GTK_ENTRY (thermal_solder_mask_clearance_entry), "");
01674 gtk_widget_set_sensitive (thermal_solder_mask_clearance_entry, FALSE);
01675
01676
01677 GtkWidget *silkscreen_package_outline_checkbutton = lookup_widget (GTK_WIDGET (button),
01678 "silkscreen_package_outline_checkbutton");
01679 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (silkscreen_package_outline_checkbutton), FALSE);
01680 GtkWidget *silkscreen_line_width_entry = lookup_widget (GTK_WIDGET (button),
01681 "silkscreen_line_width_entry");
01682 gtk_entry_set_text (GTK_ENTRY (silkscreen_line_width_entry), "");
01683 GtkWidget *silkscreen_indicate_1_checkbutton = lookup_widget (GTK_WIDGET (button),
01684 "silkscreen_indicate_1_checkbutton");
01685 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (silkscreen_indicate_1_checkbutton), FALSE);
01686 GtkWidget *courtyard_checkbutton = lookup_widget (GTK_WIDGET (button),
01687 "courtyard_checkbutton");
01688 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (courtyard_checkbutton), FALSE);
01689 GtkWidget *courtyard_length_entry = lookup_widget (GTK_WIDGET (button),
01690 "courtyard_length_entry");
01691 gtk_entry_set_text (GTK_ENTRY (courtyard_length_entry), "");
01692 GtkWidget *courtyard_width_entry = lookup_widget (GTK_WIDGET (button),
01693 "courtyard_width_entry");
01694 gtk_entry_set_text (GTK_ENTRY (courtyard_width_entry), "");
01695 GtkWidget *courtyard_line_width_entry = lookup_widget (GTK_WIDGET (button),
01696 "courtyard_line_width_entry");
01697 gtk_entry_set_text (GTK_ENTRY (courtyard_line_width_entry), "");
01698 GtkWidget *courtyard_clearance_with_package_entry = lookup_widget (GTK_WIDGET (button),
01699 "courtyard_clearance_with_package_entry");
01700 gtk_entry_set_text (GTK_ENTRY (courtyard_clearance_with_package_entry), "");
01701
01702
01703 GtkWidget *C1_entry = lookup_widget (GTK_WIDGET (button),
01704 "C1_entry");
01705 gtk_entry_set_text (GTK_ENTRY (C1_entry), "");
01706 gtk_widget_set_sensitive (C1_entry, TRUE);
01707 GtkWidget *C2_entry = lookup_widget (GTK_WIDGET (button),
01708 "C2_entry");
01709 gtk_entry_set_text (GTK_ENTRY (C2_entry), "");
01710 gtk_widget_set_sensitive (C2_entry, TRUE);
01711 GtkWidget *G1_entry = lookup_widget (GTK_WIDGET (button),
01712 "G1_entry");
01713 gtk_entry_set_text (GTK_ENTRY (G1_entry), "");
01714 gtk_widget_set_sensitive (G1_entry, FALSE);
01715 GtkWidget *G2_entry = lookup_widget (GTK_WIDGET (button),
01716 "G2_entry");
01717 gtk_entry_set_text (GTK_ENTRY (G2_entry), "");
01718 gtk_widget_set_sensitive (G2_entry, FALSE);
01719 GtkWidget *Z1_entry = lookup_widget (GTK_WIDGET (button),
01720 "Z1_entry");
01721 gtk_entry_set_text (GTK_ENTRY (Z1_entry), "");
01722 gtk_widget_set_sensitive (Z1_entry, FALSE);
01723 GtkWidget *Z2_entry = lookup_widget (GTK_WIDGET (button),
01724 "Z2_entry");
01725 gtk_entry_set_text (GTK_ENTRY (Z2_entry), "");
01726 gtk_widget_set_sensitive (Z2_entry, FALSE);
01727 GtkWidget *C1_radiobutton = lookup_widget (GTK_WIDGET (button),
01728 "C1_radiobutton");
01729 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (C1_radiobutton), TRUE);
01730 GtkWidget *C2_radiobutton = lookup_widget (GTK_WIDGET (button),
01731 "C2_radiobutton");
01732 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (C2_radiobutton), TRUE);
01733 GtkWidget *G1_radiobutton = lookup_widget (GTK_WIDGET (button),
01734 "G1_radiobutton");
01735 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (G1_radiobutton), FALSE);
01736 GtkWidget *G2_radiobutton = lookup_widget (GTK_WIDGET (button),
01737 "G2_radiobutton");
01738 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (G2_radiobutton), FALSE);
01739 GtkWidget *Z1_radiobutton = lookup_widget (GTK_WIDGET (button),
01740 "Z1_radiobutton");
01741 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (Z1_radiobutton), FALSE);
01742 GtkWidget *Z2_radiobutton = lookup_widget (GTK_WIDGET (button),
01743 "Z2_radiobutton");
01744 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (Z2_radiobutton), FALSE);
01745 }
01746
01747
01759 void
01760 on_close_button_clicked (GtkButton *button,
01761 gpointer user_data)
01762 {
01763 gtk_main_quit();
01764 }
01765
01766
01782 void
01783 on_count_x_entry_changed (GtkEditable *editable,
01784 gpointer user_data)
01785 {
01786 gchar *leftovers;
01787 GtkWidget *count_x_entry = lookup_widget (GTK_WIDGET (editable),
01788 "count_x_entry");
01789 const gchar* count_x_string = gtk_entry_get_text (GTK_ENTRY (count_x_entry));
01790 count_x = (int) g_ascii_strtod (count_x_string, &leftovers);
01791 entry_has_changed (GTK_WIDGET (editable));
01792 number_of_pins_has_changed (GTK_WIDGET (editable));
01793 }
01794
01795
01811 void
01812 on_count_y_entry_changed (GtkEditable *editable,
01813 gpointer user_data)
01814 {
01815 gchar *leftovers;
01816 GtkWidget *count_y_entry = lookup_widget (GTK_WIDGET (editable),
01817 "count_y_entry");
01818 const gchar* count_y_string = gtk_entry_get_text (GTK_ENTRY (count_y_entry));
01819 count_y = (int) g_ascii_strtod (count_y_string, &leftovers);
01820 entry_has_changed (GTK_WIDGET (editable));
01821 number_of_pins_has_changed (GTK_WIDGET (editable));
01822 }
01823
01824
01839 void
01840 on_courtyard_checkbutton_toggled (GtkToggleButton *togglebutton,
01841 gpointer user_data)
01842 {
01843 courtyard = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton));
01844 GtkWidget *courtyard_line_width_entry = lookup_widget (GTK_WIDGET (togglebutton),
01845 "courtyard_line_width_entry");
01846 gtk_widget_set_sensitive (courtyard_line_width_entry, courtyard);
01847 GtkWidget *courtyard_length_entry = lookup_widget (GTK_WIDGET (togglebutton),
01848 "courtyard_length_entry");
01849 gtk_widget_set_sensitive (courtyard_length_entry, courtyard);
01850 GtkWidget *courtyard_width_entry = lookup_widget (GTK_WIDGET (togglebutton),
01851 "courtyard_width_entry");
01852 gtk_widget_set_sensitive (courtyard_width_entry, courtyard);
01853 GtkWidget *courtyard_clearance_with_package_entry = lookup_widget (GTK_WIDGET (togglebutton),
01854 "courtyard_clearance_with_package_entry");
01855 gtk_widget_set_sensitive (courtyard_clearance_with_package_entry, courtyard);
01856 entry_has_changed (GTK_WIDGET (togglebutton));
01857 }
01858
01859
01875 void
01876 on_courtyard_clearance_with_package_entry_changed
01877 (GtkEditable *editable,
01878 gpointer user_data)
01879 {
01880 gchar *leftovers;
01881 GtkWidget *courtyard_clearance_with_package_entry = lookup_widget (GTK_WIDGET (editable),
01882 "courtyard_clearance_with_package_entry");
01883 const gchar* courtyard_clearance_with_package_string = gtk_entry_get_text (GTK_ENTRY (courtyard_clearance_with_package_entry));
01884 courtyard_clearance_with_package = g_ascii_strtod (courtyard_clearance_with_package_string, &leftovers);
01885 entry_has_changed (GTK_WIDGET (editable));
01886 }
01887
01888
01904 void
01905 on_courtyard_length_entry_changed (GtkEditable *editable,
01906 gpointer user_data)
01907 {
01908 gchar *leftovers;
01909 GtkWidget *courtyard_length_entry = lookup_widget (GTK_WIDGET (editable),
01910 "courtyard_length_entry");
01911 const gchar* courtyard_length_string = gtk_entry_get_text (GTK_ENTRY (courtyard_length_entry));
01912 courtyard_length = g_ascii_strtod (courtyard_length_string, &leftovers);
01913 entry_has_changed (GTK_WIDGET (editable));
01914 }
01915
01916
01932 void
01933 on_courtyard_line_width_entry_changed (GtkEditable *editable,
01934 gpointer user_data)
01935 {
01936 gchar *leftovers;
01937 GtkWidget *courtyard_line_width_entry = lookup_widget (GTK_WIDGET (editable),
01938 "courtyard_line_width_entry");
01939 const gchar* courtyard_line_width_string = gtk_entry_get_text (GTK_ENTRY (courtyard_line_width_entry));
01940 courtyard_line_width = g_ascii_strtod (courtyard_line_width_string, &leftovers);
01941 entry_has_changed (GTK_WIDGET (editable));
01942 }
01943
01944
01960 void
01961 on_courtyard_width_entry_changed (GtkEditable *editable,
01962 gpointer user_data)
01963 {
01964 gchar *leftovers;
01965 GtkWidget *courtyard_width_entry = lookup_widget (GTK_WIDGET (editable),
01966 "courtyard_width_entry");
01967 const gchar* courtyard_width_string = gtk_entry_get_text (GTK_ENTRY (courtyard_width_entry));
01968 courtyard_width = g_ascii_strtod (courtyard_width_string, &leftovers);
01969 entry_has_changed (GTK_WIDGET (editable));
01970 }
01971
01972
01985 void
01986 on_dimensions_button_clicked (GtkButton *button,
01987 gpointer user_data)
01988 {
01989 gchar *image_filename = g_strconcat
01990 (
01991 "pixmaps/", footprint_type, ".xpm", NULL
01992 );
01993 if (g_file_test (image_filename, G_FILE_TEST_EXISTS))
01994 {
01995 if (verbose)
01996 g_log ("", G_LOG_LEVEL_INFO,
01997 g_strdup_printf (_("loading image file: %s"),
01998 image_filename));
01999 dimensions_create_window (image_filename, footprint_type);
02000 }
02001 else
02002 {
02003 if (verbose)
02004 g_log ("", G_LOG_LEVEL_WARNING,
02005 g_strdup_printf (_("image file: %s does not exist."), image_filename));
02006 }
02007 g_free (image_filename);
02008 }
02009
02010
02028 void
02029 on_fiducial_checkbutton_toggled (GtkToggleButton *togglebutton,
02030 gpointer user_data)
02031 {
02032 fiducial = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton));
02033 GtkWidget *fiducial_pad_diameter_entry = lookup_widget (GTK_WIDGET (togglebutton),
02034 "fiducial_pad_diameter_entry");
02035 gtk_widget_set_sensitive (fiducial_pad_diameter_entry, fiducial);
02036 GtkWidget *fiducial_pad_clearance_entry = lookup_widget (GTK_WIDGET (togglebutton),
02037 "fiducial_pad_clearance_entry");
02038 gtk_widget_set_sensitive (fiducial_pad_clearance_entry, fiducial);
02039 GtkWidget *fiducial_pad_soldermask_clearance_entry = lookup_widget
02040 (GTK_WIDGET (togglebutton),
02041 "fiducial_pad_solder_mask_clearance_entry");
02042 gtk_widget_set_sensitive (fiducial_pad_soldermask_clearance_entry, fiducial);
02043 entry_has_changed (GTK_WIDGET (togglebutton));
02044 }
02045
02046
02063 void
02064 on_fiducial_pad_clearance_entry_changed
02065 (GtkEditable *editable,
02066 gpointer user_data)
02067 {
02068 gchar *leftovers;
02069 GtkWidget *fiducial_pad_clearance_entry = lookup_widget (GTK_WIDGET (editable),
02070 "fiducial_pad_clearance_entry");
02071 const gchar* fiducial_pad_clearance_string =
02072 gtk_entry_get_text (GTK_ENTRY (fiducial_pad_clearance_entry));
02073 fiducial_pad_clearance = g_ascii_strtod (fiducial_pad_clearance_string, &leftovers);
02074 entry_has_changed (GTK_WIDGET (editable));
02075
02076 }
02077
02078
02095 void
02096 on_fiducial_pad_diameter_entry_changed (GtkEditable *editable,
02097 gpointer user_data)
02098 {
02099 gchar *leftovers;
02100 GtkWidget *fiducial_pad_diameter_entry = lookup_widget (GTK_WIDGET (editable),
02101 "fiducial_pad_diameter_entry");
02102 const gchar* fiducial_pad_diameter_string =
02103 gtk_entry_get_text (GTK_ENTRY (fiducial_pad_diameter_entry));
02104 fiducial_pad_diameter = g_ascii_strtod (fiducial_pad_diameter_string, &leftovers);
02105 entry_has_changed (GTK_WIDGET (editable));
02106 }
02107
02108
02125 void
02126 on_fiducial_pad_solder_mask_clearance_entry_changed
02127 (GtkEditable *editable,
02128 gpointer user_data)
02129 {
02130 gchar *leftovers;
02131 GtkWidget *fiducial_pad_solder_mask_clearance_entry =
02132 lookup_widget (GTK_WIDGET (editable),
02133 "fiducial_pad_solder_mask_clearance_entry");
02134 const gchar* fiducial_pad_solder_mask_clearance_string =
02135 gtk_entry_get_text (GTK_ENTRY
02136 (fiducial_pad_solder_mask_clearance_entry));
02137 fiducial_pad_solder_mask_clearance = g_ascii_strtod
02138 (fiducial_pad_solder_mask_clearance_string, &leftovers);
02139 entry_has_changed (GTK_WIDGET (editable));
02140 }
02141
02142
02159 void
02160 on_filechooser_dialog_cancel_button_clicked
02161 (GtkButton *button,
02162 gpointer user_data)
02163 {
02164 GtkWidget *filechooser_dialog = lookup_widget (GTK_WIDGET (button),
02165 "filechooser_dialog");
02166 gtk_widget_destroy (filechooser_dialog);
02167 }
02168
02169
02184 void
02185 on_filechooser_dialog_close (GtkDialog *dialog,
02186 gpointer user_data)
02187 {
02188 GtkWidget *filechooser_dialog = lookup_widget (GTK_WIDGET (dialog),
02189 "filechooser_dialog");
02190 gtk_widget_destroy (filechooser_dialog);
02191 }
02192
02193
02194
02212 void
02213 on_filechooser_dialog_current_folder_changed
02214 (
02215 GtkFileChooser *filechooser,
02216 gpointer user_data
02217 )
02218 {
02219 GtkWidget *filechooser_dialog = lookup_widget (GTK_WIDGET (filechooser),
02220 "filechooser_dialog");
02221 gchar *current_folder = g_strdup (gtk_file_chooser_get_current_folder
02222 (GTK_FILE_CHOOSER (filechooser_dialog)));
02223
02224
02225 if (!current_folder)
02226 {
02227 if (verbose)
02228 g_log ("", G_LOG_LEVEL_WARNING,
02229 _("current folder is not initialised (null pointer)."));
02230 }
02231
02232
02233 else if (!strcmp (current_folder, ""))
02234 {
02235 if (verbose)
02236 g_log ("", G_LOG_LEVEL_WARNING,
02237 _("current folder contains an empty string."));
02238 }
02239
02240
02241 else if (g_file_test (current_folder, G_FILE_TEST_IS_DIR))
02242 {
02243 temp_dir = g_strdup (current_folder);
02244 if (verbose)
02245 g_log ("", G_LOG_LEVEL_INFO, _("Changed cwd to: %s"),
02246 current_folder);
02247 }
02248
02249 g_free (current_folder);
02250 }
02251
02252
02276 void
02277 on_filechooser_dialog_open_button_clicked
02278 (
02279 GtkButton *button,
02280 gpointer user_data
02281 )
02282 {
02283 GtkWidget *filechooser_dialog = lookup_widget (GTK_WIDGET (button),
02284 "filechooser_dialog");
02285 gchar *selected_filename = NULL;
02286 selected_filename = g_strdup (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (filechooser_dialog)));
02287
02288
02289 if (!selected_filename)
02290 {
02291 if (verbose)
02292 g_log ("", G_LOG_LEVEL_WARNING,
02293 _("selected filename is not initialised (NULL pointer)."));
02294 }
02295
02296
02297 else if (!strcmp (selected_filename, ""))
02298 {
02299 if (verbose)
02300 g_log ("", G_LOG_LEVEL_WARNING,
02301 _("selected filename contains an empty string."));
02302 }
02303
02304
02305
02306 else if (g_file_test (selected_filename, G_FILE_TEST_IS_DIR))
02307 {
02308 if (verbose)
02309 g_log ("", G_LOG_LEVEL_WARNING, _("selected filename is a directory."));
02310 }
02311 else
02312 {
02313
02314 gchar *fpw_filename = g_strdup (selected_filename);
02315 if (temp_dir)
02316 work_dir = g_strdup (temp_dir);
02317
02318 if (read_footprintwizard_file (fpw_filename) == EXIT_SUCCESS)
02319 {
02320 if (verbose)
02321 g_log ("", G_LOG_LEVEL_INFO, _("Read footprintwizard file %s."), fpw_filename);
02322
02323 GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (button));
02324 if (GTK_WIDGET_TOPLEVEL (toplevel))
02325 {
02326 all_entries_need_updated (GTK_WIDGET (toplevel));
02327 }
02328
02329 g_free (toplevel);
02330 }
02331 else
02332 {
02333 GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (button));
02334 if (GTK_WIDGET_TOPLEVEL (toplevel))
02335 {
02336 GtkWidget *dialog = gtk_message_dialog_new
02337 (
02338 GTK_WINDOW (toplevel),
02339 GTK_DIALOG_DESTROY_WITH_PARENT,
02340 GTK_MESSAGE_ERROR,
02341 GTK_BUTTONS_CLOSE,
02342 g_strdup_printf (_("ERROR: Unable to read footprint wizard file %s."), fpw_filename)
02343 );
02344 gtk_dialog_run (GTK_DIALOG (dialog));
02345 gtk_widget_destroy (dialog);
02346 g_free (dialog);
02347 return;
02348 }
02349 g_free (toplevel);
02350 }
02351
02352 g_free (fpw_filename);
02353 }
02354
02355 g_free (selected_filename);
02356 }
02357
02358
02374 void
02375 on_filechooser_dialog_selection_changed
02376 (GtkFileChooser *filechooser,
02377 gpointer user_data)
02378 {
02379
02380 }
02381
02382
02395 void
02396 on_filechooser_dialog_update_preview (GtkFileChooser *filechooser,
02397 gpointer user_data)
02398 {
02399
02400 }
02401
02402
02414 void
02415 on_footprint_author_entry_changed (GtkEditable *editable,
02416 gpointer user_data)
02417 {
02418 GtkWidget *footprint_author_entry = lookup_widget (GTK_WIDGET (editable),
02419 "footprint_author_entry");
02420 footprint_author = g_strdup (gtk_entry_get_text (GTK_ENTRY (footprint_author_entry)));
02421 entry_has_changed (GTK_WIDGET (editable));
02422 }
02423
02424
02444 void
02445 on_footprint_button_clicked (GtkButton *button,
02446 gpointer user_data)
02447 {
02448
02449
02450
02451 if (!footprint_name)
02452 {
02453 gchar *message = g_strdup_printf (_("ERROR: footprint name not initialised (null pointer)."));
02454 message_to_statusbar (GTK_WIDGET (button), message);
02455 return;
02456 }
02457
02458
02459
02460 else if (!strcmp (footprint_name, ""))
02461 {
02462 gchar *message = g_strdup_printf (_("ERROR: footprint name contains an empty string."));
02463 message_to_statusbar (GTK_WIDGET (button), message);
02464 return;
02465 }
02466 else
02467 {
02468 gchar *message = g_strdup_printf ("");
02469 message_to_statusbar (GTK_WIDGET (button), message);
02470 }
02471
02472 footprint_filename = g_strdup (footprint_name);
02473 if (g_str_has_suffix (footprint_filename, fp_suffix))
02474 {
02475
02476
02477 }
02478 else
02479 {
02480
02481
02482 footprint_filename = g_strconcat (footprint_filename, ".fp", NULL);
02483 }
02484
02485
02486 if (write_footprint () == EXIT_SUCCESS)
02487 {
02488 gchar *message = g_strdup_printf (_("Wrote footprint %s to file."), footprint_filename);
02489 message_to_statusbar (GTK_WIDGET (button), message);
02490 }
02491 else
02492 {
02493 gchar *message = g_strdup_printf (_("ERROR: Unable to write footprint %s to file."), footprint_filename);
02494 message_to_statusbar (GTK_WIDGET (button), message);
02495 }
02496 }
02497
02498
02510 void
02511 on_footprint_dist_license_entry_changed
02512 (GtkEditable *editable,
02513 gpointer user_data)
02514 {
02515 GtkWidget *footprint_dist_license_entry = lookup_widget (GTK_WIDGET (editable),
02516 "footprint_dist_license_entry");
02517 footprint_dist_license = g_strdup (gtk_entry_get_text (GTK_ENTRY (footprint_dist_license_entry)));
02518 entry_has_changed (GTK_WIDGET (editable));
02519 }
02520
02521
02533 void
02534 on_footprint_name_entry_changed (GtkEditable *editable,
02535 gpointer user_data)
02536 {
02537 GtkWidget *footprint_name_entry = lookup_widget (GTK_WIDGET (editable),
02538 "footprint_name_entry");
02539 footprint_name = g_strdup (gtk_entry_get_text (GTK_ENTRY (footprint_name_entry)));
02540 entry_has_changed (GTK_WIDGET (editable));
02541
02542
02543
02544 if (!footprint_name)
02545 {
02546 gchar *message = g_strdup_printf (_("ERROR: footprint name not initialised (null pointer)."));
02547 message_to_statusbar (GTK_WIDGET (editable), message);
02548 return;
02549 }
02550
02551
02552
02553 else if (!strcmp (footprint_name, ""))
02554 {
02555 gchar *message = g_strdup_printf (_("ERROR: footprint name contains an empty string."));
02556 message_to_statusbar (GTK_WIDGET (editable), message);
02557 return;
02558 }
02559 else if (g_str_has_prefix (footprint_name, "?"))
02560 {
02561 switch (package_type)
02562 {
02563 case BGA:
02564 {
02565 if (bga_get_default_footprint_values () == EXIT_SUCCESS)
02566 all_entries_need_updated (GTK_WIDGET (editable));
02567 return;
02568 }
02569 case CAPA:
02570 {
02571 if (capa_get_default_footprint_values () == EXIT_SUCCESS)
02572 all_entries_need_updated (GTK_WIDGET (editable));
02573 return;
02574 }
02575 case CAPC:
02576 {
02577 if (capc_get_default_footprint_values () == EXIT_SUCCESS)
02578 all_entries_need_updated (GTK_WIDGET (editable));
02579 return;
02580 }
02581 case CAPM:
02582 {
02583 if (capm_get_default_footprint_values () == EXIT_SUCCESS)
02584 all_entries_need_updated (GTK_WIDGET (editable));
02585 return;
02586 }
02587 case CAPMP:
02588 {
02589 if (capmp_get_default_footprint_values () == EXIT_SUCCESS)
02590 all_entries_need_updated (GTK_WIDGET (editable));
02591 return;
02592 }
02593 case CAPPR:
02594 {
02595 if (cappr_get_default_footprint_values () == EXIT_SUCCESS)
02596 all_entries_need_updated (GTK_WIDGET (editable));
02597 return;
02598 }
02599 case CON_DIL:
02600 {
02601 if (con_dil_get_default_footprint_values () == EXIT_SUCCESS)
02602 all_entries_need_updated (GTK_WIDGET (editable));
02603 return;
02604 }
02605 case CON_DIP:
02606 {
02607 if (con_dip_get_default_footprint_values () == EXIT_SUCCESS)
02608 all_entries_need_updated (GTK_WIDGET (editable));
02609 return;
02610 }
02611 case CON_HDR:
02612 {
02613 if (con_hdr_get_default_footprint_values () == EXIT_SUCCESS)
02614 all_entries_need_updated (GTK_WIDGET (editable));
02615 return;
02616 }
02617 case CON_SIL:
02618 {
02619 if (con_sil_get_default_footprint_values () == EXIT_SUCCESS)
02620 all_entries_need_updated (GTK_WIDGET (editable));
02621 return;
02622 }
02623 case DIOM:
02624 {
02625 if (diom_get_default_footprint_values () == EXIT_SUCCESS)
02626 all_entries_need_updated (GTK_WIDGET (editable));
02627 return;
02628 }
02629 case DIOMELF:
02630 {
02631 if (diomelf_get_default_footprint_values () == EXIT_SUCCESS)
02632 all_entries_need_updated (GTK_WIDGET (editable));
02633 return;
02634 }
02635 case DIP:
02636 {
02637 if (dip_get_default_footprint_values () == EXIT_SUCCESS)
02638 all_entries_need_updated (GTK_WIDGET (editable));
02639 return;
02640 }
02641 case DIPS:
02642 {
02643 if (dips_get_default_footprint_values () == EXIT_SUCCESS)
02644 all_entries_need_updated (GTK_WIDGET (editable));
02645 return;
02646 }
02647 case INDC:
02648 {
02649 if (indc_get_default_footprint_values () == EXIT_SUCCESS)
02650 all_entries_need_updated (GTK_WIDGET (editable));
02651 return;
02652 }
02653 case INDM:
02654 {
02655 if (indm_get_default_footprint_values () == EXIT_SUCCESS)
02656 all_entries_need_updated (GTK_WIDGET (editable));
02657 return;
02658 }
02659 case INDP:
02660 {
02661 if (indp_get_default_footprint_values () == EXIT_SUCCESS)
02662 all_entries_need_updated (GTK_WIDGET (editable));
02663 return;
02664 }
02665 case PGA:
02666 {
02667 if (pga_get_default_footprint_values () == EXIT_SUCCESS)
02668 all_entries_need_updated (GTK_WIDGET (editable));
02669 return;
02670 }
02671 case PLCC:
02672 {
02673 if (plcc_get_default_footprint_values () == EXIT_SUCCESS)
02674 all_entries_need_updated (GTK_WIDGET (editable));
02675 return;
02676 }
02677 case RES:
02678 {
02679 if (res_get_default_footprint_values () == EXIT_SUCCESS)
02680 all_entries_need_updated (GTK_WIDGET (editable));
02681 return;
02682 }
02683 case RESC:
02684 {
02685 if (resc_get_default_footprint_values () == EXIT_SUCCESS)
02686 all_entries_need_updated (GTK_WIDGET (editable));
02687 return;
02688 }
02689 case RESM:
02690 {
02691 if (resm_get_default_footprint_values () == EXIT_SUCCESS)
02692 all_entries_need_updated (GTK_WIDGET (editable));
02693 return;
02694 }
02695 case RESMELF:
02696 {
02697 if (resmelf_get_default_footprint_values () == EXIT_SUCCESS)
02698 all_entries_need_updated (GTK_WIDGET (editable));
02699 return;
02700 }
02701 case SIL:
02702 {
02703 if (sil_get_default_footprint_values () == EXIT_SUCCESS)
02704 all_entries_need_updated (GTK_WIDGET (editable));
02705 return;
02706 }
02707 case SIP:
02708 {
02709 if (sip_get_default_footprint_values () == EXIT_SUCCESS)
02710 all_entries_need_updated (GTK_WIDGET (editable));
02711 return;
02712 }
02713 case SOT:
02714 {
02715 if (sot_get_default_footprint_values () == EXIT_SUCCESS)
02716 all_entries_need_updated (GTK_WIDGET (editable));
02717 return;
02718 }
02719 case TO:
02720 {
02721 if (to_get_default_footprint_values () == EXIT_SUCCESS)
02722 all_entries_need_updated (GTK_WIDGET (editable));
02723 return;
02724 }
02725 default:
02726 {
02727 gchar *message = g_strdup_printf (_("ERROR: unknown or not yet implemented footprint type entered."));
02728 message_to_statusbar (GTK_WIDGET (editable), message);
02729 return;
02730 }
02731 }
02732 }
02733 else
02734 {
02735 gchar *message = g_strdup_printf ("");
02736 message_to_statusbar (GTK_WIDGET (editable), message);
02737 return;
02738 }
02739 }
02740
02741
02753 void
02754 on_footprint_refdes_entry_changed (GtkEditable *editable,
02755 gpointer user_data)
02756 {
02757 GtkWidget *footprint_refdes_entry = lookup_widget (GTK_WIDGET (editable),
02758 "footprint_refdes_entry");
02759 footprint_refdes = g_strdup (gtk_entry_get_text (GTK_ENTRY (footprint_refdes_entry)));
02760 entry_has_changed (GTK_WIDGET (editable));
02761 }
02762
02774 void
02775 on_footprint_status_entry_changed (GtkComboBox *combobox,
02776 gpointer user_data)
02777 {
02778 footprint_status = gtk_combo_box_get_active_text (GTK_COMBO_BOX (combobox));
02779 entry_has_changed (GTK_WIDGET (combobox));
02780
02781 if (get_status_type () == EXIT_FAILURE)
02782 {
02783 g_log ("", G_LOG_LEVEL_INFO,
02784 _("footprint status contains an unknown status type."));
02785 return;
02786 }
02787 else
02788 {
02789 if (verbose)
02790 g_log ("", G_LOG_LEVEL_INFO,
02791 _("determined the status type successful."));
02792 }
02793 }
02794
02795
02812 void
02813 on_footprint_type_entry_changed (GtkComboBox *combobox,
02814 gpointer user_data)
02815 {
02816
02817
02818
02819
02820
02821
02822 if (!footprint_name ||
02823 (!strcmp (footprint_name, "")) ||
02824 (!strcmp (footprint_type, footprint_name)))
02825 {
02826 footprint_type = gtk_combo_box_get_active_text (GTK_COMBO_BOX (combobox));
02827 footprint_name = g_strdup (footprint_type);
02828 GtkWidget *footprint_name_entry = lookup_widget (GTK_WIDGET (combobox),
02829 "footprint_name_entry");
02830 gtk_entry_set_text (GTK_ENTRY (footprint_name_entry), footprint_name);
02831 }
02832 else
02833 {
02834 footprint_type = gtk_combo_box_get_active_text (GTK_COMBO_BOX (combobox));
02835 }
02836 entry_has_changed (GTK_WIDGET (combobox));
02837
02838 if (get_package_type () == EXIT_FAILURE)
02839 {
02840 g_log ("", G_LOG_LEVEL_CRITICAL,
02841 _("footprint type contains an unknown package type."));
02842 footprint_type = g_strdup ("");
02843 return;
02844 }
02845 else
02846 {
02847 if (verbose)
02848 g_log ("", G_LOG_LEVEL_INFO,
02849 _("determined the package type (%d) for footprint type %s successful."),
02850 package_type, footprint_type);
02851 }
02852 widget = GTK_WIDGET (combobox);
02853 switch (package_type)
02854 {
02855 case BGA:
02856 {
02857 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02858 bga_set_gui_constraints ();
02859 break;
02860 }
02861 case CAPA:
02862 {
02863 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02864 capa_set_gui_constraints ();
02865 break;
02866 }
02867 case CAPC:
02868 {
02869 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02870 capc_set_gui_constraints ();
02871 break;
02872 }
02873 case CAPM:
02874 {
02875 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02876 capm_set_gui_constraints ();
02877 break;
02878 }
02879 case CAPMP:
02880 {
02881 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02882 capmp_set_gui_constraints ();
02883 break;
02884 }
02885 case CAPPR:
02886 {
02887 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02888 cappr_set_gui_constraints ();
02889 break;
02890 }
02891 case CON_DIL:
02892 {
02893 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02894 con_dil_set_gui_constraints ();
02895 break;
02896 }
02897 case CON_DIP:
02898 {
02899 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02900 con_dip_set_gui_constraints ();
02901 break;
02902 }
02903 case CON_HDR:
02904 {
02905 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02906 con_hdr_set_gui_constraints ();
02907 break;
02908 }
02909 case CON_SIL:
02910 {
02911 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02912 con_sil_set_gui_constraints ();
02913 break;
02914 }
02915 case DIL:
02916 {
02917 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02918 dip_set_gui_constraints ();
02919 break;
02920 }
02921 case DIOM:
02922 {
02923 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02924 diom_set_gui_constraints ();
02925 break;
02926 }
02927 case DIOMELF:
02928 {
02929 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02930 diomelf_set_gui_constraints ();
02931 break;
02932 }
02933 case DIP:
02934 {
02935 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02936 dip_set_gui_constraints ();
02937 break;
02938 }
02939 case DIPS:
02940 {
02941 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02942 dips_set_gui_constraints ();
02943 break;
02944 }
02945 case INDC:
02946 {
02947 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02948 indc_set_gui_constraints ();
02949 break;
02950 }
02951 case INDM:
02952 {
02953 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02954 indm_set_gui_constraints ();
02955 break;
02956 }
02957 case INDP:
02958 {
02959 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02960 indp_set_gui_constraints ();
02961 break;
02962 }
02963 case PGA:
02964 {
02965 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02966 pga_set_gui_constraints ();
02967 break;
02968 }
02969 case PLCC:
02970 {
02971 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02972 plcc_set_gui_constraints ();
02973 break;
02974 }
02975 case QFN:
02976 {
02977 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02978 gchar *message = g_strdup_printf (_("ERROR: footprint type QFN is not yet implemented."));
02979 message_to_statusbar (GTK_WIDGET (combobox), message);
02980 break;
02981 }
02982 case QFP:
02983 {
02984 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02985 gchar *message = g_strdup_printf (_("ERROR: footprint type QFP is not yet implemented."));
02986 message_to_statusbar (GTK_WIDGET (combobox), message);
02987 break;
02988 }
02989 case RES:
02990 {
02991 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02992 res_set_gui_constraints ();
02993 break;
02994 }
02995 case RESC:
02996 {
02997 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
02998 resc_set_gui_constraints ();
02999 break;
03000 }
03001 case RESM:
03002 {
03003 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
03004 resm_set_gui_constraints ();
03005 break;
03006 }
03007 case RESMELF:
03008 {
03009 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
03010 resmelf_set_gui_constraints ();
03011 break;
03012 }
03013 case SIL:
03014 {
03015 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
03016 sil_set_gui_constraints ();
03017 break;
03018 }
03019 case SIP:
03020 {
03021 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
03022 sip_set_gui_constraints ();
03023 break;
03024 }
03025 case SO:
03026 {
03027 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
03028 gchar *message = g_strdup_printf (_("ERROR: footprint type SO is not yet implemented."));
03029 message_to_statusbar (GTK_WIDGET (combobox), message);
03030 break;
03031 }
03032 case SOT:
03033 {
03034 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
03035 sot_set_gui_constraints ();
03036 break;
03037 }
03038 case TO92:
03039 {
03040 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
03041 to_set_gui_constraints ();
03042 break;
03043 }
03044 case TO220:
03045 {
03046 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
03047 to_set_gui_constraints ();
03048 break;
03049 }
03050 case TO220S:
03051 {
03052 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
03053 to_set_gui_constraints ();
03054 break;
03055 }
03056 case TO220SW:
03057 {
03058 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
03059 to_set_gui_constraints ();
03060 break;
03061 }
03062 case TO220W:
03063 {
03064 all_entries_to_default_sensitivity (GTK_WIDGET (combobox));
03065 to_set_gui_constraints ();
03066 break;
03067 }
03068 default:
03069 {
03070 gchar *message = g_strdup_printf (_("ERROR: unknown or not yet implemented footprint type entered."));
03071 message_to_statusbar (GTK_WIDGET (combobox), message);
03072 break;
03073 }
03074 }
03075 }
03076
03077
03092 void
03093 on_footprint_units_entry_changed (GtkComboBox *combobox,
03094 gpointer user_data)
03095 {
03096 entry_has_changed (GTK_WIDGET (combobox));
03097 footprint_units = gtk_combo_box_get_active_text (GTK_COMBO_BOX (combobox));
03098
03099
03100
03101 if (!footprint_units)
03102 {
03103 gchar *message = g_strdup_printf (_("ERROR: footprint units not initialised (null pointer)."));
03104 message_to_statusbar (GTK_WIDGET (combobox), message);
03105 return;
03106 }
03107
03108
03109
03110 else if (!strcmp (footprint_units, ""))
03111 {
03112 gchar *message = g_strdup_printf (_("ERROR: footprint units contains an empty string."));
03113 message_to_statusbar (GTK_WIDGET (combobox), message);
03114 return;
03115 }
03116
03117 else if (update_units_variables () == EXIT_FAILURE)
03118 {
03119 gchar *message = g_strdup_printf (_("ERROR: footprint units contains an unknown units type."));
03120 message_to_statusbar (GTK_WIDGET (combobox), message);
03121 }
03122 else
03123 {
03124 gchar *message = g_strdup_printf ("");
03125 message_to_statusbar (GTK_WIDGET (combobox), message);
03126 }
03127 }
03128
03129
03141 void
03142 on_footprint_use_license_entry_changed (GtkEditable *editable,
03143 gpointer user_data)
03144 {
03145 GtkWidget *footprint_use_license_entry = lookup_widget (GTK_WIDGET (editable),
03146 "footprint_use_license_entry");
03147 footprint_use_license = g_strdup (gtk_entry_get_text (GTK_ENTRY (footprint_use_license_entry)));
03148 entry_has_changed (GTK_WIDGET (editable));
03149 }
03150
03151
03163 void
03164 on_footprint_value_entry_changed (GtkEditable *editable,
03165 gpointer user_data)
03166 {
03167 GtkWidget *footprint_value_entry = lookup_widget (GTK_WIDGET (editable),
03168 "footprint_value_entry");
03169 footprint_value = g_strdup (gtk_entry_get_text (GTK_ENTRY (footprint_value_entry)));
03170 entry_has_changed (GTK_WIDGET (editable));
03171 }
03172
03173
03185 void
03186 on_number_1_position_entry_changed
03187 (GtkComboBox *combobox,
03188 gpointer user_data)
03189 {
03190 pin_1_position = gtk_combo_box_get_active_text (GTK_COMBO_BOX (combobox));
03191 entry_has_changed (GTK_WIDGET (combobox));
03192 }
03193
03194
03209 void
03210 on_number_of_columns_entry_changed (GtkEditable *editable,
03211 gpointer user_data)
03212 {
03213 gchar *leftovers;
03214 GtkWidget *number_of_columns_entry = lookup_widget (GTK_WIDGET (editable),
03215 "number_of_columns_entry");
03216 const gchar* number_of_columns_string = gtk_entry_get_text (GTK_ENTRY (number_of_columns_entry));
03217 number_of_columns = (int) g_ascii_strtod (number_of_columns_string, &leftovers);
03218 entry_has_changed (GTK_WIDGET (editable));
03219 number_of_pins_has_changed (GTK_WIDGET (editable));
03220 }
03221
03222
03237 void
03238 on_number_of_rows_entry_changed (GtkEditable *editable,
03239 gpointer user_data)
03240 {
03241 gchar *leftovers;
03242 GtkWidget *number_of_rows_entry = lookup_widget (GTK_WIDGET (editable),
03243 "number_of_rows_entry");
03244 const gchar* number_of_rows_string = gtk_entry_get_text (GTK_ENTRY (number_of_rows_entry));
03245 number_of_rows = (int) g_ascii_strtod (number_of_rows_string, &leftovers);
03246 entry_has_changed (GTK_WIDGET (editable));
03247 number_of_pins_has_changed (GTK_WIDGET (editable));
03248 }
03249
03250
03265 void
03266 on_number_total_pins_entry_changed (GtkEditable *editable,
03267 gpointer user_data)
03268 {
03269 gchar *leftovers;
03270 GtkWidget *number_total_pins_entry = lookup_widget (GTK_WIDGET (editable),
03271 "number_total_pins_entry");
03272 const gchar* number_of_pins_string = gtk_entry_get_text (GTK_ENTRY (number_total_pins_entry));
03273 number_of_pins = (int) g_ascii_strtod (number_of_pins_string, &leftovers);
03274 entry_has_changed (GTK_WIDGET (editable));
03275 }
03276
03277
03293 void
03294 on_open_button_clicked (GtkButton *button,
03295 gpointer user_data)
03296 {
03297 GtkWidget *filechooser_dialog = create_filechooser_dialog ();
03298 GtkFileFilter *file_filter = gtk_file_filter_new ();
03299 gtk_file_filter_set_name (file_filter, "fpw filter");
03300 gtk_file_filter_add_pattern (GTK_FILE_FILTER (file_filter), "*.fpw");
03301 gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (filechooser_dialog),
03302 GTK_FILE_FILTER (file_filter));
03303 gtk_widget_show (filechooser_dialog);
03304 }
03305
03306
03322 void
03323 on_package_body_height_entry_changed (GtkEditable *editable,
03324 gpointer user_data)
03325 {
03326 gchar *leftovers;
03327 GtkWidget *package_body_height_entry = lookup_widget (GTK_WIDGET (editable),
03328 "package_body_height_entry");
03329 const gchar* package_body_height_string = gtk_entry_get_text (GTK_ENTRY (package_body_height_entry));
03330 package_body_height = g_ascii_strtod (package_body_height_string, &leftovers);
03331 entry_has_changed (GTK_WIDGET (editable));
03332 }
03333
03334
03350 void
03351 on_package_body_length_entry_changed (GtkEditable *editable,
03352 gpointer user_data)
03353 {
03354 gchar *leftovers;
03355 GtkWidget *package_body_length_entry = lookup_widget (GTK_WIDGET (editable),
03356 "package_body_length_entry");
03357 const gchar* package_body_length_string = gtk_entry_get_text (GTK_ENTRY (package_body_length_entry));
03358 package_body_length = g_ascii_strtod (package_body_length_string, &leftovers);
03359 entry_has_changed (GTK_WIDGET (editable));
03360 }
03361
03362
03378 void
03379 on_package_body_width_entry_changed (GtkEditable *editable,
03380 gpointer user_data)
03381 {
03382 gchar *leftovers;
03383 GtkWidget *package_body_width_entry = lookup_widget (GTK_WIDGET (editable),
03384 "package_body_width_entry");
03385 const gchar* package_body_width_string = gtk_entry_get_text (GTK_ENTRY (package_body_width_entry));
03386 package_body_width = g_ascii_strtod (package_body_width_string, &leftovers);
03387 entry_has_changed (GTK_WIDGET (editable));
03388 }
03389
03390
03403 void
03404 on_package_is_radial_checkbutton_toggled
03405 (GtkToggleButton *togglebutton,
03406 gpointer user_data)
03407 {
03408 package_is_radial = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton));
03409 entry_has_changed (GTK_WIDGET (togglebutton));
03410 }
03411
03412
03428 void
03429 on_pad_clearance_entry_changed (GtkEditable *editable,
03430 gpointer user_data)
03431 {
03432 gchar *leftovers;
03433 GtkWidget *pad_clearance_entry = lookup_widget (GTK_WIDGET (editable),
03434 "pad_clearance_entry");
03435 const gchar* pad_clearance_string = gtk_entry_get_text (GTK_ENTRY (pad_clearance_entry));
03436 pad_clearance = g_ascii_strtod (pad_clearance_string, &leftovers);
03437 entry_has_changed (GTK_WIDGET (editable));
03438 }
03439
03440
03455 void
03456 on_pad_diameter_entry_changed (GtkEditable *editable,
03457 gpointer user_data)
03458 {
03459 gchar *leftovers;
03460 GtkWidget *pad_diameter_entry = lookup_widget (GTK_WIDGET (editable),
03461 "pad_diameter_entry");
03462 const gchar* pad_diameter_string = gtk_entry_get_text (GTK_ENTRY (pad_diameter_entry));
03463 pad_diameter = g_ascii_strtod (pad_diameter_string, &leftovers);
03464 entry_has_changed (GTK_WIDGET (editable));
03465 }
03466
03467
03483 void
03484 on_pad_length_entry_changed (GtkEditable *editable,
03485 gpointer user_data)
03486 {
03487 gchar *leftovers;
03488 GtkWidget *pad_length_entry = lookup_widget (GTK_WIDGET (editable),
03489 "pad_length_entry");
03490 const gchar* pad_length_string = gtk_entry_get_text (GTK_ENTRY (pad_length_entry));
03491 pad_length = g_ascii_strtod (pad_length_string, &leftovers);
03492 entry_has_changed (GTK_WIDGET (editable));
03493 }
03494
03495
03510 void
03511 on_pad_shape_entry_changed (GtkComboBox *combobox,
03512 gpointer user_data)
03513 {
03514 pad_shape = gtk_combo_box_get_active_text (GTK_COMBO_BOX (combobox));
03515 entry_has_changed (GTK_WIDGET (combobox));
03516
03517
03518
03519 if (!pad_shape)
03520 {
03521 gchar *message = g_strdup_printf (_("ERROR: pad shape not initialised (null pointer)."));
03522 message_to_statusbar (GTK_WIDGET (combobox), message);
03523 return;
03524 }
03525
03526
03527
03528 else if (!strcmp (pad_shape, ""))
03529 {
03530 gchar *message = g_strdup_printf (_("ERROR: pad shape contains an empty string."));
03531 message_to_statusbar (GTK_WIDGET (combobox), message);
03532 return;
03533 }
03534
03535 else if (update_pad_shapes_variables () == EXIT_FAILURE)
03536 {
03537 gchar *message = g_strdup_printf (_("ERROR: pad shape contains an unknown pad shape type."));
03538 message_to_statusbar (GTK_WIDGET (combobox), message);
03539 }
03540 else
03541 {
03542 gchar *message = g_strdup_printf ("");
03543 message_to_statusbar (GTK_WIDGET (combobox), message);
03544 }
03545 }
03546
03547
03563 void
03564 on_pad_solder_mask_clearance_entry_changed
03565 (GtkEditable *editable,
03566 gpointer user_data)
03567 {
03568 gchar *leftovers;
03569 GtkWidget *pad_solder_mask_clearance_entry = lookup_widget (GTK_WIDGET (editable),
03570 "pad_solder_mask_clearance_entry");
03571 const gchar* pad_SMC_string = gtk_entry_get_text (GTK_ENTRY (pad_solder_mask_clearance_entry));
03572 pad_solder_mask_clearance = g_ascii_strtod (pad_SMC_string, &leftovers);
03573 entry_has_changed (GTK_WIDGET (editable));
03574 }
03575
03576
03592 void
03593 on_pad_width_entry_changed (GtkEditable *editable,
03594 gpointer user_data)
03595 {
03596 gchar *leftovers;
03597 GtkWidget *pad_width_entry = lookup_widget (GTK_WIDGET (editable),
03598 "pad_width_entry");
03599 const gchar* pad_width_string = gtk_entry_get_text (GTK_ENTRY (pad_width_entry));
03600 pad_width = g_ascii_strtod (pad_width_string, &leftovers);
03601 entry_has_changed (GTK_WIDGET (editable));
03602 }
03603
03604
03616 void
03617 on_pcb_gfpw_destroy (GtkObject *object,
03618 gpointer user_data)
03619 {
03620 gtk_main_quit();
03621 }
03622
03623
03639 void
03640 on_pin_drill_diameter_entry_changed (GtkEditable *editable,
03641 gpointer user_data)
03642 {
03643 gchar *leftovers;
03644 GtkWidget *pin_drill_diameter_entry = lookup_widget (GTK_WIDGET (editable),
03645 "pin_drill_diameter_entry");
03646 const gchar* pin_drill_diameter_string = gtk_entry_get_text (GTK_ENTRY (pin_drill_diameter_entry));
03647 pin_drill_diameter = g_ascii_strtod (pin_drill_diameter_string, &leftovers);
03648 entry_has_changed (GTK_WIDGET (editable));
03649 }
03650
03651
03672 void
03673 on_pin_pad_exceptions_button_clicked (GtkButton *button,
03674 gpointer user_data)
03675 {
03676 if ((number_of_rows < 1) ||
03677 (number_of_columns < 1))
03678 {
03679 gchar *message = g_strdup_printf (_("Number of rows or columns is 0."));
03680 message_to_statusbar (GTK_WIDGET (button), message);
03681 return;
03682 }
03683 else
03684 {
03685
03686
03687 gint i;
03688 gint j;
03689 SelectionButtonSet *selection_button;
03690 gint selection_button_index = 0;
03691 for (i = 0; (i < MAX_ROWS); i++)
03692 {
03693 for (j = 0; (j < MAX_COLUMNS); j++)
03694 {
03695 selection_button = &selection_buttons[selection_button_index];
03696 selection_button->active = FALSE;
03697 selection_button_index++;
03698 }
03699 }
03700
03701
03702
03703 selection_button_index = 0;
03704 for (i = 0; (i < number_of_rows); i++)
03705 {
03706 for (j = 0; (j < number_of_columns); j++)
03707 {
03708 selection_button = &selection_buttons[selection_button_index];
03709 selection_button->id = selection_button_index;
03710 gchar *selection_button_name = g_strdup_printf ("%s%d",
03711 (row_letters[i]), (j + 1));
03712 selection_button->name = g_strdup (selection_button_name);
03713 selection_button->active = !get_pin_pad_exception
03714 (selection_button_name);
03715 selection_button_index++;
03716 g_free (selection_button_name);
03717 }
03718 }
03719 gchar *message = g_strdup ("");
03720 message_to_statusbar (GTK_WIDGET (button), message);
03721 select_exceptions_create_window (number_of_rows,
03722 number_of_columns);
03723 }
03724
03725 }
03726
03727
03743 void
03744 on_pin_pad_exceptions_entry_changed (GtkEditable *editable,
03745 gpointer user_data)
03746 {
03747 GtkWidget *pin_pad_exceptions_entry = lookup_widget (GTK_WIDGET (editable),
03748 "pin_pad_exceptions_entry");
03749 pin_pad_exceptions_string = g_strdup_printf (gtk_entry_get_text (GTK_ENTRY (pin_pad_exceptions_entry)));
03750 entry_has_changed (GTK_WIDGET (editable));
03751
03752 }
03753
03766 void
03767 on_pin_square_checkbutton_toggled (GtkToggleButton *togglebutton,
03768 gpointer user_data)
03769 {
03770
03771 pin1_square = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton));
03772 entry_has_changed (GTK_WIDGET (togglebutton));
03773 }
03774
03789 void
03790 on_pitch_x_entry_changed (GtkEditable *editable,
03791 gpointer user_data)
03792 {
03793 gchar *leftovers;
03794 GtkWidget *pitch_x_entry = lookup_widget (GTK_WIDGET (editable),
03795 "pitch_x_entry");
03796 const gchar* pitch_x_string = gtk_entry_get_text (GTK_ENTRY (pitch_x_entry));
03797 pitch_x = g_ascii_strtod (pitch_x_string, &leftovers);
03798 entry_has_changed (GTK_WIDGET (editable));
03799 }
03800
03801
03816 void
03817 on_pitch_y_entry_changed (GtkEditable *editable,
03818 gpointer user_data)
03819 {
03820 gchar *leftovers;
03821 GtkWidget *pitch_y_entry = lookup_widget (GTK_WIDGET (editable),
03822 "pitch_y_entry");
03823 const gchar* pitch_y_string = gtk_entry_get_text (GTK_ENTRY (pitch_y_entry));
03824 pitch_y = g_ascii_strtod (pitch_y_string, &leftovers);
03825 entry_has_changed (GTK_WIDGET (editable));
03826 }
03827
03828
03864 void
03865 on_preview_button_clicked (GtkButton *button,
03866 gpointer user_data)
03867 {
03871 }
03872
03873
03885 void
03886 on_refresh_button_clicked (GtkButton *button,
03887 gpointer user_data)
03888 {
03889 all_entries_need_updated (GTK_WIDGET (button));
03890 }
03891
03916 void
03917 on_save_button_clicked (GtkButton *button,
03918 gpointer user_data)
03919 {
03920
03921
03922
03923 if (!footprint_name)
03924 {
03925 gchar *message = g_strdup_printf (_("ERROR: footprint name not initialised (null pointer)."));
03926 message_to_statusbar (GTK_WIDGET (button), message);
03927 return;
03928 }
03929
03930
03931
03932 else if (!strcmp (footprint_name, ""))
03933 {
03934 gchar *message = g_strdup_printf (_("ERROR: footprint name contains an empty string."));
03935 message_to_statusbar (GTK_WIDGET (button), message);
03936 return;
03937 }
03938 else
03939 {
03940 gchar *message = g_strdup_printf ("");
03941 message_to_statusbar (GTK_WIDGET (button), message);
03942 }
03943
03944 footprint_filename = g_strdup (footprint_name);
03945 if (g_str_has_suffix (footprint_filename, fp_suffix))
03946 {
03947
03948
03949 }
03950 else
03951 {
03952
03953
03954 footprint_filename = g_strconcat (footprint_filename, ".fp", NULL);
03955 }
03956
03957 gchar *fpw_filename = g_strdup (footprint_name);
03958 if (g_str_has_suffix (fpw_filename, fp_suffix))
03959 {
03960
03961
03962
03963 fpw_filename = g_strconcat (fpw_filename, "w", NULL);
03964 }
03965 else
03966 {
03967 if (g_str_has_suffix (fpw_filename, fpw_suffix))
03968 {
03969
03970
03971
03972 }
03973 else
03974 {
03975
03976
03977 fpw_filename = g_strconcat (fpw_filename, ".fpw", NULL);
03978 }
03979 }
03980
03981
03982 if (write_footprintwizard_file (fpw_filename) == EXIT_SUCCESS)
03983 {
03984 change_main_window_title (GTK_WIDGET (button),
03985 g_strconcat ("pcb-gfpw : ",
03986 fpw_filename, NULL));
03987 main_window_title_has_asterisk = FALSE;
03988 fpw_file_saved = TRUE;
03989 }
03990 else
03991 {
03992 gchar *message = g_strdup_printf (_("ERROR: Unable to write footprintwizard file %s."), footprint_filename);
03993 message_to_statusbar (GTK_WIDGET (button), message);
03994 }
03995 }
03996
03997
04010 void
04011 on_silkscreen_indicate_1_checkbutton_toggled
04012 (GtkToggleButton *togglebutton,
04013 gpointer user_data)
04014 {
04015 silkscreen_indicate_1 = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton));
04016 entry_has_changed (GTK_WIDGET (togglebutton));
04017 }
04018
04019
04035 void
04036 on_silkscreen_line_width_entry_changed (GtkEditable *editable,
04037 gpointer user_data)
04038 {
04039 gchar *leftovers;
04040 GtkWidget *silkscreen_line_width_entry = lookup_widget (GTK_WIDGET (editable),
04041 "silkscreen_line_width_entry");
04042 const gchar* silkscreen_line_width_string = gtk_entry_get_text (GTK_ENTRY (silkscreen_line_width_entry));
04043 silkscreen_line_width = g_ascii_strtod (silkscreen_line_width_string, &leftovers);
04044 entry_has_changed (GTK_WIDGET (editable));
04045 }
04046
04047
04066 void
04067 on_silkscreen_package_outline_checkbutton_toggled
04068 (GtkToggleButton *togglebutton,
04069 gpointer user_data)
04070 {
04071
04072 silkscreen_package_outline = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton));
04073
04074 GtkWidget *silkscreen_line_width_entry = lookup_widget (GTK_WIDGET (togglebutton), "silkscreen_line_width_entry");
04075
04076
04077 gtk_widget_set_sensitive (silkscreen_line_width_entry, silkscreen_package_outline);
04078 entry_has_changed (GTK_WIDGET (togglebutton));
04079 }
04080
04081
04102 void
04103 on_thermal_checkbutton_toggled (GtkToggleButton *togglebutton,
04104 gpointer user_data)
04105 {
04106
04107 thermal = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton));
04108 entry_has_changed (GTK_WIDGET (togglebutton));
04109 number_of_pins_has_changed (GTK_WIDGET (togglebutton));
04110
04111 GtkWidget *thermal_nopaste_checkbutton = lookup_widget (GTK_WIDGET (togglebutton),
04112 "thermal_nopaste_checkbutton");
04113 GtkWidget *thermal_length_entry = lookup_widget (GTK_WIDGET (togglebutton),
04114 "thermal_length_entry");
04115 GtkWidget *thermal_width_entry = lookup_widget (GTK_WIDGET (togglebutton),
04116 "thermal_width_entry");
04117 GtkWidget *thermal_clearance_entry = lookup_widget (GTK_WIDGET (togglebutton),
04118 "thermal_clearance_entry");
04119 GtkWidget *thermal_solder_mask_clearance_entry = lookup_widget (GTK_WIDGET (togglebutton),
04120 "thermal_solder_mask_clearance_entry");
04121
04122
04123 gtk_widget_set_sensitive (thermal_nopaste_checkbutton, thermal);
04124 gtk_widget_set_sensitive (thermal_length_entry, thermal);
04125 gtk_widget_set_sensitive (thermal_width_entry, thermal);
04126 gtk_widget_set_sensitive (thermal_clearance_entry, thermal);
04127 gtk_widget_set_sensitive (thermal_solder_mask_clearance_entry, thermal);
04128
04129
04130
04131
04132 gtk_toggle_button_set_active ((void *) thermal_nopaste_checkbutton, thermal);
04133 }
04134
04135
04151 void
04152 on_thermal_clearance_entry_changed (GtkEditable *editable,
04153 gpointer user_data)
04154 {
04155 gchar *leftovers;
04156 GtkWidget *thermal_clearance_entry = lookup_widget (GTK_WIDGET (editable),
04157 "thermal_clearance_entry");
04158 const gchar* thermal_clearance_string = gtk_entry_get_text (GTK_ENTRY (thermal_clearance_entry));
04159 thermal_clearance = g_ascii_strtod (thermal_clearance_string, &leftovers);
04160 entry_has_changed (GTK_WIDGET (editable));
04161 }
04162
04163
04179 void
04180 on_thermal_length_entry_changed (GtkEditable *editable,
04181 gpointer user_data)
04182 {
04183 gchar *leftovers;
04184 GtkWidget *thermal_length_entry = lookup_widget (GTK_WIDGET (editable),
04185 "thermal_length_entry");
04186 const gchar* thermal_length_string = gtk_entry_get_text (GTK_ENTRY (thermal_length_entry));
04187 thermal_length = g_ascii_strtod (thermal_length_string, &leftovers);
04188 entry_has_changed (GTK_WIDGET (editable));
04189 }
04190
04191
04204 void
04205 on_thermal_nopaste_checkbutton_toggled (GtkToggleButton *togglebutton,
04206 gpointer user_data)
04207 {
04208 thermal_nopaste = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton));
04209 entry_has_changed (GTK_WIDGET (togglebutton));
04210 }
04211
04212
04228 void
04229 on_thermal_solder_mask_clearance_entry_changed
04230 (GtkEditable *editable,
04231 gpointer user_data)
04232 {
04233 gchar *leftovers;
04234 GtkWidget *thermal_solder_mask_clearance_entry = lookup_widget (GTK_WIDGET (editable),
04235 "thermal_solder_mask_clearance_entry");
04236 const gchar* SMC_string = gtk_entry_get_text (GTK_ENTRY (thermal_solder_mask_clearance_entry));
04237 thermal_solder_mask_clearance = g_ascii_strtod (SMC_string, &leftovers);
04238 entry_has_changed (GTK_WIDGET (editable));
04239 }
04240
04241
04257 void
04258 on_thermal_width_entry_changed (GtkEditable *editable,
04259 gpointer user_data)
04260 {
04261 gchar *leftovers;
04262 GtkWidget *thermal_width_entry = lookup_widget (GTK_WIDGET (editable),
04263 "thermal_width_entry");
04264 const gchar* thermal_width_string = gtk_entry_get_text (GTK_ENTRY (thermal_width_entry));
04265 thermal_width = g_ascii_strtod (thermal_width_string, &leftovers);
04266 entry_has_changed (GTK_WIDGET (editable));
04267 }
04268
04269