1 /* gEDA - GPL Electronic Design Automation
2 * gschem - gEDA Schematic Capture
3 * Copyright (C) 1998-2000 Ales V. Hvezda
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
25 #include <libgeda/libgeda.h>
27 #include "../include/globals.h"
28 #include "../include/prototype.h"
30 #ifdef HAVE_LIBDMALLOC
34 /*! \todo Finish function documentation!!!
36 * \par Function Description
39 static void i_update_status(TOPLEVEL
*w_current
, const char *string
)
41 if (!w_current
->status_label
) {
46 /* NOTE: consider optimizing this if same label */
47 w_current
->DONT_RESIZE
=1;
48 gtk_label_set(GTK_LABEL(w_current
->status_label
),
53 /*! \todo Finish function documentation!!!
55 * \par Function Description
58 /* Prefix to i_show_state(), i_set_state() and i_set_state_msg()
59 , Allows expose events to happen
62 void i_allow_expose(void)
64 /* This function is probably not needed and should be deleted eventually */
66 /* HACK: This one allows the expose events to happen? */
67 w_current
->DONT_EXPOSE
= 1;
71 /*! \todo Finish function documentation!!!
73 * \par Function Description
76 /* Get string corresponding to the currently selected mode
77 * The returned string will only last until the next time
78 * the function is called (which is probably just fine, really)
81 static const char *i_status_string(TOPLEVEL
*w_current
)
85 switch ( w_current
->event_state
) {
87 case STARTROUTENET
: /*! \todo */
88 case ENDROUTENET
: /*! \todo */
94 return _("Select Mode");
97 return _("Attribute Mode"); /*EK* new */
100 return _("Component Mode"); /*EK* new */
104 return _("Text Mode"); /*EK* new */
107 return _("Copy Mode");
110 return _("Move Mode");
112 return _("Rotate Mode");
114 return _("Mirror Mode");
118 return _("Zoom Box");
122 return _("Pan Mode");
125 if (buf
) g_free(buf
);
126 buf
= g_strdup_printf(_("Paste %d Mode"), w_current
->buffer_number
+1);
131 return _("Net Mode");
135 return _("Bus Mode");
138 return _("Line Mode");
141 return _("Box Mode");
144 return _("Picture Mode");
147 return _("Circle Mode");
150 return _("Arc Mode");
153 return _("Pin Mode");
159 return _("Multiple Copy");
162 return _("Multiple Copy Mode");
164 return ""; /* should not happen */
167 /*! \todo Finish function documentation!!!
169 * \par Function Description
172 /* Show state field on screen,
173 * possibly with the addition of an extra message
174 * *EK* Egil Kvaleberg
176 void i_show_state(TOPLEVEL
*w_current
, const char *message
)
178 static char *buf
= 0;
180 const char *state_string
= i_status_string(w_current
);
181 const char *what_to_say
;
183 /* This may be a memory leak... either way it's weird and -Wall is */
188 if ( message
!= NULL
) {
189 if ( message
&& message
[0] ) {
190 buf
= g_strdup_printf("%s - ", message
);
191 if (aux
) g_free(aux
);
196 if ( !w_current
->snap
) {
197 buf
= g_strdup_printf("%s%s - ", buf
, _("Snap Off"));
198 if (aux
) g_free(aux
);
202 if ( w_current
->show_hidden_text
) {
203 buf
= g_strdup_printf("%s%s - ", buf
, _("Show Hidden"));
204 if (aux
) g_free(aux
);
209 if (strlen(buf
) > 0) {
210 buf
= g_strdup_printf("%s%s", buf
, state_string
);
211 if (aux
) g_free(aux
);
215 what_to_say
= state_string
;
219 what_to_say
= state_string
;
222 i_update_status(w_current
, what_to_say
);
223 if (buf
!= NULL
) g_free(buf
);
226 /*! \todo Finish function documentation!!!
228 * \par Function Description
231 /* Set new state, then show state field
232 * *EK* Egil Kvaleberg
234 void i_set_state(TOPLEVEL
*w_current
, enum x_states newstate
)
236 i_set_state_msg(w_current
, newstate
, NULL
);
239 /*! \todo Finish function documentation!!!
241 * \par Function Description
244 /* Set new state, then show state field including some message
245 * *EK* Egil Kvaleberg
247 void i_set_state_msg(TOPLEVEL
*w_current
, enum x_states newstate
,
250 w_current
->event_state
= newstate
;
251 i_show_state(w_current
, message
);
254 /*! \todo Finish function documentation!!!
256 * \par Function Description
259 void i_update_left_button(const char *string
)
263 /*! \todo Finish function documentation!!!
265 * \par Function Description
268 void i_update_middle_button(TOPLEVEL
*w_current
,
269 void (*func_ptr
)(gpointer
, guint
, GtkWidget
*), const char *string
)
273 if (func_ptr
== NULL
) {
277 if (string
== NULL
) {
281 if (!w_current
->middle_label
) {
285 switch(w_current
->middle_button
) {
287 /* remove this case eventually and make it a null case */
289 w_current
->DONT_RESIZE
= 1;
290 gtk_label_set(GTK_LABEL(w_current
->middle_label
),
296 w_current
->DONT_RESIZE
= 1;
298 gtk_label_set(GTK_LABEL(w_current
->middle_label
),
302 /* remove this case eventually and make it a null case */
304 w_current
->DONT_RESIZE
= 1;
305 gtk_label_set(GTK_LABEL(w_current
->middle_label
),
311 w_current
->DONT_RESIZE
= 1;
313 temp_string
= g_strconcat (_("Repeat/"), string
, NULL
);
315 gtk_label_set(GTK_LABEL(w_current
->middle_label
),
317 w_current
->last_callback
= func_ptr
;
325 /*! \todo Finish function documentation!!!
327 * \par Function Description
330 void i_update_right_button(const char *string
)
334 /*! \todo Finish function documentation!!!
336 * \par Function Description
339 void i_update_toolbar(TOPLEVEL
*w_current
)
341 if (!w_current
->toolbars
)
344 switch(w_current
->event_state
) {
349 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(
350 w_current
->toolbar_select
), TRUE
);
356 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(
357 w_current
->toolbar_net
), TRUE
);
363 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(
364 w_current
->toolbar_bus
), TRUE
);
367 case(DRAWCOMP
): /*! \todo */
368 case(DRAWLINE
): /*! \todo */
369 case(DRAWBOX
): /*! \todo */
370 case(DRAWPICTURE
): /*! \todo */
371 case(DRAWPIN
): /*! \todo */
372 case(DRAWCIRCLE
): /*! \todo */
373 case(DRAWARC
): /*! \todo */
374 case(MOVE
): /*! \todo */
375 case(COPY
): /*! \todo */
376 case(ZOOM
): /*! \todo */
377 case(PAN
): /*! \todo */
378 case(STARTPAN
): /*! \todo */
379 case(STARTCOPY
): /*! \todo */
380 case(STARTMOVE
): /*! \todo */
381 case(ENDCOPY
): /*! \todo */
382 case(ENDMOVE
): /*! \todo */
383 case(ENDLINE
): /*! \todo */
384 case(ENDBOX
): /*! \todo */
385 case(ENDPICTURE
): /*! \todo */
386 case(ENDCIRCLE
): /*! \todo */
387 case(ENDARC
): /*! \todo */
388 case(ENDPIN
): /*! \todo */
389 case(ENDCOMP
): /*! \todo */
390 case(DRAWATTRIB
): /*! \todo */
391 case(ENDATTRIB
): /*! \todo */
392 case(DRAWTEXT
): /*! \todo */
393 case(ENDTEXT
): /*! \todo */
394 case(ENDROTATEP
): /*! \todo */
395 case(ENDMIRROR
): /*! \todo */
396 case(ZOOMBOXSTART
): /*! \todo */
397 case(ZOOMBOXEND
): /*! \todo */
398 case(STARTROUTENET
): /*! \todo */
399 case(ENDROUTENET
): /*! \todo */
400 case(MOUSEPAN
): /*! \todo */
401 case(STARTPASTE
): /*! \todo */
402 case(ENDPASTE
): /*! \todo */
403 case(GRIPS
): /*! \todo */
404 case(MCOPY
): /*! \todo */
405 case(STARTMCOPY
): /*! \todo */
406 case(ENDMCOPY
): /*! \todo */
408 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(
409 w_current
->toolbar_select
), TRUE
);
414 /*! \todo Finish function documentation!!!
416 * \par Function Description
419 void i_update_menus(TOPLEVEL
*w_current
)
422 * This is very simplistic. Right now it just disables all menu
423 * items which get greyed out when a component is not selected.
424 * Eventually what gets enabled/disabled
425 * should be based on what is in the selection list
428 g_assert(w_current
!= NULL
);
429 g_assert(w_current
->page_current
!= NULL
);
431 if (w_current
->page_current
->selection_list
!= NULL
) {
432 /* since one or more things are selected, we set these TRUE */
433 /* These strings should NOT be internationalized */
434 x_menus_sensitivity(w_current
, "Edit/Cut Buffer", TRUE
);
435 x_menus_sensitivity(w_current
, "Edit/Copy Buffer", TRUE
);
436 x_menus_sensitivity(w_current
, "Edit/Edit...", TRUE
);
437 x_menus_sensitivity(w_current
, "Edit/Edit Text...", TRUE
);
438 x_menus_sensitivity(w_current
, "Edit/Copy Mode", TRUE
);
439 x_menus_sensitivity(w_current
, "Edit/Multiple Copy Mode", TRUE
);
440 x_menus_sensitivity(w_current
, "Edit/Move Mode", TRUE
);
441 x_menus_sensitivity(w_current
, "Edit/Delete", TRUE
);
442 x_menus_sensitivity(w_current
, "Edit/Rotate 90 Mode", TRUE
);
443 x_menus_sensitivity(w_current
, "Edit/Mirror Mode", TRUE
);
444 x_menus_sensitivity(w_current
, "Edit/Slot...", TRUE
);
445 x_menus_sensitivity(w_current
, "Edit/Color...", TRUE
);
446 x_menus_sensitivity(w_current
, "Edit/Lock", TRUE
);
447 x_menus_sensitivity(w_current
, "Edit/Unlock", TRUE
);
448 x_menus_sensitivity(w_current
, "Edit/Line Width & Type...", TRUE
);
449 x_menus_sensitivity(w_current
, "Edit/Fill Type...", TRUE
);
450 x_menus_sensitivity(w_current
, "Edit/Embed Component/Picture", TRUE
);
451 x_menus_sensitivity(w_current
, "Edit/Unembed Component/Picture", TRUE
);
452 x_menus_sensitivity(w_current
, "Edit/Update Component", TRUE
);
453 x_menus_sensitivity(w_current
, "Buffer/Copy into 1", TRUE
);
454 x_menus_sensitivity(w_current
, "Buffer/Copy into 2", TRUE
);
455 x_menus_sensitivity(w_current
, "Buffer/Copy into 3", TRUE
);
456 x_menus_sensitivity(w_current
, "Buffer/Copy into 4", TRUE
);
457 x_menus_sensitivity(w_current
, "Buffer/Copy into 5", TRUE
);
458 x_menus_sensitivity(w_current
, "Buffer/Cut into 1", TRUE
);
459 x_menus_sensitivity(w_current
, "Buffer/Cut into 2", TRUE
);
460 x_menus_sensitivity(w_current
, "Buffer/Cut into 3", TRUE
);
461 x_menus_sensitivity(w_current
, "Buffer/Cut into 4", TRUE
);
462 x_menus_sensitivity(w_current
, "Buffer/Cut into 5", TRUE
);
463 x_menus_sensitivity(w_current
, "Hierarchy/Down Schematic", TRUE
);
464 x_menus_sensitivity(w_current
, "Hierarchy/Down Symbol", TRUE
);
465 x_menus_sensitivity(w_current
, "Hierarchy/Documentation", TRUE
);
466 x_menus_sensitivity(w_current
, "Attributes/Attach", TRUE
);
467 x_menus_sensitivity(w_current
, "Attributes/Detach", TRUE
);
468 x_menus_sensitivity(w_current
, "Attributes/Show Value", TRUE
);
469 x_menus_sensitivity(w_current
, "Attributes/Show Name", TRUE
);
470 x_menus_sensitivity(w_current
, "Attributes/Show Both", TRUE
);
471 x_menus_sensitivity(w_current
, "Attributes/Toggle Visibility", TRUE
);
473 /* Menu items for hierarchy added by SDB 1.9.2005. */
474 x_menus_popup_sensitivity(w_current
, "/Down Schematic", TRUE
);
475 x_menus_popup_sensitivity(w_current
, "/Down Symbol", TRUE
);
476 /* x_menus_popup_sensitivity(w_current, "/Up", TRUE); */
479 /* Nothing is slected. grey these out */
480 /* These strings should NOT be internationalized */
481 x_menus_sensitivity(w_current
, "Edit/Cut Buffer", FALSE
);
482 x_menus_sensitivity(w_current
, "Edit/Copy Buffer", FALSE
);
483 x_menus_sensitivity(w_current
, "Edit/Edit...", FALSE
);
484 x_menus_sensitivity(w_current
, "Edit/Edit Text...", FALSE
);
485 x_menus_sensitivity(w_current
, "Edit/Copy Mode", FALSE
);
486 x_menus_sensitivity(w_current
, "Edit/Multiple Copy Mode", FALSE
);
487 x_menus_sensitivity(w_current
, "Edit/Move Mode", FALSE
);
488 x_menus_sensitivity(w_current
, "Edit/Delete", FALSE
);
489 x_menus_sensitivity(w_current
, "Edit/Rotate 90 Mode", FALSE
);
490 x_menus_sensitivity(w_current
, "Edit/Mirror Mode", FALSE
);
491 x_menus_sensitivity(w_current
, "Edit/Slot...", FALSE
);
492 x_menus_sensitivity(w_current
, "Edit/Color...", FALSE
);
493 x_menus_sensitivity(w_current
, "Edit/Lock", FALSE
);
494 x_menus_sensitivity(w_current
, "Edit/Unlock", FALSE
);
495 x_menus_sensitivity(w_current
, "Edit/Line Width & Type...", FALSE
);
496 x_menus_sensitivity(w_current
, "Edit/Fill Type...", FALSE
);
497 x_menus_sensitivity(w_current
, "Edit/Embed Component/Picture", FALSE
);
498 x_menus_sensitivity(w_current
, "Edit/Unembed Component/Picture", FALSE
);
499 x_menus_sensitivity(w_current
, "Edit/Update Component", FALSE
);
500 x_menus_sensitivity(w_current
, "Buffer/Copy into 1", FALSE
);
501 x_menus_sensitivity(w_current
, "Buffer/Copy into 2", FALSE
);
502 x_menus_sensitivity(w_current
, "Buffer/Copy into 3", FALSE
);
503 x_menus_sensitivity(w_current
, "Buffer/Copy into 4", FALSE
);
504 x_menus_sensitivity(w_current
, "Buffer/Copy into 5", FALSE
);
505 x_menus_sensitivity(w_current
, "Buffer/Cut into 1", FALSE
);
506 x_menus_sensitivity(w_current
, "Buffer/Cut into 2", FALSE
);
507 x_menus_sensitivity(w_current
, "Buffer/Cut into 3", FALSE
);
508 x_menus_sensitivity(w_current
, "Buffer/Cut into 4", FALSE
);
509 x_menus_sensitivity(w_current
, "Buffer/Cut into 5", FALSE
);
510 x_menus_sensitivity(w_current
, "Hierarchy/Down Schematic", FALSE
);
511 x_menus_sensitivity(w_current
, "Hierarchy/Down Symbol", FALSE
);
512 x_menus_sensitivity(w_current
, "Hierarchy/Documentation", FALSE
);
513 x_menus_sensitivity(w_current
, "Attributes/Attach", FALSE
);
514 x_menus_sensitivity(w_current
, "Attributes/Detach", FALSE
);
515 x_menus_sensitivity(w_current
, "Attributes/Show Value", FALSE
);
516 x_menus_sensitivity(w_current
, "Attributes/Show Name", FALSE
);
517 x_menus_sensitivity(w_current
, "Attributes/Show Both", FALSE
);
518 x_menus_sensitivity(w_current
, "Attributes/Toggle Visibility", FALSE
);
520 /* Menu items for hierarchy added by SDB 1.9.2005. */
521 x_menus_popup_sensitivity(w_current
, "/Down Schematic", FALSE
);
522 x_menus_popup_sensitivity(w_current
, "/Down Symbol", FALSE
);
523 /* x_menus_popup_sensitivity(w_current, "/Up", FALSE); */
526 if ((object_buffer
[0] != NULL
) && (object_buffer
[0]->next
!= NULL
)) {
527 x_menus_sensitivity(w_current
, "Edit/Paste Buffer", TRUE
);
528 x_menus_sensitivity(w_current
, "Buffer/Paste from 1", TRUE
);
530 x_menus_sensitivity(w_current
, "Edit/Paste Buffer", FALSE
);
531 x_menus_sensitivity(w_current
, "Buffer/Paste from 1", FALSE
);
534 if ((object_buffer
[1] != NULL
) && (object_buffer
[1]->next
!= NULL
)) {
535 x_menus_sensitivity(w_current
, "Buffer/Paste from 2", TRUE
);
537 x_menus_sensitivity(w_current
, "Buffer/Paste from 2", FALSE
);
540 if ((object_buffer
[2] != NULL
) && (object_buffer
[2]->next
!= NULL
)) {
541 x_menus_sensitivity(w_current
, "Buffer/Paste from 3", TRUE
);
543 x_menus_sensitivity(w_current
, "Buffer/Paste from 3", FALSE
);
546 if ((object_buffer
[3] != NULL
) && (object_buffer
[3]->next
!= NULL
)) {
547 x_menus_sensitivity(w_current
, "Buffer/Paste from 4", TRUE
);
549 x_menus_sensitivity(w_current
, "Buffer/Paste from 4", FALSE
);
552 if ((object_buffer
[4] != NULL
) && (object_buffer
[4]->next
!= NULL
)) {
553 x_menus_sensitivity(w_current
, "Buffer/Paste from 5", TRUE
);
555 x_menus_sensitivity(w_current
, "Buffer/Paste from 5", FALSE
);
562 /* This data is in X bitmap format, and can be created with the 'bitmap'
564 #define cursor1_width 16
565 #define cursor1_height 16
566 static unsigned char cursor1_bits
[] = {
567 0x00, 0x00, 0x08, 0x38, 0x18, 0x08, 0x38, 0x18, 0x78, 0x08, 0xf8, 0x38,
568 0xf8, 0x01, 0xf8, 0x03, 0xf8, 0x07, 0xf8, 0x00, 0xd8, 0x00, 0x88, 0x01,
569 0x80, 0x01, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00};
571 static unsigned char cursor1mask_bits
[] = {
572 0x0c, 0x7c, 0x1c, 0x7c, 0x3c, 0x7c, 0x7c, 0x3c, 0xfc, 0x7c, 0xfc, 0x7d,
573 0xfc, 0x7f, 0xfc, 0x07, 0xfc, 0x0f, 0xfc, 0x0f, 0xfc, 0x01, 0xdc, 0x03,
574 0xcc, 0x03, 0x80, 0x07, 0x80, 0x07, 0x00, 0x03};
577 /*! \todo Finish function documentation!!!
579 * \par Function Description
582 void i_update_cursor(TOPLEVEL
*w_current
)
585 if (!w_current
->cursors
)
592 GdkPixmap
*source
, *mask
;
593 GdkColor fg
= { 0, 0, 0, 0 }; /* Red. */
594 GdkColor bg
= { 0, 65535, 65535, 65535 }; /* Blue. */
596 source
= gdk_bitmap_create_from_data (NULL
, cursor1_bits
,
597 cursor1_width
, cursor1_height
);
598 mask
= gdk_bitmap_create_from_data (NULL
, cursor1mask_bits
,
599 cursor1_width
, cursor1_height
);
600 cursor
= gdk_cursor_new_from_pixmap (source
, mask
, &fg
, &bg
, 3, 1);
601 gdk_pixmap_unref (source
);
602 gdk_pixmap_unref (mask
);
604 gdk_window_set_cursor (w_current
->window
, cursor
);
609 cursor
= gdk_cursor_new(GDK_ARROW
);
610 gdk_window_set_cursor(w_current
->window
, cursor
);
611 gdk_cursor_destroy(cursor
);
614 switch(w_current
->event_state
) {
619 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(
620 w_current
->toolbar_select
), TRUE
);
626 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(
627 w_current
->toolbar_net
), TRUE
);
633 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(
634 w_current
->toolbar_bus
), TRUE
);
637 case(DRAWCOMP
): /*! \todo */
638 case(DRAWLINE
): /*! \todo */
639 case(DRAWBOX
): /*! \todo */
640 case(DRAWPICTURE
): /*! \todo */
641 case(DRAWPIN
): /*! \todo */
642 case(DRAWCIRCLE
): /*! \todo */
643 case(DRAWARC
): /*! \todo */
644 case(MOVE
): /*! \todo */
645 case(COPY
): /*! \todo */
646 case(ZOOM
): /*! \todo */
647 case(PAN
): /*! \todo */
648 case(STARTPAN
): /*! \todo */
649 case(STARTCOPY
): /*! \todo */
650 case(STARTMOVE
): /*! \todo */
651 case(ENDCOPY
): /*! \todo */
652 case(ENDMOVE
): /*! \todo */
653 case(ENDLINE
): /*! \todo */
654 case(ENDBOX
): /*! \todo */
655 case(ENDPICTURE
): /*! \todo */
656 case(ENDCIRCLE
): /*! \todo */
657 case(ENDARC
): /*! \todo */
658 case(ENDPIN
): /*! \todo */
659 case(ENDCOMP
): /*! \todo */
660 case(DRAWATTRIB
): /*! \todo */
661 case(ENDATTRIB
): /*! \todo */
662 case(DRAWTEXT
): /*! \todo */
663 case(ENDTEXT
): /*! \todo */
664 case(ENDROTATEP
): /*! \todo */
665 case(ENDMIRROR
): /*! \todo */
666 case(ZOOMBOXSTART
): /*! \todo */
667 case(ZOOMBOXEND
): /*! \todo */
668 case(STARTROUTENET
): /*! \todo */
669 case(ENDROUTENET
): /*! \todo */
670 case(MOUSEPAN
): /*! \todo */
671 case(STARTPASTE
): /*! \todo */
672 case(ENDPASTE
): /*! \todo */
673 case(GRIPS
): /*! \todo */
674 case(MCOPY
): /*! \todo */
675 case(MCOPYSTART
): /*! \todo */
676 case(MCOPYEND
): /*! \todo */
678 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(
679 w_current
->toolbar_select
), TRUE
);
685 /*! \brief Set filename as gschem window title
686 * \par Function Description
687 * Set the window title using the gnome HID format style.
689 void i_set_filename(TOPLEVEL
*w_current
, const gchar
*string
)
691 gchar
*print_string
=NULL
;
692 gchar
*filename
=NULL
;
694 if (!w_current
->main_window
)
699 filename
= g_path_get_basename(string
);
701 print_string
= g_strdup_printf("%s - gschem", filename
);
703 /* alternativ code with length limited pathname */
705 if (strlen(string) > max_len) {
706 print_string = g_strdup_printf("gschem: ...%s",
707 &(string[strlen(string)-max_len]));
710 print_string = g_strdup_printf("gschem: %s",string);
714 gtk_window_set_title(GTK_WINDOW(w_current
->main_window
),
717 g_free(print_string
);
721 /*! \brief Write the grid settings to the gschem status bar
722 * \par Function Description
723 * The function takes the current grid paramters of gschem and
724 * prints it to the status bar.
725 * The format is "Grid([SnapGridSize],[CurrentGridSize])"
727 void i_set_grid(TOPLEVEL
*w_current
, int visible_grid
)
729 gchar
*print_string
=NULL
;
733 if (!w_current
->grid_label
) {
737 if (!w_current
->snap
)
738 snap
= g_strdup(_("OFF"));
740 snap
= g_strdup_printf("%d", w_current
->snap_size
);
742 if (!w_current
->grid
)
743 grid
= g_strdup(_("OFF"));
745 grid
= g_strdup_printf("%d", visible_grid
);
747 print_string
= g_strdup_printf(_("Grid(%s, %s)"), snap
, grid
);
748 gtk_label_set(GTK_LABEL(w_current
->grid_label
), print_string
);
750 g_free(print_string
);