mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-26 20:31:17 +00:00
auesnthaeou
This commit is contained in:
parent
d710ea8b9d
commit
70adc04fc2
@ -53,7 +53,7 @@ static void set_up_gradient(conky_context *ctx)
|
||||
}
|
||||
if (ctx->colour_depth != 24 && ctx->colour_depth != 16) {
|
||||
NORM_ERR("using non-standard colour depth, gradients may look like a "
|
||||
"lolly-pop");
|
||||
"lollipop");
|
||||
}
|
||||
|
||||
ctx->redmask = 0;
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include "common.h"
|
||||
#include "fs.h"
|
||||
#include "logging.h"
|
||||
#include "core.h"
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <sys/time.h>
|
||||
@ -218,7 +219,7 @@ void variable_substitute(const char *s, char *dest, unsigned int n)
|
||||
|
||||
static struct net_stat netstats[16];
|
||||
|
||||
struct net_stat *get_net_stat(const char *dev, void *free_at_crash1, void *free_at_crash2)
|
||||
struct net_stat *get_net_stat(conky_context *ctx, const char *dev, void *free_at_crash1, void *free_at_crash2)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
@ -241,7 +242,7 @@ struct net_stat *get_net_stat(const char *dev, void *free_at_crash1, void *free_
|
||||
}
|
||||
}
|
||||
|
||||
CRIT_ERR(free_at_crash1, free_at_crash2, "too many interfaces used (limit is 16)");
|
||||
CRIT_ERR(ctx, free_at_crash1, free_at_crash2, "too many interfaces used (limit is 16)");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -257,13 +258,13 @@ void clear_net_stats(void)
|
||||
}
|
||||
|
||||
/* We should check if this is ok with OpenBSD and NetBSD as well. */
|
||||
int interface_up(const char *dev)
|
||||
int interface_up(conky_context *ctx, const char *dev)
|
||||
{
|
||||
int fd;
|
||||
struct ifreq ifr;
|
||||
|
||||
if ((fd = socket(PF_INET, SOCK_DGRAM, 0)) < 0) {
|
||||
CRIT_ERR(NULL, NULL, "could not create sockfd");
|
||||
CRIT_ERR(ctx, NULL, NULL, "could not create sockfd");
|
||||
return 0;
|
||||
}
|
||||
strncpy(ifr.ifr_name, dev, IFNAMSIZ);
|
||||
|
@ -77,8 +77,8 @@ struct net_stat {
|
||||
};
|
||||
void clear_net_stats(void);
|
||||
void clear_cpu_stats(void);
|
||||
struct net_stat *get_net_stat(const char *dev, void *free_at_crash1, void *free_at_crash2);
|
||||
int interface_up(const char *dev);
|
||||
struct net_stat *get_net_stat(conky_context *ctx, const char *dev, void *free_at_crash1, void *free_at_crash2);
|
||||
int interface_up(conky_context *ctx, const char *dev);
|
||||
|
||||
void get_adt746x_cpu(char *, size_t);
|
||||
void get_adt746x_fan(char *, size_t);
|
||||
|
14
src/conky.c
14
src/conky.c
@ -55,9 +55,6 @@
|
||||
#ifdef HAVE_XDAMAGE
|
||||
#include <X11/extensions/Xdamage.h>
|
||||
#endif /* HAVE_XDAMAGE */
|
||||
#ifdef IMLIB2
|
||||
#include "imlib2.h"
|
||||
#endif /* IMLIB2 */
|
||||
#endif /* X11 */
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
@ -76,7 +73,6 @@
|
||||
#include "algebra.h"
|
||||
#include "build.h"
|
||||
#include "colours.h"
|
||||
#include "diskio.h"
|
||||
#ifdef X11
|
||||
#include "fonts.h"
|
||||
#endif
|
||||
@ -121,7 +117,6 @@ char *get_apm_battery_time(void);
|
||||
#define S_ISSOCK(x) ((x & S_IFMT) == S_IFSOCK)
|
||||
#endif
|
||||
|
||||
#define MAIL_FILE "$MAIL"
|
||||
#define MAX_IF_BLOCK_DEPTH 5
|
||||
|
||||
//#define SIGNAL_BLOCKING
|
||||
@ -138,7 +133,6 @@ char** argv_copy;
|
||||
/* prototypes for internally used functions */
|
||||
static void signal_handler(int);
|
||||
static void print_version(void) __attribute__((noreturn));
|
||||
static void reload_config(void);
|
||||
|
||||
static void print_version(void)
|
||||
{
|
||||
@ -614,7 +608,7 @@ static void main_loop(conky_context *ctx)
|
||||
case SIGHUP:
|
||||
case SIGUSR1:
|
||||
NORM_ERR("received SIGHUP or SIGUSR1. reloading the config file.");
|
||||
reload_config();
|
||||
reload_config(ctx);
|
||||
break;
|
||||
case SIGINT:
|
||||
case SIGTERM:
|
||||
@ -679,7 +673,7 @@ static void main_loop(conky_context *ctx)
|
||||
if (ev->wd == inotify_config_wd && (ev->mask & IN_MODIFY || ev->mask & IN_IGNORED)) {
|
||||
/* ctx->current_config should be reloaded */
|
||||
NORM_ERR("'%s' modified, reloading...", ctx->current_config);
|
||||
reload_config();
|
||||
reload_config(ctx);
|
||||
if (ev->mask & IN_IGNORED) {
|
||||
/* for some reason we get IN_IGNORED here
|
||||
* sometimes, so we need to re-add the watch */
|
||||
@ -704,7 +698,7 @@ static void main_loop(conky_context *ctx)
|
||||
#endif /* HAVE_LUA */
|
||||
g_signal_pending = 0;
|
||||
}
|
||||
clean_up(NULL, NULL);
|
||||
clean_up(ctx, NULL, NULL);
|
||||
|
||||
#ifdef HAVE_SYS_INOTIFY_H
|
||||
if (inotify_fd != -1) {
|
||||
@ -850,7 +844,7 @@ void initialisation(conky_context *ctx, int argc, char **argv)
|
||||
break;
|
||||
#ifdef X11
|
||||
case 'f':
|
||||
set_first_font(optarg);
|
||||
set_first_font(ctx, optarg);
|
||||
break;
|
||||
case 'a':
|
||||
ctx->text_alignment = string_to_alignment(optarg);
|
||||
|
@ -250,10 +250,14 @@ enum {
|
||||
#define KFLAG_FLIP(a) ctx->info.kflags ^= a
|
||||
#define KFLAG_ISSET(a) ctx->info.kflags & a
|
||||
|
||||
#define MAIL_FILE "$MAIL"
|
||||
|
||||
/* defined in users.c */
|
||||
void update_users(void);
|
||||
|
||||
extern int inotify_fd;
|
||||
extern int argc_copy;
|
||||
extern char** argv_copy;
|
||||
|
||||
#define NOBATTERY 0
|
||||
|
||||
|
590
src/core.c
590
src/core.c
File diff suppressed because it is too large
Load Diff
@ -60,7 +60,7 @@ enum alignment {
|
||||
|
||||
void read_exec(const char *data, char *buf, const int size);
|
||||
void set_default_configurations(conky_context *ctx);
|
||||
void set_update_interval(double interval);
|
||||
void set_update_interval(conky_context *ctx, double interval);
|
||||
|
||||
/* update_text() generates new text and clears old text area */
|
||||
void update_text(conky_context *ctx);
|
||||
@ -78,4 +78,8 @@ void X11_create_window(conky_context *ctx);
|
||||
|
||||
void convert_escapes(char *buf);
|
||||
|
||||
void reload_config(conky_context *ctx);
|
||||
|
||||
void clean_up(conky_context *ctx, void *memtofree1, void *memtofree2);
|
||||
|
||||
#endif /* _CONKY_CORE_H_ */
|
||||
|
117
src/fonts.c
117
src/fonts.c
@ -29,31 +29,26 @@
|
||||
*
|
||||
*/
|
||||
#include "conky.h"
|
||||
#include "fonts.h"
|
||||
#include "ctx->fonts.h"
|
||||
#include "logging.h"
|
||||
|
||||
int selected_font = 0;
|
||||
int font_count = -1;
|
||||
struct font_list *fonts = NULL;
|
||||
char fontloaded = 0;
|
||||
|
||||
void set_font(void)
|
||||
void set_font(conky_context *ctx)
|
||||
{
|
||||
#ifdef XFT
|
||||
if (use_xft) return;
|
||||
if (use_xft->ctx) return;
|
||||
#endif /* XFT */
|
||||
if (font_count > -1 && fonts[selected_font].font) {
|
||||
XSetFont(display, window.gc, fonts[selected_font].font->fid);
|
||||
if (ctx->font_count > -1 && ctx->fonts[selected_font].font) {
|
||||
XSetFont(display, window.gc, ctx->fonts[selected_font].font->fid);
|
||||
}
|
||||
}
|
||||
|
||||
void setup_fonts(void)
|
||||
void setup_fonts(conky_context *ctx)
|
||||
{
|
||||
if ((output_methods & TO_X) == 0) {
|
||||
return;
|
||||
}
|
||||
#ifdef XFT
|
||||
if (use_xft) {
|
||||
if (use_xft->ctx) {
|
||||
if (window.xftdraw) {
|
||||
XftDrawDestroy(window.xftdraw);
|
||||
window.xftdraw = 0;
|
||||
@ -65,89 +60,89 @@ void setup_fonts(void)
|
||||
set_font();
|
||||
}
|
||||
|
||||
int add_font(const char *data_in)
|
||||
int add_font(conky_context *ctx, const char *data_in)
|
||||
{
|
||||
if ((output_methods & TO_X) == 0) {
|
||||
return 0;
|
||||
}
|
||||
if (font_count > MAX_FONTS) {
|
||||
CRIT_ERR(NULL, NULL, "you don't need that many fonts, sorry.");
|
||||
if (ctx->font_count > MAX_FONTS) {
|
||||
CRIT_ERR(NULL, NULL, "you don't need that many ctx->fonts, sorry.");
|
||||
}
|
||||
font_count++;
|
||||
if (font_count == 0) {
|
||||
if (fonts != NULL) {
|
||||
free(fonts);
|
||||
ctx->font_count++;
|
||||
if (ctx->font_count == 0) {
|
||||
if (ctx->fonts != NULL) {
|
||||
free(ctx->fonts);
|
||||
}
|
||||
if ((fonts = (struct font_list *) malloc(sizeof(struct font_list)))
|
||||
if ((ctx->fonts = (struct font_list *) malloc(sizeof(struct font_list)))
|
||||
== NULL) {
|
||||
CRIT_ERR(NULL, NULL, "malloc");
|
||||
}
|
||||
memset(fonts, 0, sizeof(struct font_list));
|
||||
memset(ctx->fonts, 0, sizeof(struct font_list));
|
||||
}
|
||||
fonts = realloc(fonts, (sizeof(struct font_list) * (font_count + 1)));
|
||||
memset(&fonts[font_count], 0, sizeof(struct font_list));
|
||||
if (fonts == NULL) {
|
||||
ctx->fonts = realloc(ctx->fonts, (sizeof(struct font_list) * (ctx->font_count + 1)));
|
||||
memset(&ctx->fonts[ctx->font_count], 0, sizeof(struct font_list));
|
||||
if (ctx->fonts == NULL) {
|
||||
CRIT_ERR(NULL, NULL, "realloc in add_font");
|
||||
}
|
||||
// must account for null terminator
|
||||
if (strlen(data_in) < DEFAULT_TEXT_BUFFER_SIZE) {
|
||||
strncpy(fonts[font_count].name, data_in, DEFAULT_TEXT_BUFFER_SIZE);
|
||||
strncpy(ctx->fonts[ctx->font_count].name, data_in, DEFAULT_TEXT_BUFFER_SIZE);
|
||||
#ifdef XFT
|
||||
fonts[font_count].font_alpha = 0xffff;
|
||||
ctx->fonts[ctx->font_count].font_alpha = 0xffff;
|
||||
#endif
|
||||
} else {
|
||||
CRIT_ERR(NULL, NULL, "Oops...looks like something overflowed in add_font().");
|
||||
}
|
||||
return font_count;
|
||||
return ctx->font_count;
|
||||
}
|
||||
|
||||
void set_first_font(const char *data_in)
|
||||
void set_first_font(conky_context *ctx, const char *data_in)
|
||||
{
|
||||
if ((output_methods & TO_X) == 0) {
|
||||
return;
|
||||
}
|
||||
if (font_count < 0) {
|
||||
if ((fonts = (struct font_list *) malloc(sizeof(struct font_list)))
|
||||
if (ctx->font_count < 0) {
|
||||
if ((ctx->fonts = (struct font_list *) malloc(sizeof(struct font_list)))
|
||||
== NULL) {
|
||||
CRIT_ERR(NULL, NULL, "malloc");
|
||||
}
|
||||
memset(fonts, 0, sizeof(struct font_list));
|
||||
font_count++;
|
||||
memset(ctx->fonts, 0, sizeof(struct font_list));
|
||||
ctx->font_count++;
|
||||
}
|
||||
if (strlen(data_in) > 1) {
|
||||
strncpy(fonts[0].name, data_in, DEFAULT_TEXT_BUFFER_SIZE);
|
||||
strncpy(ctx->fonts[0].name, data_in, DEFAULT_TEXT_BUFFER_SIZE);
|
||||
#ifdef XFT
|
||||
fonts[0].font_alpha = 0xffff;
|
||||
ctx->fonts[0].font_alpha = 0xffff;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void free_fonts(void)
|
||||
void free_fonts(conky_context *ctx)
|
||||
{
|
||||
int i;
|
||||
|
||||
if ((output_methods & TO_X) == 0) {
|
||||
return;
|
||||
}
|
||||
if(fontloaded == 0) {
|
||||
free(fonts);
|
||||
if(ctx->fontloaded == 0) {
|
||||
free(ctx->fonts);
|
||||
return;
|
||||
}
|
||||
for (i = 0; i <= font_count; i++) {
|
||||
for (i = 0; i <= ctx->font_count; i++) {
|
||||
#ifdef XFT
|
||||
if (use_xft) {
|
||||
XftFontClose(display, fonts[i].xftfont);
|
||||
fonts[i].xftfont = 0;
|
||||
if (use_xft->ctx) {
|
||||
XftFontClose(display, ctx->fonts[i].xftfont);
|
||||
ctx->fonts[i].xftfont = 0;
|
||||
} else
|
||||
#endif /* XFT */
|
||||
{
|
||||
XFreeFont(display, fonts[i].font);
|
||||
fonts[i].font = 0;
|
||||
XFreeFont(display, ctx->fonts[i].font);
|
||||
ctx->fonts[i].font = 0;
|
||||
}
|
||||
}
|
||||
free(fonts);
|
||||
fonts = 0;
|
||||
font_count = -1;
|
||||
free(ctx->fonts);
|
||||
ctx->fonts = 0;
|
||||
ctx->font_count = -1;
|
||||
selected_font = 0;
|
||||
#ifdef XFT
|
||||
if (window.xftdraw) {
|
||||
@ -157,47 +152,47 @@ void free_fonts(void)
|
||||
#endif /* XFT */
|
||||
}
|
||||
|
||||
void load_fonts(void)
|
||||
void load_fonts(conky_context *ctx)
|
||||
{
|
||||
int i;
|
||||
|
||||
if ((output_methods & TO_X) == 0)
|
||||
return;
|
||||
for (i = 0; i <= font_count; i++) {
|
||||
for (i = 0; i <= ctx->font_count; i++) {
|
||||
#ifdef XFT
|
||||
/* load Xft font */
|
||||
if (use_xft && fonts[i].xftfont) {
|
||||
if (use_xft->ctx && ctx->fonts[i].xftfont) {
|
||||
continue;
|
||||
} else if (use_xft) {
|
||||
fonts[i].xftfont = XftFontOpenName(display, screen,
|
||||
fonts[i].name);
|
||||
if (fonts[i].xftfont) {
|
||||
} else if (use_xft->ctx) {
|
||||
ctx->fonts[i].xftfont = XftFontOpenName(display, screen,
|
||||
ctx->fonts[i].name);
|
||||
if (ctx->fonts[i].xftfont) {
|
||||
continue;
|
||||
}
|
||||
|
||||
NORM_ERR("can't load Xft font '%s'", fonts[i].name);
|
||||
if ((fonts[i].xftfont = XftFontOpenName(display, screen,
|
||||
NORM_ERR("can't load Xft font '%s'", ctx->fonts[i].name);
|
||||
if ((ctx->fonts[i].xftfont = XftFontOpenName(display, screen,
|
||||
"courier-12")) != NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
NORM_ERR("can't load Xft font '%s'", "courier-12");
|
||||
|
||||
if ((fonts[i].font = XLoadQueryFont(display, "fixed")) == NULL) {
|
||||
if ((ctx->fonts[i].font = XLoadQueryFont(display, "fixed")) == NULL) {
|
||||
CRIT_ERR(NULL, NULL, "can't load font '%s'", "fixed");
|
||||
}
|
||||
use_xft = 0;
|
||||
use_xft->ctx = 0;
|
||||
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
/* load normal font */
|
||||
if (!fonts[i].font && (fonts[i].font = XLoadQueryFont(display, fonts[i].name)) == NULL) {
|
||||
NORM_ERR("can't load font '%s'", fonts[i].name);
|
||||
if ((fonts[i].font = XLoadQueryFont(display, "fixed")) == NULL) {
|
||||
if (!ctx->fonts[i].font && (ctx->fonts[i].font = XLoadQueryFont(display, ctx->fonts[i].name)) == NULL) {
|
||||
NORM_ERR("can't load font '%s'", ctx->fonts[i].name);
|
||||
if ((ctx->fonts[i].font = XLoadQueryFont(display, "fixed")) == NULL) {
|
||||
CRIT_ERR(NULL, NULL, "can't load font '%s'", "fixed");
|
||||
}
|
||||
}
|
||||
}
|
||||
fontloaded = 1;
|
||||
ctx->fontloaded = 1;
|
||||
}
|
||||
|
36
src/fonts.h
36
src/fonts.h
@ -34,33 +34,33 @@
|
||||
|
||||
#ifdef XFT
|
||||
|
||||
#define font_height() (use_xft ? (fonts[ctx->selected_font].xftfont->ascent + \
|
||||
fonts[ctx->selected_font].xftfont->descent) \
|
||||
: (fonts[ctx->selected_font].font->max_bounds.ascent + \
|
||||
fonts[ctx->selected_font].font->max_bounds.descent))
|
||||
#define font_ascent() (use_xft ? fonts[ctx->selected_font].xftfont->ascent \
|
||||
: fonts[ctx->selected_font].font->max_bounds.ascent)
|
||||
#define font_descent() (use_xft ? fonts[ctx->selected_font].xftfont->descent \
|
||||
: fonts[ctx->selected_font].font->max_bounds.descent)
|
||||
#define font_height() (use_xft ? (ctx->fonts[ctx->selected_font].xftfont->ascent + \
|
||||
ctx->fonts[ctx->selected_font].xftfont->descent) \
|
||||
: (ctx->fonts[ctx->selected_font].font->max_bounds.ascent + \
|
||||
ctx->fonts[ctx->selected_font].font->max_bounds.descent))
|
||||
#define font_ascent() (use_xft ? ctx->fonts[ctx->selected_font].xftfont->ascent \
|
||||
: ctx->fonts[ctx->selected_font].font->max_bounds.ascent)
|
||||
#define font_descent() (use_xft ? ctx->fonts[ctx->selected_font].xftfont->descent \
|
||||
: ctx->fonts[ctx->selected_font].font->max_bounds.descent)
|
||||
|
||||
#else
|
||||
|
||||
#define font_height() (fonts[ctx->selected_font].font->max_bounds.ascent + \
|
||||
fonts[ctx->selected_font].font->max_bounds.descent)
|
||||
#define font_ascent() fonts[ctx->selected_font].font->max_bounds.ascent
|
||||
#define font_descent() fonts[ctx->selected_font].font->max_bounds.descent
|
||||
#define font_height() (ctx->fonts[ctx->selected_font].font->max_bounds.ascent + \
|
||||
ctx->fonts[ctx->selected_font].font->max_bounds.descent)
|
||||
#define font_ascent() ctx->fonts[ctx->selected_font].font->max_bounds.ascent
|
||||
#define font_descent() ctx->fonts[ctx->selected_font].font->max_bounds.descent
|
||||
|
||||
#endif
|
||||
|
||||
#define MAX_FONTS 256
|
||||
|
||||
|
||||
void setup_fonts(void);
|
||||
void set_font(void);
|
||||
int add_font(const char *);
|
||||
void set_first_font(const char *);
|
||||
void free_fonts(void);
|
||||
void load_fonts(void);
|
||||
void setup_fonts(conky_context *ctx);
|
||||
void set_font(conky_context *ctx);
|
||||
int add_font(conky_context *ctx, const char *);
|
||||
void set_first_font(conky_context *ctx, const char *);
|
||||
void free_fonts(conky_context *ctx);
|
||||
void load_fonts(conky_context *ctx);
|
||||
|
||||
#endif /* _FONTS_H */
|
||||
#endif /* X11 */
|
||||
|
@ -27,8 +27,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
void clean_up(void *memtofree1, void* memtofree2);
|
||||
|
||||
#ifndef _LOGGING_H
|
||||
#define _LOGGING_H
|
||||
|
||||
@ -39,8 +37,8 @@ void clean_up(void *memtofree1, void* memtofree2);
|
||||
}
|
||||
|
||||
/* critical error */
|
||||
#define CRIT_ERR(memtofree1, memtofree2, ...) \
|
||||
{ NORM_ERR(__VA_ARGS__); clean_up(memtofree1, memtofree2); exit(EXIT_FAILURE); }
|
||||
#define CRIT_ERR(ctx, memtofree1, memtofree2, ...) \
|
||||
{ NORM_ERR(__VA_ARGS__); clean_up(ctx, memtofree1, memtofree2); exit(EXIT_FAILURE); }
|
||||
|
||||
/* debugging output */
|
||||
extern int global_debug_level;
|
||||
|
@ -41,8 +41,6 @@ size_t remove_comments(char *string);
|
||||
|
||||
int extract_variable_text_internal(struct text_object *retval, const char *const_p);
|
||||
|
||||
void free_text_objects(struct text_object *root, int internal);
|
||||
|
||||
#ifdef X11
|
||||
void scan_mixer_bar(const char *arg, int *a, int *w, int *h);
|
||||
#endif /* X11 */
|
||||
|
@ -275,10 +275,57 @@ void evaluate(const char *text, char *buffer)
|
||||
free(tmp_info);
|
||||
}
|
||||
|
||||
void generate_text_internal(char *p, int p_max_size, struct text_object root,
|
||||
struct information *cur)
|
||||
static struct mail_s *ensure_mail_thread(conky_context *ctx, struct text_object *obj,
|
||||
void *thread(void *), const char *text)
|
||||
{
|
||||
if (obj->char_b && ctx->info.mail) {
|
||||
/* this means we use ctx->info */
|
||||
if (!ctx->info.mail->p_timed_thread) {
|
||||
ctx->info.mail->p_timed_thread =
|
||||
timed_thread_create(thread,
|
||||
(void *) ctx->info.mail, ctx->info.mail->interval * 1000000);
|
||||
if (!ctx->info.mail->p_timed_thread) {
|
||||
NORM_ERR("Error creating %s timed thread", text);
|
||||
}
|
||||
timed_thread_register(ctx->info.mail->p_timed_thread,
|
||||
&ctx->info.mail->p_timed_thread);
|
||||
if (timed_thread_run(ctx->info.mail->p_timed_thread)) {
|
||||
NORM_ERR("Error running %s timed thread", text);
|
||||
}
|
||||
}
|
||||
return ctx->info.mail;
|
||||
} else if (obj->data.mail) {
|
||||
// this means we use obj
|
||||
if (!obj->data.mail->p_timed_thread) {
|
||||
obj->data.mail->p_timed_thread =
|
||||
timed_thread_create(thread,
|
||||
(void *) obj->data.mail,
|
||||
obj->data.mail->interval * 1000000);
|
||||
if (!obj->data.mail->p_timed_thread) {
|
||||
NORM_ERR("Error creating %s timed thread", text);
|
||||
}
|
||||
timed_thread_register(obj->data.mail->p_timed_thread,
|
||||
&obj->data.mail->p_timed_thread);
|
||||
if (timed_thread_run(obj->data.mail->p_timed_thread)) {
|
||||
NORM_ERR("Error running %s timed thread", text);
|
||||
}
|
||||
}
|
||||
return obj->data.mail;
|
||||
} else if (!obj->a) {
|
||||
// something is wrong, warn once then stop
|
||||
NORM_ERR("There's a problem with your mail settings. "
|
||||
"Check that the global mail settings are properly defined"
|
||||
" (line %li).", obj->line);
|
||||
obj->a++;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void generate_text_internal(conky_context *ctx, char *p, int p_max_size, struct
|
||||
text_object root)
|
||||
{
|
||||
struct text_object *obj;
|
||||
struct information *cur = &ctx->info;
|
||||
#ifdef X11
|
||||
int need_to_load_fonts = 0;
|
||||
#endif /* X11 */
|
||||
@ -1011,7 +1058,7 @@ void generate_text_internal(char *p, int p_max_size, struct text_object root,
|
||||
}
|
||||
}
|
||||
OBJ(imap_unseen) {
|
||||
struct mail_s *mail = ensure_mail_thread(obj, imap_thread, "imap");
|
||||
struct mail_s *mail = ensure_mail_thread(ctx, obj, imap_thread, "imap");
|
||||
|
||||
if (mail && mail->p_timed_thread) {
|
||||
timed_thread_lock(mail->p_timed_thread);
|
||||
@ -1020,7 +1067,7 @@ void generate_text_internal(char *p, int p_max_size, struct text_object root,
|
||||
}
|
||||
}
|
||||
OBJ(imap_messages) {
|
||||
struct mail_s *mail = ensure_mail_thread(obj, imap_thread, "imap");
|
||||
struct mail_s *mail = ensure_mail_thread(ctx, obj, imap_thread, "imap");
|
||||
|
||||
if (mail && mail->p_timed_thread) {
|
||||
timed_thread_lock(mail->p_timed_thread);
|
||||
@ -1029,7 +1076,7 @@ void generate_text_internal(char *p, int p_max_size, struct text_object root,
|
||||
}
|
||||
}
|
||||
OBJ(pop3_unseen) {
|
||||
struct mail_s *mail = ensure_mail_thread(obj, pop3_thread, "pop3");
|
||||
struct mail_s *mail = ensure_mail_thread(ctx, obj, pop3_thread, "pop3");
|
||||
|
||||
if (mail && mail->p_timed_thread) {
|
||||
timed_thread_lock(mail->p_timed_thread);
|
||||
@ -1038,7 +1085,7 @@ void generate_text_internal(char *p, int p_max_size, struct text_object root,
|
||||
}
|
||||
}
|
||||
OBJ(pop3_used) {
|
||||
struct mail_s *mail = ensure_mail_thread(obj, pop3_thread, "pop3");
|
||||
struct mail_s *mail = ensure_mail_thread(ctx, obj, pop3_thread, "pop3");
|
||||
|
||||
if (mail && mail->p_timed_thread) {
|
||||
timed_thread_lock(mail->p_timed_thread);
|
||||
|
@ -35,7 +35,7 @@
|
||||
#include "conky.h"
|
||||
#include "text_object.h"
|
||||
|
||||
void generate_text_internal(char *p, int p_max_size, struct text_object root,
|
||||
struct information *cur);
|
||||
void generate_text_internal(conky_context *ctx, char *p, int p_max_size, struct
|
||||
text_object root);
|
||||
|
||||
#endif /* _CONKY_OBJ_DISPLAY_H_ */
|
||||
|
@ -318,7 +318,6 @@ typedef struct _conky_context_s {
|
||||
short colour_depth;
|
||||
long redmask, greenmask, bluemask;
|
||||
|
||||
|
||||
struct font_list *fonts;
|
||||
int font_count;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user