* src/hildon-bread-crumb-trail.c: (hildon_bread_crumb_trail_size_allocate):
[hildon] / src / hildon-bread-crumb-trail.c
1 /*
2  * This file is a part of hildon
3  *
4  * Copyright (C) 2007 Nokia Corporation, all rights reserved.
5  *
6  * Contact: Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
7  * Author: Xan Lopez <xan.lopez@nokia.com>
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public License
11  * as published by the Free Software Foundation; version 2.1 of
12  * the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22  * 02110-1301 USA
23  *
24  */
25
26
27 /**
28  * SECTION:hildon-bread-crumb-trail
29  * @short_description: Widget used to represent a specific path in a hierarchical tree.
30  * Stability: Unstable
31  *
32  * HildonBreadCrumbTrail is a GTK widget used to represent the currently active path in
33  * some kind of hierarchical structure (file system, media library, structured document, etc).
34  *
35  * It has built-in support for text and icon bread crumbs, but the trail only requires a very
36  * simple interface to be implemented for its children and thus new types of items can be
37  * implemented if needed. See #HildonBreadCrumb for more details.
38  */
39
40 #include "hildon-marshalers.h"
41 #include "hildon-bread-crumb-trail.h"
42 #include "hildon-bread-crumb-widget.h"
43
44 #define HILDON_BREAD_CRUMB_TRAIL_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), HILDON_TYPE_BREAD_CRUMB_TRAIL, HildonBreadCrumbTrailPrivate))
45
46 struct _HildonBreadCrumbTrailPrivate
47 {
48   GtkWidget *back_button;
49   GList *item_list;
50 };
51
52 /* Signals */
53
54 enum {
55   CRUMB_CLICKED,
56   LAST_SIGNAL
57 };
58
59 /* Properties */
60
61 enum {
62   PROP_0
63 };
64
65 static void hildon_bread_crumb_trail_size_request (GtkWidget *widget,
66                                                    GtkRequisition *requisition);
67 static void hildon_bread_crumb_trail_size_allocate (GtkWidget *widget,
68                                                     GtkAllocation *allocation);
69 static void hildon_bread_crumb_trail_add (GtkContainer *container,
70                                           GtkWidget *widget);
71 static void hildon_bread_crumb_trail_forall (GtkContainer *container,
72                                              gboolean include_internals,
73                                              GtkCallback callback,
74                                              gpointer callback_data);
75 static void hildon_bread_crumb_trail_remove (GtkContainer *container,
76                                              GtkWidget *widget);
77 static void hildon_bread_crumb_trail_finalize (GObject *object);
78 static void hildon_bread_crumb_trail_scroll_back (GtkWidget *button,
79                                                   HildonBreadCrumbTrail *bct);
80 static void hildon_bread_crumb_trail_update_back_button_sensitivity (HildonBreadCrumbTrail *bct);
81
82 static guint bread_crumb_trail_signals[LAST_SIGNAL] = { 0 };
83
84 /* GType methods */
85
86 G_DEFINE_TYPE (HildonBreadCrumbTrail, hildon_bread_crumb_trail, GTK_TYPE_CONTAINER)
87
88 static void
89 hildon_bread_crumb_trail_class_init (HildonBreadCrumbTrailClass *klass)
90 {
91   GObjectClass *gobject_class = (GObjectClass*)klass;
92   GtkObjectClass *object_class = (GtkObjectClass*)klass;
93   GtkWidgetClass *widget_class = (GtkWidgetClass*)klass;
94   GtkContainerClass *container_class = (GtkContainerClass*)klass;
95
96   /* GObject signals */
97   gobject_class->finalize = hildon_bread_crumb_trail_finalize;
98
99   /* GtkWidget signals */
100   widget_class->size_request = hildon_bread_crumb_trail_size_request;
101   widget_class->size_allocate = hildon_bread_crumb_trail_size_allocate;
102
103   /* GtkContainer signals */
104   container_class->add = hildon_bread_crumb_trail_add;
105   container_class->forall = hildon_bread_crumb_trail_forall;
106   container_class->remove = hildon_bread_crumb_trail_remove;
107
108   /* Style properties */
109
110 #define _BREAD_CRUMB_TRAIL_MINIMUM_WIDTH 10
111
112   /* FIXME: is this the best way to do it? */
113   gtk_widget_class_install_style_property (widget_class,
114                                            g_param_spec_int ("minimum-width",
115                                                              "Minimum width",
116                                                              "The minimum width in characters the children widgets will request",
117                                                              0,
118                                                              G_MAXINT,
119                                                              _BREAD_CRUMB_TRAIL_MINIMUM_WIDTH,
120                                                              G_PARAM_READABLE));
121
122 #define _BREAD_CRUMB_TRAIL_ARROW_SIZE 34
123
124   gtk_widget_class_install_style_property (widget_class,
125                                            g_param_spec_int ("arrow-size",
126                                                              "Arrow size",
127                                                              "Size of the back button arrow",
128                                                              0,
129                                                              G_MAXINT,
130                                                              _BREAD_CRUMB_TRAIL_ARROW_SIZE,
131                                                              G_PARAM_READABLE));
132   /* Signals */
133   bread_crumb_trail_signals[CRUMB_CLICKED] =
134     g_signal_new ("crumb-clicked",
135                   G_OBJECT_CLASS_TYPE (object_class),
136                   G_SIGNAL_RUN_LAST,
137                   G_STRUCT_OFFSET (HildonBreadCrumbTrailClass, crumb_clicked),
138                   g_signal_accumulator_true_handled, NULL,
139                   _hildon_marshal_BOOLEAN__POINTER,
140                   G_TYPE_BOOLEAN, 1,
141                   G_TYPE_POINTER);
142                   
143   /* Private data */
144   g_type_class_add_private (gobject_class, sizeof (HildonBreadCrumbTrailPrivate));
145 }
146
147 static void
148 hildon_bread_crumb_trail_finalize (GObject *object)
149 {
150   HildonBreadCrumbTrailPrivate *priv = HILDON_BREAD_CRUMB_TRAIL (object)->priv;
151
152   g_list_free (priv->item_list);
153
154   G_OBJECT_CLASS (hildon_bread_crumb_trail_parent_class)->finalize (object);
155 }
156
157 static void
158 hildon_bread_crumb_trail_size_request (GtkWidget *widget,
159                                        GtkRequisition *requisition)
160 {
161   GList *p;
162   GtkRequisition child_requisition;
163   HildonBreadCrumbTrail *bct;
164   HildonBreadCrumbTrailPrivate *priv;
165   gint minimum_width, width = 0;
166   PangoLayout *layout;
167   gchar *tmp = NULL;
168
169   bct= HILDON_BREAD_CRUMB_TRAIL (widget);
170   priv = bct->priv;
171
172   requisition->height = 0;
173   requisition->width = 0;
174
175   gtk_widget_size_request (priv->back_button, &child_requisition);
176   requisition->width = child_requisition.width;
177   requisition->height = child_requisition.height;
178
179   if (priv->item_list)
180     {
181       /* Add minimum width for one item */
182       /* TODO: this can be probably cached */
183       gtk_widget_style_get (widget,
184                             "minimum-width", &minimum_width,
185                             NULL);
186
187       tmp = g_strnfill ((gsize)minimum_width, 'm');
188       layout = gtk_widget_create_pango_layout (widget, tmp);
189       g_free (tmp);
190       pango_layout_get_size (layout, &width, NULL);
191       requisition->width += PANGO_PIXELS (width);
192       g_object_unref (layout);
193     }
194
195   /* Button requisitions */
196   for (p = priv->item_list; p; p = p->next)
197     {
198       GtkWidget *child = GTK_WIDGET (p->data);
199
200       if (GTK_WIDGET_VISIBLE (child))
201         gtk_widget_size_request (child, &child_requisition);
202     }
203
204   /* Border width */
205   requisition->width += GTK_CONTAINER (widget)->border_width * 2;
206   requisition->height += GTK_CONTAINER (widget)->border_width * 2;
207
208   widget->requisition = *requisition;
209 }
210
211 /* Document me please */
212
213 static void
214 hildon_bread_crumb_trail_size_allocate (GtkWidget *widget,
215                                         GtkAllocation *allocation)
216 {
217   GtkRequisition req;
218   gint natural_width, natural_height;
219   HildonBreadCrumb *item;
220   GtkAllocation child_allocation;
221   GtkRequisition child_requisition;
222   GtkWidget *child;
223   gint allocation_width;
224   gint border_width, width;
225   gint extra_space;
226   GList *p, *first_show, *first_hide;
227   gint back_button_size;
228   HildonBreadCrumbTrailPrivate *priv = HILDON_BREAD_CRUMB_TRAIL (widget)->priv;
229
230   widget->allocation = *allocation;
231
232   border_width = (gint) GTK_CONTAINER (widget)->border_width;
233   allocation_width = allocation->width - 2 * border_width;
234
235   /* Allocate the back button */
236   child_allocation.x = allocation->x + border_width;
237   child_allocation.y = allocation->y + border_width;
238   gtk_widget_get_child_requisition (priv->back_button, &child_requisition);
239   /* We want the back button to be a square */
240   back_button_size = MAX (child_requisition.width, child_requisition.height);
241   child_allocation.width = child_allocation.height = back_button_size;
242   gtk_widget_size_allocate (priv->back_button, &child_allocation);
243   child_allocation.x += back_button_size;
244
245   /* If there are no buttons there's nothing else to do */
246   if (priv->item_list == NULL)
247     return;
248
249   /* We find out how many buttons can we show, starting from the
250      the last one in the logical path (the first item in the list) */
251
252   width = back_button_size;
253   p = priv->item_list;
254   first_show = NULL;
255   first_hide = NULL; 
256   extra_space = 0;
257
258   for (p = priv->item_list; p; p = p->next)
259     {
260       item = HILDON_BREAD_CRUMB (p->data);
261       child = GTK_WIDGET (item);
262
263       /* Does the widget fit with its natural size? */
264       hildon_bread_crumb_get_natural_size (item,
265                                            &natural_width,
266                                            &natural_height);
267
268       if (width + natural_width <= allocation_width)
269         {
270           /* Yes, it does */
271           first_show = p;
272           first_hide = p->next;
273           width += natural_width;
274         }
275       else
276         {
277           /* No, it doesn't. Allocate as much as possible
278              and stop */
279           child_allocation.width = allocation_width - width;
280
281           gtk_widget_size_request (child, &req);
282
283           if (child_allocation.width > req.width)
284             {
285               first_hide = p->next;
286               gtk_widget_size_allocate (child, &child_allocation);
287               gtk_widget_show (child);
288               gtk_widget_set_child_visible (child, TRUE);
289               child_allocation.x += child_allocation.width;
290             }
291           else
292             {
293               extra_space = child_allocation.width;
294             }
295
296           break;
297         }
298     }
299
300   /* Not enough items to fill the breadcrumb? */
301   if (p == NULL && width < allocation_width)
302     {
303       extra_space = allocation_width - width;
304     }
305
306   /* Allocate the other buttons */
307   for (p = first_show; p; p = p->prev)
308     {
309       item = HILDON_BREAD_CRUMB (p->data);
310       child = GTK_WIDGET (item);
311
312       /* Does the widget fit with its natural size? */
313       hildon_bread_crumb_get_natural_size (item,
314                                            &natural_width,
315                                            &natural_height);
316
317       /* If I'm the last and there's extra space, use it */
318       if (p->prev == NULL && extra_space != 0)
319         {
320           natural_width += extra_space;
321         }
322
323       child_allocation.width = natural_width;
324       gtk_widget_size_allocate (child, &child_allocation);
325       gtk_widget_show (child);
326       gtk_widget_set_child_visible (child, TRUE);
327       child_allocation.x += child_allocation.width;
328     }
329
330   for (p = first_hide; p; p = p->next)
331     {
332       item = HILDON_BREAD_CRUMB (p->data);
333       child = GTK_WIDGET (item);
334
335       gtk_widget_hide (GTK_WIDGET (item));
336       gtk_widget_set_child_visible (GTK_WIDGET (item), FALSE);
337     }
338 }
339
340 static gpointer
341 get_bread_crumb_id (HildonBreadCrumb *item)
342 {
343   return g_object_get_data (G_OBJECT (item), "bread-crumb-id");
344 }
345
346 static void
347 crumb_activated_cb (GtkWidget *button,
348                     HildonBreadCrumbTrail *bct)
349 {
350   gboolean signal_handled = FALSE;
351
352   g_signal_emit (bct, bread_crumb_trail_signals[CRUMB_CLICKED], 0,
353                  get_bread_crumb_id (HILDON_BREAD_CRUMB (button)),
354                  &signal_handled);
355
356   if (signal_handled == FALSE)
357     {
358       GtkWidget *child;
359       HildonBreadCrumbTrailPrivate *priv;
360
361       priv = bct->priv;
362
363       child = GTK_WIDGET (priv->item_list->data);
364
365       /* We remove the tip of the list until we hit the clicked button */
366       while (child != button)
367         {
368           gtk_container_remove (GTK_CONTAINER (bct), child);
369
370           child = GTK_WIDGET (priv->item_list->data);
371         }
372     }
373 }
374
375 static void
376 hildon_bread_crumb_trail_add (GtkContainer *container,
377                               GtkWidget *widget)
378 {
379   gtk_widget_set_parent (widget, GTK_WIDGET (container));
380
381   if (HILDON_IS_BREAD_CRUMB (widget))
382     {
383       HildonBreadCrumbTrail *bct = HILDON_BREAD_CRUMB_TRAIL (container);
384
385       g_signal_connect (G_OBJECT (widget), "crumb-activated",
386                         G_CALLBACK (crumb_activated_cb), container);
387
388       bct->priv->item_list = g_list_prepend (bct->priv->item_list, widget);
389
390       hildon_bread_crumb_trail_update_back_button_sensitivity (bct);
391     }
392 }
393
394 static void
395 hildon_bread_crumb_trail_forall (GtkContainer *container,
396                                  gboolean include_internals,
397                                  GtkCallback callback,
398                                  gpointer callback_data)
399 {
400   g_return_if_fail (callback != NULL);
401   g_return_if_fail (HILDON_IS_BREAD_CRUMB_TRAIL (container));
402
403   GList *children;
404   HildonBreadCrumbTrailPrivate *priv = HILDON_BREAD_CRUMB_TRAIL (container)->priv;
405
406   children = priv->item_list;
407
408   while (children)
409     {
410       GtkWidget *child;
411       child = GTK_WIDGET (children->data);
412       children = children->next;
413
414       (*callback) (child, callback_data);
415     }
416
417   if (include_internals && priv->back_button)
418     {
419       (*callback) (priv->back_button, callback_data);
420     }
421 }
422
423 static void
424 hildon_bread_crumb_trail_remove (GtkContainer *container,
425                                  GtkWidget *widget)
426 {
427   GList *p;
428   HildonBreadCrumbTrailPrivate *priv;
429   gboolean was_visible = GTK_WIDGET_VISIBLE (widget);
430
431   priv = HILDON_BREAD_CRUMB_TRAIL (container)->priv;
432
433   p = priv->item_list;
434
435   while (p)
436     {
437       if (widget == GTK_WIDGET (p->data))
438         {
439           g_signal_handlers_disconnect_by_func (widget, G_CALLBACK (crumb_activated_cb),
440                                                 HILDON_BREAD_CRUMB_TRAIL (container));
441           gtk_widget_unparent (widget);
442
443           priv->item_list = g_list_remove_link (priv->item_list, p);
444           g_list_free (p);
445
446           hildon_bread_crumb_trail_update_back_button_sensitivity (HILDON_BREAD_CRUMB_TRAIL (container));
447
448           if (was_visible)
449             {
450               gtk_widget_queue_resize (GTK_WIDGET (container));
451             }
452         }
453
454       p = p->next;
455     }
456 }
457
458 static void
459 hildon_bread_crumb_trail_update_back_button_sensitivity (HildonBreadCrumbTrail *bct)
460 {
461   guint list_length;
462   HildonBreadCrumbTrailPrivate *priv = bct->priv;
463
464   list_length = g_list_length (priv->item_list);
465
466   if (list_length == 0 || list_length == 1)
467     {
468       gtk_widget_set_sensitive (priv->back_button, FALSE);
469     }
470   else
471     {
472       gtk_widget_set_sensitive (priv->back_button, TRUE);
473     }
474 }
475
476 static GtkWidget*
477 create_back_button (HildonBreadCrumbTrail *bct)
478 {
479   GtkWidget *button;
480   GtkWidget *arrow;
481   gint arrow_size;
482
483   gtk_widget_push_composite_child ();
484
485   button = gtk_button_new ();
486   gtk_widget_set_name (button, "hildon-bread-crumb-back-button");
487   gtk_widget_set_sensitive (button, FALSE);
488
489   arrow = gtk_arrow_new (GTK_ARROW_LEFT, GTK_SHADOW_NONE);
490   gtk_widget_style_get (GTK_WIDGET (bct),
491                         "arrow-size", &arrow_size,
492                         NULL);
493   gtk_widget_set_size_request (arrow, arrow_size, arrow_size);
494
495   gtk_container_add (GTK_CONTAINER (button), arrow);
496   gtk_container_add (GTK_CONTAINER (bct), button);
497   gtk_widget_show_all (button);
498
499   gtk_widget_pop_composite_child ();
500
501   return button;
502 }
503
504 static void
505 hildon_bread_crumb_trail_init (HildonBreadCrumbTrail *bct)
506 {
507   HildonBreadCrumbTrailPrivate *priv = HILDON_BREAD_CRUMB_TRAIL_GET_PRIVATE (bct);
508
509   GTK_WIDGET_SET_FLAGS (bct, GTK_NO_WINDOW);
510   gtk_widget_set_redraw_on_allocate (GTK_WIDGET (bct), FALSE);
511
512   bct->priv = priv;
513   priv->item_list = NULL;
514
515   priv->back_button = create_back_button (bct);
516   g_signal_connect (priv->back_button, "clicked",
517                     G_CALLBACK (hildon_bread_crumb_trail_scroll_back),
518                     bct);
519 }
520
521 static void
522 hildon_bread_crumb_trail_scroll_back (GtkWidget *button,
523                                       HildonBreadCrumbTrail *bct)
524 {
525   HildonBreadCrumb *item;
526
527   hildon_bread_crumb_trail_pop (bct);
528
529   item = HILDON_BREAD_CRUMB (bct->priv->item_list->data);
530
531   g_signal_emit (bct, bread_crumb_trail_signals[CRUMB_CLICKED], 0,
532                  get_bread_crumb_id (item));
533 }
534
535 static void
536 attach_bread_crumb (HildonBreadCrumbTrail *bct,
537                     GtkWidget *bread_crumb,
538                     gpointer id,
539                     GDestroyNotify destroy)
540 {
541   g_object_set_data_full (G_OBJECT (bread_crumb), "bread-crumb-id", id, destroy);
542
543   gtk_container_add (GTK_CONTAINER (bct), bread_crumb);
544
545   gtk_widget_show (bread_crumb);
546 }
547
548 /* PUBLIC API */
549
550 /**
551  * hildon_bread_crumb_trail_new:
552  * 
553  * Creates a new #HildonBreadCrumbTrail widget.
554  *
555  * Returns: a #GtkWidget pointer of newly created bread crumb trail
556  * widget
557  *
558  * Stability: Unstable
559  */
560
561 GtkWidget*
562 hildon_bread_crumb_trail_new (void)
563 {
564   return GTK_WIDGET (g_object_new (HILDON_TYPE_BREAD_CRUMB_TRAIL, NULL));
565 }
566
567 /**
568  * hildon_bread_crumb_trail_push:
569  * @bct: pointer to #HildonBreadCrumbTrail
570  * @item: the #HildonBreadCrumb to be added to the trail
571  * @id: optional id for the bread crumb
572  * @destroy: GDestroyNotify callback to be called when the bread crumb is destroyed
573  *
574  * Adds a new bread crumb to the end of the trail.
575  *
576  * Stability: Unstable
577  */
578
579 void
580 hildon_bread_crumb_trail_push (HildonBreadCrumbTrail *bct,
581                                HildonBreadCrumb *item,
582                                gpointer id,
583                                GDestroyNotify destroy)
584 {
585   GtkWidget *widget;
586
587   g_return_if_fail (HILDON_IS_BREAD_CRUMB_TRAIL (bct));
588   g_return_if_fail (HILDON_IS_BREAD_CRUMB (item));
589
590   widget = GTK_WIDGET (item);
591
592   attach_bread_crumb (bct, widget, id, destroy);
593 }
594
595 /**
596  * hildon_bread_crumb_trail_push_text:
597  * @bct: pointer to #HildonBreadCrumbTrail
598  * @text: content of the new bread crumb
599  * @id: optional id for the bread crumb
600  * @destroy: GDestroyNotify callback to be called when the bread crumb is destroyed
601  *
602  * Adds a new bread crumb to the end of the trail containing the specified text.
603  *
604  * Stability: Unstable
605  */
606
607 void
608 hildon_bread_crumb_trail_push_text (HildonBreadCrumbTrail *bct,
609                                     const gchar *text,
610                                     gpointer id,
611                                     GDestroyNotify destroy)
612 {
613   GtkWidget *widget;
614
615   g_return_if_fail (HILDON_IS_BREAD_CRUMB_TRAIL (bct));
616   g_return_if_fail (text != NULL);
617
618   widget = _hildon_bread_crumb_widget_new_with_text (text);
619   attach_bread_crumb (bct, widget, id, destroy);
620 }
621
622 /**
623  * hildon_bread_crumb_trail_push_text:
624  * @bct: pointer to #HildonBreadCrumbTrail
625  * @text: content of the new bread crumb
626  * @icon: a widget to set as the icon in the bread crumb
627  * @id: optional id for the bread crumb
628  * @destroy: GDestroyNotify callback to be called when the bread crumb is destroyed
629  *
630  * Adds a new bread crumb to the end of the trail containing the specified text and
631  * icon.
632  *
633  * Stability: Unstable
634  */
635
636 void
637 hildon_bread_crumb_trail_push_icon (HildonBreadCrumbTrail *bct,
638                                     const gchar *text,
639                                     GtkWidget *icon,
640                                     gpointer id,
641                                     GDestroyNotify destroy)
642 {
643   GtkWidget *widget;
644
645   g_return_if_fail (HILDON_IS_BREAD_CRUMB_TRAIL (bct));
646   g_return_if_fail (text != NULL);
647   g_return_if_fail (GTK_IS_WIDGET (icon));
648
649   widget = _hildon_bread_crumb_widget_new_with_icon (icon, text);
650   attach_bread_crumb (bct, widget, id, destroy);
651 }
652
653 /**
654  * hildon_bread_crumb_trail_pop:
655  * @bct: pointer to #HildonBreadCrumbTrail
656  *
657  * Removes the last bread crumb from the trail.
658  *
659  * Stability: Unstable
660  */
661
662 void
663 hildon_bread_crumb_trail_pop (HildonBreadCrumbTrail *bct)
664 {
665   GtkWidget *child;
666   HildonBreadCrumbTrailPrivate *priv;
667
668   g_return_if_fail (HILDON_IS_BREAD_CRUMB_TRAIL (bct));
669
670   priv = bct->priv;
671
672   if (priv->item_list == NULL)
673     return;
674
675   if (priv->item_list)
676     {
677       child = GTK_WIDGET (priv->item_list->data);
678       gtk_container_remove (GTK_CONTAINER (bct), child);
679     }
680
681   hildon_bread_crumb_trail_update_back_button_sensitivity (bct);
682 }
683
684 /**
685  * hildon_bread_crumb_trail_clear:
686  * @bct: pointer to #HildonBreadCrumbTrail
687  *
688  * Removes all the bread crumbs from the bread crumb trail.
689  *
690  * Stability: Unstable
691  */
692
693 void
694 hildon_bread_crumb_trail_clear (HildonBreadCrumbTrail *bct)
695 {
696   HildonBreadCrumbTrailPrivate *priv;
697
698   g_return_if_fail (HILDON_IS_BREAD_CRUMB_TRAIL (bct));
699
700   priv = bct->priv;
701
702   while (priv->item_list)
703     {
704       hildon_bread_crumb_trail_pop (bct);
705     }
706 }