mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Put function opening braces in column zero.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7720 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
116e1a7b8a
commit
6af4501e06
@ -120,7 +120,8 @@ static char error_end[] = "</body></html>";
|
||||
|
||||
|
||||
static char *
|
||||
extract_machine_name(const gchar * path) {
|
||||
extract_machine_name(const gchar * path)
|
||||
{
|
||||
char machine_rexp[] = "^(//[^/]*)/*(.*)?$";
|
||||
regex_t compiled_m;
|
||||
regmatch_t match[4];
|
||||
@ -172,7 +173,8 @@ gnc_html_register_urltype (URLType type, const char *protocol)
|
||||
|
||||
URLType
|
||||
gnc_html_parse_url(gnc_html * html, const gchar * url,
|
||||
char ** url_location, char ** url_label) {
|
||||
char ** url_location, char ** url_label)
|
||||
{
|
||||
char uri_rexp[] = "^(([^:]*):)?([^#]+)?(#(.*))?$";
|
||||
regex_t compiled;
|
||||
regmatch_t match[6];
|
||||
@ -274,7 +276,8 @@ gnc_html_parse_url(gnc_html * html, const gchar * url,
|
||||
|
||||
|
||||
static char *
|
||||
extract_base_name(URLType type, const gchar * path) {
|
||||
extract_base_name(URLType type, const gchar * path)
|
||||
{
|
||||
char machine_rexp[] = "^(//[^/]*)/*(/.*)?$";
|
||||
char path_rexp[] = "^/*(.*)/+([^/]*)$";
|
||||
regex_t compiled_m, compiled_p;
|
||||
@ -379,7 +382,8 @@ gnc_html_initialize (void)
|
||||
|
||||
|
||||
char *
|
||||
gnc_build_url (URLType type, const gchar * location, const gchar * label) {
|
||||
gnc_build_url (URLType type, const gchar * location, const gchar * label)
|
||||
{
|
||||
char * type_name;
|
||||
|
||||
type_name = g_hash_table_lookup (gnc_html_type_to_proto_hash, type);
|
||||
@ -431,7 +435,8 @@ gnc_network_allowed()
|
||||
static void
|
||||
gnc_html_http_request_cb(const gchar * uri, int completed_ok,
|
||||
const gchar * body, gint body_len,
|
||||
gpointer user_data) {
|
||||
gpointer user_data)
|
||||
{
|
||||
gnc_html * html = user_data;
|
||||
URLType type;
|
||||
char * location = NULL;
|
||||
@ -517,7 +522,8 @@ gnc_html_http_request_cb(const gchar * uri, int completed_ok,
|
||||
************************************************************/
|
||||
|
||||
static void
|
||||
gnc_html_start_request(gnc_html * html, gchar * uri, GtkHTMLStream * handle) {
|
||||
gnc_html_start_request(gnc_html * html, gchar * uri, GtkHTMLStream * handle)
|
||||
{
|
||||
GList * handles = NULL;
|
||||
gint need_request = FALSE;
|
||||
|
||||
@ -634,7 +640,8 @@ gnc_html_load_to_stream(gnc_html * html, GtkHTMLStream * handle,
|
||||
********************************************************************/
|
||||
|
||||
static void
|
||||
gnc_html_link_clicked_cb(GtkHTML * html, const gchar * url, gpointer data) {
|
||||
gnc_html_link_clicked_cb(GtkHTML * html, const gchar * url, gpointer data)
|
||||
{
|
||||
URLType type;
|
||||
char * location = NULL;
|
||||
char * label = NULL;
|
||||
@ -654,7 +661,8 @@ gnc_html_link_clicked_cb(GtkHTML * html, const gchar * url, gpointer data) {
|
||||
|
||||
static void
|
||||
gnc_html_url_requested_cb(GtkHTML * html, char * url,
|
||||
GtkHTMLStream * handle, gpointer data) {
|
||||
GtkHTMLStream * handle, gpointer data)
|
||||
{
|
||||
URLType type;
|
||||
char * location=NULL;
|
||||
char * label=NULL;
|
||||
@ -674,7 +682,8 @@ gnc_html_url_requested_cb(GtkHTML * html, char * url,
|
||||
|
||||
static int
|
||||
gnc_html_object_requested_cb(GtkHTML * html, GtkHTMLEmbedded * eb,
|
||||
gpointer data) {
|
||||
gpointer data)
|
||||
{
|
||||
gnc_html * gnchtml = data;
|
||||
GncHTMLObjectCB h;
|
||||
|
||||
@ -695,7 +704,8 @@ gnc_html_object_requested_cb(GtkHTML * html, GtkHTMLEmbedded * eb,
|
||||
********************************************************************/
|
||||
|
||||
static void
|
||||
gnc_html_on_url_cb(GtkHTML * html, const gchar * url, gpointer data) {
|
||||
gnc_html_on_url_cb(GtkHTML * html, const gchar * url, gpointer data)
|
||||
{
|
||||
gnc_html * gnchtml = (gnc_html *) data;
|
||||
|
||||
g_free(gnchtml->current_link);
|
||||
@ -712,7 +722,8 @@ gnc_html_on_url_cb(GtkHTML * html, const gchar * url, gpointer data) {
|
||||
|
||||
static void
|
||||
gnc_html_set_base_cb(GtkHTML * gtkhtml, const gchar * base,
|
||||
gpointer data) {
|
||||
gpointer data)
|
||||
{
|
||||
gnc_html * html = (gnc_html *)data;
|
||||
URLType type;
|
||||
char * location = NULL;
|
||||
@ -735,7 +746,8 @@ gnc_html_set_base_cb(GtkHTML * gtkhtml, const gchar * base,
|
||||
|
||||
static int
|
||||
gnc_html_button_press_cb(GtkWidget * widg, GdkEventButton * event,
|
||||
gpointer user_data) {
|
||||
gpointer user_data)
|
||||
{
|
||||
gnc_html * html = user_data;
|
||||
|
||||
if(html->button_cb) {
|
||||
@ -754,14 +766,16 @@ gnc_html_button_press_cb(GtkWidget * widg, GdkEventButton * event,
|
||||
********************************************************************/
|
||||
|
||||
GHashTable *
|
||||
gnc_html_unpack_form_data(const char * encoding) {
|
||||
gnc_html_unpack_form_data(const char * encoding)
|
||||
{
|
||||
GHashTable * rv = g_hash_table_new(g_str_hash, g_str_equal);
|
||||
gnc_html_merge_form_data(rv, encoding);
|
||||
return rv;
|
||||
}
|
||||
|
||||
void
|
||||
gnc_html_merge_form_data(GHashTable * rv, const char * encoding) {
|
||||
gnc_html_merge_form_data(GHashTable * rv, const char * encoding)
|
||||
{
|
||||
char * next_pair = NULL;
|
||||
char * name = NULL;
|
||||
char * value = NULL;
|
||||
@ -799,21 +813,24 @@ gnc_html_merge_form_data(GHashTable * rv, const char * encoding) {
|
||||
}
|
||||
|
||||
static gboolean
|
||||
free_form_data_helper(gpointer k, gpointer v, gpointer user) {
|
||||
free_form_data_helper(gpointer k, gpointer v, gpointer user)
|
||||
{
|
||||
g_free(k);
|
||||
g_free(v);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
gnc_html_free_form_data(GHashTable * d) {
|
||||
gnc_html_free_form_data(GHashTable * d)
|
||||
{
|
||||
g_hash_table_foreach_remove(d, free_form_data_helper, NULL);
|
||||
g_hash_table_destroy(d);
|
||||
}
|
||||
|
||||
static void
|
||||
pack_form_data_helper(gpointer key, gpointer val,
|
||||
gpointer user_data) {
|
||||
gpointer user_data)
|
||||
{
|
||||
char * old_str = *(char **)user_data;
|
||||
char * enc_key = gnc_html_encode_string((char *)key);
|
||||
char * enc_val = gnc_html_encode_string((char *)val);
|
||||
@ -830,7 +847,8 @@ pack_form_data_helper(gpointer key, gpointer val,
|
||||
}
|
||||
|
||||
char *
|
||||
gnc_html_pack_form_data(GHashTable * form_data) {
|
||||
gnc_html_pack_form_data(GHashTable * form_data)
|
||||
{
|
||||
char * encoded = NULL;
|
||||
g_hash_table_foreach(form_data, pack_form_data_helper, &encoded);
|
||||
return encoded;
|
||||
@ -845,7 +863,8 @@ gnc_html_pack_form_data(GHashTable * form_data) {
|
||||
static int
|
||||
gnc_html_submit_cb(GtkHTML * html, const gchar * method,
|
||||
const gchar * action, const gchar * encoded_form_data,
|
||||
gpointer user_data) {
|
||||
gpointer user_data)
|
||||
{
|
||||
gnc_html * gnchtml = user_data;
|
||||
char * location = NULL;
|
||||
char * new_loc = NULL;
|
||||
@ -908,7 +927,8 @@ gnc_html_submit_cb(GtkHTML * html, const gchar * method,
|
||||
|
||||
static void
|
||||
gnc_html_open_scm(gnc_html * html, const gchar * location,
|
||||
const gchar * label, int newwin) {
|
||||
const gchar * label, int newwin)
|
||||
{
|
||||
PINFO("location='%s'", location ? location : "(null)");
|
||||
}
|
||||
|
||||
@ -921,7 +941,8 @@ gnc_html_open_scm(gnc_html * html, const gchar * location,
|
||||
|
||||
void
|
||||
gnc_html_show_data(gnc_html * html, const char * data,
|
||||
int datalen) {
|
||||
int datalen)
|
||||
{
|
||||
GtkHTMLStream * handle = gtk_html_begin(GTK_HTML(html->html));
|
||||
gtk_html_write(GTK_HTML(html->html), handle, data, datalen);
|
||||
gtk_html_end(GTK_HTML(html->html), handle, GTK_HTML_STREAM_OK);
|
||||
@ -1096,7 +1117,8 @@ gnc_html_show_url(gnc_html * html, URLType type,
|
||||
********************************************************************/
|
||||
|
||||
void
|
||||
gnc_html_reload(gnc_html * html) {
|
||||
gnc_html_reload(gnc_html * html)
|
||||
{
|
||||
gnc_html_history_node * n = gnc_html_history_get_current(html->history);
|
||||
if(n) {
|
||||
gnc_html_show_url(html, n->type, n->location, n->label, 0);
|
||||
@ -1110,7 +1132,8 @@ gnc_html_reload(gnc_html * html) {
|
||||
********************************************************************/
|
||||
|
||||
gnc_html *
|
||||
gnc_html_new(void) {
|
||||
gnc_html_new(void)
|
||||
{
|
||||
gnc_html * retval = g_new0(gnc_html, 1);
|
||||
|
||||
retval->container = gtk_scrolled_window_new(NULL, NULL);
|
||||
@ -1172,14 +1195,16 @@ gnc_html_new(void) {
|
||||
********************************************************************/
|
||||
|
||||
static gboolean
|
||||
html_cancel_helper(gpointer key, gpointer value, gpointer user_data) {
|
||||
html_cancel_helper(gpointer key, gpointer value, gpointer user_data)
|
||||
{
|
||||
g_free(key);
|
||||
g_list_free((GList *)value);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
gnc_html_cancel(gnc_html * html) {
|
||||
gnc_html_cancel(gnc_html * html)
|
||||
{
|
||||
/* remove our own references to requests */
|
||||
gnc_http_cancel_requests(html->http);
|
||||
|
||||
@ -1193,7 +1218,8 @@ gnc_html_cancel(gnc_html * html) {
|
||||
********************************************************************/
|
||||
|
||||
void
|
||||
gnc_html_destroy(gnc_html * html) {
|
||||
gnc_html_destroy(gnc_html * html)
|
||||
{
|
||||
|
||||
if(!html) return;
|
||||
|
||||
@ -1218,27 +1244,31 @@ gnc_html_destroy(gnc_html * html) {
|
||||
}
|
||||
|
||||
void
|
||||
gnc_html_set_urltype_cb(gnc_html * html, GncHTMLUrltypeCB urltype_cb) {
|
||||
gnc_html_set_urltype_cb(gnc_html * html, GncHTMLUrltypeCB urltype_cb)
|
||||
{
|
||||
html->urltype_cb = urltype_cb;
|
||||
}
|
||||
|
||||
void
|
||||
gnc_html_set_load_cb(gnc_html * html, GncHTMLLoadCB load_cb,
|
||||
gpointer data) {
|
||||
gpointer data)
|
||||
{
|
||||
html->load_cb = load_cb;
|
||||
html->load_cb_data = data;
|
||||
}
|
||||
|
||||
void
|
||||
gnc_html_set_flyover_cb(gnc_html * html, GncHTMLFlyoverCB flyover_cb,
|
||||
gpointer data) {
|
||||
gpointer data)
|
||||
{
|
||||
html->flyover_cb = flyover_cb;
|
||||
html->flyover_cb_data = data;
|
||||
}
|
||||
|
||||
void
|
||||
gnc_html_set_button_cb(gnc_html * html, GncHTMLButtonCB button_cb,
|
||||
gpointer data) {
|
||||
gpointer data)
|
||||
{
|
||||
html->button_cb = button_cb;
|
||||
html->button_cb_data = data;
|
||||
}
|
||||
@ -1251,14 +1281,16 @@ static gboolean
|
||||
raw_html_receiver (gpointer engine,
|
||||
const gchar *data,
|
||||
guint len,
|
||||
gpointer user_data) {
|
||||
gpointer user_data)
|
||||
{
|
||||
FILE *fh = (FILE *) user_data;
|
||||
fwrite (data, len, 1, fh);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gnc_html_export(gnc_html * html, const char *filepath) {
|
||||
gnc_html_export(gnc_html * html, const char *filepath)
|
||||
{
|
||||
FILE *fh;
|
||||
|
||||
g_return_val_if_fail (html != NULL, FALSE);
|
||||
@ -1276,7 +1308,8 @@ gnc_html_export(gnc_html * html, const char *filepath) {
|
||||
}
|
||||
|
||||
void
|
||||
gnc_html_print(gnc_html * html) {
|
||||
gnc_html_print(gnc_html * html)
|
||||
{
|
||||
PrintSession * ps = gnc_print_session_create(FALSE);
|
||||
|
||||
gtk_html_print(GTK_HTML(html->html),
|
||||
@ -1286,21 +1319,24 @@ gnc_html_print(gnc_html * html) {
|
||||
}
|
||||
|
||||
gnc_html_history *
|
||||
gnc_html_get_history(gnc_html * html) {
|
||||
gnc_html_get_history(gnc_html * html)
|
||||
{
|
||||
if (!html) return NULL;
|
||||
return html->history;
|
||||
}
|
||||
|
||||
|
||||
GtkWidget *
|
||||
gnc_html_get_widget(gnc_html * html) {
|
||||
gnc_html_get_widget(gnc_html * html)
|
||||
{
|
||||
if (!html) return NULL;
|
||||
return html->container;
|
||||
}
|
||||
|
||||
void
|
||||
gnc_html_register_object_handler(const char * classid,
|
||||
GncHTMLObjectCB hand) {
|
||||
GncHTMLObjectCB hand)
|
||||
{
|
||||
g_return_if_fail (classid != NULL);
|
||||
|
||||
if(!gnc_html_object_handlers) {
|
||||
@ -1315,7 +1351,8 @@ gnc_html_register_object_handler(const char * classid,
|
||||
}
|
||||
|
||||
void
|
||||
gnc_html_unregister_object_handler(const char * classid) {
|
||||
gnc_html_unregister_object_handler(const char * classid)
|
||||
{
|
||||
gchar * keyptr=NULL;
|
||||
gchar * valptr=NULL;
|
||||
|
||||
@ -1331,7 +1368,8 @@ gnc_html_unregister_object_handler(const char * classid) {
|
||||
|
||||
void
|
||||
gnc_html_register_action_handler(const char * actionid,
|
||||
GncHTMLActionCB hand) {
|
||||
GncHTMLActionCB hand)
|
||||
{
|
||||
g_return_if_fail (actionid != NULL);
|
||||
|
||||
if(!gnc_html_action_handlers) {
|
||||
@ -1346,7 +1384,8 @@ gnc_html_register_action_handler(const char * actionid,
|
||||
}
|
||||
|
||||
void
|
||||
gnc_html_unregister_action_handler(const char * actionid) {
|
||||
gnc_html_unregister_action_handler(const char * actionid)
|
||||
{
|
||||
gchar * keyptr=NULL;
|
||||
gchar * valptr=NULL;
|
||||
|
||||
@ -1389,7 +1428,8 @@ gnc_html_register_url_handler (URLType url_type, GncHTMLUrlCB hand)
|
||||
{
|
||||
g_return_if_fail (url_type != NULL && *url_type != '\0');
|
||||
|
||||
if(!gnc_html_url_handlers) {
|
||||
if(!gnc_html_url_handlers)
|
||||
{
|
||||
gnc_html_url_handlers = g_hash_table_new (g_str_hash, g_str_equal);
|
||||
}
|
||||
|
||||
@ -1417,7 +1457,8 @@ gnc_html_unregister_url_handler (URLType url_type)
|
||||
********************************************************************/
|
||||
|
||||
char *
|
||||
gnc_html_encode_string(const char * str) {
|
||||
gnc_html_encode_string(const char * str)
|
||||
{
|
||||
static gchar *safe = "$-._!*(),"; /* RFC 1738 */
|
||||
unsigned pos = 0;
|
||||
GString *encoded = g_string_new ("");
|
||||
@ -1457,7 +1498,8 @@ gnc_html_encode_string(const char * str) {
|
||||
|
||||
|
||||
char *
|
||||
gnc_html_decode_string(const char * str) {
|
||||
gnc_html_decode_string(const char * str)
|
||||
{
|
||||
static gchar * safe = "$-._!*(),"; /* RFC 1738 */
|
||||
GString * decoded = g_string_new ("");
|
||||
const gchar * ptr;
|
||||
@ -1502,7 +1544,8 @@ gnc_html_decode_string(const char * str) {
|
||||
********************************************************************/
|
||||
|
||||
char *
|
||||
gnc_html_unescape_newlines(const gchar * in) {
|
||||
gnc_html_unescape_newlines(const gchar * in)
|
||||
{
|
||||
const char * ip = in;
|
||||
char * cstr = NULL;
|
||||
GString * rv = g_string_new("");
|
||||
@ -1524,7 +1567,8 @@ gnc_html_unescape_newlines(const gchar * in) {
|
||||
}
|
||||
|
||||
char *
|
||||
gnc_html_escape_newlines(const gchar * in) {
|
||||
gnc_html_escape_newlines(const gchar * in)
|
||||
{
|
||||
char *out;
|
||||
const char * ip = in;
|
||||
GString * escaped = g_string_new("");
|
||||
@ -1550,7 +1594,8 @@ gnc_html_escape_newlines(const gchar * in) {
|
||||
|
||||
void
|
||||
gnc_html_generic_get_submit(gnc_html * html, const char * action,
|
||||
GHashTable * form_data) {
|
||||
GHashTable * form_data)
|
||||
{
|
||||
URLType type;
|
||||
char * location = NULL;
|
||||
char * label = NULL;
|
||||
@ -1574,7 +1619,8 @@ gnc_html_generic_get_submit(gnc_html * html, const char * action,
|
||||
|
||||
void
|
||||
gnc_html_generic_post_submit(gnc_html * html, const char * action,
|
||||
GHashTable * form_data) {
|
||||
GHashTable * form_data)
|
||||
{
|
||||
char * encoded = gnc_html_pack_form_data(form_data);
|
||||
char * copy = strdup(encoded);
|
||||
gnc_http_start_post(html->http, action,
|
||||
@ -1593,7 +1639,8 @@ gnc_html_generic_post_submit(gnc_html * html, const char * action,
|
||||
|
||||
static void
|
||||
multipart_post_helper(gpointer key, gpointer val,
|
||||
gpointer user_data) {
|
||||
gpointer user_data)
|
||||
{
|
||||
char * old_str = *(char **)user_data;
|
||||
char * new_str =
|
||||
g_strconcat(old_str,
|
||||
@ -1609,7 +1656,8 @@ multipart_post_helper(gpointer key, gpointer val,
|
||||
|
||||
void
|
||||
gnc_html_multipart_post_submit(gnc_html * html, const char * action,
|
||||
GHashTable * form_data) {
|
||||
GHashTable * form_data)
|
||||
{
|
||||
|
||||
char * htmlstr = g_strdup("");
|
||||
char * next_htmlstr;
|
||||
|
@ -104,7 +104,8 @@ static gint last_height = 0;
|
||||
********************************************************************/
|
||||
|
||||
static int
|
||||
gnc_help_window_check_urltype(URLType t) {
|
||||
gnc_help_window_check_urltype(URLType t)
|
||||
{
|
||||
if (!safe_strcmp (t, URL_TYPE_FILE) ||
|
||||
!safe_strcmp (t, URL_TYPE_HELP) ||
|
||||
!safe_strcmp (t, URL_TYPE_HTTP) ||
|
||||
@ -124,7 +125,8 @@ gnc_help_window_check_urltype(URLType t) {
|
||||
|
||||
static void
|
||||
gnc_help_window_url_flyover(gnc_html * html, const gchar * url,
|
||||
gpointer data) {
|
||||
gpointer data)
|
||||
{
|
||||
gnc_help_window * help = (gnc_help_window *)data;
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(help->statusbar), 1);
|
||||
if(url) {
|
||||
@ -139,7 +141,8 @@ gnc_help_window_url_flyover(gnc_html * html, const gchar * url,
|
||||
********************************************************************/
|
||||
|
||||
static void
|
||||
gnc_help_window_set_back_button(gnc_help_window * win, int enabled) {
|
||||
gnc_help_window_set_back_button(gnc_help_window * win, int enabled)
|
||||
{
|
||||
GtkToolbar * tb = GTK_TOOLBAR(win->toolbar);
|
||||
gtk_widget_set_sensitive
|
||||
(GTK_WIDGET(((GtkToolbarChild *)g_list_nth_data(tb->children, 0))->widget),
|
||||
@ -148,7 +151,8 @@ gnc_help_window_set_back_button(gnc_help_window * win, int enabled) {
|
||||
|
||||
|
||||
static void
|
||||
gnc_help_window_set_fwd_button(gnc_help_window * win, int enabled) {
|
||||
gnc_help_window_set_fwd_button(gnc_help_window * win, int enabled)
|
||||
{
|
||||
GtkToolbar * tb = GTK_TOOLBAR(win->toolbar);
|
||||
gtk_widget_set_sensitive
|
||||
(GTK_WIDGET(((GtkToolbarChild *)g_list_nth_data(tb->children, 1))->widget),
|
||||
@ -233,7 +237,8 @@ gnc_help_show_topic (gnc_help_window *help, const char * location)
|
||||
static void
|
||||
gnc_help_window_load_cb(gnc_html * html, URLType type,
|
||||
const gchar * location, const gchar * label,
|
||||
gpointer data) {
|
||||
gpointer data)
|
||||
{
|
||||
gnc_help_window * win = data;
|
||||
|
||||
if(gnc_html_history_forward_p(gnc_html_get_history(win->html))) {
|
||||
@ -259,7 +264,8 @@ gnc_help_window_load_cb(gnc_html * html, URLType type,
|
||||
********************************************************************/
|
||||
|
||||
static int
|
||||
gnc_help_window_fwd_cb(GtkWidget * w, gpointer data) {
|
||||
gnc_help_window_fwd_cb(GtkWidget * w, gpointer data)
|
||||
{
|
||||
gnc_help_window * help = data;
|
||||
gnc_html_history_node * node;
|
||||
|
||||
@ -270,7 +276,8 @@ gnc_help_window_fwd_cb(GtkWidget * w, gpointer data) {
|
||||
}
|
||||
|
||||
static int
|
||||
gnc_help_window_back_cb(GtkWidget * w, gpointer data) {
|
||||
gnc_help_window_back_cb(GtkWidget * w, gpointer data)
|
||||
{
|
||||
gnc_help_window * help = data;
|
||||
gnc_html_history_node * node;
|
||||
|
||||
@ -281,21 +288,24 @@ gnc_help_window_back_cb(GtkWidget * w, gpointer data) {
|
||||
}
|
||||
|
||||
static int
|
||||
gnc_help_window_stop_button_cb(GtkWidget * w, gpointer data) {
|
||||
gnc_help_window_stop_button_cb(GtkWidget * w, gpointer data)
|
||||
{
|
||||
gnc_help_window * help = data;
|
||||
gnc_html_cancel(help->html);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static int
|
||||
gnc_help_window_reload_button_cb(GtkWidget * w, gpointer data) {
|
||||
gnc_help_window_reload_button_cb(GtkWidget * w, gpointer data)
|
||||
{
|
||||
gnc_help_window * help = data;
|
||||
gnc_html_reload(help->html);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
goto_string_cb(char * string, gpointer data) {
|
||||
goto_string_cb(char * string, gpointer data)
|
||||
{
|
||||
if(!data) return;
|
||||
if(!string) {
|
||||
*(char **)data = NULL;
|
||||
@ -306,7 +316,8 @@ goto_string_cb(char * string, gpointer data) {
|
||||
}
|
||||
|
||||
static int
|
||||
gnc_help_window_goto_button_cb(GtkWidget * w, gpointer data) {
|
||||
gnc_help_window_goto_button_cb(GtkWidget * w, gpointer data)
|
||||
{
|
||||
gnc_help_window * help = data;
|
||||
int retval = -1;
|
||||
char * url = NULL;
|
||||
@ -342,7 +353,8 @@ gnc_help_window_goto_button_cb(GtkWidget * w, gpointer data) {
|
||||
|
||||
static void
|
||||
gnc_help_window_topic_select_cb(GtkCTree * tree, GtkCTreeNode * row, int col,
|
||||
gpointer user_data) {
|
||||
gpointer user_data)
|
||||
{
|
||||
gnc_help_window * wind = user_data;
|
||||
URLType type;
|
||||
char * location = NULL;
|
||||
@ -358,13 +370,15 @@ gnc_help_window_topic_select_cb(GtkCTree * tree, GtkCTreeNode * row, int col,
|
||||
}
|
||||
|
||||
static void
|
||||
free_url_cb(gpointer user_data) {
|
||||
free_url_cb(gpointer user_data)
|
||||
{
|
||||
if(user_data) free(user_data);
|
||||
}
|
||||
|
||||
static void
|
||||
topics_add_children(SCM topics, GtkCTree * tree, GtkCTreeNode * parent,
|
||||
gnc_help_window * help) {
|
||||
gnc_help_window * help)
|
||||
{
|
||||
SCM this_topic;
|
||||
SCM subtopics;
|
||||
GtkCTreeNode * node;
|
||||
@ -432,7 +446,8 @@ gnc_help_window_load_topics(gnc_help_window * help, const gchar * file)
|
||||
|
||||
|
||||
static void
|
||||
gnc_help_window_destroy_cb(GtkWidget * w, gpointer data) {
|
||||
gnc_help_window_destroy_cb(GtkWidget * w, gpointer data)
|
||||
{
|
||||
gnc_help_window * help = data;
|
||||
|
||||
gnc_unregister_gui_component_by_data (WINDOW_HELP_CM_CLASS, help);
|
||||
@ -454,14 +469,16 @@ gnc_help_window_destroy_cb(GtkWidget * w, gpointer data) {
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_help_window_close_cb(GtkWidget * w, gpointer data) {
|
||||
gnc_help_window_close_cb(GtkWidget * w, gpointer data)
|
||||
{
|
||||
gnc_help_window * help = data;
|
||||
|
||||
gnc_close_gui_component_by_data (WINDOW_HELP_CM_CLASS, help);
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_help_window_print_cb(GtkWidget * w, gpointer data) {
|
||||
gnc_help_window_print_cb(GtkWidget * w, gpointer data)
|
||||
{
|
||||
gnc_help_window * help = data;
|
||||
|
||||
gnc_html_print(help->html);
|
||||
@ -469,7 +486,8 @@ gnc_help_window_print_cb(GtkWidget * w, gpointer data) {
|
||||
|
||||
|
||||
static void
|
||||
item_destroy_cb(GtkListItem * li, gpointer user_data) {
|
||||
item_destroy_cb(GtkListItem * li, gpointer user_data)
|
||||
{
|
||||
gpointer x = gtk_object_get_user_data(GTK_OBJECT(li));
|
||||
g_free(x);
|
||||
}
|
||||
@ -477,7 +495,8 @@ item_destroy_cb(GtkListItem * li, gpointer user_data) {
|
||||
|
||||
static void
|
||||
show_search_results(gnc_help_window * help, const char * matches,
|
||||
int match_len) {
|
||||
int match_len)
|
||||
{
|
||||
const char * current;
|
||||
const char * end;
|
||||
char * this_link=NULL;
|
||||
@ -523,7 +542,8 @@ show_search_results(gnc_help_window * help, const char * matches,
|
||||
|
||||
|
||||
static void
|
||||
gnc_help_window_search_button_cb(GtkButton * button, gpointer data) {
|
||||
gnc_help_window_search_button_cb(GtkButton * button, gpointer data)
|
||||
{
|
||||
gnc_help_window * help = data;
|
||||
char * search_string =
|
||||
gtk_entry_get_text(GTK_ENTRY(help->search_entry));
|
||||
@ -549,7 +569,8 @@ gnc_help_window_search_button_cb(GtkButton * button, gpointer data) {
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_help_window_search_help_button_cb(GtkButton * button, gpointer data) {
|
||||
gnc_help_window_search_help_button_cb(GtkButton * button, gpointer data)
|
||||
{
|
||||
#if 0
|
||||
gnc_help_window * help = data;
|
||||
#endif
|
||||
@ -559,7 +580,8 @@ gnc_help_window_search_help_button_cb(GtkButton * button, gpointer data) {
|
||||
|
||||
static void
|
||||
gnc_help_window_search_result_select_cb(GtkWidget * list, GtkWidget * child,
|
||||
gpointer user_data) {
|
||||
gpointer user_data)
|
||||
{
|
||||
gnc_help_window * help = user_data;
|
||||
char * helpfile = gtk_object_get_user_data(GTK_OBJECT(child));
|
||||
gnc_help_window_show_help(help, helpfile, NULL);
|
||||
@ -584,7 +606,8 @@ close_handler (gpointer user_data)
|
||||
********************************************************************/
|
||||
|
||||
gnc_help_window *
|
||||
gnc_help_window_new (void) {
|
||||
gnc_help_window_new (void)
|
||||
{
|
||||
|
||||
gnc_help_window * help = g_new0(gnc_help_window, 1);
|
||||
char * indexfile;
|
||||
@ -741,7 +764,8 @@ gnc_help_window_new (void) {
|
||||
********************************************************************/
|
||||
|
||||
void
|
||||
gnc_help_window_destroy(gnc_help_window * help) {
|
||||
gnc_help_window_destroy(gnc_help_window * help)
|
||||
{
|
||||
if (!help) return;
|
||||
|
||||
gnc_unregister_gui_component_by_data (WINDOW_HELP_CM_CLASS, help);
|
||||
@ -763,7 +787,8 @@ gnc_help_window_destroy(gnc_help_window * help) {
|
||||
|
||||
void
|
||||
gnc_help_window_show_help(gnc_help_window * help, const char * location,
|
||||
const char * label) {
|
||||
const char * label)
|
||||
{
|
||||
gnc_html_show_url(help->html, URL_TYPE_FILE, location, label, 0);
|
||||
}
|
||||
|
||||
@ -773,7 +798,8 @@ gnc_help_window_show_help(gnc_help_window * help, const char * location,
|
||||
********************************************************************/
|
||||
|
||||
void
|
||||
helpWindow(GtkWidget * parent, const char * title, const char * htmlfile) {
|
||||
helpWindow(GtkWidget * parent, const char * title, const char * htmlfile)
|
||||
{
|
||||
gnc_help_window * help = gnc_help_window_new();
|
||||
gnc_help_window_show_help(help, htmlfile, NULL);
|
||||
}
|
||||
|
@ -89,7 +89,8 @@ static void gnc_report_window_reload_cb(GtkWidget * w, gpointer data);
|
||||
|
||||
static GtkWidget *
|
||||
gnc_report_window_view_labeler(GnomeMDIChild * child, GtkWidget * current,
|
||||
gpointer user_data) {
|
||||
gpointer user_data)
|
||||
{
|
||||
GNCMDIChildInfo * rwin = gtk_object_get_user_data(GTK_OBJECT(child));
|
||||
gnc_report_window * report;
|
||||
SCM get_name = gh_eval_str("gnc:report-name");
|
||||
@ -206,7 +207,8 @@ gnc_report_window_view_new(GnomeMDIChild * child, gpointer user_data)
|
||||
********************************************************************/
|
||||
|
||||
GnomeMDIChild *
|
||||
gnc_report_window_create_child(const gchar * configstring) {
|
||||
gnc_report_window_create_child(const gchar * configstring)
|
||||
{
|
||||
GnomeMDIGenericChild * reportchild =
|
||||
gnome_mdi_generic_child_new(configstring);
|
||||
GNCMDIInfo * maininfo = gnc_mdi_get_current();
|
||||
@ -227,7 +229,8 @@ gnc_report_window_create_child(const gchar * configstring) {
|
||||
********************************************************************/
|
||||
|
||||
void
|
||||
gnc_main_window_open_report(int report_id, gint toplevel) {
|
||||
gnc_main_window_open_report(int report_id, gint toplevel)
|
||||
{
|
||||
char * id_name = g_strdup_printf("id=%d", report_id);
|
||||
char * child_name = gnc_build_url (URL_TYPE_REPORT, id_name, NULL);
|
||||
g_free (id_name);
|
||||
@ -236,7 +239,8 @@ gnc_main_window_open_report(int report_id, gint toplevel) {
|
||||
|
||||
|
||||
void
|
||||
gnc_main_window_open_report_url(const char * url, gint toplevel) {
|
||||
gnc_main_window_open_report_url(const char * url, gint toplevel)
|
||||
{
|
||||
GnomeMDIChild * reportchild = gnc_report_window_create_child(url);
|
||||
GNCMDIInfo * maininfo = gnc_mdi_get_current();
|
||||
|
||||
@ -265,7 +269,8 @@ gnc_main_window_open_report_url(const char * url, gint toplevel) {
|
||||
********************************************************************/
|
||||
|
||||
static int
|
||||
gnc_report_window_check_urltype(URLType t) {
|
||||
gnc_report_window_check_urltype(URLType t)
|
||||
{
|
||||
if (!safe_strcmp (t, URL_TYPE_REPORT)) {
|
||||
return TRUE;
|
||||
} else {
|
||||
@ -279,7 +284,8 @@ gnc_report_window_check_urltype(URLType t) {
|
||||
********************************************************************/
|
||||
|
||||
static int
|
||||
gnc_report_window_fwd_cb(GtkWidget * w, gpointer data) {
|
||||
gnc_report_window_fwd_cb(GtkWidget * w, gpointer data)
|
||||
{
|
||||
gnc_report_window * report = data;
|
||||
gnc_html_history_node * node = NULL;
|
||||
|
||||
@ -293,7 +299,8 @@ gnc_report_window_fwd_cb(GtkWidget * w, gpointer data) {
|
||||
}
|
||||
|
||||
static int
|
||||
gnc_report_window_back_cb(GtkWidget * w, gpointer data) {
|
||||
gnc_report_window_back_cb(GtkWidget * w, gpointer data)
|
||||
{
|
||||
gnc_report_window * report = data;
|
||||
gnc_html_history_node * node;
|
||||
|
||||
@ -308,7 +315,8 @@ gnc_report_window_back_cb(GtkWidget * w, gpointer data) {
|
||||
|
||||
|
||||
static int
|
||||
gnc_report_window_stop_button_cb(GtkWidget * w, gpointer data) {
|
||||
gnc_report_window_stop_button_cb(GtkWidget * w, gpointer data)
|
||||
{
|
||||
gnc_report_window * report = data;
|
||||
gnc_html_cancel(report->html);
|
||||
return TRUE;
|
||||
@ -521,7 +529,8 @@ gnc_report_window_params_cb(GtkWidget * w, gpointer data)
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_report_window_reload_cb(GtkWidget * unused, gpointer data) {
|
||||
gnc_report_window_reload_cb(GtkWidget * unused, gpointer data)
|
||||
{
|
||||
gnc_report_window * report = data;
|
||||
SCM dirty_report = gh_eval_str("gnc:report-set-dirty?!");
|
||||
|
||||
@ -532,7 +541,8 @@ gnc_report_window_reload_cb(GtkWidget * unused, gpointer data) {
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_report_window_set_back_button(gnc_report_window * win, int enabled) {
|
||||
gnc_report_window_set_back_button(gnc_report_window * win, int enabled)
|
||||
{
|
||||
GnomeApp * app = win->mc->app;
|
||||
GnomeUIInfo * info;
|
||||
|
||||
@ -546,7 +556,8 @@ gnc_report_window_set_back_button(gnc_report_window * win, int enabled) {
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_report_window_set_fwd_button(gnc_report_window * win, int enabled) {
|
||||
gnc_report_window_set_fwd_button(gnc_report_window * win, int enabled)
|
||||
{
|
||||
GnomeApp * app = win->mc->app;
|
||||
GnomeUIInfo * info;
|
||||
|
||||
@ -560,12 +571,14 @@ gnc_report_window_set_fwd_button(gnc_report_window * win, int enabled) {
|
||||
}
|
||||
|
||||
void
|
||||
gnc_report_window_reload(gnc_report_window * win) {
|
||||
gnc_report_window_reload(gnc_report_window * win)
|
||||
{
|
||||
gnc_html_reload(win->html);
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_report_window_option_change_cb(gpointer data) {
|
||||
gnc_report_window_option_change_cb(gpointer data)
|
||||
{
|
||||
gnc_report_window * report = data;
|
||||
SCM dirty_report = gh_eval_str("gnc:report-set-dirty?!");
|
||||
|
||||
@ -682,7 +695,8 @@ gnc_report_window_load_cb(gnc_html * html, URLType type,
|
||||
********************************************************************/
|
||||
|
||||
static void
|
||||
gnc_report_window_destroy_cb(GtkWidget * w, gpointer data) {
|
||||
gnc_report_window_destroy_cb(GtkWidget * w, gpointer data)
|
||||
{
|
||||
gnc_report_window * win = data;
|
||||
/* make sure we don't get a double dose -o- destruction */
|
||||
gtk_signal_disconnect_by_data(GTK_OBJECT(win->container),
|
||||
@ -697,14 +711,16 @@ gnc_report_window_destroy_cb(GtkWidget * w, gpointer data) {
|
||||
********************************************************************/
|
||||
|
||||
static void
|
||||
gnc_report_window_print_cb(GtkWidget * w, gpointer data) {
|
||||
gnc_report_window_print_cb(GtkWidget * w, gpointer data)
|
||||
{
|
||||
gnc_report_window * win = data;
|
||||
gnc_html_print(win->html);
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_report_window_history_destroy_cb(gnc_html_history_node * node,
|
||||
gpointer user_data) {
|
||||
gpointer user_data)
|
||||
{
|
||||
static SCM remover = SCM_BOOL_F;
|
||||
int report_id;
|
||||
|
||||
@ -789,7 +805,8 @@ gnc_report_window_new(GNCMDIChildInfo * mc)
|
||||
|
||||
void
|
||||
gnc_report_window_create_toolbar(gnc_report_window * win,
|
||||
GNCMDIChildInfo * child) {
|
||||
GNCMDIChildInfo * child)
|
||||
{
|
||||
GnomeUIInfo toolbar_data[] =
|
||||
{
|
||||
{ GNOME_APP_UI_ITEM,
|
||||
@ -869,7 +886,8 @@ gnc_report_window_create_toolbar(gnc_report_window * win,
|
||||
********************************************************************/
|
||||
void
|
||||
gnc_report_window_create_menu(gnc_report_window * report,
|
||||
GNCMDIChildInfo * child) {
|
||||
GNCMDIChildInfo * child)
|
||||
{
|
||||
child->menu_info = NULL;
|
||||
}
|
||||
|
||||
@ -880,7 +898,8 @@ gnc_report_window_create_menu(gnc_report_window * report,
|
||||
********************************************************************/
|
||||
|
||||
void
|
||||
gnc_report_window_destroy(gnc_report_window * win) {
|
||||
gnc_report_window_destroy(gnc_report_window * win)
|
||||
{
|
||||
|
||||
SCM get_editor = gh_eval_str("gnc:report-editor-widget");
|
||||
SCM set_editor = gh_eval_str("gnc:report-set-editor-widget!");
|
||||
@ -918,36 +937,42 @@ gnc_report_window_destroy(gnc_report_window * win) {
|
||||
}
|
||||
|
||||
gnc_html *
|
||||
gnc_report_window_get_html(gnc_report_window * report) {
|
||||
gnc_report_window_get_html(gnc_report_window * report)
|
||||
{
|
||||
return report->html;
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
gnc_report_window_get_container(gnc_report_window * report) {
|
||||
gnc_report_window_get_container(gnc_report_window * report)
|
||||
{
|
||||
return report->container;
|
||||
}
|
||||
|
||||
SCM
|
||||
gnc_report_window_get_report(gnc_report_window * report) {
|
||||
gnc_report_window_get_report(gnc_report_window * report)
|
||||
{
|
||||
return report->cur_report;
|
||||
}
|
||||
|
||||
void
|
||||
gnc_report_window_show_report(gnc_report_window * report, int report_id) {
|
||||
gnc_report_window_show_report(gnc_report_window * report, int report_id)
|
||||
{
|
||||
char * location = g_strdup_printf("id=%d", report_id);
|
||||
gnc_html_show_url(report->html, URL_TYPE_REPORT, location, NULL, 0);
|
||||
g_free(location);
|
||||
}
|
||||
|
||||
void
|
||||
reportWindow(int report_id) {
|
||||
reportWindow(int report_id)
|
||||
{
|
||||
gnc_set_busy_cursor (NULL, TRUE);
|
||||
gnc_main_window_open_report(report_id, FALSE);
|
||||
gnc_unset_busy_cursor (NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gnc_print_report (int report_id) {
|
||||
gnc_print_report (int report_id)
|
||||
{
|
||||
gnc_html *html;
|
||||
char * location;
|
||||
|
||||
@ -979,7 +1004,8 @@ struct report_default_params_data {
|
||||
|
||||
static void
|
||||
gnc_options_dialog_apply_cb(GNCOptionWin * propertybox,
|
||||
gpointer user_data) {
|
||||
gpointer user_data)
|
||||
{
|
||||
SCM dirty_report = gh_eval_str("gnc:report-set-dirty?!");
|
||||
struct report_default_params_data * win = user_data;
|
||||
|
||||
@ -990,13 +1016,15 @@ gnc_options_dialog_apply_cb(GNCOptionWin * propertybox,
|
||||
|
||||
static void
|
||||
gnc_options_dialog_help_cb(GNCOptionWin * propertybox,
|
||||
gpointer user_data) {
|
||||
gpointer user_data)
|
||||
{
|
||||
gnome_ok_dialog(_("Set the report options you want using this dialog."));
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_options_dialog_close_cb(GNCOptionWin * propertybox,
|
||||
gpointer user_data) {
|
||||
gpointer user_data)
|
||||
{
|
||||
struct report_default_params_data * win = user_data;
|
||||
SCM set_editor = gh_eval_str("gnc:report-set-editor-widget!");
|
||||
|
||||
@ -1061,7 +1089,8 @@ gnc_report_window_default_params_editor(SCM options, SCM report)
|
||||
}
|
||||
|
||||
void
|
||||
gnc_report_window_remove_edited_report(gnc_report_window * win, SCM report) {
|
||||
gnc_report_window_remove_edited_report(gnc_report_window * win, SCM report)
|
||||
{
|
||||
SCM new_edited = scm_delete(win->edited_reports, report);
|
||||
scm_unprotect_object(win->edited_reports);
|
||||
win->edited_reports = new_edited;
|
||||
@ -1069,7 +1098,8 @@ gnc_report_window_remove_edited_report(gnc_report_window * win, SCM report) {
|
||||
}
|
||||
|
||||
void
|
||||
gnc_report_window_add_edited_report(gnc_report_window * win, SCM report) {
|
||||
gnc_report_window_add_edited_report(gnc_report_window * win, SCM report)
|
||||
{
|
||||
SCM new_edited = gh_cons(report, win->edited_reports);
|
||||
scm_unprotect_object(win->edited_reports);
|
||||
win->edited_reports = new_edited;
|
||||
@ -1077,7 +1107,8 @@ gnc_report_window_add_edited_report(gnc_report_window * win, SCM report) {
|
||||
}
|
||||
|
||||
void
|
||||
gnc_report_raise_editor(SCM report) {
|
||||
gnc_report_raise_editor(SCM report)
|
||||
{
|
||||
SCM get_editor = gh_eval_str("gnc:report-editor-widget");
|
||||
SCM editor = gh_call1(get_editor, report);
|
||||
gtk_window_present(gw_wcp_get_ptr(editor));
|
||||
|
Loading…
Reference in New Issue
Block a user