Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GUINewsFeed.cpp File Reference
#include <config.h>
#include <iomanip>
#include <regex>
#include <sstream>
#include <utils/common/StringUtils.h>
#include <utils/common/ToString.h>
#include <utils/common/Translation.h>
#include <utils/foxtools/MFXLinkLabel.h>
#include <utils/gui/images/GUIIconSubSys.h>
#include <utils/gui/div/GUIDesigns.h>
#include "GUINewsFeed.h"
Include dependency graph for GUINewsFeed.cpp:

Go to the source code of this file.

Macros

#define NEWS_DISABLED   4102444800LL
 
#define NEWS_MAX_BYTES   (1024 * 1024)
 
#define NEWS_MAX_SHOWN   5
 
#define NEWS_REG_SECTION   "NEWS"
 
#define NEWS_WRAP_COLUMNS   80
 

Functions

static void addRichLine (FXComposite *parent, const std::string &line)
 adds a row of labels to parent, words that look like URLs (with or without scheme) become clickable links
 
 FXDEFMAP (GUINewsFeed) GUINewsFeedMap[]
 
static bool getElement (const std::string &xml, const std::string &tag, size_t &pos, std::string &result)
 returns the text of the first <tag> element in xml (starting at pos), the feed is created by tools/newsfeed.py
 
static time_t parseDate (const std::string &text)
 parses an RFC 822 date like "Thu, 19 Nov 2026 10:00:00 +0000" (always UTC)
 
static std::string wrapLine (const std::string &line, const size_t width)
 inserts line breaks at spaces so that lines have at most the given number of bytes (if possible)
 

Detailed Description

Author
Michael Behrisch
Date
2026-11-20

Definition in file GUINewsFeed.cpp.

Macro Definition Documentation

◆ NEWS_DISABLED

#define NEWS_DISABLED   4102444800LL

Definition at line 47 of file GUINewsFeed.cpp.

◆ NEWS_MAX_BYTES

#define NEWS_MAX_BYTES   (1024 * 1024)

Definition at line 49 of file GUINewsFeed.cpp.

◆ NEWS_MAX_SHOWN

#define NEWS_MAX_SHOWN   5

Definition at line 46 of file GUINewsFeed.cpp.

◆ NEWS_REG_SECTION

#define NEWS_REG_SECTION   "NEWS"

Definition at line 45 of file GUINewsFeed.cpp.

◆ NEWS_WRAP_COLUMNS

#define NEWS_WRAP_COLUMNS   80

Definition at line 48 of file GUINewsFeed.cpp.

Function Documentation

◆ addRichLine()

static void addRichLine ( FXComposite *  parent,
const std::string &  line 
)
static

adds a row of labels to parent, words that look like URLs (with or without scheme) become clickable links

Definition at line 315 of file GUINewsFeed.cpp.

Referenced by GUINewsFeed::onCmdShow().

Here is the caller graph for this function:

◆ FXDEFMAP()

◆ getElement()

static bool getElement ( const std::string &  xml,
const std::string &  tag,
size_t &  pos,
std::string &  result 
)
static

returns the text of the first <tag> element in xml (starting at pos), the feed is created by tools/newsfeed.py

Definition at line 105 of file GUINewsFeed.cpp.

References StringUtils::replace(), and StringUtils::trim().

Referenced by GUINewsFeed::parseRSS().

Here is the caller graph for this function:

◆ parseDate()

static time_t parseDate ( const std::string &  text)
static

parses an RFC 822 date like "Thu, 19 Nov 2026 10:00:00 +0000" (always UTC)

Definition at line 133 of file GUINewsFeed.cpp.

Referenced by GUINewsFeed::parseRSS().

Here is the caller graph for this function:

◆ wrapLine()

static std::string wrapLine ( const std::string &  line,
const size_t  width 
)
static

inserts line breaks at spaces so that lines have at most the given number of bytes (if possible)

Definition at line 86 of file GUINewsFeed.cpp.

Referenced by GUINewsFeed::onCmdShow().

Here is the caller graph for this function: