### Get Global Page Setup for Printing Source: https://github.com/gnome/epiphany/blob/main/_autodocs/embed-shell-api.md Retrieves the current global page setup configuration. The returned GtkPageSetup object should not be unreferenced. ```c GtkPageSetup *ephy_embed_shell_get_page_setup (EphyEmbedShell *shell); ``` ```c EphyEmbedShell *shell = ephy_embed_shell_get_default (); GtkPageSetup *setup = ephy_embed_shell_get_page_setup (shell); ``` -------------------------------- ### Get Web View UID Example - C Source: https://github.com/gnome/epiphany/blob/main/_autodocs/web-view-api.md Example showing how to get the unique identifier of a web view and print it to the console. ```c guint64 uid = ephy_web_view_get_uid (web_view); g_print ("Web view UID: %lu\n", uid); ``` -------------------------------- ### Print Web View Example - C Source: https://github.com/gnome/epiphany/blob/main/_autodocs/web-view-api.md Example demonstrating how to call the ephy_web_view_print function to open the print dialog. ```c ephy_web_view_print (web_view); ``` -------------------------------- ### Handle Download Start Source: https://github.com/gnome/epiphany/blob/main/_autodocs/download-api.md Callback function for when a download starts. Creates a new EphyDownload, sets its destination based on the suggested filename and user's home directory, and sets the action to open the file upon completion. Remember to unreference the download object when done. ```c static void on_download_started ( WebKitWebContext *context, WebKitDownload *webkit_download, gpointer user_data ) { EphyDownload *download = ephy_download_new (webkit_download); // Set destination const char *filename = webkit_download_get_suggested_filename (webkit_download); const char *downloads_dir = g_get_home_dir (); ephy_download_set_suggested_destination (download, downloads_dir, filename); // Set action ephy_download_set_action (download, EPHY_DOWNLOAD_ACTION_OPEN); // Unref when done g_object_unref (download); } ``` -------------------------------- ### Getting Search Suggestions Source: https://github.com/gnome/epiphany/blob/main/_autodocs/search-engine-api.md Provides an example of how to asynchronously retrieve search suggestions for a given query. ```APIDOC ## Getting Search Suggestions ### Description This example demonstrates how to asynchronously fetch search suggestions for a given query using the search engine API. It includes a callback function to process the received suggestions. ### Code Example ```c static void suggestions_ready (GAsyncResult *result, gpointer user_data) { GError *error = NULL; GSequence *suggestions = ephy_search_engine_load_suggestions_finish (result, &error); if (!error && suggestions) { for (GSequenceIter *iter = g_sequence_get_begin_iter (suggestions); !g_sequence_iter_is_end (iter); iter = g_sequence_iter_next (iter)) { const char *suggestion = g_sequence_get (iter); g_print ("Suggestion: %s\n", suggestion); } g_sequence_free (suggestions); } } EphySearchEngine *engine = ephy_search_engine_manager_get_default_engine (manager); char *sugg_url = ephy_search_engine_build_suggestions_address (engine, "query"); ephy_search_engine_load_suggestions_async (sugg_url, engine, NULL, G_CALLBACK (suggestions_ready), NULL); g_free (sugg_url); ``` ``` -------------------------------- ### ephy_embed_shell_get_page_setup Source: https://github.com/gnome/epiphany/blob/main/_autodocs/embed-shell-api.md Gets the global page setup for printing. This function retrieves the current page setup configuration. ```APIDOC ## ephy_embed_shell_get_page_setup ### Description Gets the global page setup for printing. ### Method `GtkPageSetup *` ### Parameters #### Path Parameters - **shell** (EphyEmbedShell*) - Required - The embed shell ### Returns - **GtkPageSetup*** - The GtkPageSetup. Do not unref. ### Request Example ```c EphyEmbedShell *shell = ephy_embed_shell_get_default (); GtkPageSetup *setup = ephy_embed_shell_get_page_setup (shell); ``` ``` -------------------------------- ### Install Epiphany Canary via Flatpak Source: https://github.com/gnome/epiphany/blob/main/README.md Use this command to install the unstable development version of Epiphany. ```shell flatpak --user install https://nightly.gnome.org/repo/appstream/org.gnome.Epiphany.Canary.flatpakref ``` -------------------------------- ### Example Meson Dependency Error Source: https://github.com/gnome/epiphany/blob/main/README.md An example of the error output displayed when a required dependency is missing during the build process. ```text meson.build:84:0: ERROR: Native dependency 'hogweed' not found ``` -------------------------------- ### Get Download Start Time Source: https://github.com/gnome/epiphany/blob/main/_autodocs/download-api.md Retrieves the GDateTime object representing when the download began. The returned object should not be unreferenced. ```c GDateTime *start = ephy_download_get_start_time (download); if (start) { gchar *time_str = g_date_time_format (start, "%Y-%m-%d %H:%M:%S"); g_print ("Started: %s\n", time_str); g_free (time_str); } ``` -------------------------------- ### Meson Build System Commands Source: https://github.com/gnome/epiphany/blob/main/_autodocs/README.md Standard commands to configure, build, and install the project using the Meson build system. ```bash mkdir build && cd build meson .. ninja sudo ninja install ``` -------------------------------- ### Set Global Page Setup for Printing Source: https://github.com/gnome/epiphany/blob/main/_autodocs/embed-shell-api.md Configures the global page setup for printing operations. This function takes an EphyEmbedShell and a GtkPageSetup object. ```c void ephy_embed_shell_set_page_setup (EphyEmbedShell *shell, GtkPageSetup *page_setup); ``` ```c EphyEmbedShell *shell = ephy_embed_shell_get_default (); GtkPageSetup *setup = gtk_page_setup_new (); gtk_page_setup_set_paper_size (setup, gtk_paper_size_new ("A4")); ephy_embed_shell_set_page_setup (shell, setup); ``` -------------------------------- ### EphySearchEngine API Source: https://github.com/gnome/epiphany/blob/main/_autodocs/GENERATION-REPORT.txt Documentation for the EphySearchEngine and EphySearchEngineManager APIs, covering search engine configuration. Details include engine creation, URL management, search suggestions, and overall management, with examples for setup, bang parsing, and suggestion loading. ```APIDOC ## EphySearchEngine API Reference ### Description Documentation for the EphySearchEngine and EphySearchEngineManager APIs, focused on search engine configuration and management. This includes creating search engines, managing their URLs, handling search suggestions, and overall administration. ### Coverage - Search Engine Creation - URL Management - Search Bangs - Suggestions - Management Operations ### Examples - Setting Up a New Search Engine - Parsing Search Bangs - Loading Search Suggestions ``` -------------------------------- ### ephy_web_view_is_overview Source: https://github.com/gnome/epiphany/blob/main/_autodocs/web-view-api.md Checks if the current web page is an overview or start page. ```APIDOC ## ephy_web_view_is_overview ### Description Checks if the page is an overview/start page. ### Method ```c gboolean ephy_web_view_is_overview (EphyWebView *view); ``` ### Parameters #### Path Parameters - **view** (EphyWebView*) - Required - The web view ### Returns - **gboolean** - TRUE if overview page, FALSE otherwise ``` -------------------------------- ### Install Missing Dependencies Source: https://github.com/gnome/epiphany/blob/main/README.md Commands to resolve missing pkg-config dependencies on Fedora and Debian-based systems. ```shell $ sudo dnf install 'pkgconfig(hogweed)' ``` ```shell $ sudo apt install $(apt-file search --package-only hogweed) ``` -------------------------------- ### ephy_get_portal Source: https://github.com/gnome/epiphany/blob/main/_autodocs/file-helpers-api.md Gets the XDP (XDG Desktop Portal) instance. ```APIDOC ## ephy_get_portal ### Description Gets the XDP (XDG Desktop Portal) instance. ### Method XdpPortal * ### Parameters None ### Returns The XdpPortal instance. Do not unref. ### Example ```c XdpPortal *portal = ephy_get_portal (); if (portal) { // Use portal for system integration } ``` ``` -------------------------------- ### Finish Getting Web App Manifest URL Source: https://github.com/gnome/epiphany/blob/main/_autodocs/web-view-api.md Completes the asynchronous operation to get the web app manifest URL. Handles potential errors and returns the URL string. The caller is responsible for freeing the returned string with g_free(). ```c char *ephy_web_view_get_web_app_manifest_url_finish ( EphyWebView *view, GAsyncResult *result, GError **error); ``` -------------------------------- ### Get Post-Download Action Source: https://github.com/gnome/epiphany/blob/main/_autodocs/download-api.md Retrieves the action that should be performed after the download is completed. Possible actions include opening the file or browsing to its location. ```c EphyDownloadActionType ephy_download_get_action (EphyDownload *download); ``` ```c EphyDownloadActionType action = ephy_download_get_action (download); if (action == EPHY_DOWNLOAD_ACTION_OPEN) { g_print ("Will open file after download\n"); } ``` -------------------------------- ### ephy_download_get_action Source: https://github.com/gnome/epiphany/blob/main/_autodocs/download-api.md Gets the post-download action that is configured for the download. This determines what happens after the download completes. ```APIDOC ## ephy_download_get_action ### Description Gets the post-download action. ### Method EphyDownloadActionType ### Parameters #### Path Parameters - **download** (EphyDownload*) - Required - The download ### Response #### Success Response (200) - **return value** (EphyDownloadActionType) - EphyDownloadActionType value ### Possible return values: - `EPHY_DOWNLOAD_ACTION_NONE` — No action - `EPHY_DOWNLOAD_ACTION_BROWSE_TO` — Open file browser at location - `EPHY_DOWNLOAD_ACTION_OPEN` — Open downloaded file ### Request Example ```c EphyDownloadActionType action = ephy_download_get_action (download); if (action == EPHY_DOWNLOAD_ACTION_OPEN) { g_print ("Will open file after download\n"); } ``` ``` -------------------------------- ### Get Configuration Directory Path Source: https://github.com/gnome/epiphany/blob/main/_autodocs/file-helpers-api.md Retrieves the path for the configuration directory. The returned pointer should not be freed. ```c const char *ephy_config_dir (void); ``` ```c const char *config = ephy_config_dir (); ``` -------------------------------- ### ephy_download_set_always_ask_destination Source: https://github.com/gnome/epiphany/blob/main/_autodocs/download-api.md Configures whether to always prompt the user for a destination before starting a download. ```APIDOC ## ephy_download_set_always_ask_destination ### Description Configures whether to always ask for destination before downloading. ### Method ```c void ephy_download_set_always_ask_destination (EphyDownload *download, gboolean always_ask); ``` ### Parameters #### Path Parameters - **download** (EphyDownload*) - Required - The download object. - **always_ask** (gboolean) - Required - Set to TRUE to always ask for the destination. ### Returns - **void** ``` -------------------------------- ### Get XDP Portal Instance Source: https://github.com/gnome/epiphany/blob/main/_autodocs/file-helpers-api.md Retrieves the XDG Desktop Portal instance. The returned pointer should not be unreferenced. ```c XdpPortal *ephy_get_portal (void); ``` ```c XdpPortal *portal = ephy_get_portal (); if (portal) { // Use portal for system integration } ``` -------------------------------- ### Get Standard Directories Source: https://github.com/gnome/epiphany/blob/main/_autodocs/file-helpers-api.md Retrieves standard directory paths such as profile, cache, and downloads. Use `ephy_ensure_dir_exists` to create directories if they do not exist. ```c // Get standard directories const char *profile = ephy_profile_dir (); const char *cache = ephy_cache_dir (); char *downloads = ephy_file_get_downloads_dir (); // Create a new directory if needed GError *error = NULL; char *app_data = g_build_filename (profile, "app_data", NULL); ephy_ensure_dir_exists (app_data, &error); g_free (app_data); g_free (downloads); ``` -------------------------------- ### ephy_embed_shell_set_page_setup Source: https://github.com/gnome/epiphany/blob/main/_autodocs/embed-shell-api.md Sets the global page setup for printing. This allows configuring page size, orientation, and margins for print jobs. ```APIDOC ## ephy_embed_shell_set_page_setup ### Description Sets the global page setup for printing. ### Method `void` ### Parameters #### Path Parameters - **shell** (EphyEmbedShell*) - Required - The embed shell - **page_setup** (GtkPageSetup*) - Required - The page setup configuration ### Request Example ```c EphyEmbedShell *shell = ephy_embed_shell_get_default (); GtkPageSetup *setup = gtk_page_setup_new (); gtk_page_setup_set_paper_size (setup, gtk_paper_size_new ("A4")); ephy_embed_shell_set_page_setup (shell, setup); ``` ``` -------------------------------- ### Create and Use Search Engines Source: https://github.com/gnome/epiphany/blob/main/_autodocs/search-engine-api.md Demonstrates how to create a new search engine, add it to the manager, set it as default, and save the configuration. ```c // Create a search engine EphySearchEngine *engine = g_object_new (EPHY_TYPE_SEARCH_ENGINE, "name", "MySearch", "url", "https://mysearch.com/q=%s", "bang", "!m", "suggestions-url", "https://mysearch.com/suggest?q=%s", NULL); // Create manager and add engine EphySearchEngineManager *manager = ephy_search_engine_manager_new (); ephy_search_engine_manager_add_engine (manager, engine); ephy_search_engine_manager_set_default_engine (manager, engine); // Save configuration ephy_search_engine_manager_save_to_settings (manager); ``` -------------------------------- ### Create and Open SQLite Database Source: https://github.com/gnome/epiphany/blob/main/_autodocs/sqlite-api.md Demonstrates how to create a new SQLite database file or open an existing one in read-write mode. Includes error handling and table creation if it doesn't exist. ```c GError *error = NULL; EphySQLiteConnection *connection = ephy_sqlite_connection_new ( EPHY_SQLITE_CONNECTION_MODE_READWRITE, "/home/user/.local/share/app/database.db" ); if (!ephy_sqlite_connection_open (connection, &error)) { g_warning ("Failed to open database: %s", error->message); g_clear_error (&error); g_object_unref (connection); return; } // Create table if needed if (!ephy_sqlite_connection_table_exists (connection, "items")) { ephy_sqlite_connection_execute (connection, "CREATE TABLE items (id INTEGER PRIMARY KEY, name TEXT NOT NULL)", &error); } // Use database... // Close ephy_sqlite_connection_close (connection); g_object_unref (connection); ``` -------------------------------- ### Create and Use Prepared Statements Source: https://github.com/gnome/epiphany/blob/main/_autodocs/sqlite-api.md Illustrates the creation and usage of prepared statements for efficient and safe execution of parameterized SQL queries. This example prepares an insert statement. ```c GError *error = NULL; // Prepare statement EphySQLiteStatement *stmt = ephy_sqlite_connection_create_statement ( connection, "INSERT INTO items (name) VALUES (?)", EPHY_SQLITE_STATEMENT_SHORT_LIVED, &error ); if (!stmt) { g_warning ("Failed to prepare statement: %s", error->message); return; } // Bind and execute (statement-specific methods) // ... g_object_unref (stmt); ``` -------------------------------- ### Get Shell GUID Source: https://github.com/gnome/epiphany/blob/main/_autodocs/embed-shell-api.md Retrieves a unique GUID for the current shell instance. The returned string should not be freed. ```c const char *ephy_embed_shell_get_guid (EphyEmbedShell *shell); ``` ```c EphyEmbedShell *shell = ephy_embed_shell_get_default (); const char *guid = ephy_embed_shell_get_guid (shell); g_print ("Shell GUID: %s\n", guid); ``` -------------------------------- ### Get Global History Service Source: https://github.com/gnome/epiphany/blob/main/_autodocs/embed-shell-api.md Retrieves the singleton history service. Do not unreference the returned service. ```c EphyEmbedShell *shell = ephy_embed_shell_get_default (); EphyHistoryService *history = ephy_embed_shell_get_global_history_service (shell); ``` -------------------------------- ### Initialize File Helpers Source: https://github.com/gnome/epiphany/blob/main/_autodocs/file-helpers-api.md Initializes the file helpers system. Requires a profile directory path and flags. Handles potential errors during initialization. ```c gboolean ephy_file_helpers_init (const char *profile_dir, EphyFileHelpersFlags flags, GError **error); ``` ```c GError *error = NULL; if (!ephy_file_helpers_init ("/home/user/.local/share/epiphany", EPHY_FILE_HELPERS_ENSURE_EXISTS, &error)) { g_warning ("Failed to init file helpers: %s", error->message); g_clear_error (&error); } ``` -------------------------------- ### ephy_web_view_get_web_app_manifest_url_finish Source: https://github.com/gnome/epiphany/blob/main/_autodocs/web-view-api.md Finishes getting manifest URL. This method is used to complete the asynchronous operation started by `ephy_web_view_get_web_app_manifest_url` and retrieve the result. ```APIDOC ## ephy_web_view_get_web_app_manifest_url_finish ### Description Finishes getting manifest URL. This method is used to complete the asynchronous operation started by `ephy_web_view_get_web_app_manifest_url` and retrieve the result. ### Method char * ### Parameters #### Path Parameters - **view** (EphyWebView*) - Required - The web view - **result** (GAsyncResult*) - Required - The operation result - **error** (GError**) - Optional - Output error ### Returns The manifest URL string. Caller must free with g_free(). ### Throws/Rejects GError if operation failed ``` -------------------------------- ### Open Default Instance Window Source: https://github.com/gnome/epiphany/blob/main/_autodocs/file-helpers-api.md Use this function to open a new browser window in the default instance. It takes no arguments. ```c void ephy_open_default_instance_window (void); ``` ```c ephy_open_default_instance_window (); ``` -------------------------------- ### ephy_file_helpers_init Source: https://github.com/gnome/epiphany/blob/main/_autodocs/file-helpers-api.md Initializes the file helpers system with profile directory and flags. Returns TRUE on success, FALSE on error. ```APIDOC ## ephy_file_helpers_init ### Description Initializes the file helpers system with profile directory and flags. ### Parameters #### Path Parameters - **profile_dir** (const char*) - Required - Profile directory path - **flags** (EphyFileHelpersFlags) - Required - Initialization flags - **error** (GError**) - Optional - Output error ### Returns - **gboolean** - TRUE on success, FALSE on error ### Example ```c GError *error = NULL; if (!ephy_file_helpers_init ("/home/user/.local/share/epiphany", EPHY_FILE_HELPERS_ENSURE_EXISTS, &error)) { g_warning ("Failed to init file helpers: %s", error->message); g_clear_error (&error); } ``` ``` -------------------------------- ### Initialize File Helpers Source: https://github.com/gnome/epiphany/blob/main/_autodocs/file-helpers-api.md Initializes the file helpers with a specified profile directory and flags. Ensure to handle potential errors and shut down helpers when done. ```c GError *error = NULL; char *profile_dir = ephy_default_profile_dir (); if (!ephy_file_helpers_init (profile_dir, EPHY_FILE_HELPERS_ENSURE_EXISTS, &error)) { g_warning ("Failed to initialize: %s", error->message); g_clear_error (&error); } g_free (profile_dir); // Later... ephy_file_helpers_shutdown (); ``` -------------------------------- ### Get Shell Mode Source: https://github.com/gnome/epiphany/blob/main/_autodocs/embed-shell-api.md Gets the current operating mode of the embed shell. Useful for conditional logic based on how the shell is being used. ```c EphyEmbedShellMode ephy_embed_shell_get_mode (EphyEmbedShell *shell); ``` ```c EphyEmbedShell *shell = ephy_embed_shell_get_default (); EphyEmbedShellMode mode = ephy_embed_shell_get_mode (shell); if (mode == EPHY_EMBED_SHELL_MODE_INCOGNITO) { g_print ("Running in incognito mode\n"); } ``` -------------------------------- ### Creating and Using Search Engines Source: https://github.com/gnome/epiphany/blob/main/_autodocs/search-engine-api.md Demonstrates the common pattern for creating a new search engine, adding it to the manager, setting it as default, and saving the configuration. ```APIDOC ## Creating and Using Search Engines ### Description This common usage pattern illustrates how to create a new search engine, add it to the manager, set it as the default engine, and then persist these changes. ### Code Example ```c // Create a search engine EphySearchEngine *engine = g_object_new (EPHY_TYPE_SEARCH_ENGINE, "name", "MySearch", "url", "https://mysearch.com/q=%s", "bang", "!m", "suggestions-url", "https://mysearch.com/suggest?q=%s", NULL); // Create manager and add engine EphySearchEngineManager *manager = ephy_search_engine_manager_new (); ephy_search_engine_manager_add_engine (manager, engine); ephy_search_engine_manager_set_default_engine (manager, engine); // Save configuration ephy_search_engine_manager_save_to_settings (manager); ``` ``` -------------------------------- ### Creating an EphySearchEngine Source: https://github.com/gnome/epiphany/blob/main/_autodocs/search-engine-api.md Search engines are created using g_object_new with specific properties. This example shows how to initialize a new search engine with its name, URL, bang, and suggestions URL. ```APIDOC ## Creating an EphySearchEngine Search engines are not created with a constructor function. Instead, use `g_object_new()` with property values: ```c EphySearchEngine *engine = g_object_new (EPHY_TYPE_SEARCH_ENGINE, "name", "DuckDuckGo", "url", "https://duckduckgo.com/?q=%s", "bang", "!d", "suggestions-url", "https://duckduckgo.com/ac/?q=%s", NULL); ``` ``` -------------------------------- ### Get All Hosts - History API Source: https://github.com/gnome/epiphany/blob/main/_autodocs/history-api.md Retrieves all hosts stored in the history service. Use this to get a comprehensive list of visited hosts. ```c void ephy_history_service_get_hosts (EphyHistoryService *self, GCancellable *cancellable, EphyHistoryJobCallback callback, gpointer user_data); ``` -------------------------------- ### Initialize Epiphany File Helpers Source: https://github.com/gnome/epiphany/blob/main/_autodocs/API-INDEX.md Initializes the file helper utilities. Requires a profile path and flags. Ensure GError is handled for potential initialization failures. ```c #include #include // Initialize GError *error = NULL; ephy_file_helpers_init(profile_path, flags, &error); // Get shell EphyEmbedShell *shell = ephy_embed_shell_get_default(); ``` -------------------------------- ### ephy_history_service_get_url Source: https://github.com/gnome/epiphany/blob/main/_autodocs/history-api.md Gets information about a specific URL. ```APIDOC ## ephy_history_service_get_url ### Description Gets information about a specific URL. ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Method Signature ```c void ephy_history_service_get_url (EphyHistoryService *self, const char *url, GCancellable *cancellable, EphyHistoryJobCallback callback, gpointer user_data); ``` ### Parameters - **self** (EphyHistoryService*) - The history service - **url** (const char*) - The URL to get info for - **cancellable** (GCancellable*) - Optional cancellation - **callback** (EphyHistoryJobCallback) - Callback with EphyHistoryURL - **user_data** (gpointer) - Callback user data ### Returns void ``` -------------------------------- ### ephy_sqlite_connection_get_error Source: https://github.com/gnome/epiphany/blob/main/_autodocs/sqlite-api.md Gets the last error from SQLite. ```APIDOC ## ephy_sqlite_connection_get_error ### Description Gets the last error from SQLite. ### Parameters #### Path Parameters - **self** (EphySQLiteConnection*) - Required - The connection - **error** (GError**) - Required - Output error ### Returns - void ``` -------------------------------- ### Launch URI Handler for File Source: https://github.com/gnome/epiphany/blob/main/_autodocs/file-helpers-api.md Launches the default application to handle a given file or MIME type. Requires a GFile, MIME type, GdkDisplay, and handler type. Returns TRUE on success, FALSE on error. ```c GFile *file = g_file_new_for_path ("/home/user/image.png"); ephy_file_launch_uri_handler ( file, "image/png", gdk_display_get_default (), EPHY_FILE_LAUNCH_URI_HANDLER_FILE ); ``` -------------------------------- ### Set Initiating Web Extension Info (C) Source: https://github.com/gnome/epiphany/blob/main/_autodocs/download-api.md Sets the web extension ID and name for a given download. This function does not return a value. ```c void ephy_download_set_initiating_web_extension_info (EphyDownload *download, const char *extension_id, const char *extension_name); ``` -------------------------------- ### ephy_search_engine_get_opensearch_url Source: https://github.com/gnome/epiphany/blob/main/_autodocs/search-engine-api.md Gets the OpenSearch descriptor URL for auto-discovery. ```APIDOC ## ephy_search_engine_get_opensearch_url ### Description Gets the OpenSearch descriptor URL for auto-discovery. ### Method C Function ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Parameters - **self** (EphySearchEngine*) - The search engine ### Returns The OpenSearch URL or NULL. Do not free. ``` -------------------------------- ### Build Epiphany with Meson Source: https://github.com/gnome/epiphany/blob/main/README.md Standard commands to configure and compile the project using the Meson build system. ```shell $ mkdir build && cd build $ meson .. $ ninja $ sudo ninja install ``` -------------------------------- ### ephy_web_view_get_link_message Source: https://github.com/gnome/epiphany/blob/main/_autodocs/web-view-api.md Gets the link message, which is the URL of a hovered link. ```APIDOC ## ephy_web_view_get_link_message ### Description Gets the link message (URL of hovered link). ### Method ```c const char *ephy_web_view_get_link_message (EphyWebView *view); ``` ### Parameters #### Path Parameters - **view** (EphyWebView*) - Required - The web view ### Returns The link URL or NULL. Do not free. ### Example ```c const char *link_url = ephy_web_view_get_link_message (web_view); if (link_url && strlen (link_url) > 0) { g_print ("Link: %s\n", link_url); } ``` ``` -------------------------------- ### ephy_file_launch_uri_handler Source: https://github.com/gnome/epiphany/blob/main/_autodocs/file-helpers-api.md Launches the default application associated with a file or URI. Returns TRUE on success and FALSE on failure. ```APIDOC ## ephy_file_launch_uri_handler ### Description Launches the default application for a file. ### Parameters #### Path Parameters - **file** (GFile*) - The file - **mime_type** (const char*) - The MIME type - **display** (GdkDisplay*) - The display - **type** (EphyFileLaunchUriHandlerType) - File or directory handler ### Returns gboolean - TRUE on success, FALSE on error ### Example ```c GFile *file = g_file_new_for_path ("/home/user/image.png"); ephy_file_launch_uri_handler ( file, "image/png", gdk_display_get_default (), EPHY_FILE_LAUNCH_URI_HANDLER_FILE ); ``` ``` -------------------------------- ### Get Initiating Web Extension Info (C) Source: https://github.com/gnome/epiphany/blob/main/_autodocs/download-api.md Retrieves the ID and name of the web extension that initiated a download. Returns TRUE if initiated by an extension, FALSE otherwise. ```c gboolean ephy_download_get_initiating_web_extension_info (EphyDownload *download, const char **extension_id_out, const char **extension_name_out); ``` -------------------------------- ### ephy_open_default_instance_window Source: https://github.com/gnome/epiphany/blob/main/_autodocs/file-helpers-api.md Opens a new window in the default browser instance. ```APIDOC ## ephy_open_default_instance_window ### Description Opens a new window in the default browser instance. ### Method void ### Parameters None ### Returns void ### Example ```c ephy_open_default_instance_window (); ``` ``` -------------------------------- ### ephy_web_view_get_icon Source: https://github.com/gnome/epiphany/blob/main/_autodocs/web-view-api.md Gets the favicon or page icon associated with the web view. ```APIDOC ## ephy_web_view_get_icon ### Description Gets the favicon or page icon. ### Method ```c GIcon *ephy_web_view_get_icon (EphyWebView *view); ``` ### Parameters #### Path Parameters - **view** (EphyWebView*) - Required - The web view ### Returns A GIcon representing the page icon, or NULL. Do not unref. ### Example ```c GIcon *icon = ephy_web_view_get_icon (web_view); if (icon) { gtk_image_set_from_gicon (GTK_IMAGE (image_widget), icon); } ``` ``` -------------------------------- ### ephy_permissions_manager_get_permission Source: https://github.com/gnome/epiphany/blob/main/_autodocs/permissions-api.md Gets the permission status for a specific origin and permission type. ```APIDOC ## ephy_permissions_manager_get_permission ### Description Gets the permission status for a specific origin and permission type. ### Method `EphyPermission ephy_permissions_manager_get_permission (EphyPermissionsManager *manager, EphyPermissionType type, const char *origin);` ### Parameters #### Path Parameters - **manager** (EphyPermissionsManager*) - The permissions manager - **type** (EphyPermissionType) - The permission type to query - **origin** (const char*) - The origin URL (e.g., "https://example.com") ### Returns EphyPermission value ### Possible return values: - `EPHY_PERMISSION_UNDECIDED` — No decision has been made - `EPHY_PERMISSION_DENY` — Permission denied - `EPHY_PERMISSION_PERMIT` — Permission granted ### Example ```c EphyPermissionsManager *manager = ephy_permissions_manager_new (); EphyPermission perm = ephy_permissions_manager_get_permission ( manager, EPHY_PERMISSION_TYPE_SHOW_NOTIFICATIONS, "https://example.com" ); switch (perm) { case EPHY_PERMISSION_PERMIT: g_print ("Notifications allowed\n"); break; case EPHY_PERMISSION_DENY: g_print ("Notifications denied\n"); break; case EPHY_PERMISSION_UNDECIDED: g_print ("Notifications decision pending\n"); break; } ``` ``` -------------------------------- ### Create and Load a Web View Source: https://github.com/gnome/epiphany/blob/main/_autodocs/API-INDEX.md Creates a new Epiphany web view instance and loads a specified URL. The widget must be shown after creation. ```c #include EphyWebView *view = EPHY_WEB_VIEW(ephy_web_view_new()); gtk_widget_show(GTK_WIDGET(view)); ephy_web_view_load_url(view, "https://example.com"); ``` -------------------------------- ### Set Web Extension Initialization Data Source: https://github.com/gnome/epiphany/blob/main/_autodocs/embed-shell-api.md Sets initialization data for web process extensions. Use this to pass custom key-value pairs to extensions during their startup. ```c void ephy_embed_shell_set_web_extension_initialization_data (EphyEmbedShell *shell, GVariant *data); ``` ```c EphyEmbedShell *shell = ephy_embed_shell_get_default (); GVariantBuilder builder; g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); g_variant_builder_add (&builder, "{sv}", "key", g_variant_new_string ("value")); GVariant *data = g_variant_builder_end (&builder); ephy_embed_shell_set_web_extension_initialization_data (shell, data); ``` -------------------------------- ### ephy_web_view_get_status_message Source: https://github.com/gnome/epiphany/blob/main/_autodocs/web-view-api.md Gets the status bar message, typically shown when hovering over links. ```APIDOC ## ephy_web_view_get_status_message ### Description Gets the status bar message (typically shown when hovering links). ### Method ```c const char *ephy_web_view_get_status_message (EphyWebView *view); ``` ### Parameters #### Path Parameters - **view** (EphyWebView*) - Required - The web view ### Returns The status message or NULL. Do not free. ### Example ```c const char *status = ephy_web_view_get_status_message (web_view); if (status) { gtk_label_set_text (GTK_LABEL (status_label), status); } ``` ``` -------------------------------- ### ephy_embed_shell_get_downloads_manager Source: https://github.com/gnome/epiphany/blob/main/_autodocs/embed-shell-api.md Gets the singleton downloads manager responsible for handling all file downloads. ```APIDOC ## ephy_embed_shell_get_downloads_manager ### Description Gets the singleton downloads manager handling all file downloads. ### Method ```c EphyDownloadsManager *ephy_embed_shell_get_downloads_manager (EphyEmbedShell *shell); ``` ### Parameters #### Path Parameters - **shell** (EphyEmbedShell*) - Required - The embed shell ### Returns - **EphyDownloadsManager*** - The EphyDownloadsManager. Do not unref. ### Example ```c EphyEmbedShell *shell = ephy_embed_shell_get_default (); EphyDownloadsManager *downloads = ephy_embed_shell_get_downloads_manager (shell); ``` ``` -------------------------------- ### ephy_embed_shell_get_network_session Source: https://github.com/gnome/epiphany/blob/main/_autodocs/embed-shell-api.md Gets the global WebKit network session used for all network operations. ```APIDOC ## ephy_embed_shell_get_network_session ### Description Gets the global WebKit network session for all network operations. ### Method ```c WebKitNetworkSession * ephy_embed_shell_get_network_session (EphyEmbedShell *shell); ``` ### Parameters #### Path Parameters - **shell** (EphyEmbedShell*) - Required - The embed shell ### Returns The WebKitNetworkSession. Do not unref. ### Example ```c EphyEmbedShell *shell = ephy_embed_shell_get_default (); WebKitNetworkSession *session = ephy_embed_shell_get_network_session (shell); ``` ``` -------------------------------- ### Set Post-Download Action Source: https://github.com/gnome/epiphany/blob/main/_autodocs/download-api.md Sets the action to be performed once the download is finished. This allows for automated handling of downloaded files. ```c void ephy_download_set_action (EphyDownload *download, EphyDownloadActionType action); ``` ```c ephy_download_set_action (download, EPHY_DOWNLOAD_ACTION_OPEN); ``` -------------------------------- ### Build Search Suggestions URL Source: https://github.com/gnome/epiphany/blob/main/_autodocs/search-engine-api.md Constructs a complete URL for fetching search suggestions based on a given search query. The returned string is newly allocated and must be freed by the caller. ```c char *ephy_search_engine_build_suggestions_address (EphySearchEngine *self, const char *search_query); ``` ```c char *sugg_url = ephy_search_engine_build_suggestions_address (engine, "wikipedia"); // Returns: "https://example.com/suggestions?q=wikipedia" g_free (sugg_url); ``` -------------------------------- ### ephy_embed_shell_get_default Source: https://github.com/gnome/epiphany/blob/main/_autodocs/embed-shell-api.md Gets the singleton EphyEmbedShell instance. This is the global manager for all embedding functionality. ```APIDOC ## ephy_embed_shell_get_default ### Description Gets the singleton EphyEmbedShell instance. This is the global manager for all embedding functionality. ### Method ```c EphyEmbedShell * ephy_embed_shell_get_default (void); ``` ### Returns The singleton EphyEmbedShell instance. Do not unref. ### Example ```c EphyEmbedShell *shell = ephy_embed_shell_get_default (); WebKitWebContext *context = ephy_embed_shell_get_web_context (shell); ``` ``` -------------------------------- ### ephy_file_tmp_dir Source: https://github.com/gnome/epiphany/blob/main/_autodocs/file-helpers-api.md Gets the temporary directory path. The returned path should not be freed by the caller. ```APIDOC ## ephy_file_tmp_dir ### Description Gets the temporary directory path. ### Returns const char* - The temp directory path. Do not free. ### Example ```c const char *tmp = ephy_file_tmp_dir (); ``` ``` -------------------------------- ### Prepare and Execute Statement with Parameter Binding Source: https://github.com/gnome/epiphany/blob/main/_autodocs/sqlite-api.md Prepare a SQL statement with placeholders, bind parameters, and execute it. Use EPHY_SQLITE_STATEMENT_SHORT_LIVED for statements used briefly. ```c // Prepare statement with parameter placeholders EphySQLiteStatement *stmt = ephy_sqlite_connection_create_statement ( connection, "SELECT * FROM users WHERE id = ?", EPHY_SQLITE_STATEMENT_SHORT_LIVED, &error ); // Bind parameters (specific methods vary) // Execute and get results ``` -------------------------------- ### ephy_web_view_get_address Source: https://github.com/gnome/epiphany/blob/main/_autodocs/web-view-api.md Gets the current page address/URL. Returns the current URL or NULL. Do not free. ```APIDOC ## ephy_web_view_get_address ### Description Gets the current page address/URL. ### Method ```c const char *ephy_web_view_get_address (EphyWebView *view); ``` ### Parameters #### Path Parameters - **view** (EphyWebView*) - Required - The web view ### Returns - **const char*** - The current URL or NULL. Do not free. ### Example ```c const char *url = ephy_web_view_get_address (web_view); if (url) { g_print ("Current URL: %s\n", url); } ``` ``` -------------------------------- ### Create EphyHistoryService Instance Source: https://github.com/gnome/epiphany/blob/main/_autodocs/history-api.md Instantiates a new EphyHistoryService. Ensure the history database file path is correctly provided and choose the appropriate connection mode (MEMORY or READWRITE). The caller is responsible for unreferencing the returned object. ```c #define EPHY_TYPE_HISTORY_SERVICE (ephy_history_service_get_type()) G_DECLARE_FINAL_TYPE (EphyHistoryService, ephy_history_service, EPHY, HISTORY_SERVICE, GObject) ``` ```c const char *history_path = g_build_filename ( ephy_profile_dir (), "history.db", NULL ); EphyHistoryService *history = ephy_history_service_new ( history_path, EPHY_SQLITE_CONNECTION_MODE_READWRITE ); g_free (history_path); ``` -------------------------------- ### ephy_embed_shell_get_favicon_database Source: https://github.com/gnome/epiphany/blob/main/_autodocs/embed-shell-api.md Gets the WebKit favicon database, used for storing and retrieving site icons. ```APIDOC ## ephy_embed_shell_get_favicon_database ### Description Gets the WebKit favicon database for storing and retrieving site icons. ### Method ```c WebKitFaviconDatabase *ephy_embed_shell_get_favicon_database (EphyEmbedShell *shell); ``` ### Parameters #### Path Parameters - **shell** (EphyEmbedShell*) - Required - The embed shell ### Returns - **WebKitFaviconDatabase*** - The WebKitFaviconDatabase. Do not unref. ### Example ```c EphyEmbedShell *shell = ephy_embed_shell_get_default (); WebKitFaviconDatabase *favicons = ephy_embed_shell_get_favicon_database (shell); ``` ``` -------------------------------- ### Perform Download Action Source: https://github.com/gnome/epiphany/blob/main/_autodocs/download-api.md Executes a specified post-download action on a completed download. This function is typically called after verifying the download's success. ```c gboolean ephy_download_do_download_action (EphyDownload *download, EphyDownloadActionType action); ``` ```c if (ephy_download_succeeded (download)) { EphyDownloadActionType action = ephy_download_get_action (download); ephy_download_do_download_action (download, action); } ``` -------------------------------- ### GObject Type Declaration and Usage Source: https://github.com/gnome/epiphany/blob/main/_autodocs/README.md Demonstrates the GObject type system declaration for a class and its basic instantiation, method call, and unreferencing. ```c #define EPHY_TYPE_CLASS_NAME (ephy_class_name_get_type ()) G_DECLARE_FINAL_TYPE (EphyClassName, ephy_class_name, EPHY, CLASS_NAME, GObject) // Create EphyClassName *obj = ephy_class_name_new (); // Use ephy_class_name_method (obj, args); // Free g_object_unref (obj); ``` -------------------------------- ### ephy_embed_shell_get_password_manager Source: https://github.com/gnome/epiphany/blob/main/_autodocs/embed-shell-api.md Gets the singleton password manager used for storing and retrieving saved passwords. ```APIDOC ## ephy_embed_shell_get_password_manager ### Description Gets the singleton password manager for storing and retrieving saved passwords. ### Method ```c EphyPasswordManager *ephy_embed_shell_get_password_manager (EphyEmbedShell *shell); ``` ### Parameters #### Path Parameters - **shell** (EphyEmbedShell*) - Required - The embed shell ### Returns - **EphyPasswordManager*** - The EphyPasswordManager. Do not unref. ### Example ```c EphyEmbedShell *shell = ephy_embed_shell_get_default (); EphyPasswordManager *passwords = ephy_embed_shell_get_password_manager (shell); ``` ``` -------------------------------- ### ephy_embed_shell_get_guid Source: https://github.com/gnome/epiphany/blob/main/_autodocs/embed-shell-api.md Gets a globally unique identifier for this shell instance. The returned string should not be freed. ```APIDOC ## ephy_embed_shell_get_guid ### Description Gets a globally unique identifier for this shell instance. ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Method - Not applicable (C function) ### Endpoint - Not applicable (C function) ### Returns - **guid** (string) - A unique GUID string. Do not free. ### Example ```c EphyEmbedShell *shell = ephy_embed_shell_get_default (); const char *guid = ephy_embed_shell_get_guid (shell); g_print ("Shell GUID: %s\n", guid); ``` ``` -------------------------------- ### ephy_config_dir Source: https://github.com/gnome/epiphany/blob/main/_autodocs/file-helpers-api.md Gets the configuration directory path. Returns the config directory path. Do not free. ```APIDOC ## ephy_config_dir ### Description Gets the configuration directory path. ### Returns - **const char*** - The config directory path. Do not free. ### Example ```c const char *config = ephy_config_dir (); ``` ``` -------------------------------- ### Build WebKit with JHBuild Source: https://github.com/gnome/epiphany/blob/main/README.md Steps to clone and build WebKit from source for development purposes using JHBuild. ```shell $ git clone https://github.com/WebKit/WebKit.git WebKit $ mkdir -p WebKit/WebKitBuild/GNOME $ cd WebKit/WebKitBuild/GNOME $ jhbuild run cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DPORT=GTK -DDEVELOPER_MODE=ON -DCMAKE_INSTALL_PREFIX=$HOME/jhbuild/install/ -DCMAKE_INSTALL_LIBDIR=lib -GNinja ../.. $ jhbuild run ninja $ jhbuild run cmake -P cmake_install.cmake ``` -------------------------------- ### Create and Load URL in Epiphany WebView Source: https://github.com/gnome/epiphany/blob/main/_autodocs/README.md Demonstrates the creation of a new EphyWebView instance and loading a URL. This is a fundamental operation for web view interaction. ```c EphyWebView *view = EPHY_WEB_VIEW (ephy_web_view_new ()); ephy_web_view_load_url (view, "https://example.com"); ``` -------------------------------- ### ephy_cache_dir Source: https://github.com/gnome/epiphany/blob/main/_autodocs/file-helpers-api.md Gets the cache directory path. Returns the cache directory path. Do not free. ```APIDOC ## ephy_cache_dir ### Description Gets the cache directory path. ### Returns - **const char*** - The cache directory path. Do not free. ### Example ```c const char *cache = ephy_cache_dir (); g_print ("Cache: %s\n", cache); ``` ``` -------------------------------- ### ephy_profile_dir Source: https://github.com/gnome/epiphany/blob/main/_autodocs/file-helpers-api.md Gets the active profile directory. Returns the profile directory path. Do not free. ```APIDOC ## ephy_profile_dir ### Description Gets the active profile directory. ### Returns - **const char*** - The profile directory path. Do not free. ### Example ```c const char *profile = ephy_profile_dir (); g_print ("Profile: %s\n", profile); ``` ``` -------------------------------- ### Create EphySearchEngine Instance Source: https://github.com/gnome/epiphany/blob/main/_autodocs/search-engine-api.md Creates a new EphySearchEngine instance using g_object_new with specific properties. Ensure all required properties like 'name', 'url', 'bang', and 'suggestions-url' are provided. ```c EphySearchEngine *engine = g_object_new (EPHY_TYPE_SEARCH_ENGINE, "name", "DuckDuckGo", "url", "https://duckduckgo.com/?q=%s", "bang", "!d", "suggestions-url", "https://duckduckgo.com/ac/?q=%s", NULL); ``` -------------------------------- ### Load Homepage in Web View Source: https://github.com/gnome/epiphany/blob/main/_autodocs/web-view-api.md Loads the web view's configured homepage. This is useful for providing a quick way to return to a default or user-defined starting page. ```c void ephy_web_view_load_homepage (EphyWebView *view); ``` ```c EphyWebView *web_view = EPHY_WEB_VIEW (ephy_web_view_new ()); ephy_web_view_load_homepage (web_view); ``` -------------------------------- ### ephy_web_view_get_visit_type Source: https://github.com/gnome/epiphany/blob/main/_autodocs/web-view-api.md Gets the current visit type recorded for the page in the web view's history. ```APIDOC ## ephy_web_view_get_visit_type ### Description Gets the current visit type. ### Parameters #### Path Parameters - **view** (EphyWebView*) - Required - The web view ### Returns EphyHistoryPageVisitType ``` -------------------------------- ### ephy_download_set_initiating_web_extension_info Source: https://github.com/gnome/epiphany/blob/main/_autodocs/download-api.md Associates a web extension's ID and name with a download. ```APIDOC ## ephy_download_set_initiating_web_extension_info ### Description Sets the web extension information for the download. ### Method C Function ### Parameters #### Path Parameters - download (EphyDownload*) - Required - The download - extension_id (const char*) - Required - The extension ID - extension_name (const char*) - Required - The extension name ### Returns void ``` -------------------------------- ### ephy_embed_shell_get_print_settings Source: https://github.com/gnome/epiphany/blob/main/_autodocs/embed-shell-api.md Gets the global print settings. This function retrieves the current print settings configuration. ```APIDOC ## ephy_embed_shell_get_print_settings ### Description Gets the global print settings. ### Method `GtkPrintSettings *` ### Parameters #### Path Parameters - **shell** (EphyEmbedShell*) - Required - The embed shell ### Returns - **GtkPrintSettings*** - The GtkPrintSettings. Do not unref. ### Request Example ```c EphyEmbedShell *shell = ephy_embed_shell_get_default (); GtkPrintSettings *settings = ephy_embed_shell_get_print_settings (shell); ``` ``` -------------------------------- ### Profile Code Sections Source: https://github.com/gnome/epiphany/blob/main/HACKING.md Use the START_PROFILER and STOP_PROFILER macros to profile specific sections of code. ```c START_PROFILER STOP_PROFILER ``` -------------------------------- ### ephy_embed_shell_get_search_engine_manager Source: https://github.com/gnome/epiphany/blob/main/_autodocs/embed-shell-api.md Gets the singleton search engine manager responsible for managing search engine configurations. ```APIDOC ## ephy_embed_shell_get_search_engine_manager ### Description Gets the singleton search engine manager for managing search engine configuration. ### Method ```c EphySearchEngineManager *ephy_embed_shell_get_search_engine_manager (EphyEmbedShell *shell); ``` ### Parameters #### Path Parameters - **shell** (EphyEmbedShell*) - Required - The embed shell ### Returns - **EphySearchEngineManager*** - The EphySearchEngineManager. Do not unref. ### Example ```c EphyEmbedShell *shell = ephy_embed_shell_get_default (); EphySearchEngineManager *search = ephy_embed_shell_get_search_engine_manager (shell); ``` ``` -------------------------------- ### ephy_download_get_start_time Source: https://github.com/gnome/epiphany/blob/main/_autodocs/download-api.md Retrieves the timestamp when the download process began. ```APIDOC ## ephy_download_get_start_time ### Description Gets the time when the download started. ### Method ```c GDateTime *ephy_download_get_start_time (EphyDownload *download); ``` ### Parameters #### Path Parameters - **download** (EphyDownload*) - Required - The download object. ### Returns - **GDateTime*** - A GDateTime object representing the start time. Do not unref. ### Example ```c GDateTime *start = ephy_download_get_start_time (download); if (start) { gchar *time_str = g_date_time_format (start, "%Y-%m-%d %H:%M:%S"); g_print ("Started: %s\n", time_str); g_free (time_str); } ``` ``` -------------------------------- ### ephy_embed_shell_get_global_history_service Source: https://github.com/gnome/epiphany/blob/main/_autodocs/embed-shell-api.md Gets the singleton history service managing all browsing history. Do not unref the returned service. ```APIDOC ## ephy_embed_shell_get_global_history_service ### Description Gets the singleton history service managing all browsing history. ### Method EphyHistoryService * ephy_embed_shell_get_global_history_service (EphyEmbedShell *shell); ### Parameters #### Path Parameters - **shell** (EphyEmbedShell*) - Required - The embed shell ### Response #### Success Response (200) - **EphyHistoryService** - The EphyHistoryService. Do not unref. ### Request Example ```c EphyEmbedShell *shell = ephy_embed_shell_get_default (); EphyHistoryService *history = ephy_embed_shell_get_global_history_service (shell); ``` ```