1
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
6
* Copyright (C) 2005 David Malcolm
8
* Conglomerate is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU General Public License as
10
* published by the Free Software Foundation; either version 2 of the
11
* License, or (at your option) any later version.
13
* Conglomerate is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program; if not, write to the Free Software
20
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
* Authors: David Malcolm <david@davemalcolm.demon.co.uk>
27
#include "cong-property-page.h"
29
#include "cong-util.h"
30
#include "cong-command.h"
32
#define PRIVATE(x) ((x)->private)
35
struct CongPropertyPageDetails
38
gulong handler_id_selection_change;
41
/* Internal function declarations: */
43
finalize (GObject *object);
46
dispose (GObject *object);
49
on_selection_change (CongDocument *doc,
50
CongPropertyPage *property_page);
52
/* Exported function definitions: */
53
GNOME_CLASS_BOILERPLATE(CongPropertyPage,
58
CONG_EEL_IMPLEMENT_MUST_OVERRIDE_SIGNAL (cong_property_page, selection_change_handler);
61
cong_property_page_class_init (CongPropertyPageClass *klass)
63
CONG_EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass,
65
selection_change_handler);
66
G_OBJECT_CLASS (klass)->finalize = finalize;
67
G_OBJECT_CLASS (klass)->dispose = dispose;
71
cong_property_page_instance_init (CongPropertyPage *property_page)
73
property_page->private = g_new0(CongPropertyPageDetails,1);
77
* cong_property_page_construct:
88
cong_property_page_construct (CongPropertyPage *property_page,
91
g_return_val_if_fail (IS_CONG_PROPERTY_PAGE(property_page), NULL);
93
PRIVATE(property_page)->doc = doc;
96
PRIVATE(property_page)->handler_id_selection_change = g_signal_connect_after (G_OBJECT(doc),
98
G_CALLBACK(on_selection_change),
100
return CONG_PROPERTY_PAGE (property_page);
104
* cong_property_page_get_document:
111
cong_property_page_get_document (CongPropertyPage *property_page)
113
g_return_val_if_fail (IS_CONG_PROPERTY_PAGE(property_page), NULL);
115
return PRIVATE(property_page)->doc;
118
/* Internal function definitions: */
120
finalize (GObject *object)
122
CongPropertyPage *property_page = CONG_PROPERTY_PAGE(object);
124
g_free (property_page->private);
125
property_page->private = NULL;
127
G_OBJECT_CLASS (parent_class)->finalize (object);
131
dispose (GObject *object)
133
CongPropertyPage *property_page = CONG_PROPERTY_PAGE(object);
135
if (PRIVATE(property_page)->doc) {
137
g_signal_handler_disconnect (G_OBJECT (PRIVATE(property_page)->doc),
138
PRIVATE(property_page)->handler_id_selection_change);
139
PRIVATE(property_page)->handler_id_selection_change = 0;
141
g_object_unref (G_OBJECT (PRIVATE(property_page)->doc));
142
PRIVATE(property_page)->doc = NULL;
145
GNOME_CALL_PARENT (G_OBJECT_CLASS, dispose, (object));
149
on_selection_change (CongDocument *doc,
150
CongPropertyPage *property_page)
152
g_return_if_fail (IS_CONG_PROPERTY_PAGE(property_page));
154
CONG_EEL_CALL_METHOD (CONG_PROPERTY_PAGE_CLASS,
156
selection_change_handler,