Macros | Enumerations | Functions
GUI: Graphical User Interface

This graphical user interface is based on FLTK 1.3 and is intended to work with a FLTK 1.3.0 shared library. Using features that are added later is not allowed (without ABI guards) to preserve backward compatibility. More...

Macros

#define USE_LINE_COUNT   0
 Setting this to 1 enables line count in article tree/list (EXPERIMENTAL)
 
#define USE_ARTICLE_NUMBER   0
 Setting this to 1 enables article number in article tree/list (EXPERIMENTAL)
 
#define MAIN_ERR_PREFIX   "GUI: "
 Message prefix for MAIN module.
 
#define UI_STYLES_LEN   9
 Number of styles for article content syntax highlighting.
 
#define UI_HDR_BUFSIZE   (std::size_t) 998
 Size of buffer for header field creation.
 
#define UI_STATIC_STYLE_BUFSIZE   (std::size_t) 80
 Static buffer size for compose window style update callback.
 
#define UI_XPOST_LIMIT   (std::size_t) 10
 Maximum number of groups for crossposting.
 
#define UI_AW_REFERENCES   0
 
#define UI_WINDOW_CLASS   Fl_Window
 
#define USE_WINDOW_ICON   0
 
#define UI_STATUS(s)   { if(mainWindow) { mainWindow->statusBar->label(s); } }
 Replace message in main window status bar.
 
#define UI_READY()
 Clear main window progress bar. More...
 
#define UI_BUSY()
 Display "Busy" in main window progress bar. More...
 
#define UI_PROGRESS(s, e)
 Update value of main window progress bar. More...
 
#define UI_HDR_FIELDS   (std::size_t) 14
 
#define UI_HDR_PAD(s, n)   { for(i = 0; i < n; ++i) { s << " "; } }
 
#define UI_MAX_FILENAME_LENGTH   1023
 Maximum length of filenames (without string termination) More...
 

Enumerations

enum  ui_scroll { UI_SCROLL_NONE, UI_SCROLL_TOP, UI_SCROLL_MIDDLE, UI_SCROLL_BOTTOM }
 

Functions

void ui_init (int argc, char **argv)
 Init GUI. More...
 
int ui_exec (void)
 Drive GUI. More...
 
void ui_exit (void)
 Shutdown GUI. More...
 
int ui_get_locale_utf8 (void)
 Check whether locale use UTF-8 encoding. More...
 
void ui_wakeup (unsigned int cookie)
 Wakeup callback (called by core thread after operation has finished) More...
 
int ui_lock (void)
 Lock for multithread support. More...
 
int ui_unlock (void)
 Unlock for multithread support. More...
 
void MainWindow::asearch_cb_i (void)
 
void MainWindow::calculatePercent (std::size_t, std::size_t)
 
void MainWindow::ascrolldown_cb (bool)
 
void MainWindow::updateServer (int)
 
void MainWindow::groupListRefresh (int)
 
void MainWindow::articleUpdate (Fl_Text_Buffer *)
 
void MainWindow::viewArticle (int, const char *)
 
void MainWindow::articlePost (int, const char *)
 
 MainWindow::MainWindow (const char *)
 
int ServerCfgWindow::process (void)
 
 ServerCfgWindow::ServerCfgWindow (ServerConfig *, const char *)
 
 IdentityCfgWindow::IdentityCfgWindow (const char *)
 
 MiscCfgWindow::MiscCfgWindow (const char *)
 
 SearchWindow::SearchWindow (const char *, const char **)
 
 MIMEContent::MIMEContent (struct core_article_header *, const char *)
 
 SubscribeWindow::SubscribeWindow (const char *label, core_groupdesc *glist, core_grouplabel *labels)
 
void ProtocolConsole::update (void)
 
 ProtocolConsole::ProtocolConsole (const char *)
 
 MIDSearchWindow::MIDSearchWindow (const char *)
 
 BugreportWindow::BugreportWindow (const char *, const char *)
 
 MotdWindow::MotdWindow (const char *, const char *)
 
 LicenseWindow::LicenseWindow (const char *)
 
 ArticleWindow::ArticleWindow (const char *, const char *)
 
 ArticleSrcWindow::ArticleSrcWindow (const char *, const char *)
 
 ComposeWindow::ComposeWindow (const char *, const char *, const char *, const char *, struct core_article_header *, bool)
 

Fixed widget colors

Override some FLTK defaults that can't be configured via X resources.

Selection color for menu

#define UI_COLOR_MENU_SELECTION   (Fl_Color) 0x50505000UL
 
#define UI_COLOR_PROGRESS_BAR   (Fl_Color) 0x50505000UL
 Color for progress bar.
 
#define UI_COLOR_RADIO_BUTTON   (Fl_Color) 0x50505000UL
 Color for selected radio button.
 

Callback action controls

#define UI_CB_START   0
 
#define UI_CB_CONTINUE   1
 
#define UI_CB_FINISH   2
 

Callback cookies

#define UI_CB_COOKIE_SERVER   0U
 
#define UI_CB_COOKIE_GROUPLIST   1U
 
#define UI_CB_COOKIE_GROUPLABELS   2U
 
#define UI_CB_COOKIE_GROUPPROPOSAL   3U
 
#define UI_CB_COOKIE_GROUPINFO1   4U
 
#define UI_CB_COOKIE_GROUPINFO2   5U
 
#define UI_CB_COOKIE_GROUP   6U
 
#define UI_CB_COOKIE_OVERVIEW   7U
 
#define UI_CB_COOKIE_HEADER   8U
 
#define UI_CB_COOKIE_BODY   9U
 
#define UI_CB_COOKIE_MOTD   10U
 
#define UI_CB_COOKIE_ARTICLE   11U
 
#define UI_CB_COOKIE_SRC   12U
 
#define UI_CB_COOKIE_POST   13U
 

Encryption algorithms

All nonzero values additionally provide server to client authentication via X509 certificate.

#define UI_ENC_NONE   0
 
#define UI_ENC_STRONG   1
 
#define UI_ENC_WEAK   2
 

Authentication algorithms (client to server)

#define UI_AUTH_NONE   0
 
#define UI_AUTH_USER   1
 

Limits for clamp article count (CONF_CAC) configuration value

#define UI_CAC_MIN   10
 
#define UI_CAC_MAX   50000
 

Detailed Description

This graphical user interface is based on FLTK 1.3 and is intended to work with a FLTK 1.3.0 shared library. Using features that are added later is not allowed (without ABI guards) to preserve backward compatibility.

Note
If you hear bugging beeps when information windows appear, this file is the wrong place to fix. These beeps are created by FLTK internally and can be eliminated by patching the file 'fltk-1.3.0/src/fl_ask.cxx'. Commenting out all calls to 'fl_beep()' and rebuilding FLTK will give you comfortable silence. Newer FLTK versions already contains this "silence patch".

Macro Definition Documentation

◆ UI_AW_REFERENCES

#define UI_AW_REFERENCES   0

Enable references line in ArticleWindow class

This is currently not useful, because ArticleWindow has no hyperlink support.

Definition at line 200 of file gui.cxx.

◆ UI_BUSY

#define UI_BUSY ( )
Value:
{ \
if(mainWindow) \
{ \
mainWindow->progressBar->value(0.0); \
SC("This string must fit into the progress bar box") \
mainWindow->progressBar->label(S("Busy")); \
mainWindow->default_cursor(FL_CURSOR_WAIT); \
mainWindow->busy = true; \
} \
}

Display "Busy" in main window progress bar.

Definition at line 1650 of file gui.cxx.

◆ UI_MAX_FILENAME_LENGTH

#define UI_MAX_FILENAME_LENGTH   1023

Maximum length of filenames (without string termination)

This value is limited by the FLTK filename length limit of 1023 bytes.

Definition at line 24 of file ui.hxx.

◆ UI_PROGRESS

#define UI_PROGRESS (   s,
 
)
Value:
{ \
if(mainWindow) \
{ \
mainWindow->calculatePercent(s, e); \
if(100.0 == progress_percent_value || !progress_skip_update) \
{ \
mainWindow->progressBar->value(progress_percent_value); \
mainWindow->progressBar->copy_label(progress_percent_label); \
} \
if(!mainWindow->busy) \
{ \
mainWindow->default_cursor(FL_CURSOR_WAIT); \
mainWindow->busy = true; \
} \
Fl::check(); \
progress_skip_update = true; \
Fl::add_timeout(0.1, progress_release_cb, this); \
} \
}

Update value of main window progress bar.

Definition at line 1663 of file gui.cxx.

◆ UI_READY

#define UI_READY ( )
Value:
{ \
if(mainWindow) \
{ \
mainWindow->progressBar->value(0.0); \
mainWindow->progressBar->label(""); \
mainWindow->default_cursor(FL_CURSOR_DEFAULT); \
mainWindow->busy = false; \
} \
}

Clear main window progress bar.

Definition at line 1638 of file gui.cxx.

Function Documentation

◆ ui_exec()

int ui_exec ( void  )

Drive GUI.

Assign the CPU to the GUI to process queued operations. Before this function is called, ui_init() must be executed.

Returns
  • 0 on success
  • 1 to indicate an exit request from the GUI

Definition at line 12407 of file gui.cxx.

◆ ui_exit()

void ui_exit ( void  )

Shutdown GUI.

It is not allowed to call ui_exec() after this function returns.

Definition at line 12527 of file gui.cxx.

◆ ui_get_locale_utf8()

int ui_get_locale_utf8 ( void  )

Check whether locale use UTF-8 encoding.

Determine which codeset the locale uses that FLTK will set for LC_CTYPE after opening the X11 display.

Attention
This works even if the X11 display is not opened yet! This means the return value is valid before ui_init() is called too.
Returns
  • 1 Locale use UTF-8 encoding
  • 0 Locale use other encoding

Definition at line 12584 of file gui.cxx.

◆ ui_init()

void ui_init ( int  argc,
char **  argv 
)

Init GUI.

Attention
Remember that the locale must use either UTF-8 or ISO 8859-1 codeset or be the POSIX locale.
Parameters
[in]argcCommand line argument count
[in]argvPointer to Command line argument array
Todo:
Workaround for "creeping window" problem without session manager seems not to be the "right" solution. If you know a better one, please report it.

Definition at line 12139 of file gui.cxx.

◆ ui_lock()

int ui_lock ( void  )

Lock for multithread support.

This function must be called by other threads before they call an OS function that is not guaranteed to be thread-safe. Prominent examples are:

  • getenv()
  • gethostbyname()
  • localtime()
  • readdir()

FLTK documentation for MT locking:
http://www.fltk.org/doc-1.3/advanced.html#advanced_multithreading

Returns
  • 0 on success
  • Negative value on error

Definition at line 12706 of file gui.cxx.

Referenced by ts_lock_ui().

◆ ui_unlock()

int ui_unlock ( void  )

Unlock for multithread support.

Returns
  • 0 on success
  • Negative value on error

Definition at line 12728 of file gui.cxx.

Referenced by ts_unlock_ui().

◆ ui_wakeup()

void ui_wakeup ( unsigned int  cookie)

Wakeup callback (called by core thread after operation has finished)

Parameters
[in]cookieCookie that was assigned to the operation by GUI

Definition at line 12596 of file gui.cxx.


Generated at 2024-04-27 using  doxygen