mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Doxygen improvements, patch by Jesse Weinstein
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18778 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
bf2d2ea3e4
commit
d6c376cc93
@ -21,6 +21,13 @@
|
|||||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||||
\********************************************************************/
|
\********************************************************************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file dialog-print-check.c
|
||||||
|
* @brief Print Checks Dialog
|
||||||
|
* @author Copyright (C) 2000 Bill Gribble <grib@billgribble.com>
|
||||||
|
* @author Copyright (C) 2006,2007 David Hampton <hampton@employees.org>
|
||||||
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
@ -106,7 +113,7 @@
|
|||||||
#define KF_KEY_SPLITS_MEMO "SplitsMemo"
|
#define KF_KEY_SPLITS_MEMO "SplitsMemo"
|
||||||
#define KF_KEY_SPLITS_ACCOUNT "SplitsAccount"
|
#define KF_KEY_SPLITS_ACCOUNT "SplitsAccount"
|
||||||
|
|
||||||
/**< This enum specifies the columns used in the check format combobox. */
|
/** This enum specifies the columns used in the check format combobox. */
|
||||||
typedef enum format_combo_col_t
|
typedef enum format_combo_col_t
|
||||||
{
|
{
|
||||||
COL_NAME = 0, /**< This column holds a copy of the check
|
COL_NAME = 0, /**< This column holds a copy of the check
|
||||||
@ -168,21 +175,21 @@ AS_STRING_DEC(CheckItemType, ENUM_CHECK_ITEM_TYPE)
|
|||||||
AS_STRING_FUNC(CheckItemType, ENUM_CHECK_ITEM_TYPE)
|
AS_STRING_FUNC(CheckItemType, ENUM_CHECK_ITEM_TYPE)
|
||||||
|
|
||||||
/** This data structure describes a single item printed on a check.
|
/** This data structure describes a single item printed on a check.
|
||||||
* It is build from a description in a text file. */
|
* It is built from a description in a text file. */
|
||||||
typedef struct _check_item
|
typedef struct _check_item
|
||||||
{
|
{
|
||||||
|
|
||||||
CheckItemType type; /**< What type of item is this? */
|
CheckItemType type; /**< What type of item is this? */
|
||||||
|
|
||||||
gdouble x, y; /**< The x/y coordinates where this item
|
gdouble x, y; /**< The x/y coordinates where this item should
|
||||||
* should be printed. The origin for this
|
* be printed. The origin for these
|
||||||
* coordinate is determined by the print
|
* coordinates is determined by the print
|
||||||
* system used. */
|
* system used. */
|
||||||
|
|
||||||
gdouble w, h; /**< Optional. The width and height of this
|
gdouble w, h; /**< Optional. The width and height of this
|
||||||
* item. Text will be clipped to this
|
* item. Text will be clipped to this
|
||||||
* size. Pictures will be shrunk if
|
* size. Pictures will be shrunk to fit if
|
||||||
* necessary to fit. */
|
* necessary. */
|
||||||
|
|
||||||
gchar *filename; /**< The filename for picture items. Otherwise
|
gchar *filename; /**< The filename for picture items. Otherwise
|
||||||
* unused. */
|
* unused. */
|
||||||
@ -190,16 +197,18 @@ typedef struct _check_item
|
|||||||
gchar *text; /**< The text to be displayed (for text based
|
gchar *text; /**< The text to be displayed (for text based
|
||||||
* items.) Otherwise unused. */
|
* items.) Otherwise unused. */
|
||||||
|
|
||||||
gchar *font; /**< The font to use for text based item. This
|
gchar *font; /**< The font to use for text based items. This
|
||||||
* overrides any font in the check format.
|
* overrides any font in the check format.
|
||||||
* Unused for non-text items. */
|
* Unused for non-text items. */
|
||||||
|
|
||||||
gboolean blocking; /**< Optional. Override blocking in the check format.
|
gboolean blocking; /**< Optional. Overrides blocking in the check
|
||||||
* Default is no blocking characters are written.
|
* format. Default is no blocking characters
|
||||||
* Unused for non-text items. */
|
* are written. Unused for non-text
|
||||||
|
* items. */
|
||||||
|
|
||||||
gboolean print_date_format; /**< Optional. Print date format. Only applies to DATE items.
|
gboolean print_date_format; /**< Optional. Print date format. Only
|
||||||
* Default is no format is written. */
|
* applies to DATE items. Default is no
|
||||||
|
* format is written. */
|
||||||
|
|
||||||
PangoAlignment align; /**< The alignment of a text based item. Only
|
PangoAlignment align; /**< The alignment of a text based item. Only
|
||||||
* used for text based items when a width is
|
* used for text based items when a width is
|
||||||
@ -208,7 +217,7 @@ typedef struct _check_item
|
|||||||
|
|
||||||
/** This data structure describes an entire page of checks. Depending
|
/** This data structure describes an entire page of checks. Depending
|
||||||
* upon the check format, the page may contain multiple checks or
|
* upon the check format, the page may contain multiple checks or
|
||||||
* only a single check. The data structure is build from a
|
* only a single check. The data structure is built from a
|
||||||
* description in a text file. */
|
* description in a text file. */
|
||||||
typedef struct _check_format
|
typedef struct _check_format
|
||||||
{
|
{
|
||||||
@ -220,8 +229,8 @@ typedef struct _check_format
|
|||||||
gchar *filename; /**< The name of the file from which this data
|
gchar *filename; /**< The name of the file from which this data
|
||||||
* was read. */
|
* was read. */
|
||||||
|
|
||||||
gchar *title; /**< Title of this check format. Displayed to
|
gchar *title; /**< Title of this check format. Displayed in
|
||||||
* user in the dialog box. */
|
* the dialog box. */
|
||||||
|
|
||||||
gboolean blocking; /**< Default for printing blocking characters for
|
gboolean blocking; /**< Default for printing blocking characters for
|
||||||
* this page of checks. */
|
* this page of checks. */
|
||||||
@ -234,19 +243,19 @@ typedef struct _check_format
|
|||||||
gboolean show_boxes; /**< Print boxes when width and height are
|
gboolean show_boxes; /**< Print boxes when width and height are
|
||||||
* known. */
|
* known. */
|
||||||
|
|
||||||
gdouble rotation; /**< Rotate entire page by this amount */
|
gdouble rotation; /**< Rotate the entire page by this amount. */
|
||||||
|
|
||||||
gdouble trans_x; /**< Move entire page by this X amount */
|
gdouble trans_x; /**< Move entire page left by this amount. */
|
||||||
|
|
||||||
gdouble trans_y; /**< Move entire page by this Y amount */
|
gdouble trans_y; /**< Move entire page down by this amount. */
|
||||||
|
|
||||||
gchar *font; /**< Default font for this page of checks */
|
gchar *font; /**< Default font for this page of checks. */
|
||||||
|
|
||||||
gdouble height; /**< Height of one check on a page */
|
gdouble height; /**< Height of one check on a page. */
|
||||||
|
|
||||||
GSList *positions; /**< Names of the checks on the page. */
|
GSList *positions; /**< Names of the checks on the page. */
|
||||||
|
|
||||||
GSList *items; /**< List of items printed on each check */
|
GSList *items; /**< List of items printed on each check. */
|
||||||
} check_format_t;
|
} check_format_t;
|
||||||
|
|
||||||
/** This data structure is used to manage the print check dialog, and
|
/** This data structure is used to manage the print check dialog, and
|
||||||
@ -298,11 +307,10 @@ struct _print_check_dialog
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**< This function walks ths list of available check formats looking for a
|
/** This function walks ths list of available check formats looking for a
|
||||||
* specific format as specified by guid number. If found, a pointer to the
|
* specific format as specified by guid number. If found, a pointer to it is
|
||||||
* check format is returned to the caller. Additionally, if the caller passed
|
* returned to the caller. Additionally, if the caller passed a pointer to a
|
||||||
* a pointer to a GtkTreeIter, then the iter for that entry will also be
|
* GtkTreeIter, then the iter for that entry will also be returned. */
|
||||||
* returned. */
|
|
||||||
static check_format_t *
|
static check_format_t *
|
||||||
find_existing_format (GtkListStore *store, gchar *guid, GtkTreeIter *iter_out)
|
find_existing_format (GtkListStore *store, gchar *guid, GtkTreeIter *iter_out)
|
||||||
{
|
{
|
||||||
@ -332,8 +340,8 @@ find_existing_format (GtkListStore *store, gchar *guid, GtkTreeIter *iter_out)
|
|||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
/** This function is used by the custom format dialog to save position values
|
||||||
|
* to the GConf database. */
|
||||||
static void
|
static void
|
||||||
save_float_pair (const char *section, const char *key, double a, double b)
|
save_float_pair (const char *section, const char *key, double a, double b)
|
||||||
{
|
{
|
||||||
@ -345,6 +353,8 @@ save_float_pair (const char *section, const char *key, double a, double b)
|
|||||||
g_slist_free(coord_list);
|
g_slist_free(coord_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** This function is used by the custom format dialog to restore position
|
||||||
|
* values from the GConf database. */
|
||||||
static void
|
static void
|
||||||
get_float_pair (const char *section, const char *key, double *a, double *b)
|
get_float_pair (const char *section, const char *key, double *a, double *b)
|
||||||
{
|
{
|
||||||
@ -363,11 +373,14 @@ get_float_pair (const char *section, const char *key, double *a, double *b)
|
|||||||
g_slist_free(coord_list);
|
g_slist_free(coord_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** This function returns a string containing the check address in a five-line
|
||||||
|
* format.
|
||||||
|
*
|
||||||
|
* Note that the string needs to be freed with g_free. */
|
||||||
gchar *
|
gchar *
|
||||||
get_check_address( PrintCheckDialog *pcd)
|
get_check_address( PrintCheckDialog *pcd)
|
||||||
{
|
{
|
||||||
/* return an address in five lines
|
|
||||||
* the string needs to be freed with g_free */
|
|
||||||
gchar *address;
|
gchar *address;
|
||||||
address = g_strconcat(gtk_entry_get_text(GTK_ENTRY(pcd->check_address_name)), "\n",
|
address = g_strconcat(gtk_entry_get_text(GTK_ENTRY(pcd->check_address_name)), "\n",
|
||||||
gtk_entry_get_text(GTK_ENTRY(pcd->check_address_1)), "\n",
|
gtk_entry_get_text(GTK_ENTRY(pcd->check_address_1)), "\n",
|
||||||
@ -378,6 +391,10 @@ get_check_address( PrintCheckDialog *pcd)
|
|||||||
return address;
|
return address;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//@{
|
||||||
|
/** @name Split printing functions */
|
||||||
|
|
||||||
|
/** This function formats the splits amounts for printing. */
|
||||||
gchar *
|
gchar *
|
||||||
get_check_splits_amount(PrintCheckDialog *pcd)
|
get_check_splits_amount(PrintCheckDialog *pcd)
|
||||||
{
|
{
|
||||||
@ -412,6 +429,7 @@ get_check_splits_amount(PrintCheckDialog *pcd)
|
|||||||
return amount;
|
return amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** This function formats the splits memo fields for printing. */
|
||||||
gchar *
|
gchar *
|
||||||
get_check_splits_memo(PrintCheckDialog *pcd)
|
get_check_splits_memo(PrintCheckDialog *pcd)
|
||||||
{
|
{
|
||||||
@ -446,6 +464,7 @@ get_check_splits_memo(PrintCheckDialog *pcd)
|
|||||||
return memo;
|
return memo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** This function formats the splits accounts for printing. */
|
||||||
gchar *
|
gchar *
|
||||||
get_check_splits_account(PrintCheckDialog *pcd)
|
get_check_splits_account(PrintCheckDialog *pcd)
|
||||||
{
|
{
|
||||||
@ -481,7 +500,9 @@ get_check_splits_account(PrintCheckDialog *pcd)
|
|||||||
}
|
}
|
||||||
return account;
|
return account;
|
||||||
}
|
}
|
||||||
|
//@}
|
||||||
|
|
||||||
|
/** This function determines if an address item is present in the check format.*/
|
||||||
gboolean
|
gboolean
|
||||||
check_format_has_address ( PrintCheckDialog *pcd )
|
check_format_has_address ( PrintCheckDialog *pcd )
|
||||||
{
|
{
|
||||||
@ -686,9 +707,9 @@ pcd_get_custom_multip(PrintCheckDialog * pcd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Save a coordinate pair into a check description file. This function
|
/** This function saves a coordinate pair into a check description file. It
|
||||||
* extracts the values from the spin buttons, adjusts them for the units
|
* extracts the values from the spin buttons, adjusts them according to the
|
||||||
* multiplies (inch, pixel, etc), and then adds them to the gKeyFile. */
|
* unit multiplier (inches, pixels, etc), then adds them to the gKeyFile. */
|
||||||
static void
|
static void
|
||||||
pcd_key_file_save_xy (GKeyFile *key_file, const gchar *group_name,
|
pcd_key_file_save_xy (GKeyFile *key_file, const gchar *group_name,
|
||||||
const gchar *key_name, gdouble multip,
|
const gchar *key_name, gdouble multip,
|
||||||
@ -705,9 +726,9 @@ pcd_key_file_save_xy (GKeyFile *key_file, const gchar *group_name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Save the information about a single printed item into a check description
|
/** This function saves the information about a single printed item into a
|
||||||
* file. This function uses a helper function to extracts and save the item
|
* check description file. It uses a helper function to extracts and save the
|
||||||
* coordinates. */
|
* item coordinates. */
|
||||||
static void
|
static void
|
||||||
pcd_key_file_save_item_xy (GKeyFile *key_file, int index,
|
pcd_key_file_save_item_xy (GKeyFile *key_file, int index,
|
||||||
CheckItemType type, gdouble multip,
|
CheckItemType type, gdouble multip,
|
||||||
@ -724,8 +745,8 @@ pcd_key_file_save_item_xy (GKeyFile *key_file, int index,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Save all of the information from the custom check dialog into a check
|
/** This function saves all of the information from the custom check dialog
|
||||||
* description file. */
|
* into a check description file. */
|
||||||
static void
|
static void
|
||||||
pcd_save_custom_data(PrintCheckDialog *pcd, const gchar *title)
|
pcd_save_custom_data(PrintCheckDialog *pcd, const gchar *title)
|
||||||
{
|
{
|
||||||
@ -805,7 +826,7 @@ pcd_save_custom_data(PrintCheckDialog *pcd, const gchar *title)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Make the OK button sensitive iff a title has been entered. */
|
/** This function makes the OK button active iff a title has been entered. */
|
||||||
void
|
void
|
||||||
gnc_check_format_title_changed (GtkEditable *editable, GtkWidget *ok_button)
|
gnc_check_format_title_changed (GtkEditable *editable, GtkWidget *ok_button)
|
||||||
{
|
{
|
||||||
@ -853,8 +874,8 @@ gnc_print_check_save_button_clicked(GtkButton *unused, PrintCheckDialog *pcd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** This is an auxiliary debugging function for converting an array of doubles
|
/** This function is an auxiliary debugging function for converting an array of
|
||||||
* into a printable string. */
|
* doubles into a printable string. */
|
||||||
static gchar *
|
static gchar *
|
||||||
doubles_to_string(gdouble * dd, gint len)
|
doubles_to_string(gdouble * dd, gint len)
|
||||||
{
|
{
|
||||||
@ -868,14 +889,15 @@ doubles_to_string(gdouble * dd, gint len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Read the information describing the placement for each item to be printed
|
|
||||||
* on the check. This information is all relative to the upper left hand
|
/** This function reads in the information describing the placement for each
|
||||||
* corner of a "check". See the format_read_multicheck_info() function for
|
* item to be printed on a check. This information is all relative to the
|
||||||
* determining if there are multiple checks on a single page of paper. This
|
* upper left hand corner of a "check". See the format_read_multicheck_info()
|
||||||
* data is build into a linked list and saved as part of the check format
|
* function for determining if there are multiple checks on a single page of
|
||||||
* information. These items will be printed in the same order they are read,
|
* paper. This data is build into a linked list and saved as part of the check
|
||||||
* meaning that items listed later in the date file can be printed over top
|
* format information. These items will be printed in the same order they are
|
||||||
* of items that appear earlier in the file. */
|
* read, meaning that items listed later in the date file can be printed over
|
||||||
|
* top of items that appear earlier in the file. */
|
||||||
static GSList *
|
static GSList *
|
||||||
format_read_item_placement(const gchar * file,
|
format_read_item_placement(const gchar * file,
|
||||||
GKeyFile * key_file, check_format_t * format)
|
GKeyFile * key_file, check_format_t * format)
|
||||||
|
Loading…
Reference in New Issue
Block a user