mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Realign source files gnc-dense-cal*.c/h for spaces
This commit is contained in:
parent
a35af97250
commit
d393c42697
@ -1,34 +1,35 @@
|
||||
/*
|
||||
* gnc-dense-cal-model.c
|
||||
*
|
||||
* Copyright (C) 2006 Joshua Sled <jsled@asynchronous.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 and/or version 3 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* As a special exception, permission is granted to link the binary module
|
||||
* resultant from this code with the OpenSSL project's "OpenSSL" library (or
|
||||
* modified versions of it that use the same license as the "OpenSSL"
|
||||
* library), and distribute the linked executable. You must obey the GNU
|
||||
* General Public License in all respects for all of the code used other than
|
||||
* "OpenSSL". If you modify this file, you may extend this exception to your
|
||||
* version of the file, but you are not obligated to do so. If you do not
|
||||
* wish to do so, delete this exception statement from your version of this
|
||||
* file.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
/********************************************************************\
|
||||
* gnc-dense-cal-model.c *
|
||||
* Copyright (C) 2006 Joshua Sled <jsled@asynchronous.org> *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
* published by the Free Software Foundation, under version 2 and *
|
||||
* / or version 3 of the License. *
|
||||
* *
|
||||
* As a special exception, permission is granted to link the binary *
|
||||
* module resultant from this code with the OpenSSL project's *
|
||||
* "OpenSSL" library (or modified versions of it that use the same *
|
||||
* license as the "OpenSSL" library), and distribute the linked *
|
||||
* executable. You must obey the GNU General Public License in all *
|
||||
* respects for all of the code used other than "OpenSSL". If you *
|
||||
* modify this file, you may extend this exception to your version *
|
||||
* of the file, but you are not obligated to do so. If you do not *
|
||||
* wish to do so, delete this exception statement from your version *
|
||||
* of this file. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License*
|
||||
* along with this program; if not, contact:
|
||||
*
|
||||
* Free Software Foundation Voice: +1-617-542-5942
|
||||
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org
|
||||
*/
|
||||
* along with this program; if not, contact: *
|
||||
* *
|
||||
* Free Software Foundation Voice: +1-617-542-5942 *
|
||||
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
\********************************************************************/
|
||||
|
||||
|
||||
#include <config.h>
|
||||
@ -41,7 +42,7 @@ enum { GDCM_ADDED, GDCM_UPDATE, GDCM_REMOVE, LAST_SIGNAL };
|
||||
static guint gnc_dense_cal_model_signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
static void
|
||||
gnc_dense_cal_model_default_init(GncDenseCalModelInterface *g_class)
|
||||
gnc_dense_cal_model_default_init (GncDenseCalModelInterface *g_class)
|
||||
{
|
||||
gnc_dense_cal_model_signals[GDCM_ADDED] = g_signal_new("added",
|
||||
G_TYPE_FROM_CLASS(g_class),
|
||||
@ -80,34 +81,37 @@ gnc_dense_cal_model_default_init(GncDenseCalModelInterface *g_class)
|
||||
);
|
||||
}
|
||||
|
||||
G_DEFINE_INTERFACE (GncDenseCalModel, gnc_dense_cal_model, G_TYPE_OBJECT)
|
||||
G_DEFINE_INTERFACE(GncDenseCalModel, gnc_dense_cal_model, G_TYPE_OBJECT)
|
||||
|
||||
GList*
|
||||
gnc_dense_cal_model_get_contained(GncDenseCalModel *model)
|
||||
gnc_dense_cal_model_get_contained (GncDenseCalModel *model)
|
||||
{
|
||||
return (*GNC_DENSE_CAL_MODEL_GET_IFACE(model)->get_contained)(model);
|
||||
}
|
||||
|
||||
gchar*
|
||||
gnc_dense_cal_model_get_name(GncDenseCalModel *model, guint tag)
|
||||
gnc_dense_cal_model_get_name (GncDenseCalModel *model, guint tag)
|
||||
{
|
||||
return (*GNC_DENSE_CAL_MODEL_GET_IFACE(model)->get_name)(model, tag);
|
||||
}
|
||||
|
||||
gchar*
|
||||
gnc_dense_cal_model_get_info(GncDenseCalModel *model, guint tag)
|
||||
gnc_dense_cal_model_get_info (GncDenseCalModel *model, guint tag)
|
||||
{
|
||||
return (*GNC_DENSE_CAL_MODEL_GET_IFACE(model)->get_info)(model, tag);
|
||||
}
|
||||
|
||||
gint
|
||||
gnc_dense_cal_model_get_instance_count(GncDenseCalModel *model, guint tag)
|
||||
gnc_dense_cal_model_get_instance_count (GncDenseCalModel *model, guint tag)
|
||||
{
|
||||
return (*GNC_DENSE_CAL_MODEL_GET_IFACE(model)->get_instance_count)(model, tag);
|
||||
}
|
||||
|
||||
void
|
||||
gnc_dense_cal_model_get_instance(GncDenseCalModel *model, guint tag, gint instance_index, GDate *date)
|
||||
gnc_dense_cal_model_get_instance (GncDenseCalModel *model,
|
||||
guint tag,
|
||||
gint instance_index,
|
||||
GDate *date)
|
||||
{
|
||||
(*GNC_DENSE_CAL_MODEL_GET_IFACE(model)->get_instance)(model, tag, instance_index, date);
|
||||
}
|
||||
|
@ -1,24 +1,24 @@
|
||||
/*
|
||||
* gnc-dense-cal-model.h
|
||||
*
|
||||
* Copyright (C) 2006 Joshua Sled <jsled@asynchronous.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 and/or version 3 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
/********************************************************************\
|
||||
* gnc-dense-cal-model.h *
|
||||
* Copyright (C) 2006 Joshua Sled <jsled@asynchronous.org> *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
* published by the Free Software Foundation, under version 2 and *
|
||||
* / or version 3 of the License. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License*
|
||||
* along with this program; if not, contact:
|
||||
*
|
||||
* Free Software Foundation Voice: +1-617-542-5942
|
||||
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org
|
||||
*/
|
||||
* along with this program; if not, contact: *
|
||||
* *
|
||||
* Free Software Foundation Voice: +1-617-542-5942 *
|
||||
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
\********************************************************************/
|
||||
|
||||
#ifndef _GNC_DENSE_CAL_MODEL_H
|
||||
#define _GNC_DENSE_CAL_MODEL_H
|
||||
@ -29,8 +29,8 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GNC_TYPE_DENSE_CAL_MODEL (gnc_dense_cal_model_get_type())
|
||||
G_DECLARE_INTERFACE (GncDenseCalModel, gnc_dense_cal_model, GNC, DENSE_CAL_MODEL, GObject)
|
||||
#define GNC_TYPE_DENSE_CAL_MODEL (gnc_dense_cal_model_get_type ())
|
||||
G_DECLARE_INTERFACE(GncDenseCalModel, gnc_dense_cal_model, GNC, DENSE_CAL_MODEL, GObject)
|
||||
|
||||
struct _GncDenseCalModelInterface
|
||||
{
|
||||
@ -45,11 +45,14 @@ struct _GncDenseCalModelInterface
|
||||
};
|
||||
|
||||
/** @return Caller-owned GList (but not elements). The Model-user will free. **/
|
||||
GList* gnc_dense_cal_model_get_contained(GncDenseCalModel *model);
|
||||
gchar* gnc_dense_cal_model_get_name(GncDenseCalModel *model, guint tag);
|
||||
gchar* gnc_dense_cal_model_get_info(GncDenseCalModel *model, guint tag);
|
||||
gint gnc_dense_cal_model_get_instance_count(GncDenseCalModel *model, guint tag);
|
||||
void gnc_dense_cal_model_get_instance(GncDenseCalModel *model, guint tag, gint instance_index, GDate *date);
|
||||
GList* gnc_dense_cal_model_get_contained (GncDenseCalModel *model);
|
||||
gchar* gnc_dense_cal_model_get_name (GncDenseCalModel *model, guint tag);
|
||||
gchar* gnc_dense_cal_model_get_info (GncDenseCalModel *model, guint tag);
|
||||
gint gnc_dense_cal_model_get_instance_count (GncDenseCalModel *model, guint tag);
|
||||
void gnc_dense_cal_model_get_instance (GncDenseCalModel *model,
|
||||
guint tag,
|
||||
gint instance_index,
|
||||
GDate *date);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -1,34 +1,35 @@
|
||||
/*
|
||||
* gnc-dense-cal-store.h
|
||||
*
|
||||
* Copyright (C) 2006 Joshua Sled <jsled@asynchronous.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 and/or version 3 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* As a special exception, permission is granted to link the binary module
|
||||
* resultant from this code with the OpenSSL project's "OpenSSL" library (or
|
||||
* modified versions of it that use the same license as the "OpenSSL"
|
||||
* library), and distribute the linked executable. You must obey the GNU
|
||||
* General Public License in all respects for all of the code used other than
|
||||
* "OpenSSL". If you modify this file, you may extend this exception to your
|
||||
* version of the file, but you are not obligated to do so. If you do not
|
||||
* wish to do so, delete this exception statement from your version of this
|
||||
* file.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, contact:
|
||||
*
|
||||
* Free Software Foundation Voice: +1-617-542-5942
|
||||
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org
|
||||
*/
|
||||
/********************************************************************\
|
||||
* gnc-dense-cal-store.h *
|
||||
* Copyright (C) 2006 Joshua Sled <jsled@asynchronous.org> *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
* published by the Free Software Foundation, under version 2 and *
|
||||
* / or version 3 of the License. *
|
||||
* *
|
||||
* As a special exception, permission is granted to link the binary *
|
||||
* module resultant from this code with the OpenSSL project's *
|
||||
* "OpenSSL" library (or modified versions of it that use the same *
|
||||
* license as the "OpenSSL" library), and distribute the linked *
|
||||
* executable. You must obey the GNU General Public License in all *
|
||||
* respects for all of the code used other than "OpenSSL". If you *
|
||||
* modify this file, you may extend this exception to your version *
|
||||
* of the file, but you are not obligated to do so. If you do not *
|
||||
* wish to do so, delete this exception statement from your version *
|
||||
* of this file. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License*
|
||||
* along with this program; if not, contact: *
|
||||
* *
|
||||
* Free Software Foundation Voice: +1-617-542-5942 *
|
||||
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
\********************************************************************/
|
||||
|
||||
#include <config.h>
|
||||
#include <glib.h>
|
||||
@ -54,20 +55,20 @@ struct _GncDenseCalStore
|
||||
GDate **cal_marks;
|
||||
};
|
||||
|
||||
static void gnc_dense_cal_store_iface_init(GncDenseCalModelInterface *iface);
|
||||
static void gnc_dense_cal_store_finalize(GObject *obj);
|
||||
static void gnc_dense_cal_store_iface_init (GncDenseCalModelInterface *iface);
|
||||
static void gnc_dense_cal_store_finalize (GObject *obj);
|
||||
|
||||
static GList* gdcs_get_contained(GncDenseCalModel *model);
|
||||
static gchar* gdcs_get_name(GncDenseCalModel *model, guint tag);
|
||||
static gchar* gdcs_get_info(GncDenseCalModel *model, guint tag);
|
||||
static gint gdcs_get_instance_count(GncDenseCalModel *model, guint tag);
|
||||
static void gdcs_get_instance(GncDenseCalModel *model, guint tag, gint instance_index, GDate *date);
|
||||
static GList* gdcs_get_contained (GncDenseCalModel *model);
|
||||
static gchar* gdcs_get_name (GncDenseCalModel *model, guint tag);
|
||||
static gchar* gdcs_get_info (GncDenseCalModel *model, guint tag);
|
||||
static gint gdcs_get_instance_count (GncDenseCalModel *model, guint tag);
|
||||
static void gdcs_get_instance (GncDenseCalModel *model, guint tag, gint instance_index, GDate *date);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GncDenseCalStore, gnc_dense_cal_store, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (GNC_TYPE_DENSE_CAL_MODEL, gnc_dense_cal_store_iface_init))
|
||||
G_DEFINE_TYPE_WITH_CODE(GncDenseCalStore, gnc_dense_cal_store, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE(GNC_TYPE_DENSE_CAL_MODEL, gnc_dense_cal_store_iface_init))
|
||||
|
||||
static void
|
||||
gnc_dense_cal_store_class_init(GncDenseCalStoreClass *klass)
|
||||
gnc_dense_cal_store_class_init (GncDenseCalStoreClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
|
||||
@ -75,12 +76,12 @@ gnc_dense_cal_store_class_init(GncDenseCalStoreClass *klass)
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_dense_cal_store_init(GncDenseCalStore *self)
|
||||
gnc_dense_cal_store_init (GncDenseCalStore *self)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_dense_cal_store_iface_init(GncDenseCalModelInterface *iface)
|
||||
gnc_dense_cal_store_iface_init (GncDenseCalModelInterface *iface)
|
||||
{
|
||||
iface->get_contained = gdcs_get_contained;
|
||||
iface->get_name = gdcs_get_name;
|
||||
@ -90,79 +91,75 @@ gnc_dense_cal_store_iface_init(GncDenseCalModelInterface *iface)
|
||||
}
|
||||
|
||||
GncDenseCalStore*
|
||||
gnc_dense_cal_store_new(int num_marks)
|
||||
gnc_dense_cal_store_new (int num_marks)
|
||||
{
|
||||
GncDenseCalStore *model = g_object_new(GNC_TYPE_DENSE_CAL_STORE, NULL);
|
||||
GncDenseCalStore *model = g_object_new (GNC_TYPE_DENSE_CAL_STORE, NULL);
|
||||
model->num_marks = num_marks;
|
||||
model->cal_marks = g_new0(GDate*, num_marks);
|
||||
model->cal_marks = g_new0 (GDate*, num_marks);
|
||||
{
|
||||
int i = 0;
|
||||
for (i = 0; i < model->num_marks; i++)
|
||||
for (int i = 0; i < model->num_marks; i++)
|
||||
{
|
||||
model->cal_marks[i] = g_date_new();
|
||||
}
|
||||
}
|
||||
model->num_real_marks = 0;
|
||||
g_date_clear(&model->start_date, 1);
|
||||
g_date_clear (&model->start_date, 1);
|
||||
gnc_gdate_set_today (&model->start_date);
|
||||
model->end_type = NEVER_END;
|
||||
g_date_clear(&model->end_date, 1);
|
||||
g_date_clear (&model->end_date, 1);
|
||||
gnc_gdate_set_today (&model->end_date);
|
||||
model->n_occurrences = 0;
|
||||
return model;
|
||||
}
|
||||
|
||||
void
|
||||
gnc_dense_cal_store_clear(GncDenseCalStore *model)
|
||||
gnc_dense_cal_store_clear (GncDenseCalStore *model)
|
||||
{
|
||||
model->num_real_marks = 0;
|
||||
g_signal_emit_by_name(model, "update", GUINT_TO_POINTER(1));
|
||||
g_signal_emit_by_name (model, "update", GUINT_TO_POINTER(1));
|
||||
}
|
||||
|
||||
void
|
||||
gnc_dense_cal_store_update_name(GncDenseCalStore *model, const gchar *name)
|
||||
gnc_dense_cal_store_update_name (GncDenseCalStore *model, const gchar *name)
|
||||
{
|
||||
if (model->name != NULL)
|
||||
{
|
||||
g_free(model->name);
|
||||
}
|
||||
model->name = g_strdup(name);
|
||||
g_free (model->name);
|
||||
|
||||
model->name = g_strdup (name);
|
||||
//g_signal_emit_by_name(model, "update", GUINT_TO_POINTER(1));
|
||||
}
|
||||
|
||||
void
|
||||
gnc_dense_cal_store_update_info(GncDenseCalStore *model, const gchar *info)
|
||||
gnc_dense_cal_store_update_info (GncDenseCalStore *model, const gchar *info)
|
||||
{
|
||||
if (model->info != NULL)
|
||||
{
|
||||
g_free(model->info);
|
||||
}
|
||||
model->info = g_strdup(info);
|
||||
g_free (model->info);
|
||||
|
||||
model->info = g_strdup (info);
|
||||
//g_signal_emit_by_name(model, "update", GUINT_TO_POINTER(1));
|
||||
}
|
||||
|
||||
static void
|
||||
gdcs_generic_update_recurrences(GncDenseCalStore *trans, GDate *start, GList *recurrences)
|
||||
gdcs_generic_update_recurrences (GncDenseCalStore *trans, GDate *start, GList *recurrences)
|
||||
{
|
||||
int i;
|
||||
int i = 0;
|
||||
GDate date, next;
|
||||
|
||||
date = *start;
|
||||
recurrenceListNextInstance(recurrences, &date, &next);
|
||||
recurrenceListNextInstance (recurrences, &date, &next);
|
||||
|
||||
i = 0;
|
||||
while ((i < trans->num_marks)
|
||||
&& g_date_valid(&next)
|
||||
&& g_date_valid (&next)
|
||||
/* Do checking against end restriction. */
|
||||
&& ((trans->end_type == NEVER_END)
|
||||
|| (trans->end_type == END_ON_DATE
|
||||
&& g_date_compare(&next, &trans->end_date) <= 0)
|
||||
&& g_date_compare (&next, &trans->end_date) <= 0)
|
||||
|| (trans->end_type == END_AFTER_N_OCCS
|
||||
&& i < trans->n_occurrences)))
|
||||
{
|
||||
*trans->cal_marks[i++] = next;
|
||||
date = next;
|
||||
recurrenceListNextInstance(recurrences, &date, &next);
|
||||
recurrenceListNextInstance (recurrences, &date, &next);
|
||||
}
|
||||
trans->num_real_marks = i;
|
||||
/* cstim: Previously this was i-1 but that's just plain wrong for
|
||||
@ -170,42 +167,50 @@ gdcs_generic_update_recurrences(GncDenseCalStore *trans, GDate *start, GList *re
|
||||
* the number of (rest) occurrences exactly! Subtracting one means
|
||||
* we will miss the last one. */
|
||||
|
||||
g_signal_emit_by_name(trans, "update", GUINT_TO_POINTER(1));
|
||||
g_signal_emit_by_name (trans, "update", GUINT_TO_POINTER(1));
|
||||
}
|
||||
|
||||
void
|
||||
gnc_dense_cal_store_update_recurrences_no_end(GncDenseCalStore *model, GDate *start, GList *recurrences)
|
||||
gnc_dense_cal_store_update_recurrences_no_end (GncDenseCalStore *model,
|
||||
GDate *start,
|
||||
GList *recurrences)
|
||||
{
|
||||
model->end_type = NEVER_END;
|
||||
gdcs_generic_update_recurrences(model, start, recurrences);
|
||||
gdcs_generic_update_recurrences (model, start, recurrences);
|
||||
}
|
||||
|
||||
void
|
||||
gnc_dense_cal_store_update_recurrences_count_end(GncDenseCalStore *model, GDate *start, GList *recurrences, int num_occur)
|
||||
gnc_dense_cal_store_update_recurrences_count_end (GncDenseCalStore *model,
|
||||
GDate *start,
|
||||
GList *recurrences,
|
||||
int num_occur)
|
||||
{
|
||||
model->end_type = END_AFTER_N_OCCS;
|
||||
model->n_occurrences = num_occur;
|
||||
gdcs_generic_update_recurrences(model, start, recurrences);
|
||||
gdcs_generic_update_recurrences (model, start, recurrences);
|
||||
}
|
||||
|
||||
void
|
||||
gnc_dense_cal_store_update_recurrences_date_end(GncDenseCalStore *model, GDate *start, GList *recurrences, GDate *end_date)
|
||||
gnc_dense_cal_store_update_recurrences_date_end (GncDenseCalStore *model,
|
||||
GDate *start,
|
||||
GList *recurrences,
|
||||
GDate *end_date)
|
||||
{
|
||||
model->end_type = END_ON_DATE;
|
||||
model->end_date = *end_date;
|
||||
gdcs_generic_update_recurrences(model, start, recurrences);
|
||||
gdcs_generic_update_recurrences (model, start, recurrences);
|
||||
}
|
||||
|
||||
static GList*
|
||||
gdcs_get_contained(GncDenseCalModel *model)
|
||||
gdcs_get_contained (GncDenseCalModel *model)
|
||||
{
|
||||
GList *rtn = NULL;
|
||||
rtn = g_list_append(rtn, GUINT_TO_POINTER(1));
|
||||
rtn = g_list_append (rtn, GUINT_TO_POINTER(1));
|
||||
return rtn;
|
||||
}
|
||||
|
||||
static gchar*
|
||||
gdcs_get_name(GncDenseCalModel *model, guint tag)
|
||||
gdcs_get_name (GncDenseCalModel *model, guint tag)
|
||||
{
|
||||
GncDenseCalStore *mdl = GNC_DENSE_CAL_STORE(model);
|
||||
// assert(tag == 1)
|
||||
@ -213,15 +218,15 @@ gdcs_get_name(GncDenseCalModel *model, guint tag)
|
||||
}
|
||||
|
||||
static gchar*
|
||||
gdcs_get_info(GncDenseCalModel *model, guint tag)
|
||||
gdcs_get_info (GncDenseCalModel *model, guint tag)
|
||||
{
|
||||
GncDenseCalStore *mdl = GNC_DENSE_CAL_STORE(model);
|
||||
// assert(tag == 1)
|
||||
return g_strdup(mdl->info);
|
||||
return g_strdup (mdl->info);
|
||||
}
|
||||
|
||||
static gint
|
||||
gdcs_get_instance_count(GncDenseCalModel *model, guint tag)
|
||||
gdcs_get_instance_count (GncDenseCalModel *model, guint tag)
|
||||
{
|
||||
GncDenseCalStore *mdl = GNC_DENSE_CAL_STORE(model);
|
||||
// assert(tag == 1)
|
||||
@ -229,7 +234,7 @@ gdcs_get_instance_count(GncDenseCalModel *model, guint tag)
|
||||
}
|
||||
|
||||
static void
|
||||
gdcs_get_instance(GncDenseCalModel *model, guint tag, gint instance_index, GDate *date)
|
||||
gdcs_get_instance (GncDenseCalModel *model, guint tag, gint instance_index, GDate *date)
|
||||
{
|
||||
GncDenseCalStore *mdl = GNC_DENSE_CAL_STORE(model);
|
||||
// assert(tag == 1)
|
||||
@ -238,36 +243,35 @@ gdcs_get_instance(GncDenseCalModel *model, guint tag, gint instance_index, GDate
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_dense_cal_store_finalize(GObject *obj)
|
||||
gnc_dense_cal_store_finalize (GObject *obj)
|
||||
{
|
||||
int i;
|
||||
GncDenseCalStore *store;
|
||||
g_return_if_fail(obj != NULL);
|
||||
g_return_if_fail (obj != NULL);
|
||||
|
||||
store = GNC_DENSE_CAL_STORE(obj);
|
||||
|
||||
if (store->name != NULL)
|
||||
{
|
||||
g_free(store->name);
|
||||
g_free (store->name);
|
||||
store->name = NULL;
|
||||
}
|
||||
|
||||
if (store->info != NULL)
|
||||
{
|
||||
g_free(store->info);
|
||||
g_free (store->info);
|
||||
store->info = NULL;
|
||||
}
|
||||
|
||||
for (i = 0; i < store->num_marks; i++)
|
||||
for (int i = 0; i < store->num_marks; i++)
|
||||
{
|
||||
g_free(store->cal_marks[i]);
|
||||
g_free (store->cal_marks[i]);
|
||||
store->cal_marks[i] = NULL;
|
||||
}
|
||||
if (store->cal_marks != NULL)
|
||||
{
|
||||
g_free(store->cal_marks);
|
||||
g_free (store->cal_marks);
|
||||
store->cal_marks = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS(gnc_dense_cal_store_parent_class)->finalize(obj);
|
||||
G_OBJECT_CLASS(gnc_dense_cal_store_parent_class)->finalize (obj);
|
||||
}
|
||||
|
@ -1,24 +1,24 @@
|
||||
/*
|
||||
* gnc-dense-cal-store.h
|
||||
*
|
||||
* Copyright (C) 2006 Joshua Sled <jsled@asynchronous.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 and/or version 3 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
/********************************************************************\
|
||||
* gnc-dense-cal-store.h *
|
||||
* Copyright (C) 2006 Joshua Sled <jsled@asynchronous.org> *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
* published by the Free Software Foundation, under version 2 and *
|
||||
* / or version 3 of the License. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License*
|
||||
* along with this program; if not, contact:
|
||||
*
|
||||
* Free Software Foundation Voice: +1-617-542-5942
|
||||
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org
|
||||
*/
|
||||
* along with this program; if not, contact: *
|
||||
* *
|
||||
* Free Software Foundation Voice: +1-617-542-5942 *
|
||||
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
\********************************************************************/
|
||||
|
||||
#ifndef _GNC_DENSE_CAL_STORE_H
|
||||
#define _GNC_DENSE_CAL_STORE_H
|
||||
@ -31,19 +31,27 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GNC_TYPE_DENSE_CAL_STORE (gnc_dense_cal_store_get_type())
|
||||
G_DECLARE_FINAL_TYPE (GncDenseCalStore, gnc_dense_cal_store, GNC, DENSE_CAL_STORE, GObject)
|
||||
#define GNC_TYPE_DENSE_CAL_STORE (gnc_dense_cal_store_get_type ())
|
||||
G_DECLARE_FINAL_TYPE(GncDenseCalStore, gnc_dense_cal_store, GNC, DENSE_CAL_STORE, GObject)
|
||||
|
||||
typedef enum { NEVER_END, END_ON_DATE, END_AFTER_N_OCCS, BAD_END } gdcs_end_type;
|
||||
|
||||
GncDenseCalStore* gnc_dense_cal_store_new(int num_marks);
|
||||
void gnc_dense_cal_store_clear(GncDenseCalStore *model);
|
||||
void gnc_dense_cal_store_update_name(GncDenseCalStore *model, const gchar* name);
|
||||
void gnc_dense_cal_store_update_info(GncDenseCalStore *model, const gchar* info);
|
||||
GncDenseCalStore* gnc_dense_cal_store_new (int num_marks);
|
||||
void gnc_dense_cal_store_clear (GncDenseCalStore *model);
|
||||
void gnc_dense_cal_store_update_name (GncDenseCalStore *model, const gchar* name);
|
||||
void gnc_dense_cal_store_update_info (GncDenseCalStore *model, const gchar* info);
|
||||
|
||||
void gnc_dense_cal_store_update_recurrences_no_end(GncDenseCalStore *model, GDate *start, GList *recurrences);
|
||||
void gnc_dense_cal_store_update_recurrences_count_end(GncDenseCalStore *model, GDate *start, GList *recurrences, int num_occur);
|
||||
void gnc_dense_cal_store_update_recurrences_date_end(GncDenseCalStore *model, GDate *start, GList *recurrences, GDate *end_date);
|
||||
void gnc_dense_cal_store_update_recurrences_no_end (GncDenseCalStore *model,
|
||||
GDate *start,
|
||||
GList *recurrences);
|
||||
void gnc_dense_cal_store_update_recurrences_count_end (GncDenseCalStore *model,
|
||||
GDate *start,
|
||||
GList *recurrences,
|
||||
int num_occur);
|
||||
void gnc_dense_cal_store_update_recurrences_date_end (GncDenseCalStore *model,
|
||||
GDate *start,
|
||||
GList *recurrences,
|
||||
GDate *end_date);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -4,8 +4,8 @@
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
* published by the Free Software Foundation, under version 2 and/or version 3 of *
|
||||
* the License. *
|
||||
* published by the Free Software Foundation, under version 2 and *
|
||||
* / or version 3 of the License. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
@ -31,26 +31,26 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GNC_TYPE_DENSE_CAL (gnc_dense_cal_get_type ())
|
||||
#define GNC_TYPE_DENSE_CAL (gnc_dense_cal_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (GncDenseCal, gnc_dense_cal, GNC, DENSE_CAL, GtkBox)
|
||||
|
||||
GtkWidget* gnc_dense_cal_new (GtkWindow *parent);
|
||||
GtkWidget* gnc_dense_cal_new_with_model (GtkWindow *parent,
|
||||
GncDenseCalModel *model);
|
||||
void gnc_dense_cal_set_model(GncDenseCal *cal, GncDenseCalModel *model);
|
||||
GtkWidget* gnc_dense_cal_new (GtkWindow *parent);
|
||||
GtkWidget* gnc_dense_cal_new_with_model (GtkWindow *parent,
|
||||
GncDenseCalModel *model);
|
||||
void gnc_dense_cal_set_model (GncDenseCal *cal, GncDenseCalModel *model);
|
||||
|
||||
void gnc_dense_cal_set_month(GncDenseCal *dcal, GDateMonth mon);
|
||||
GDateMonth gnc_dense_cal_get_month( GncDenseCal *dcal );
|
||||
void gnc_dense_cal_set_month (GncDenseCal *dcal, GDateMonth mon);
|
||||
GDateMonth gnc_dense_cal_get_month (GncDenseCal *dcal);
|
||||
/**
|
||||
* @param year Julian year: 2000 = 2000AD.
|
||||
**/
|
||||
void gnc_dense_cal_set_year( GncDenseCal *dcal, guint year );
|
||||
GDateYear gnc_dense_cal_get_year( GncDenseCal *dcal );
|
||||
void gnc_dense_cal_set_year (GncDenseCal *dcal, guint year);
|
||||
GDateYear gnc_dense_cal_get_year (GncDenseCal *dcal);
|
||||
|
||||
void gnc_dense_cal_set_num_months( GncDenseCal *dcal, guint num_months );
|
||||
guint gnc_dense_cal_get_num_months( GncDenseCal *dcal );
|
||||
void gnc_dense_cal_set_num_months (GncDenseCal *dcal, guint num_months);
|
||||
guint gnc_dense_cal_get_num_months (GncDenseCal *dcal);
|
||||
|
||||
void gnc_dense_cal_set_months_per_col( GncDenseCal *dcal, guint monthsPerCol );
|
||||
void gnc_dense_cal_set_months_per_col (GncDenseCal *dcal, guint monthsPerCol);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user