22
22
#define APP_NAME "Tickr"
23
23
#define APP_CMD "tickr"
24
#define APP_VERSION_NUMBER "0.6.0"
25
#define APP_WEBSITE "http://www.newsrssticker.com"
26
#define APP_SUPPORT_WEBSITE "http://www.newsrssticker.com/help.php"
27
#define APP_DOWNLOAD_WEBSITE "http://www.newsrssticker.com/download.php"
28
#define APP_SUPPORT_EMAIL "tickrfeedreader@gmail.com"/*"contact@newsrssticker.com"*/
24
#define APP_VERSION_NUMBER "0.6.1"
25
#define WEBSITE_URL "http://www.newsrssticker.com"
26
#define SUPPORT_URL WEBSITE_URL"/help.php"
27
#define DOWNLOAD_URL WEBSITE_URL"/download.php"
28
#define SUPPORT_EMAIL_ADDR "manu@newsrssticker.com"
29
#define CHECK4UPDATES_URL WEBSITE_URL"/app_version_visible.php"
30
#define CHECK4UPDATES_ID_STR "LSVN=" /* Stands for 'Last Stable Version Number =' */
30
32
#define _GNU_SOURCE
31
33
#define _ISOC99_SOURCE
33
/*#define WITHOUT_GTK_SPINNER*/ /* for karmic and jaunty */
35
/*#define WITHOUT_GTK_SPINNER*/ /* For karmic and jaunty (now deprecated) */
34
36
#define VERBOSE_OUTPUT
35
37
/*#define DEBUG_OUTPUT*/
37
/* for info_win_wait(..., timeout) */
38
/*#define INFO_WIN_WAIT_POS GTK_WIN_POS_CENTER*/ /* same as for info_win() */
39
/* For info_win_wait(..., timeout) */
40
/*#define INFO_WIN_WAIT_POS GTK_WIN_POS_CENTER*/ /* Same as for info_win() */
39
41
#define INFO_WIN_WAIT_POS GTK_WIN_POS_CENTER_ON_PARENT
40
42
/*#define INFO_WIN_WAIT_POS GTK_WIN_POS_NONE*/
41
43
#define INFO_WIN_WAIT_TIMEOUT 2000 /* in ms */
85
87
#include "tickr_socket.h"
86
88
#include "tickr_list.h"
88
#define USE_GUI TRUE /* to implement or not gui/menu features at compile time
89
* otherwise, cli only app */
91
# define RESOURCE_NONE_QUIT FALSE /* to quit or not if no resource id specified */
92
# define OPTION_ERROR_QUIT FALSE /* to quit or not if unknown or invalid option(s) */
94
# define RESOURCE_NONE_QUIT TRUE
95
# define OPTION_ERROR_QUIT TRUE
90
#define RESOURCE_NONE_QUIT FALSE /* To quit or not if no resource is specified */
91
#define OPTION_ERROR_QUIT FALSE /* To quit or not if unknown or invalid option(s) */
98
93
#define DRWA_WIDTH_MIN 100
99
94
#define DRWA_HEIGHT_MIN 10
100
95
#define TAB_SIZE 8
101
/* ok? previous value was FILE_NAME_MAXLEN = 255 - apply to both full file names and urls
102
* maybe we should change this so that file name max len = 255 and url max len = 2047 (or more) */
103
#define FILE_NAME_MAXLEN (2 * 1024 - 1)
104
/*#define URL_MAXLEN (2 * 1024 - 1)*/ /* unused so far, see above */
96
#define FILE_NAME_MAXLEN (2 * 1024 - 1) /* Apply to both FULL FILE NAMES and ***URLs*** */
105
97
#define FONT_NAME_MAXLEN 64
106
98
#define FONT_SIZE_MAXLEN 3
107
99
#define FONT_MAXLEN FONT_NAME_MAXLEN + 1 + FONT_SIZE_MAXLEN
109
101
#define OPTION_NAME_MAXLEN 31
110
102
#define OPTION_VALUE_MAXLEN MAX(MAX(FILE_NAME_MAXLEN, FONT_MAXLEN), DELIMITER_MAXLEN)
111
103
#define OPTION_MAXLEN OPTION_NAME_MAXLEN + OPTION_VALUE_MAXLEN + 4 /* -name="value" */
112
#define N_OPTION_MAX 64 /* max number of options */
113
#define N_URL_MAX 1024 /* max number of url's */
114
#define NFEEDLINKANDOFFSETMAX 256 /* max number of "open-able" links per feed */
104
#define N_OPTION_MAX 64 /* Max number of options */
105
#define N_URL_MAX 1024 /* Max number of url's */
106
#define NFEEDLINKANDOFFSETMAX 256 /* Max number of "open-able" links per feed */
115
107
#define LINK_TAG_CHAR '^' /* ascii 5E - char used internally for links, removed from feed text */
116
#define TMPSTR_SIZE (2 * 1024 - 1) /* used for most tmp strings - must be large enough */
108
#define TMPSTR_SIZE (2 * 1024 - 1) /* Used for most tmp strings - must be large enough */
117
109
#ifndef G_OS_WIN32
118
110
# define SEPARATOR_CHAR '/'
128
120
#define UNSELECTED_URL_CHAR '-'
129
121
#define UNSELECTED_URL_STR "-"
131
/* make sure this stuff is robust enough */
123
/* Make sure this stuff is robust enough */
132
124
#define XPIXMAP_MAXWIDTH (32 * 1024 - 1) /* 32 K - 1 = max supported width for xpixmaps
133
* (not 64 k - 1 as sometimes uncorrectly specified)
125
* (not 64 k - 1 as sometimes uncorrectly specified.)
135
#define LINE_MAXLEN 128 /* max length of a single line (see tickr_render.c) */
136
#define WORD_MAXLEN 32 /* max length of a word that won't get cut off */
127
#define LINE_MAXLEN 128 /* Max length of a single line (see tickr_render.c) */
128
#define WORD_MAXLEN 32 /* Max length of a word that won't get cut off */
137
129
#if (LINE_MAXLEN <= WORD_MAXLEN)
138
130
# error LINE_MAXLEN must be > WORD_MAXLEN
140
132
#define FONT_MAXSIZE 200
134
#define ARBITRARY_TASKBAR_HEIGHT 25
143
* file names, paths and dirs stuff
137
* File names, paths and dirs stuff
145
* linux version: /usr/bin/
139
* Linux version: /usr/bin/
146
140
* /usr/share/APP_CMD/
147
141
* /usr/share/APP_CMD/pixmpas/
148
142
* /home/<user_name>/.APP_CMD/
150
* win32 version: C:\Program files\APP_NAME\ (also location for pixmaps)
144
* Win32 version: C:\Program files\APP_NAME\ (also location for pixmaps)
151
145
* C:\...\Application Data\APP_NAME\
153
147
#ifndef G_OS_WIN32
191
185
# define FONTNAME "Arial Unicode MS"
193
187
#define FONTSIZE "14"
194
#define FGCOLOR "#ffffffff" /* white */
195
#define BGCOLOR "#36516240" /* some translucent blue */
188
#define FGCOLOR "#ffffffff" /* White */
189
#define BGCOLOR "#36516240" /* Some translucent blue */
198
#define WIN_W 1024 /* unused, we use get_ticker_env()->screen_w instead */
199
#define WIN_H 0 /* if = 0, determined by font size */
192
#define WIN_W 1024 /* Unused, we use get_ticker_env()->screen_w instead */
193
#define WIN_H 0 /* If = 0, determined by font size */
200
194
#define WINDEC 'n'
201
#define ALWAYSONTOP 'y'
195
#define ALWAYSONTOP 'n' /* Changed to no */
202
196
#ifndef G_OS_WIN32
203
197
# define WINTRANSPARENCY 1.0
212
206
#define SHADOWFX 2
213
207
#define LINEDELIMITER " "
214
208
#define CUTLINEDELIMITER "..."LINEDELIMITER
209
#define SPECIALCHARS 'n'
215
212
#define RSSREFRESH 15
217
#define RSSTITLEDELIMITER " "
218
#define RSSDESCRIPTION 'n'
219
#define RSSDESCRIPTIONDELIMITER " - "
213
#define FEEDTITLE 'n'
214
#define FEEDTITLEDELIMITER " "
215
#define ITEMTITLE 'y'
216
#define ITEMTITLEDELIMITER " "
217
#define ITEMDESCRIPTION 'n'
218
#define ITEMDESCRIPTIONDELIMITER " - "
220
219
#define NITEMSPERFEED 5
221
220
#define STRIPHTMLTAGS 'y'
222
221
#define UPPERCASETEXT 'n'
223
222
#define HOMEFEED "http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml"
224
223
#ifndef G_OS_WIN32
225
# define OPENLINKCMD "firefox" /* firefox on linux */
224
# define OPENLINKCMD "firefox" /* Firefox on Linux */
227
226
# define OPENLINKCMD ""
294
296
} connection_settings_page;
296
298
/* typedef struct's */
297
/* usefull graphical (and other) ticker 'environment' values */
299
/* Usefull graphical (and other) ticker 'environment' values */
299
GdkScreen *screen; /* gdk screen for win */
301
GdkScreen *screen; /* GDK screen for win */
300
302
GdkVisual *visual;
301
gint screen_w, screen_h; /* screen width & height */
302
gint depth; /* screen depth */
303
GtkWidget *win; /* top level window */
304
GtkWidget *drw_a, *drwa_clock; /* drawing areas (main / clock) */
305
gint drwa_width, drwa_height; /* main drawing area dimensions */
306
gint drwa_clock_width; /* clock drawing area width */
307
cairo_surface_t *c_surf; /* cairo image surface onto which text is rendered */
308
gint surf_width, surf_height; /* cairo image surface dimensions */
303
gint screen_w, screen_h; /* Screen width & height */
304
gint depth; /* Screen depth */
305
GtkWidget *win; /* Top level window */
306
GtkWidget *drw_a, *drwa_clock; /* Drawing areas (main / clock) */
307
gint drwa_width, drwa_height; /* Main drawing area dimensions */
308
gint drwa_clock_width; /* Clock drawing area width */
309
cairo_surface_t *c_surf; /* Cairo image surface onto which text is rendered */
310
gint surf_width, surf_height; /* Cairo image surface dimensions */
309
311
char active_link[FILE_NAME_MAXLEN + 1];
310
/* these flags are checked by callback */
311
gboolean suspend_rq; /* request for doing nothing */
312
gboolean compute_rq; /* request for (re)computing everything (surface and win) */
313
gboolean reload_rq; /* request for (re)loading resource */
314
_selection_mode selection_mode; /* default = MULTIPLE, set to SINGLE internally if selection
312
/* These flags are checked by callback */
313
gboolean suspend_rq; /* Request for doing nothing */
314
gboolean compute_rq; /* Request for (re)computing everything (surface and win) */
315
gboolean reload_rq; /* Request for (re)loading resource */
316
_selection_mode selection_mode; /* default = MULTIPLE, set to SINGLE internally if selection
315
317
* is unavalaible/empty or after picking a single feed */
316
gboolean stream_fully_read; /* set/checked only in render_stream_to_surface() and
318
gboolean stream_fully_read; /* Set/checked only in render_stream_to_surface() and
317
319
* shift2left_callback() */
323
325
} FeedLinkAndOffset;
326
_resrc_type type; /* text file or url */
328
_resrc_type type; /* Text file or url */
327
329
_rss_format format; /* RSS 1.0, RSS 2.0 or Atom */
328
char id[FILE_NAME_MAXLEN + 1]; /* local = file name or remote = feed url */
329
/* apply only to url/rss */
330
char id[FILE_NAME_MAXLEN + 1]; /* Local = file name or remote = feed url */
331
/* Apply only to url/rss */
330
332
_rss_format rss_format;
331
333
char feed_title[FEED_TITLE_MAXLEN + 1];
332
char resrc_dump[FILE_NAME_MAXLEN + 1]; /* downloaded file/resource */
334
char resrc_dump[FILE_NAME_MAXLEN + 1]; /* Downloaded file/resource */
333
335
char xml_dump[FILE_NAME_MAXLEN + 1];
334
FILE *fp; /* file to be read (from xmldump) after some processing, */
336
FILE *fp; /* File to be read (from xmldump) after some processing, */
335
337
FeedLinkAndOffset link_and_offset[NFEEDLINKANDOFFSETMAX];
390
392
char line_delimiter[DELIMITER_MAXLEN + 1];
391
393
char cutline_delimiter[DELIMITER_MAXLEN + 1];
394
char rss_title_delimiter[DELIMITER_MAXLEN + 1];
395
char rss_description;
396
char rss_description_delimiter[DELIMITER_MAXLEN + 1];
399
char feed_title_delimiter[DELIMITER_MAXLEN + 1];
401
char item_title_delimiter[DELIMITER_MAXLEN + 1];
402
char item_description;
403
char item_description_delimiter[DELIMITER_MAXLEN + 1];
397
404
int n_items_per_feed;
398
405
char strip_html_tags;
399
406
char upper_case_text;
408
415
guint16 clock_bg_color_alpha;
409
416
char disable_popups;
410
417
char pause_on_mouseover;
411
char mouse_wheel_scroll; /* apply to s (speed) / f (feed) / n (none) */
415
/* do we need both these auth/proxy structs and auth/proxy params? redundant... */
418
char disable_leftclick;
419
char mouse_wheel_scroll; /* Apply to s (speed) / f (feed) / n (none) */
420
/* Do we need both these auth/proxy structs and auth/proxy params? redundant... */
416
421
char use_authentication;
417
422
char user[USER_MAXLEN + 1];
614
619
int save_str_as_opml_file(const char *);
616
621
/* tickr_http.c */
622
void remove_chunk_info(char **);
617
623
int connect_with_url(sockt *, char *);
618
624
int fetch_resource(const char *, const char *, char *);
619
625
const char *build_http_request(const char *, const char *, const char *,\