NetSurf
Data Structures | Functions | Variables
gui.c File Reference

win32 gui implementation. More...

#include <stdbool.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <windows.h>
#include "utils/errors.h"
#include "utils/nsurl.h"
#include "utils/log.h"
#include "utils/corestrings.h"
#include "utils/url.h"
#include "utils/file.h"
#include "utils/messages.h"
#include "netsurf/browser_window.h"
#include "windows/schedule.h"
#include "windows/window.h"
#include "windows/gui.h"
Include dependency graph for gui.c:

Go to the source code of this file.

Data Structures

struct  dialog_list_entry
 

Functions

nserror nsw32_add_dialog (HWND hwndDlg)
 add a modeless dialog to the special handling list More...
 
nserror nsw32_del_dialog (HWND hwndDlg)
 remove a modeless dialog from the special handling list More...
 
static nserror handle_dialog_message (LPMSG lpMsg)
 walks dialog list and attempts to process any messages for them More...
 
void win32_set_quit (bool q)
 cause the main message loop to exit More...
 
void win32_run (void)
 Run the win32 message loop with scheduling. More...
 
nserror win32_warning (const char *warning, const char *detail)
 Warn the user of an event. More...
 
nserror win32_report_nserror (nserror error, const char *detail)
 Warn the user of an unexpected nserror. More...
 

Variables

HINSTANCE hinst
 win32 application instance handle. More...
 
char ** G_resource_pathv
 resource search path vector. More...
 
char * G_config_path
 path to where all user config files are held. More...
 
static bool win32_quit = false
 
static struct dialog_list_entrydlglist = NULL
 

Detailed Description

win32 gui implementation.

Definition in file gui.c.

Function Documentation

◆ handle_dialog_message()

static nserror handle_dialog_message ( LPMSG  lpMsg)
static

walks dialog list and attempts to process any messages for them

Definition at line 107 of file gui.c.

References dlglist, dialog_list_entry::hwnd, dialog_list_entry::next, NSERROR_NOT_FOUND, NSERROR_OK, and NSLOG.

Referenced by win32_run().

Here is the caller graph for this function:

◆ nsw32_add_dialog()

nserror nsw32_add_dialog ( HWND  hwndDlg)

add a modeless dialog to the special handling list

Definition at line 63 of file gui.c.

References dlglist, dialog_list_entry::hwnd, dialog_list_entry::next, NSERROR_NOMEM, and NSERROR_OK.

◆ nsw32_del_dialog()

nserror nsw32_del_dialog ( HWND  hwndDlg)

remove a modeless dialog from the special handling list

Definition at line 79 of file gui.c.

References dlglist, dialog_list_entry::hwnd, dialog_list_entry::next, NSERROR_NOT_FOUND, NSERROR_OK, and NSLOG.

◆ win32_report_nserror()

nserror win32_report_nserror ( nserror  error,
const char *  detail 
)

Warn the user of an unexpected nserror.

Parameters
[in]errorThe nserror to report
[in]detailAdditional text to be displayed or NULL.
Returns
NSERROR_OK on success or error code if there was a faliure displaying the message to the user.

Definition at line 187 of file gui.c.

References messages_get_errorcode(), and NSERROR_OK.

Referenced by nsws_window_command(), and nsws_window_go().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ win32_run()

void win32_run ( void  )

Run the win32 message loop with scheduling.

Definition at line 130 of file gui.c.

References handle_dialog_message(), NSERROR_OK, NSLOG, schedule_run(), and win32_quit.

Referenced by WinMain().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ win32_set_quit()

void win32_set_quit ( bool  q)

cause the main message loop to exit

Definition at line 124 of file gui.c.

References win32_quit.

Referenced by nsws_window_event_callback().

Here is the caller graph for this function:

◆ win32_warning()

nserror win32_warning ( const char *  warning,
const char *  detail 
)

Warn the user of an event.

Parameters
[in]warningA warning looked up in the message translation table
[in]detailAdditional text to be displayed or NULL.
Returns
NSERROR_OK on success or error code if there was a faliure displaying the message to the user.

Definition at line 173 of file gui.c.

References messages_get(), and NSERROR_OK.

Referenced by gui_download_window_create(), nsw32_about_dialog_init(), nsws_prefs_font_prepare(), nsws_window_command(), and WinMain().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ dlglist

struct dialog_list_entry* dlglist = NULL
static

Definition at line 60 of file gui.c.

Referenced by handle_dialog_message(), nsw32_add_dialog(), and nsw32_del_dialog().

◆ G_config_path

char* G_config_path

path to where all user config files are held.

Definition at line 51 of file gui.c.

Referenced by nsw32_option_init(), nsws_prefs_save(), and set_defaults().

◆ G_resource_pathv

char** G_resource_pathv

resource search path vector.

Definition at line 48 of file gui.c.

Referenced by nsw32_get_resource_url(), nsw32_option_init(), and set_defaults().

◆ hinst

HINSTANCE hinst

win32 application instance handle.

This handle is set in the main windows entry point.

Definition at line 45 of file gui.c.

Referenced by nsw32_about_dialog_init(), nsw32_cookies_present(), nsws_download_window_up(), nsws_prefs_dialog_init(), nsws_window_command(), win32_window_create(), and WinMain().

◆ win32_quit

bool win32_quit = false
static

Definition at line 53 of file gui.c.

Referenced by win32_run(), and win32_set_quit().