diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2003-11-05 07:26:31 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2003-11-05 07:26:31 +0800 |
commit | f2d0b1b1266b3bd92916dc23019af6322d510f77 (patch) | |
tree | 1838153d12e732513d0e2bbe9ceb44bb6a784afd /embed/ephy-embed.h | |
parent | 359950ec9266be580ab6bb599e59a05919c7c42a (diff) | |
download | gsoc2013-epiphany-f2d0b1b1266b3bd92916dc23019af6322d510f77.tar.gz gsoc2013-epiphany-f2d0b1b1266b3bd92916dc23019af6322d510f77.tar.zst gsoc2013-epiphany-f2d0b1b1266b3bd92916dc23019af6322d510f77.zip |
Get rid of gresult type. Use return values instead of out-parameters
2003-11-05 Christian Persch <chpe@cvs.gnome.org>
* embed/Makefile.am:
* embed/ephy-command-manager.c: (ephy_command_manager_do_command),
(ephy_command_manager_get_command_state):
* embed/ephy-command-manager.h:
* embed/ephy-embed-event.c: (ephy_embed_event_get_type),
(ephy_embed_event_class_init), (ephy_embed_event_init),
(ephy_embed_event_finalize), (ephy_embed_event_new),
(ephy_embed_event_get_event_type), (ephy_embed_event_get_coords),
(ephy_embed_event_get_context), (ephy_embed_event_set_property):
* embed/ephy-embed-event.h:
* embed/ephy-embed-persist.c: (ephy_embed_persist_cancel):
* embed/ephy-embed-persist.h:
* embed/ephy-embed-popup-control.c:
(ephy_embed_popup_control_set_event),
(embed_popup_copy_location_cmd), (embed_popup_save_page_as_cmd),
(embed_popup_open_frame_cmd):
* embed/ephy-embed-single.c: (ephy_embed_single_get_type),
(ephy_embed_single_class_init), (ephy_embed_single_clear_cache),
(ephy_embed_single_set_offline_mode),
(ephy_embed_single_load_proxy_autoconf),
(ephy_embed_single_get_font_list),
(ephy_embed_single_list_cookies),
(ephy_embed_single_remove_cookies),
(ephy_embed_single_list_passwords),
(ephy_embed_single_remove_passwords),
(ephy_embed_single_free_cookies),
(ephy_embed_single_free_passwords):
* embed/ephy-embed-single.h:
* embed/ephy-embed-types.h:
* embed/ephy-embed.c: (ephy_embed_get_type),
(ephy_embed_base_init), (ephy_embed_new), (ephy_embed_load_url),
(ephy_embed_stop_load), (ephy_embed_can_go_back),
(ephy_embed_can_go_forward), (ephy_embed_can_go_up),
(ephy_embed_get_go_up_list), (ephy_embed_go_back),
(ephy_embed_go_forward), (ephy_embed_go_up),
(ephy_embed_get_title), (ephy_embed_get_location),
(ephy_embed_reload), (ephy_embed_zoom_set), (ephy_embed_zoom_get),
(ephy_embed_shistory_n_items), (ephy_embed_shistory_get_nth),
(ephy_embed_shistory_get_pos), (ephy_embed_shistory_go_nth),
(ephy_embed_get_security_level), (ephy_embed_find_set_properties),
(ephy_embed_find_next), (ephy_embed_activate),
(ephy_embed_set_encoding), (ephy_embed_get_encoding_info),
(ephy_embed_print), (ephy_embed_print_preview_close),
(ephy_embed_print_preview_n_pages),
(ephy_embed_print_preview_navigate):
* embed/ephy-embed.h:
* embed/ephy-history.c:
* embed/find-dialog.c: (find_dialog_go_next),
(find_dialog_go_prev):
* embed/mozilla/mozilla-embed-persist.cpp:
* embed/mozilla/mozilla-embed-single.cpp:
* embed/mozilla/mozilla-embed.cpp:
* embed/mozilla/mozilla-embed.h:
* lib/Makefile.am:
* lib/ephy-state.c:
* lib/ephy-types.h:
* src/ephy-encoding-dialog.c: (sync_embed_cb), (activate_choice):
* src/ephy-encoding-menu.c: (update_encoding_menu_cb),
(encoding_activate_cb):
* src/ephy-favicon-action.c: (each_url_get_data_binder):
* src/ephy-nautilus-view.c: (gnv_embed_dom_mouse_click_cb),
(gnv_embed_context_menu_cb), (gnv_embed_title_cb),
(gnv_popup_cmd_frame_in_new_window), (gnv_zoomable_zoom_in_cb),
(gnv_zoomable_zoom_out_cb):
* src/ephy-navigation-action.c: (activate_up_menu_item_cb),
(setup_back_or_forward_menu), (setup_up_menu):
* src/ephy-tab.c: (ephy_tab_address_cb),
(ephy_tab_zoom_changed_cb), (ephy_tab_title_cb),
(ephy_tab_dom_mouse_click_cb), (ephy_tab_update_navigation_flags),
(ephy_tab_set_title):
* src/ephy-window.c: (edit_menu_show_cb), (sync_tab_security),
(show_embed_popup), (ephy_window_set_zoom):
* src/pdm-dialog.c: (pdm_dialog_init):
* src/popup-commands.c: (popup_cmd_frame_in_new_tab),
(popup_cmd_frame_in_new_window), (popup_cmd_open_frame):
* src/ppview-toolbar.c: (toolbar_update_sensitivity),
(toolbar_cmd_ppv_goto_last), (clamp_page_limits):
* src/prefs-dialog.c: (setup_font_menu),
(prefs_homepage_current_button_clicked_cb):
* src/session.c: (save_tab):
* src/window-commands.c: (window_cmd_file_send_to),
(window_cmd_file_bookmark_page), (window_cmd_view_page_source):
Get rid of gresult type. Use return values instead of out-parameters
whereever possible, and port all callers.
Diffstat (limited to 'embed/ephy-embed.h')
-rw-r--r-- | embed/ephy-embed.h | 377 |
1 files changed, 167 insertions, 210 deletions
diff --git a/embed/ephy-embed.h b/embed/ephy-embed.h index b25f02dea..0ee52025c 100644 --- a/embed/ephy-embed.h +++ b/embed/ephy-embed.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001, 2002 Marco Pesenti Gritti + * Copyright (C) 2000-2003 Marco Pesenti Gritti * * 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 @@ -14,12 +14,13 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ */ #ifndef EPHY_EMBED_H #define EPHY_EMBED_H -#include "ephy-embed-types.h" #include "ephy-embed-event.h" #include "ephy-encodings.h" @@ -56,17 +57,21 @@ typedef enum typedef enum { - EMBED_CLIPBOARD_CAP = 1 << 0, - EMBED_COOKIES_CAP = 1 << 1, - EMBED_LINKS_CAP = 1 << 2, - EMBED_ZOOM_CAP = 1 << 3, - EMBED_PRINT_CAP = 1 << 6, - EMBED_FIND_CAP = 1 << 7, - EMBED_SCROLL_CAP = 1 << 8, - EMBED_SECURITY_CAP = 1 << 9, - EMBED_ENCODING_CAP = 1 << 10, - EMBED_SHISTORY_CAP = 1 << 11 -} EmbedCapabilities; + EMBED_CHROME_NONE = 0, + EMBED_CHROME_DEFAULT = 1 << 0, + EMBED_CHROME_MENUBARON = 1 << 1, + EMBED_CHROME_TOOLBARON = 1 << 2, + EMBED_CHROME_BOOKMARKSBARON = 1 << 3, + EMBED_CHROME_BOOKMARKSBAR_DEFAULT = 1 << 4, + EMBED_CHROME_STATUSBARON = 1 << 5, + EMBED_CHROME_WINDOWRAISED = 1 << 6, + EMBED_CHROME_WINDOWLOWERED = 1 << 7, + EMBED_CHROME_CENTERSCREEN = 1 << 8, + EMBED_CHROME_OPENASDIALOG = 1 << 9, + EMBED_CHROME_OPENASCHROME = 1 << 10, + EMBED_CHROME_OPENASPOPUP = 1 << 11, + EMBED_CHROME_PPVIEWTOOLBARON = 1 << 12 +} EmbedChromeMask; typedef struct { @@ -88,37 +93,37 @@ typedef enum typedef struct { - gboolean print_to_file; - gchar *printer; - gchar *file; - gchar *paper; - gint top_margin; - gint bottom_margin; - gint left_margin; - gint right_margin; - gint pages; - gint from_page; - gint to_page; - gint frame_type; - gint orientation; - gboolean print_color; - - /* - * &T - title - * &U - Document URL - * &D - Date/Time - * &P - Page Number - * &PT - Page Number with total Number of Pages (example: 1 of 34) - * - * So, if headerLeftStr = "&T" the title and the document URL - * will be printed out on the top left-hand side of each page. - */ - gchar *header_left_string; - gchar *header_center_string; - gchar *header_right_string; - gchar *footer_left_string; - gchar *footer_center_string; - gchar *footer_right_string; + gboolean print_to_file; + gchar *printer; + gchar *file; + gchar *paper; + gint top_margin; + gint bottom_margin; + gint left_margin; + gint right_margin; + gint pages; + gint from_page; + gint to_page; + gint frame_type; + gint orientation; + gboolean print_color; + + /* + * &T - title + * &U - Document URL + * &D - Date/Time + * &P - Page Number + * &PT - Page Number with total Number of Pages (example: 1 of 34) + * + * So, if headerLeftStr = "&T" the title and the document URL + * will be printed out on the top left-hand side of each page. + */ + gchar *header_left_string; + gchar *header_center_string; + gchar *header_right_string; + gchar *footer_left_string; + gchar *footer_center_string; + gchar *footer_right_string; gboolean preview; } @@ -145,7 +150,7 @@ typedef enum struct EphyEmbedClass { - GTypeInterface base_iface; + GTypeInterface base_iface; gint (* context_menu) (EphyEmbed *embed, EphyEmbedEvent *event); @@ -160,217 +165,169 @@ struct EphyEmbedClass void (* title) (EphyEmbed *embed); void (* progress) (EphyEmbed *embed, const char *uri, - gint curprogress, + gint curprogress, gint maxprogress); void (* net_state) (EphyEmbed *embed, const char *uri, - EmbedState state); + EmbedState state); void (* new_window) (EphyEmbed *embed, - EphyEmbed **new_embed, - EmbedChromeMask chromemask); + EphyEmbed **new_embed, + EmbedChromeMask chromemask); void (* visibility) (EphyEmbed *embed, - gboolean visibility); + gboolean visibility); void (* destroy_brsr) (EphyEmbed *embed); gint (* open_uri) (EphyEmbed *embed, - const char *uri); + const char *uri); void (* size_to) (EphyEmbed *embed, - gint width, - gint height); + gint width, + gint height); gint (* dom_mouse_click) (EphyEmbed *embed, - EphyEmbedEvent *event); + EphyEmbedEvent *event); gint (* dom_mouse_down) (EphyEmbed *embed, - EphyEmbedEvent *event); + EphyEmbedEvent *event); void (* security_change) (EphyEmbed *embed, - EmbedSecurityLevel level); + EmbedSecurityLevel level); void (* zoom_change) (EphyEmbed *embed, - guint new_zoom); + guint new_zoom); /* Methods */ - void (* get_capabilities) (EphyEmbed *embed, - EmbedCapabilities *caps); - gresult (* load_url) (EphyEmbed *embed, - const char *url); - gresult (* stop_load) (EphyEmbed *embed); - gresult (* can_go_back) (EphyEmbed *embed); - gresult (* can_go_forward) (EphyEmbed *embed); - gresult (* can_go_up) (EphyEmbed *embed); - gresult (* get_go_up_list) (EphyEmbed *embed, GSList **l); - gresult (* go_back) (EphyEmbed *embed); - gresult (* go_forward) (EphyEmbed *embed); - gresult (* go_up) (EphyEmbed *embed); - gresult (* render_data) (EphyEmbed *embed, - const char *data, - guint32 len, - const char *base_uri, - const char *mime_type); - gresult (* open_stream) (EphyEmbed *embed, - const char *base_uri, - const char *mime_type); - gresult (* append_data) (EphyEmbed *embed, - const char *data, - guint32 len); - gresult (* close_stream) (EphyEmbed *embed); - gresult (* get_title) (EphyEmbed *embed, - char **title); - gresult (* get_location) (EphyEmbed *embed, - gboolean toplevel, - char **location); - gresult (* reload) (EphyEmbed *embed, - EmbedReloadFlags flags); - gresult (* zoom_set) (EphyEmbed *embed, - float zoom, - gboolean reflow); - gresult (* zoom_get) (EphyEmbed *embed, - float *zoom); - gresult (* shistory_count) (EphyEmbed *embed, - int *count); - gresult (* shistory_get_nth) (EphyEmbed *embed, - int nth, - gboolean is_relative, - char **url, - char **title); - gresult (* shistory_get_pos) (EphyEmbed *embed, - int *pos); - gresult (* shistory_go_nth) (EphyEmbed *embed, - int nth); - gresult (* get_security_level) (EphyEmbed *embed, - EmbedSecurityLevel *level, - char **description); - gresult (* find_set_properties) (EphyEmbed *embed, - char *search_string, - gboolean case_sensitive, - gboolean wrap_around); - gresult (* find_next) (EphyEmbed *embed, - gboolean backwards); - gresult (* activate) (EphyEmbed *embed); - gresult (* print) (EphyEmbed *embed, - EmbedPrintInfo *info); - gresult (* print_preview_close) (EphyEmbed *embed); - gresult (* print_preview_num_pages) (EphyEmbed *embed, - gint *retNum); - gresult (* print_preview_navigate) (EphyEmbed *embed, - EmbedPrintPreviewNavType navType, - gint pageNum); - gresult (* set_encoding) (EphyEmbed *embed, - const char *encoding); - gresult (* get_encoding_info) (EphyEmbed *embed, - EphyEncodingInfo **info); + void (* load_url) (EphyEmbed *embed, + const char *url); + void (* stop_load) (EphyEmbed *embed); + void (* reload) (EphyEmbed *embed, + EmbedReloadFlags flags); + gboolean (* can_go_back) (EphyEmbed *embed); + gboolean (* can_go_forward) (EphyEmbed *embed); + gboolean (* can_go_up) (EphyEmbed *embed); + GSList * (* get_go_up_list) (EphyEmbed *embed); + void (* go_back) (EphyEmbed *embed); + void (* go_forward) (EphyEmbed *embed); + void (* go_up) (EphyEmbed *embed); + + char * (* get_title) (EphyEmbed *embed); + char * (* get_location) (EphyEmbed *embed, + gboolean toplevel); + int (* shistory_n_items) (EphyEmbed *embed); + void (* shistory_get_nth) (EphyEmbed *embed, + int nth, + gboolean is_relative, + char **url, + char **title); + int (* shistory_get_pos) (EphyEmbed *embed); + void (* shistory_go_nth) (EphyEmbed *embed, + int nth); + void (* get_security_level) (EphyEmbed *embed, + EmbedSecurityLevel *level, + char **description); + void (* zoom_set) (EphyEmbed *embed, + float zoom, + gboolean reflow); + float (* zoom_get) (EphyEmbed *embed); + void (* find_set_properties) (EphyEmbed *embed, + char *search_string, + gboolean case_sensitive, + gboolean wrap_around); + gboolean (* find_next) (EphyEmbed *embed, + gboolean backwards); + void (* set_encoding) (EphyEmbed *embed, + const char *encoding); + EphyEncodingInfo * (* get_encoding_info) (EphyEmbed *embed); + void (* print) (EphyEmbed *embed, + EmbedPrintInfo *info); + void (* print_preview_close) (EphyEmbed *embed); + int (* print_preview_n_pages) (EphyEmbed *embed); + void (* print_preview_navigate) (EphyEmbed *embed, + EmbedPrintPreviewNavType type, + int page); + void (* activate) (EphyEmbed *embed); }; -GType ephy_embed_get_type (void); +GType ephy_embed_get_type (void); -/* Base */ +EphyEmbed *ephy_embed_new (GObject *single); -EphyEmbed *ephy_embed_new (GObject *single); - -void ephy_embed_get_capabilities (EphyEmbed *embed, - EmbedCapabilities *caps); +/* Base */ +void ephy_embed_load_url (EphyEmbed *embed, + const char *url); -gresult ephy_embed_load_url (EphyEmbed *embed, - const char *url); +void ephy_embed_stop_load (EphyEmbed *embed); -gresult ephy_embed_stop_load (EphyEmbed *embed); +void ephy_embed_reload (EphyEmbed *embed, + EmbedReloadFlags flags); -gresult ephy_embed_can_go_back (EphyEmbed *embed); +char *ephy_embed_get_title (EphyEmbed *embed); -gresult ephy_embed_can_go_forward (EphyEmbed *embed); +char *ephy_embed_get_location (EphyEmbed *embed, + gboolean toplevel); -gresult ephy_embed_can_go_up (EphyEmbed *embed); +/* Navigation */ +gboolean ephy_embed_can_go_back (EphyEmbed *embed); -gresult ephy_embed_get_go_up_list (EphyEmbed *embed, - GSList **l); +gboolean ephy_embed_can_go_forward (EphyEmbed *embed); -gresult ephy_embed_go_back (EphyEmbed *embed); +gboolean ephy_embed_can_go_up (EphyEmbed *embed); -gresult ephy_embed_go_forward (EphyEmbed *embed); +GSList *ephy_embed_get_go_up_list (EphyEmbed *embed); -gresult ephy_embed_go_up (EphyEmbed *embed); +void ephy_embed_go_back (EphyEmbed *embed); -gresult ephy_embed_render_data (EphyEmbed *embed, - const char *data, - guint32 len, - const char *base_uri, - const char *mime_type); +void ephy_embed_go_forward (EphyEmbed *embed); -gresult ephy_embed_open_stream (EphyEmbed *embed, - const char *base_uri, - const char *mime_type); +void ephy_embed_go_up (EphyEmbed *embed); -gresult ephy_embed_append_data (EphyEmbed *embed, - const char *data, - guint32 len); +int ephy_embed_shistory_n_items (EphyEmbed *embed); -gresult ephy_embed_close_stream (EphyEmbed *embed); +void ephy_embed_shistory_get_nth (EphyEmbed *embed, + int nth, + gboolean is_relative, + char **url, + char **title); -gresult ephy_embed_get_title (EphyEmbed *embed, - char **title); +int ephy_embed_shistory_get_pos (EphyEmbed *embed); -gresult ephy_embed_get_location (EphyEmbed *embed, - gboolean toplevel, - char **location); +void ephy_embed_shistory_go_nth (EphyEmbed *embed, + int nth); -gresult ephy_embed_reload (EphyEmbed *embed, - EmbedReloadFlags flags); +void ephy_embed_get_security_level (EphyEmbed *embed, + EmbedSecurityLevel *level, + char **description); /* Zoom */ -gresult ephy_embed_zoom_set (EphyEmbed *embed, - float zoom, - gboolean reflow); - -gresult ephy_embed_zoom_get (EphyEmbed *embed, - float *zoom); - -/* Session history */ -gresult ephy_embed_shistory_count (EphyEmbed *embed, - int *count); - -gresult ephy_embed_shistory_get_nth (EphyEmbed *embed, - int nth, - gboolean is_relative, - char **url, - char **title); - -gresult ephy_embed_shistory_get_pos (EphyEmbed *embed, - int *pos); - -gresult ephy_embed_shistory_go_nth (EphyEmbed *embed, - int nth); - -/* Utils */ - -gresult ephy_embed_get_security_level (EphyEmbed *embed, - EmbedSecurityLevel *level, - char **description); +void ephy_embed_zoom_set (EphyEmbed *embed, + float zoom, + gboolean reflow); -gresult ephy_embed_find_set_properties (EphyEmbed *embed, - char *search_string, - gboolean case_sensitive, - gboolean wrap_around); +float ephy_embed_zoom_get (EphyEmbed *embed); -gresult ephy_embed_find_next (EphyEmbed *embed, - gboolean backwards); +/* Find */ +void ephy_embed_find_set_properties (EphyEmbed *embed, + char *search_string, + gboolean case_sensitive, + gboolean wrap_around); -gresult ephy_embed_set_encoding (EphyEmbed *embed, - const char *encoding); +gboolean ephy_embed_find_next (EphyEmbed *embed, + gboolean backwards); -gresult ephy_embed_get_encoding_info (EphyEmbed *embed, - EphyEncodingInfo **info); +/* Encoding */ +void ephy_embed_set_encoding (EphyEmbed *embed, + const char *encoding); -gresult ephy_embed_activate (EphyEmbed *embed); +EphyEncodingInfo *ephy_embed_get_encoding_info (EphyEmbed *embed); -/* Printing */ +/* Print */ +void ephy_embed_print (EphyEmbed *embed, + EmbedPrintInfo *info); -gresult ephy_embed_print (EphyEmbed *embed, - EmbedPrintInfo *info); +void ephy_embed_print_preview_close (EphyEmbed *embed); -gresult ephy_embed_print_preview_close (EphyEmbed *embed); +int ephy_embed_print_preview_n_pages (EphyEmbed *embed); -gresult ephy_embed_print_preview_num_pages (EphyEmbed *embed, - gint *retNum); +void ephy_embed_print_preview_navigate (EphyEmbed *embed, + EmbedPrintPreviewNavType type, + int page); -gresult ephy_embed_print_preview_navigate (EphyEmbed *embed, - EmbedPrintPreviewNavType navType, - gint pageNum); +/* Misc. utility */ +void ephy_embed_activate (EphyEmbed *embed); G_END_DECLS |