GnuCash  5.6-133-gc519490283+
Files | Data Structures | Macros | Typedefs | Enumerations | Enumerator | Functions | Variables

Files

file  gnc-ledger-display.h
 Public declarations for GncLedgerDisplay class.
 
file  formulacell-gnome.h
 Implements gnome dependent formula cell functions.
 
file  gnucash-color.h
 Convenience wrapper around GdkRGBA for use in Register Gnome classes.
 
file  gnucash-cursor.h
 Public declarations for GnucashCursor class.
 
file  gnucash-date-picker.h
 Public declarations for GncDatePicker class.
 
file  gnucash-header.h
 Public declarations for GnucashHeader class.
 
file  gnucash-item-edit.h
 Public declarations for GncItemEdit class.
 
file  gnucash-item-list.h
 Public Declarations for GncItemList class.
 
file  gnucash-sheet.h
 Public declarations of GnucashRegister class.
 
file  gnucash-sheet.h
 Public declarations of GnucashRegister class.
 
file  gnucash-sheetP.h
 Private declarations for GnucashSheet class.
 
file  gnucash-style.h
 Styling functions for RegisterGnome.
 

Data Structures

struct  GnucashCursorCell
 
struct  GnucashCursor
 
struct  GnucashCursorClass
 
struct  GNCDatePicker
 
struct  GNCDatePickerClass
 
struct  GncHeader
 
struct  GncHeaderClass
 
struct  PopupToggle
 
struct  GncItemEdit
 
struct  GncItemEditClass
 
struct  GncItemEditTb
 
struct  GncItemEditTbClass
 
struct  GncItemList
 
struct  GncItemListClass
 
struct  SheetBlock
 
struct  GnucashSheet
 
struct  GnucashSheetClass
 
struct  CellDimensions
 
struct  BlockDimensions
 
struct  SheetBlockStyle
 

Macros

#define GNUCASH_TYPE_CURSOR   (gnucash_cursor_get_type ())
 
#define GNUCASH_CURSOR(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNUCASH_TYPE_CURSOR, GnucashCursor))
 
#define GNUCASH_CURSOR_CLASS(k)   (G_TYPE_CHECK_CLASS_CAST ((k), GNUCASH_TYPE_CURSOR, GnucashCursorClass))
 
#define GNUCASH_IS_CURSOR(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNUCASH_TYPE_CURSOR))
 
#define GNC_TYPE_DATE_PICKER   (gnc_date_picker_get_type ())
 
#define GNC_DATE_PICKER(obj)   G_TYPE_CHECK_INSTANCE_CAST((obj), gnc_date_picker_get_type (), GNCDatePicker)
 
#define GNC_DATE_PICKER_CLASS(k)   G_TYPE_CHECK_CLASS_CAST((k), gnc_date_picker_get_type (), GNCDatePickerClass)
 
#define IS_GNC_DATE_PICKER(o)   G_TYPE_CHECK_INSTANCE_TYPE((o), gnc_date_picker_get_type ())
 
#define GNC_TYPE_HEADER   (gnc_header_get_type ())
 
#define GNC_HEADER(o)   (G_TYPE_CHECK_INSTANCE_CAST((o), GNC_TYPE_HEADER, GncHeader))
 
#define GNC_HEADER_CLASS(k)   (G_TYPE_CHECK_CLASS_CAST ((k), GNC_TYPE_HEADER, GncHeaderClass))
 
#define GNC_IS_HEADER(o)   (G_TYPE_CHECK_INSTANCE_TYPE((o), GNC_TYPE_HEADER))
 
#define GNC_TYPE_ITEM_EDIT   (gnc_item_edit_get_type ())
 
#define GNC_ITEM_EDIT(o)   (G_TYPE_CHECK_INSTANCE_CAST((o), GNC_TYPE_ITEM_EDIT, GncItemEdit))
 
#define GNC_ITEM_EDIT_CLASS(k)   (G_TYPE_CHECK_CLASS_CAST ((k), GNC_TYPE_ITEM_EDIT, GncItemEditClass))
 
#define GNC_IS_ITEM_EDIT(o)   (G_TYPE_CHECK_INSTANCE_TYPE((o), GNC_TYPE_ITEM_EDIT))
 
#define GNC_TYPE_ITEM_EDIT_TB   (gnc_item_edit_tb_get_type ())
 
#define GNC_ITEM_EDIT_TB(o)   (G_TYPE_CHECK_INSTANCE_CAST((o), GNC_TYPE_ITEM_EDIT_TB, GncItemEditTb))
 
#define GNC_ITEM_EDIT_TB_CLASS(k)   (G_TYPE_CHECK_CLASS_CAST ((k), GNC_TYPE_ITEM_EDIT_TB, GncItemEditTbClass))
 
#define GNC_IS_ITEM_EDIT_TB(o)   (G_TYPE_CHECK_INSTANCE_TYPE((o), GNC_TYPE_ITEM_EDIT_TB))
 
#define GNC_TYPE_ITEM_LIST   (gnc_item_list_get_type ())
 
#define GNC_ITEM_LIST(o)   (G_TYPE_CHECK_INSTANCE_CAST((o), GNC_TYPE_ITEM_LIST, GncItemList))
 
#define GNC_ITEM_LIST_CLASS(k)   (G_TYPE_CHECK_CLASS_CAST ((k), GNC_TYPE_ITEM_LIST, GncItemListClass))
 
#define IS_GNC_ITEM_LIST(o)   (G_TYPE_CHECK_INSTANCE_TYPE((o), GNC_TYPE_ITEM_LIST))
 
#define GNUCASH_TYPE_REGISTER   (gnucash_register_get_type ())
 
#define GNUCASH_REGISTER(obj)   (G_TYPE_CHECK_INSTANCE_CAST((obj), GNUCASH_TYPE_REGISTER, GnucashRegister))
 
#define GNUCASH_REGISTER_CLASS(k)   (G_TYPE_CHECK_CLASS_CAST ((k), GNUCASH_TYPE_REGISTER))
 
#define GNUCASH_IS_REGISTER(o)   (G_TYPE_CHECK_INSTANCE_TYPE((o), GNUCASH_TYPE_REGISTER))
 
#define GNUCASH_TYPE_SHEET   (gnucash_sheet_get_type ())
 
#define GNUCASH_SHEET(obj)   (G_TYPE_CHECK_INSTANCE_CAST((obj), GNUCASH_TYPE_SHEET, GnucashSheet))
 
#define GNUCASH_SHEET_CLASS(k)   (G_TYPE_CHECK_CLASS_CAST ((k), GNUCASH_TYPE_SHEET))
 
#define GNUCASH_IS_SHEET(o)   (G_TYPE_CHECK_INSTANCE_TYPE((o), GNUCASH_TYPE_SHEET))
 

Typedefs

typedef void(* GNCLedgerDisplayDestroy) (GNCLedgerDisplay *ld)
 
typedef GtkWidget *(* GNCLedgerDisplayGetParent) (GNCLedgerDisplay *ld)
 
typedef void(* GNCLedgerDisplaySetHelp) (GNCLedgerDisplay *ld, const char *help_str)
 
typedef int(* PopupGetHeight) (GtkWidget *item, int space_available, int row_height, gpointer user_data)
 
typedef int(* PopupAutosize) (GtkWidget *item, int max_width, gpointer user_data)
 
typedef void(* PopupSetFocus) (GtkWidget *item, gpointer user_data)
 
typedef void(* PopupPostShow) (GtkWidget *item, gpointer user_data)
 
typedef int(* PopupGetWidth) (GtkWidget *item, gpointer user_data)
 
typedef gboolean(* VirtualLocationMatchFunc) (VirtualLocation virt_loc, gpointer user_data)
 
typedef GHashTable * GNCHeaderWidths
 

Enumerations

enum  GNCLedgerDisplayType { LD_SINGLE, LD_SUBACCOUNT, LD_GL }
 
enum  { GNUCASH_CURSOR_CELL, GNUCASH_CURSOR_BLOCK, GNUCASH_CURSOR_NUM }
 
enum  Sides {
  left, right, top, bottom,
  left_right, top_bottom
}
 

Functions

Accountgnc_ledger_display_leader (GNCLedgerDisplay *ld)
 returns the 'lead' account of a ledger display, or NULL if none. More...
 
GNCLedgerDisplayType gnc_ledger_display_type (GNCLedgerDisplay *ld)
 
void gnc_ledger_display_set_user_data (GNCLedgerDisplay *ld, gpointer user_data)
 get and set the user data associated with the ledger
 
gpointer gnc_ledger_display_get_user_data (GNCLedgerDisplay *ld)
 
void gnc_ledger_display_set_handlers (GNCLedgerDisplay *ld, GNCLedgerDisplayDestroy destroy, GNCLedgerDisplayGetParent get_parent)
 set the handlers used by the ledger display
 
GtkWidget * gnc_ledger_display_get_parent (GNCLedgerDisplay *ld)
 Returns the parent of a given ledger display.
 
SplitRegister * gnc_ledger_display_get_split_register (GNCLedgerDisplay *ld)
 return the split register associated with a ledger display
 
GNCLedgerDisplay * gnc_ledger_display_simple (Account *account)
 opens up a register window to display a single account
 
GNCLedgerDisplay * gnc_ledger_display_subaccounts (Account *account, gboolean mismatched_commodities)
 opens up a register window to display the parent account and all of its children. More...
 
GNCLedgerDisplay * gnc_ledger_display_gl (void)
 opens up a general ledger window
 
GNCLedgerDisplay * gnc_ledger_display_template_gl (char *id)
 Displays a template ledger. More...
 
GNCLedgerDisplay * gnc_ledger_display_query (Query *query, SplitRegisterType type, SplitRegisterStyle style)
 display a general ledger for an arbitrary query
 
void gnc_ledger_display_set_query (GNCLedgerDisplay *ledger_display, Query *q)
 Set the query used for a register. More...
 
Querygnc_ledger_display_get_query (GNCLedgerDisplay *ld)
 return the query associated with a ledger
 
GNCLedgerDisplay * gnc_ledger_display_find_by_query (Query *q)
 If the given ledger display still exists, return it. More...
 
void gnc_ledger_display_refresh (GNCLedgerDisplay *ledger_display)
 redisplay/redraw only the indicated window. More...
 
void gnc_ledger_display_refresh_by_split_register (SplitRegister *reg)
 
void gnc_ledger_display_set_focus (GNCLedgerDisplay *ld, gboolean focus)
 Mark the ledger as being in focus (refresh immediately) or not. More...
 
void gnc_ledger_display_close (GNCLedgerDisplay *ledger_display)
 close the window
 
gboolean gnc_ledger_display_default_double_line (GNCLedgerDisplay *gld)
 Returns a boolean of whether this display should be single or double lined mode by default.
 
void gnucash_color_init (void)
 
GdkRGBA * gnucash_color_argb_to_gdk (guint32 argb)
 Return the pixel value for the given red, green and blue.
 
GType gnucash_cursor_get_type (void)
 
GnucashCursorgnucash_cursor_new (GnucashSheet *sheet)
 
void gnucash_cursor_get_virt (GnucashCursor *cursor, VirtualLocation *virt_loc)
 
void gnucash_cursor_set (GnucashCursor *cursor, VirtualLocation virt_loc)
 
void gnucash_cursor_set_style (GnucashCursor *cursor, SheetBlockStyle *style)
 
void gnucash_cursor_configure (GnucashCursor *cursor)
 
GType gnc_date_picker_get_type (void)
 
GtkWidget * gnc_date_picker_new (void)
 
void gnc_date_picker_set_date (GNCDatePicker *date_picker, guint day, guint mon, guint year)
 
void gnc_date_picker_get_date (GNCDatePicker *date_picker, guint *day, guint *mon, guint *year)
 
GType gnc_header_get_type (void)
 
GtkWidget * gnc_header_new (GnucashSheet *sheet)
 
void gnc_header_reconfigure (GncHeader *header)
 
void gnc_header_request_redraw (GncHeader *header)
 
void gnc_header_set_header_rows (GncHeader *header, int num_phys_rows)
 
gint gnc_header_get_cell_offset (GncHeader *header, gint col, gint *cell_width)
 
GType gnc_item_edit_get_type (void)
 
void gnc_item_edit_configure (GncItemEdit *item_edit)
 
void gnc_item_edit_get_pixel_coords (GncItemEdit *item_edit, int *x, int *y, int *w, int *h)
 
GtkWidget * gnc_item_edit_new (GnucashSheet *sheet)
 
void gnc_item_edit_set_popup (GncItemEdit *item_edit, GtkWidget *popup_item, PopupGetHeight popup_get_height, PopupAutosize popup_autosize, PopupSetFocus popup_set_focus, PopupPostShow popup_post_show, PopupGetWidth popup_get_width, gpointer popup_user_data)
 
void gnc_item_edit_show_popup (GncItemEdit *item_edit)
 
void gnc_item_edit_hide_popup (GncItemEdit *item_edit)
 
void gnc_item_edit_cut_clipboard (GncItemEdit *item_edit)
 
void gnc_item_edit_copy_clipboard (GncItemEdit *item_edit)
 
void gnc_item_edit_paste_clipboard (GncItemEdit *item_edit)
 
gboolean gnc_item_edit_get_has_selection (GncItemEdit *item_edit)
 
void gnc_item_edit_focus_in (GncItemEdit *item_edit)
 
void gnc_item_edit_focus_out (GncItemEdit *item_edit)
 
gint gnc_item_edit_get_margin (GncItemEdit *item_edit, Sides side)
 
gint gnc_item_edit_get_padding_border (GncItemEdit *item_edit, Sides side)
 
gint gnc_item_edit_get_button_width (GncItemEdit *item_edit)
 
GType gnc_item_edit_tb_get_type (void)
 
GtkWidget * gnc_item_edit_tb_new (GnucashSheet *sheet)
 
GType gnc_item_list_get_type (void)
 
GtkWidget * gnc_item_list_new (GtkListStore *shared_store)
 
gint gnc_item_list_num_entries (GncItemList *item_list)
 
gint gnc_item_list_get_popup_height (GncItemList *item_list)
 
void gnc_item_list_clear (GncItemList *item_list)
 
void gnc_item_list_append (GncItemList *item_list, const char *string)
 
void gnc_item_list_set_sort_column (GncItemList *item_list, gint column_id)
 
gboolean gnc_item_in_list (GncItemList *item_list, const char *string)
 
void gnc_item_list_select (GncItemList *item_list, const char *string)
 
void gnc_item_list_show_selected (GncItemList *item_list)
 
char * gnc_item_list_get_selection (GncItemList *item_list)
 Retrieve the selected string from the item_list's active GtkListStore. More...
 
int gnc_item_list_autosize (GncItemList *item_list)
 
void gnc_item_list_set_temp_store (GncItemList *item_list, GtkListStore *store)
 
gboolean gnc_item_list_using_temp (GncItemList *item_list)
 
GtkListStore * gnc_item_list_disconnect_store (GncItemList *item_list)
 
void gnc_item_list_connect_store (GncItemList *item_list, GtkListStore *store)
 
GType gnucash_register_get_type (void)
 
void gnucash_register_add_cell_types (void)
 Add cell types defined by gnucash_register to gnc_register. More...
 
GtkWidget * gnucash_register_new (Table *table, const gchar *state_section)
 this already has scrollbars attached
 
void gnucash_register_goto_virt_cell (GnucashRegister *reg, VirtualCellLocation vcell_loc)
 
void gnucash_register_goto_virt_loc (GnucashRegister *reg, VirtualLocation virt_loc)
 
void gnucash_register_goto_next_virt_row (GnucashRegister *reg)
 
void gnucash_register_goto_next_matching_row (GnucashRegister *reg, VirtualLocationMatchFunc match, gpointer user_data)
 
void gnucash_register_attach_popup (GnucashRegister *reg, GtkWidget *popup, gpointer data)
 
gboolean gnucash_register_has_selection (GnucashRegister *reg)
 
void gnucash_register_cut_clipboard (GnucashRegister *reg)
 
void gnucash_register_copy_clipboard (GnucashRegister *reg)
 
void gnucash_register_paste_clipboard (GnucashRegister *reg)
 
void gnucash_register_refresh_from_prefs (GnucashRegister *reg)
 
void gnucash_register_set_moved_cb (GnucashRegister *reg, GFunc cb, gpointer cb_data)
 
void gnucash_register_set_open_doclink_cb (GnucashRegister *reg, GFunc cb, gpointer cb_data)
 
GnucashSheet * gnucash_register_get_sheet (GnucashRegister *reg)
 
void gnucash_register_reset_sheet_layout (GnucashRegister *reg)
 
GType gnucash_sheet_get_type (void)
 
GtkWidget * gnucash_sheet_new (Table *table)
 
void gnucash_sheet_table_load (GnucashSheet *sheet, gboolean do_scroll)
 
void gnucash_sheet_recompute_block_offsets (GnucashSheet *sheet)
 
SheetBlockgnucash_sheet_get_block (GnucashSheet *sheet, VirtualCellLocation vcell_loc)
 
gint gnucash_sheet_col_max_width (GnucashSheet *sheet, gint virt_col, gint cell_col)
 
void gnucash_sheet_redraw_all (GnucashSheet *sheet)
 
void gnucash_sheet_redraw_help (GnucashSheet *sheet)
 
void gnucash_sheet_redraw_block (GnucashSheet *sheet, VirtualCellLocation vcell_loc)
 
const char * gnucash_sheet_modify_current_cell (GnucashSheet *sheet, const gchar *new_text)
 
gboolean gnucash_sheet_block_set_from_table (GnucashSheet *sheet, VirtualCellLocation vcell_loc)
 
void gnucash_sheet_set_scroll_region (GnucashSheet *sheet)
 
void gnucash_sheet_cursor_set_from_table (GnucashSheet *sheet, gboolean do_scroll)
 
void gnucash_sheet_compute_visible_range (GnucashSheet *sheet)
 
void gnucash_sheet_make_cell_visible (GnucashSheet *sheet, VirtualLocation virt_loc)
 
void gnucash_sheet_show_range (GnucashSheet *sheet, VirtualCellLocation start_loc, VirtualCellLocation end_loc)
 
void gnucash_sheet_update_adjustments (GnucashSheet *sheet)
 
void gnucash_sheet_set_window (GnucashSheet *sheet, GtkWidget *window)
 
void gnucash_get_style_classes (GnucashSheet *sheet, GtkStyleContext *stylectxt, RegisterColor field_type, gboolean use_neg_class)
 Map a cell color type to a css style class. More...
 
void gnucash_sheet_set_text_bounds (GnucashSheet *sheet, GdkRectangle *rect, gint x, gint y, gint width, gint height)
 
gint gnucash_sheet_get_text_offset (GnucashSheet *sheet, const VirtualLocation virt_loc, gint rect_width, gint logical_width)
 
gboolean gnucash_sheet_is_read_only (GnucashSheet *sheet)
 
void gnucash_sheet_set_has_focus (GnucashSheet *sheet, gboolean has_focus)
 
GncItemEditgnucash_sheet_get_item_edit (GnucashSheet *sheet)
 
void gnucash_sheet_set_popup (GnucashSheet *sheet, GtkWidget *popup, gpointer data)
 
void gnucash_sheet_goto_virt_loc (GnucashSheet *sheet, VirtualLocation virt_loc)
 
void gnucash_sheet_refresh_from_prefs (GnucashSheet *sheet)
 
gboolean gnucash_sheet_find_loc_by_pixel (GnucashSheet *sheet, gint x, gint y, VirtualLocation *vcell_loc)
 
gboolean gnucash_sheet_draw_internal (GnucashSheet *sheet, cairo_t *cr, GtkAllocation *alloc)
 
void gnucash_sheet_draw_cursor (GnucashCursor *cursor, cairo_t *cr)
 
gboolean gnucash_style_init (void)
 
void gnucash_sheet_style_init (void)
 
gint gnucash_style_col_is_resizable (SheetBlockStyle *style, int col)
 
CellDimensionsgnucash_style_get_cell_dimensions (SheetBlockStyle *style, int row, int col)
 
void gnucash_sheet_set_col_width (GnucashSheet *sheet, int col, int width)
 
gint gnucash_style_row_width (SheetBlockStyle *style, int row)
 
void gnucash_sheet_styles_set_dimensions (GnucashSheet *sheet, int width)
 
void gnucash_sheet_style_destroy (GnucashSheet *sheet, SheetBlockStyle *style)
 
void gnucash_sheet_clear_styles (GnucashSheet *sheet)
 
void gnucash_sheet_create_styles (GnucashSheet *sheet)
 
void gnucash_sheet_compile_styles (GnucashSheet *sheet)
 
void gnucash_sheet_styles_recompile (GnucashSheet *sheet)
 
SheetBlockStyle * gnucash_sheet_get_style (GnucashSheet *sheet, VirtualCellLocation vcell_loc)
 
SheetBlockStyle * gnucash_sheet_get_style_from_table (GnucashSheet *sheet, VirtualCellLocation vcell_loc)
 
SheetBlockStyle * gnucash_sheet_get_style_from_cursor (GnucashSheet *sheet, const char *cursor_name)
 
void gnucash_sheet_style_get_cell_pixel_rel_coords (SheetBlockStyle *style, gint cell_row, gint cell_col, gint *x, gint *y, gint *w, gint *h)
 
void gnucash_sheet_style_ref (GnucashSheet *sheet, SheetBlockStyle *style)
 
void gnucash_sheet_style_unref (GnucashSheet *sheet, SheetBlockStyle *style)
 
void gnucash_sheet_get_borders (GnucashSheet *sheet, VirtualLocation virt_loc, PhysicalCellBorders *borders)
 
GNCHeaderWidths gnc_header_widths_new (void)
 
void gnc_header_widths_destroy (GNCHeaderWidths widths)
 
void gnc_header_widths_set_width (GNCHeaderWidths widths, const char *cell_name, int width)
 
int gnc_header_widths_get_width (GNCHeaderWidths widths, const char *cell_name)
 
void gnucash_sheet_get_header_widths (GnucashSheet *sheet, GNCHeaderWidths widths)
 
void gnucash_sheet_set_header_widths (GnucashSheet *sheet, GNCHeaderWidths widths)
 

Variables

GdkRGBA gn_white
 
GdkRGBA gn_light_gray
 
GdkRGBA gn_dark_gray
 
GdkRGBA gn_black
 
GdkRGBA gn_blue
 
GdkRGBA gn_red
 
GdkRGBA gn_yellow
 
BasicCell * gnc_formula_cell_gnome_new (void)
 

Detailed Description

Function Documentation

◆ gnc_item_list_get_selection()

char* gnc_item_list_get_selection ( GncItemList item_list)

Retrieve the selected string from the item_list's active GtkListStore.

Parameters
item_listthe GncItemList
Returns
the string value. It must be freed with g_free().

Definition at line 200 of file gnucash-item-list.c.

201 {
202  GtkTreeIter iter;
203  GtkTreeModel* model;
204  gchar* string;
205 
206  GtkTreeSelection *selection =
207  gtk_tree_view_get_selection (item_list->tree_view);
208  if (!gtk_tree_selection_get_selected (selection, &model, &iter))
209  return NULL;
210 
211  gtk_tree_model_get (model, &iter, 0, &string, -1);
212  return string;
213 }

◆ gnc_ledger_display_find_by_query()

GNCLedgerDisplay* gnc_ledger_display_find_by_query ( Query q)

If the given ledger display still exists, return it.

Otherwise, return NULL

Definition at line 875 of file gnc-ledger-display.c.

876 {
877  if (!q)
878  return NULL;
879 
880  return gnc_find_first_gui_component (REGISTER_GL_CM_CLASS, find_by_query, q);
881 }

◆ gnc_ledger_display_leader()

Account* gnc_ledger_display_leader ( GNCLedgerDisplay *  ld)

returns the 'lead' account of a ledger display, or NULL if none.

returns the 'lead' account of a ledger display, or NULL if none.

Definition at line 109 of file gnc-ledger-display.c.

110 {
111  if (!ld)
112  return NULL;
113 
114  return xaccAccountLookup (&ld->leader, gnc_get_current_book());
115 }
Account * xaccAccountLookup(const GncGUID *guid, QofBook *book)
The xaccAccountLookup() subroutine will return the account associated with the given id...
Definition: Account.cpp:2064

◆ gnc_ledger_display_refresh()

void gnc_ledger_display_refresh ( GNCLedgerDisplay *  ledger_display)

redisplay/redraw only the indicated window.

Both routines do same thing, they differ only by the argument they take.

Definition at line 917 of file gnc-ledger-display.c.

918 {
919  ENTER ("ld=%p", ld);
920 
921  if (!ld)
922  {
923  LEAVE ("no display");
924  return;
925  }
926 
927  if (ld->loading)
928  {
929  LEAVE ("already loading");
930  return;
931  }
932 
933  /* if subaccount ledger, check to see if still the same number
934  * of subaccounts, if not recreate the query. */
935  if (ld->ld_type == LD_SUBACCOUNT)
936  {
937  Account* leader = gnc_ledger_display_leader (ld);
938  GList* accounts = gnc_account_get_descendants (leader);
939 
940  if (g_list_length (accounts) != ld->number_of_subaccounts)
941  gnc_ledger_display_make_query (ld,
942  gnc_prefs_get_float (GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_MAX_TRANS),
943  gnc_get_reg_type (leader, ld->ld_type));
944 
945  g_list_free (accounts);
946  }
947 
948  /* In lieu of not "mis-using" some portion of the infrastructure by writing
949  * a bunch of new code, we just filter out the accounts of the template
950  * transactions. While these are in a separate Account trees just for this
951  * reason, the query engine makes no distinction between Account trees.
952  * See Gnome Bug 86302.
953  * -- jsled */
954  // Exclude any template accounts for search register and gl
955  if (!ld->reg->is_template && (ld->reg->type == SEARCH_LEDGER || ld->ld_type == LD_GL))
956  exclude_template_accounts (ld->query, ld->excluded_template_acc_hash);
957 
958  gnc_ledger_display_refresh_internal (ld);
959  LEAVE (" ");
960 }
STRUCTS.
Account * gnc_ledger_display_leader(GNCLedgerDisplay *ld)
Implementations.
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
GList * gnc_account_get_descendants(const Account *account)
This routine returns a flat list of all of the accounts that are descendants of the specified account...
Definition: Account.cpp:3039
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282
gdouble gnc_prefs_get_float(const gchar *group, const gchar *pref_name)
Get an float value from the preferences backend.

◆ gnc_ledger_display_set_focus()

void gnc_ledger_display_set_focus ( GNCLedgerDisplay *  ld,
gboolean  focus 
)

Mark the ledger as being in focus (refresh immediately) or not.

Definition at line 962 of file gnc-ledger-display.c.

963 {
964  if (!ld)
965  return;
966 
967  ld->visible = focus;
968 
969  if (ld->visible && ld->needs_refresh)
970  {
971  DEBUG ("deferred refresh because ledger is now visible");
973  }
974 }
void gnc_ledger_display_refresh(GNCLedgerDisplay *ld)
redisplay/redraw only the indicated window.
#define DEBUG(format, args...)
Print a debugging message.
Definition: qoflog.h:264

◆ gnc_ledger_display_set_query()

void gnc_ledger_display_set_query ( GNCLedgerDisplay *  ledger_display,
Query q 
)

Set the query used for a register.

Definition at line 863 of file gnc-ledger-display.c.

864 {
865  if (!ledger_display || !q)
866  return;
867 
868  g_return_if_fail (ledger_display->ld_type == LD_GL);
869 
870  qof_query_destroy (ledger_display->query);
871  ledger_display->query = qof_query_copy (q);
872 }
QofQuery * qof_query_copy(QofQuery *q)
Make a copy of the indicated query.
Definition: qofquery.cpp:999
void qof_query_destroy(QofQuery *query)
Frees the resources associate with a Query object.

◆ gnc_ledger_display_subaccounts()

GNCLedgerDisplay* gnc_ledger_display_subaccounts ( Account account,
gboolean  mismatched_commodities 
)

opens up a register window to display the parent account and all of its children.

Definition at line 424 of file gnc-ledger-display.c.

426 {
427  SplitRegisterType reg_type;
428  GNCLedgerDisplay* ld;
429 
430  ENTER ("account=%p", account);
431 
432  reg_type = gnc_get_reg_type (account, LD_SUBACCOUNT);
433 
434  ld = gnc_ledger_display_internal (account, NULL, LD_SUBACCOUNT,
435  reg_type, REG_STYLE_JOURNAL, FALSE,
436  FALSE, mismatched_commodities);
437  LEAVE ("%p", ld);
438  return ld;
439 }
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282
SplitRegisterType
Register types.

◆ gnc_ledger_display_template_gl()

GNCLedgerDisplay* gnc_ledger_display_template_gl ( char *  id)

Displays a template ledger.

This lists template Splits from the given ScheduledTransaction.

Really, requires a GList of scheduled transactions and kvp-frame data.

Parameters
idThe string version of the GncGUID of the context of template transaction being edited in this template GL. As used by scheduled transactions, this is the GncGUID of the SX itself which is magically the name of the (template) account which contains the transactions for this scheduled transaction. That's right. The stringified GncGUID of the SX is the name of the SX'es template account.

Definition at line 495 of file gnc-ledger-display.c.

496 {
497  QofBook* book;
498  Query* q;
499  GNCLedgerDisplay* ld;
500  SplitRegister* sr;
501  Account* root, *acct;
502  gboolean isTemplateModeTrue;
503 
504  ENTER ("id=%s", id ? id : "(null)");
505 
506  acct = NULL;
507  isTemplateModeTrue = TRUE;
508 
509  q = qof_query_create_for (GNC_ID_SPLIT);
510 
511  book = gnc_get_current_book();
512  qof_query_set_book (q, book);
513 
514  if (id != NULL)
515  {
516  root = gnc_book_get_template_root (book);
517  acct = gnc_account_lookup_by_name (root, id);
518  g_assert (acct);
519  xaccQueryAddSingleAccountMatch (q, acct, QOF_QUERY_AND);
520  }
521 
522  ld = gnc_ledger_display_internal (NULL, q, LD_GL,
523  SEARCH_LEDGER,
524  REG_STYLE_JOURNAL,
525  FALSE,
526  isTemplateModeTrue,
527  FALSE);
528 
530  if (acct)
531  {
533  }
534 
535  qof_query_destroy (q);
536 
537  LEAVE ("%p", ld);
538  return ld;
539 }
STRUCTS.
void gnc_split_register_set_template_account(SplitRegister *reg, Account *template_account)
Set the template account for use in a template register.
Account * gnc_book_get_template_root(const QofBook *book)
Returns the template group from the book.
Definition: SX-book.c:65
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
Account * gnc_account_lookup_by_name(const Account *parent, const char *name)
The gnc_account_lookup_by_name() subroutine fetches the account by name from the descendants of the s...
Definition: Account.cpp:3086
void qof_query_destroy(QofQuery *query)
Frees the resources associate with a Query object.
void qof_query_set_book(QofQuery *query, QofBook *book)
Set the book to be searched.
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282
SplitRegister * gnc_ledger_display_get_split_register(GNCLedgerDisplay *ld)
return the split register associated with a ledger display
A Query.
Definition: qofquery.cpp:74

◆ gnucash_get_style_classes()

void gnucash_get_style_classes ( GnucashSheet *  sheet,
GtkStyleContext *  stylectxt,
RegisterColor  field_type,
gboolean  use_neg_class 
)

Map a cell color type to a css style class.

Definition at line 2256 of file gnucash-sheet.c.

2258 {
2259  gchar *full_class, *style_class = NULL;
2260 
2261  if (field_type >= COLOR_NEGATIVE) // Require a Negative fg color
2262  {
2263  if (use_neg_class)
2264  gtk_style_context_add_class (stylectxt, "gnc-class-negative-numbers");
2265  field_type -= COLOR_NEGATIVE;
2266  }
2267  else
2268  {
2269  if (sheet->use_gnc_color_theme) // only add this class if builtin colors used
2270  gtk_style_context_add_class (stylectxt, "gnc-class-register-foreground");
2271  }
2272 
2273  switch (field_type)
2274  {
2275  default:
2276  case COLOR_UNDEFINED:
2277  gtk_style_context_add_class (stylectxt, GTK_STYLE_CLASS_BACKGROUND);
2278  return;
2279 
2280  case COLOR_HEADER:
2281  style_class = "header";
2282  break;
2283 
2284  case COLOR_PRIMARY:
2285  style_class = "primary";
2286  break;
2287 
2288  case COLOR_PRIMARY_ACTIVE:
2289  case COLOR_SECONDARY_ACTIVE:
2290  case COLOR_SPLIT_ACTIVE:
2291  gtk_style_context_set_state (stylectxt, GTK_STATE_FLAG_SELECTED);
2292  style_class = "cursor";
2293  break;
2294 
2295  case COLOR_SECONDARY:
2296  style_class = "secondary";
2297  break;
2298 
2299  case COLOR_SPLIT:
2300  style_class = "split";
2301  break;
2302  }
2303 
2304  if (sheet->use_gnc_color_theme)
2305  full_class = g_strconcat ("gnc-class-register-", style_class, NULL);
2306  else
2307  {
2308  gtk_style_context_add_class (stylectxt, GTK_STYLE_CLASS_VIEW);
2309  full_class = g_strconcat ("gnc-class-user-register-", style_class, NULL);
2310  }
2311 
2312  gtk_style_context_add_class (stylectxt, full_class);
2313 
2314  g_free (full_class);
2315 }

◆ gnucash_register_add_cell_types()

void gnucash_register_add_cell_types ( void  )

Add cell types defined by gnucash_register to gnc_register.

Should be called before any table layout is created using these new types

Add cell types defined by gnucash_register to gnc_register.

Definition at line 101 of file gnucash-register.c.

102 {
103  gnc_register_add_cell_type (COMBO_CELL_TYPE_NAME, gnc_combo_cell_new);
104  gnc_register_add_cell_type (COMPLETION_CELL_TYPE_NAME, gnc_completion_cell_new);
105  gnc_register_add_cell_type (DATE_CELL_TYPE_NAME, gnc_date_cell_new);
106  gnc_register_add_cell_type (PRICE_CELL_TYPE_NAME,
107  gnc_price_cell_gnome_new);
108  gnc_register_add_cell_type (QUICKFILL_CELL_TYPE_NAME,
109  gnc_quickfill_cell_gnome_new);
110  gnc_register_add_cell_type( FORMULA_CELL_TYPE_NAME,
111  gnc_formula_cell_gnome_new );
112  gnc_table_gnome_init ();
113 }
BasicCell * gnc_date_cell_new(void)
installs a callback to handle date recording