~ubuntu-branches/ubuntu/hardy/pidgin/hardy

« back to all changes in this revision

Viewing changes to finch/libgnt/gntbox.c

  • Committer: Bazaar Package Importer
  • Author(s): Pedro Fragoso
  • Date: 2007-12-21 02:48:06 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20071221024806-pd44a5k9tiyh12mp
Tags: 1:2.3.1-2ubuntu1
* Sync with Debian, remaining Ubuntu changes; (LP: #177811)
  - Set Maintainer to Ubuntu Core Developers.
  - Add build-deps on liblaunchpad-integration-dev, intltool,
    libnm-glib-dev (for --enable-nm) (Ubuntu #112720).
  - Drop build-deps on libsilc-1.1-2-dev | libsilc-dev (>= 1.1.1) as 
    this library is in universe.
  - Drop the libpurple0 recommends on libpurple-bin.
  - Add a gaim transitionnal package for upgrades.
  - Ship compatibility symlinks via debian/gaim.links.
  - Pass --enable-nm to configure to enable NetworkManager support.
  - Pass --disable-silc to configure to disable silc support even if 
    it's installed in the build environment.
  - Add X-Ubuntu-Gettext-Domain to the desktop file and update the
    translation templates in common-install-impl::.
   - Update debian/prefs.xml to set the notify plugin prefs
    /plugins/gtk/X11/notify/* and set /pidgin/plugins/loaded to load 
    the notify plugin; Ubuntu: #13389.
  - Add LPI integration patch, 02_lpi.
  - Add patch 04_let_crasher_for_apport to stop catching the SIGSEGV signal
    and let apport handle it.
  - Add patch 05_default_to_irc_ubuntu_com to set the default IRC 
    server to irc.ubuntu.com.
  - Add autoconf patch, 70_autoconf.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
enum
29
29
{
 
30
        PROP_0,
 
31
        PROP_VERTICAL,
 
32
        PROP_HOMO        /* ... */
 
33
};
 
34
 
 
35
enum
 
36
{
30
37
        SIGS = 1,
31
38
};
32
39
 
80
87
                get_title_thingies(box, title, &pos, &right);
81
88
 
82
89
                if (gnt_widget_has_focus(widget))
83
 
                        wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_TITLE));
 
90
                        wbkgdset(widget->window, '\0' | gnt_color_pair(GNT_COLOR_TITLE));
84
91
                else
85
 
                        wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_TITLE_D));
86
 
                mvwaddch(widget->window, 0, pos-1, ACS_RTEE | COLOR_PAIR(GNT_COLOR_NORMAL));
 
92
                        wbkgdset(widget->window, '\0' | gnt_color_pair(GNT_COLOR_TITLE_D));
 
93
                mvwaddch(widget->window, 0, pos-1, ACS_RTEE | gnt_color_pair(GNT_COLOR_NORMAL));
87
94
                mvwaddstr(widget->window, 0, pos, title);
88
 
                mvwaddch(widget->window, 0, right, ACS_LTEE | COLOR_PAIR(GNT_COLOR_NORMAL));
 
95
                mvwaddch(widget->window, 0, right, ACS_LTEE | gnt_color_pair(GNT_COLOR_NORMAL));
89
96
                g_free(title);
90
97
        }
91
98
        
511
518
}
512
519
 
513
520
static void
 
521
gnt_box_set_property(GObject *obj, guint prop_id, const GValue *value,
 
522
                GParamSpec *spec)
 
523
{
 
524
        GntBox *box = GNT_BOX(obj);
 
525
        switch (prop_id) {
 
526
                case PROP_VERTICAL:
 
527
                        box->vertical = g_value_get_boolean(value);
 
528
                        break;
 
529
                case PROP_HOMO:
 
530
                        box->homogeneous = g_value_get_boolean(value);
 
531
                        break;
 
532
                default:
 
533
                        g_return_if_reached();
 
534
                        break;
 
535
        }
 
536
}
 
537
 
 
538
static void
 
539
gnt_box_get_property(GObject *obj, guint prop_id, GValue *value,
 
540
                GParamSpec *spec)
 
541
{
 
542
        GntBox *box = GNT_BOX(obj);
 
543
        switch (prop_id) {
 
544
                case PROP_VERTICAL:
 
545
                        g_value_set_boolean(value, box->vertical);
 
546
                        break;
 
547
                case PROP_HOMO:
 
548
                        g_value_set_boolean(value, box->homogeneous);
 
549
                        break;
 
550
                default:
 
551
                        break;
 
552
        }
 
553
}
 
554
 
 
555
static void
514
556
gnt_box_class_init(GntBoxClass *klass)
515
557
{
 
558
        GObjectClass *gclass = G_OBJECT_CLASS(klass);
516
559
        parent_class = GNT_WIDGET_CLASS(klass);
517
560
        parent_class->destroy = gnt_box_destroy;
518
561
        parent_class->draw = gnt_box_draw;
527
570
        parent_class->confirm_size = gnt_box_confirm_size;
528
571
        parent_class->size_changed = gnt_box_size_changed;
529
572
 
530
 
        GNTDEBUG;
 
573
        gclass->set_property = gnt_box_set_property;
 
574
        gclass->get_property = gnt_box_get_property;
 
575
        g_object_class_install_property(gclass,
 
576
                        PROP_VERTICAL,
 
577
                        g_param_spec_boolean("vertical", "Vertical",
 
578
                                "Whether the child widgets in the box should be stacked vertically.",
 
579
                                TRUE,
 
580
                                G_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB
 
581
                        )
 
582
                );
 
583
        g_object_class_install_property(gclass,
 
584
                        PROP_HOMO,
 
585
                        g_param_spec_boolean("homogeneous", "Homogeneous",
 
586
                                "Whether the child widgets in the box should have the same size.",
 
587
                                TRUE,
 
588
                                G_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB
 
589
                        )
 
590
                );
531
591
}
532
592
 
533
593
static void
603
663
                /* Erase the old title */
604
664
                int pos, right;
605
665
                get_title_thingies(b, prev, &pos, &right);
606
 
                mvwhline(w->window, 0, pos - 1, ACS_HLINE | COLOR_PAIR(GNT_COLOR_NORMAL),
 
666
                mvwhline(w->window, 0, pos - 1, ACS_HLINE | gnt_color_pair(GNT_COLOR_NORMAL),
607
667
                                right - pos + 2);
608
668
                g_free(prev);
609
669
        }
791
851
 
792
852
void gnt_box_give_focus_to_child(GntBox *box, GntWidget *widget)
793
853
{
794
 
        GList *find = g_list_find(box->focus, widget);
795
 
        gpointer now = box->active;
 
854
        GList *find;
 
855
        gpointer now;
 
856
 
 
857
        while (GNT_WIDGET(box)->parent)
 
858
                box = GNT_BOX(GNT_WIDGET(box)->parent);
 
859
 
 
860
        find = g_list_find(box->focus, widget);
 
861
        now = box->active;
796
862
        if (find)
797
863
                box->active = widget;
798
864
        if (now && now != box->active)