aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntony Kellermann2018-10-04 11:30:59 -0400
committerAntony Kellermann2018-10-04 11:30:59 -0400
commit133bcca2edfa81357e10282c0942de301b5d5dbb (patch)
tree925bc1d27dd4fd6f6d6e38000e4d069f8c095bcd
parente253f52d3d0a1582774323d82d84e3b2214cd0d5 (diff)
downloadaur-133bcca2edfa81357e10282c0942de301b5d5dbb.tar.gz
Added some documentation
-rw-r--r--api.h18
-rw-r--r--gtk_win.h78
2 files changed, 90 insertions, 6 deletions
diff --git a/api.h b/api.h
index e37b24a4e26b..c6a426234d1d 100644
--- a/api.h
+++ b/api.h
@@ -294,12 +294,30 @@ void info_store_portfolio_data(Info* pInfo);
*/
void info_array_store_totals(Info_Array* pInfo_Array);
+/**
+ * Sets global variable ref_cache to a valid Ref_Data object or NULL. It will first try reading
+ * the cache file. If it doesn't exist or hasn't been reloaded in a week, calls the api. If it does
+ * exist and has been reloaded in the past week, sets ref_cache to the cache file.
+ */
void api_ref_cache_init(void);
+/**
+ * Calls IEX's ref data api endpoint and writes the data in JSON format to
+ * $HOME/.tick_ref_cache.json
+ */
void api_ref_data_write_cache(void);
+/**
+ * Reads the ref cache file and returns a Ref_Data* containing its data if valid or NULL if not.
+ * @return
+ */
Ref_Data* ref_data_read_cache(void);
+/**
+ * Stores the data found in IEX formatted jobj in the Ref_Data.
+ * @param pRef_Data
+ * @param jobj
+ */
void ref_data_store_json(Ref_Data* pRef_Data, const Json* jobj);
/**
diff --git a/gtk_win.h b/gtk_win.h
index 76afe12752f2..226d135d2bc7 100644
--- a/gtk_win.h
+++ b/gtk_win.h
@@ -9,7 +9,6 @@
#define PEER_COLUMN_PROFIT_24H_PERCENT 1
#define PEER_COLUMN_PROFIT_7D_PERCENT 2
#define PEER_COLUMN_PROFIT_30D_PERCENT 3
-#define PEER_NUM_COLS 4
#define INFO_ARRAY_CACHE_MAX 128
typedef enum column_index {
@@ -55,8 +54,6 @@ void check_list_create_from_string(void);
*/
void check_list_add_api_data(void);
-/********************* SIGNALS *********************/
-
/**
* SIGNAL FOR LOAD BUTTON CLICK
*
@@ -174,28 +171,69 @@ void on_check_window_destroy(void);
*/
void on_column_clicked(GtkTreeViewColumn* column, GtkListStore* list_store);
+/**
+ * SIGNAL FOR CHECK TREE VIEW ACTIVATE
+ *
+ * Shows info for the security in the column activated.
+ * @param tree_view GtkTreeView*
+ * @param path GtkTreePath*
+ * @param column GtkTreeViewColumn*
+ */
void on_check_tree_view_row_activated(GtkTreeView* tree_view, GtkTreePath* path,
GtkTreeViewColumn* column);
+/**
+ * SIGNAL FOR BACK BUTTON CLICKED
+ *
+ * Returns to the portfolio view.
+ * @param button
+ */
void on_info_back_button_clicked(GtkButton* button);
+/**
+ * SIGNAL FOR SEARCH ENTRY FOCUS
+ *
+ * On first time focusing, populates the search completion list store with ref symbols.
+ * @param search_entry
+ * @param event
+ */
void on_search_entry_focus_in_event(GtkWidget* search_entry, GdkEvent* event);
+/**
+ * SIGNAL FOR SEARCH ENTRY ACTIVATE
+ *
+ * Shows info for the entered security if available.
+ * @param entry
+ */
void on_search_entry_activate(GtkEntry* entry);
+/**
+ * SIGNAL FOR PEER COLUMN ACTIVATED
+ *
+ * Shows info for the security in the column activated.
+ * @param tree_view
+ * @param path
+ * @param column
+ */
void on_info_peers_tree_view_row_activated(GtkTreeView* tree_view, GtkTreePath* path,
GtkTreeViewColumn* column);
+/**
+ * Shows info for the given symbol
+ * @param symbol
+ */
void symbol_show_info(const char* symbol);
-/** UTILS **/
-
/**
- * Formats text in Info structs for printing to window
+ * Formats text in an Info_Array for printing to window
* @param portfolio_data Info_Array* with valid Info data in it.
*/
void info_array_format_cells(Info_Array* portfolio_data);
+/**
+ * Formats text in pInfo for printing to window
+ * @param pInfo
+ */
void info_format_cells(Info* pInfo);
/**
@@ -211,16 +249,44 @@ void list_store_sort(GtkListStore* list_store, Col_Index idx);
*/
void list_store_update(void);
+/**
+ * Fills all components of info window with the given pInfo.
+ * @param pInfo
+ */
void info_pane_populate_all(const Info* pInfo);
+/**
+ * Fills header with info from pInfo
+ * @param pInfo
+ */
void info_pane_populate_header(const Info* pInfo);
+/**
+ * Fills company section with info from pInfo
+ * @param pInfo
+ */
void info_pane_populate_company(const Info* pInfo);
+/**
+ * Fills peers section with info from pInfo
+ * @param pInfo
+ */
void info_pane_populate_peers(const Info* pInfo);
+/**
+ * Fills news section with info from pInfo
+ * @param pInfo
+ */
void info_pane_populate_news(const Info* pInfo);
+/**
+ * SIGNAL FOR GRAPH DRAW
+ *
+ * Draws a graph of app.focused
+ * @param widget GtkDrawingArea
+ * @param cr cairo object to draw on
+ * @return FALSE
+ */
gboolean on_info_graph_drawing_area_draw(GtkWidget* widget, cairo_t* cr);
/**