NetSurf
Data Structures | Macros | Functions | Variables
gui.h File Reference
#include <stdbool.h>
#include <Application.h>
#include <FilePanel.h>
#include <Window.h>
#include <BeBuild.h>
Include dependency graph for gui.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  NSBrowserApplication
 

Macros

#define B_UI_SETTINGS_CHANGED   '_UIC'
 
#define CALLED()   fprintf(stderr, "%s()\n", __FUNCTION__);
 

Functions

int gui_init_replicant (int argc, char **argv)
 called when replicated from NSBaseView::Instantiate() More...
 
nserror gui_401login_open (struct nsurl *url, const char *realm, const char *username, const char *password, nserror(*cb)(const char *username, const char *password, void *pw), void *cbpw)
 
void nsbeos_gui_poll (void)
 
void nsbeos_pipe_message (BMessage *message, BView *_this, struct gui_window *gui)
 
void nsbeos_pipe_message_top (BMessage *message, BWindow *_this, struct beos_scaffolding *scaffold)
 
void nsbeos_gui_view_source (struct hlcache_handle *content)
 Send the source of a content to a text editor. More...
 
image_id nsbeos_find_app_path (char *path)
 
char * find_resource (char *buf, const char *filename, const char *def)
 Locate a shared resource file by searching known places in order. More...
 
void nsbeos_update_system_ui_colors (void)
 
void die (const char *const error) __attribute__((noreturn))
 Cause an abnormal program termination. More...
 
nserror beos_warn_user (const char *warning, const char *detail)
 Display a warning for a serious problem (eg memory exhaustion). More...
 

Variables

bool nsbeos_done
 
bool replicated
 if we are running as a replicant More...
 
char * options_file_location
 
BWindow * wndAbout
 
BWindow * wndTooltip
 
BFilePanel * wndOpenFile
 

Macro Definition Documentation

◆ B_UI_SETTINGS_CHANGED

#define B_UI_SETTINGS_CHANGED   '_UIC'

Definition at line 28 of file gui.h.

◆ CALLED

#define CALLED ( )    fprintf(stderr, "%s()\n", __FUNCTION__);

Definition at line 31 of file gui.h.

Function Documentation

◆ beos_warn_user()

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

Display a warning for a serious problem (eg memory exhaustion).

Parameters
warningmessage key for warning message
detailadditional message, or 0

Definition at line 116 of file gui.cpp.

References NSERROR_OK, NSLOG, and text().

Referenced by beos_fetch_filetype_init(), fetch_rsrc_register(), gui_init(), gui_launch_url(), gui_window_create(), nsbeos_gui_view_source(), nsbeos_new_scaffolding(), nsbeos_plot_arc(), nsbeos_plot_bbitmap(), nsbeos_plot_bitmap(), nsbeos_plot_clip(), nsbeos_plot_disc(), nsbeos_plot_line(), nsbeos_plot_polygon(), nsbeos_plot_rectangle(), nsbeos_scaffolding_dispatch_event(), and nsfont_paint().

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

◆ die()

void die ( const char *const  error)

Cause an abnormal program termination.

Note
This never returns and is intended to terminate without any cleanup.
Parameters
errorThe message to display to the user.

Cause an abnormal program termination.

Should only be used during initialisation.

Definition at line 69 of file misc.c.

◆ find_resource()

char * find_resource ( char *  buf,
const char *  filename,
const char *  def 
)

Locate a shared resource file by searching known places in order.

Search order is: ~/config/settings/NetSurf/, ~/.netsurf/, $NETSURFRES/ (where NETSURFRES is an environment variable), and finally the path specified by the macro at the top of this file.

Parameters
bufbuffer to write to. must be at least PATH_MAX chars
filenamefile to look for
defdefault to return if file not found
Returns
path to resource.

Definition at line 277 of file gui.cpp.

References find_resource(), path(), PATH_MAX, and realpath().

Referenced by find_resource(), gui_init(), and nsbeos_scaffolding_dispatch_event().

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

◆ gui_401login_open()

nserror gui_401login_open ( struct nsurl url,
const char *  realm,
const char *  username,
const char *  password,
nserror(*)(const char *username, const char *password, void *pw)  cb,
void *  cbpw 
)

Definition at line 175 of file login.cpp.

References create_login_window(), NSERROR_OK, nsurl_get_component(), and NSURL_HOST.

Here is the call graph for this function:

◆ gui_init_replicant()

int gui_init_replicant ( int  argc,
char **  argv 
)

called when replicated from NSBaseView::Instantiate()

Definition at line 1102 of file gui.cpp.

References beos_bitmap_table, beos_clipboard_table, beos_download_table, beos_fetch_table, beos_layout_table, beos_misc_table, beos_window_table, die(), get_messages_path(), gui_init(), messages_add_from_file(), netsurf_init(), netsurf_register(), NSERROR_OK, nslog_init(), nslog_stream_configure(), nsoption_commandline(), nsoption_init(), nsoption_read(), nsoptions, nsoptions_default, options, and set_defaults().

Referenced by NSBaseView::Instantiate().

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

◆ nsbeos_find_app_path()

image_id nsbeos_find_app_path ( char *  path)

Definition at line 246 of file gui.cpp.

References nsbeos_find_app_path(), and path().

Referenced by find_app_resources(), NSBaseView::Instantiate(), and nsbeos_find_app_path().

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

◆ nsbeos_gui_poll()

void nsbeos_gui_poll ( void  )

Definition at line 745 of file gui.cpp.

References earliest_callback_timeout, fetch_fdset(), nsbeos_dispatch_event(), NSLOG, schedule_run(), and sEventPipe.

Referenced by main(), and nsbeos_replicant_main_thread().

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

◆ nsbeos_gui_view_source()

void nsbeos_gui_view_source ( struct hlcache_handle content)

Send the source of a content to a text editor.

Definition at line 830 of file gui.cpp.

References beos_warn_user(), content_get_mime_type(), content_get_source_data(), filename_request(), hlcache_handle_get_url(), nsurl_access(), path(), TEMP_FILENAME_PREFIX, type, and url_to_path().

Referenced by nsbeos_scaffolding_dispatch_event().

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

◆ nsbeos_pipe_message()

void nsbeos_pipe_message ( BMessage *  message,
BView *  _this,
struct gui_window gui 
)

Definition at line 717 of file gui.cpp.

References gui_window::gui, and sEventPipe.

Referenced by NSBrowserApplication::AboutRequested(), NSBrowserFrameView::Draw(), NSBrowserFrameView::FrameResized(), NSBrowserFrameView::KeyDown(), LoginAlert::MessageReceived(), NSBrowserFrameView::MouseDown(), NSBrowserFrameView::MouseMoved(), NSBrowserFrameView::MouseUp(), and NSBrowserApplication::QuitRequested().

Here is the caller graph for this function:

◆ nsbeos_pipe_message_top()

void nsbeos_pipe_message_top ( BMessage *  message,
BWindow *  _this,
struct beos_scaffolding scaffold 
)

Definition at line 731 of file gui.cpp.

References gui_window::scaffold, and sEventPipe.

Referenced by NSBrowserApplication::ArgvReceived(), NSBrowserWindow::DispatchMessage(), NSBaseView::MessageReceived(), NSBrowserWindow::MessageReceived(), NSBrowserFrameView::MessageReceived(), NSBrowserWindow::QuitRequested(), NSBrowserApplication::RefsReceived(), and NSBaseView::~NSBaseView().

Here is the caller graph for this function:

◆ nsbeos_update_system_ui_colors()

void nsbeos_update_system_ui_colors ( void  )

Definition at line 503 of file gui.cpp.

References nsoptions, and set_defaults().

Referenced by gui_init(), nsbeos_dispatch_event(), and nsbeos_scaffolding_dispatch_event().

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

Variable Documentation

◆ nsbeos_done

bool nsbeos_done
extern

◆ options_file_location

char* options_file_location
extern

Definition at line 94 of file gui.cpp.

Referenced by gui_init().

◆ replicated

bool replicated
extern

if we are running as a replicant

Definition at line 92 of file gui.cpp.

Referenced by gui_init(), NSBaseView::Instantiate(), main(), nsbeos_new_scaffolding(), and NSBaseView::~NSBaseView().

◆ wndAbout

BWindow* wndAbout
extern

Definition at line 99 of file gui.cpp.

◆ wndOpenFile

BFilePanel* wndOpenFile
extern

Definition at line 104 of file gui.cpp.

◆ wndTooltip

BWindow* wndTooltip
extern

Definition at line 102 of file gui.cpp.