~ubuntu-branches/ubuntu/quantal/gnumeric/quantal

« back to all changes in this revision

Viewing changes to src/gnm-sheet-slicer-combo.c

  • Committer: Bazaar Package Importer
  • Author(s): Gauvain Pocentek
  • Date: 2009-06-22 13:37:20 UTC
  • mfrom: (1.1.20 upstream) (2.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090622133720-rtdazsiz2lx5q8l7
Tags: 1.9.9-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Promoted gnumeric-doc to Recommends in gnumeric package for help to be
    installed automatically
  - gnumeric-gtk is a transitional package
  - gnumeric conflicts with gnumeric-gtk << 1.8.3-3ubuntu1
  - call initltool-update in po*
  - remove psiconv support (psiconv is in universe):
    o debian/control: remove B-D on libpsiconv-dev
    o debian/rules: don't pass --with-psiconv to ./configure
    o debian/gnumeric-plugins-extra.install: don't install the psiconv
      plugin

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 
2
/*
 
3
 * gnm-sheet-slicer-combo.c: Model for in cell combo for data slicers
 
4
 *
 
5
 * Copyright (C) Jody Goldberg <jody@gnome.org>
 
6
 *
 
7
 * This program is free software; you can redistribute it and/or modify
 
8
 * it under the terms of the GNU General Public License as published by
 
9
 * the Free Software Foundation; either version 2 of the License, or
 
10
 * (at your option) any later version.
 
11
 *
 
12
 * This program is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 * GNU General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License
 
18
 * along with this program; if not, write to the Free Software
 
19
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
20
 */
 
21
 
 
22
#include <gnumeric-config.h>
 
23
#include "gnumeric.h"
 
24
#include "gnm-sheet-slicer-combo.h"
 
25
#include "go-data-slicer-field.h"
 
26
#include "widgets/gnm-cell-combo-foo-view.h"
 
27
#include "widgets/gnm-sheet-slicer-combo-foo-view.h"
 
28
 
 
29
#include <gsf/gsf-impl-utils.h>
 
30
 
 
31
enum {
 
32
        PROP_0,
 
33
        PROP_FIELD
 
34
};
 
35
 
 
36
static void
 
37
gnm_sheet_slicer_combo_finalize (GObject *object)
 
38
{
 
39
#if 0
 
40
        GnmSheetSlicerCombo *sscombo = GNM_SHEET_SLICER_COMBO (object);
 
41
#endif
 
42
        GObjectClass *parent;
 
43
 
 
44
        parent = g_type_class_peek (gnm_cell_combo_get_type ());
 
45
        parent->finalize (object);
 
46
}
 
47
 
 
48
static void
 
49
gnm_sheet_slicer_combo_init (SheetObject *so)
 
50
{
 
51
}
 
52
 
 
53
static SheetObjectView *
 
54
gnm_sheet_slicer_combo_foo_view_new (SheetObject *so, SheetObjectViewContainer *container)
 
55
{
 
56
        return gnm_cell_combo_foo_view_new (so,
 
57
                gnm_sheet_slicer_combo_foo_view_get_type (), container);
 
58
}
 
59
 
 
60
static void
 
61
gnm_sheet_slicer_combo_set_property (GObject *obj, guint property_id,
 
62
                                     GValue const *value, GParamSpec *pspec)
 
63
{
 
64
        GnmSheetSlicerCombo *sscombo = (GnmSheetSlicerCombo *)obj;
 
65
 
 
66
        switch (property_id) {
 
67
        case PROP_FIELD : sscombo->dsf =  g_value_get_object (value); break;
 
68
        default:
 
69
                G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, property_id, pspec);
 
70
        }
 
71
}
 
72
 
 
73
static void
 
74
gnm_sheet_slicer_combo_get_property (GObject *obj, guint property_id,
 
75
                                     GValue *value, GParamSpec *pspec)
 
76
{
 
77
        GnmSheetSlicerCombo const *sscombo = (GnmSheetSlicerCombo const *)obj;
 
78
        switch (property_id) {
 
79
        case PROP_FIELD : g_value_set_object (value, (GObject *) (sscombo->dsf)); break;
 
80
        default:
 
81
                G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, property_id, pspec);
 
82
        }
 
83
}
 
84
static void
 
85
gnm_sheet_slicer_combo_class_init (GObjectClass *gobject_class)
 
86
{
 
87
        SheetObjectClass *so_class = SHEET_OBJECT_CLASS (gobject_class);
 
88
        gobject_class->set_property     = gnm_sheet_slicer_combo_set_property;
 
89
        gobject_class->get_property     = gnm_sheet_slicer_combo_get_property;
 
90
        gobject_class->finalize         = gnm_sheet_slicer_combo_finalize;
 
91
        so_class->new_view              = gnm_sheet_slicer_combo_foo_view_new;
 
92
 
 
93
        g_object_class_install_property (gobject_class, PROP_FIELD,
 
94
                 g_param_spec_object ("field", NULL, NULL, GO_DATA_SLICER_FIELD_TYPE,
 
95
                        GSF_PARAM_STATIC | G_PARAM_READWRITE));
 
96
}
 
97
 
 
98
typedef GnmCellComboClass GnmSheetSlicerComboClass;
 
99
GSF_CLASS (GnmSheetSlicerCombo, gnm_sheet_slicer_combo,
 
100
           gnm_sheet_slicer_combo_class_init, gnm_sheet_slicer_combo_init,
 
101
           gnm_cell_combo_get_type ())