panel-message: allow building without X11
This commit is contained in:
parent
f7534105d0
commit
71680bb5f3
|
@ -22,12 +22,16 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#include <libintl.h>
|
#include <libintl.h>
|
||||||
|
#include <System/error.h>
|
||||||
#include <Desktop.h>
|
#include <Desktop.h>
|
||||||
#if GTK_CHECK_VERSION(3, 0, 0)
|
#if defined(GDK_WINDOWING_X11)
|
||||||
|
# if GTK_CHECK_VERSION(3, 0, 0)
|
||||||
# include <gtk/gtkx.h>
|
# include <gtk/gtkx.h>
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#include "../include/Panel.h"
|
#include "../include/Panel.h"
|
||||||
#include "../config.h"
|
#include "../config.h"
|
||||||
|
|
||||||
#define _(string) gettext(string)
|
#define _(string) gettext(string)
|
||||||
|
|
||||||
/* constants */
|
/* constants */
|
||||||
|
@ -50,8 +54,10 @@
|
||||||
static int _message(unsigned int timeout, char const * stock,
|
static int _message(unsigned int timeout, char const * stock,
|
||||||
char const * title, char const * message);
|
char const * title, char const * message);
|
||||||
|
|
||||||
|
#if defined(GDK_WINDOWING_X11)
|
||||||
/* callbacks */
|
/* callbacks */
|
||||||
static gboolean _message_on_timeout(gpointer data);
|
static gboolean _message_on_timeout(gpointer data);
|
||||||
|
#endif
|
||||||
|
|
||||||
static int _error(char const * message, int ret);
|
static int _error(char const * message, int ret);
|
||||||
static int _usage(void);
|
static int _usage(void);
|
||||||
|
@ -62,6 +68,7 @@ static int _usage(void);
|
||||||
static int _message(unsigned int timeout, char const * stock,
|
static int _message(unsigned int timeout, char const * stock,
|
||||||
char const * title, char const * message)
|
char const * title, char const * message)
|
||||||
{
|
{
|
||||||
|
#if defined(GDK_WINDOWING_X11)
|
||||||
PangoFontDescription * bold;
|
PangoFontDescription * bold;
|
||||||
GtkWidget * plug;
|
GtkWidget * plug;
|
||||||
GtkWidget * hbox;
|
GtkWidget * hbox;
|
||||||
|
@ -136,9 +143,19 @@ static int _message(unsigned int timeout, char const * stock,
|
||||||
pango_font_description_free(bold);
|
pango_font_description_free(bold);
|
||||||
gtk_main();
|
gtk_main();
|
||||||
return 0;
|
return 0;
|
||||||
|
#else
|
||||||
|
(void) timeout;
|
||||||
|
(void) stock;
|
||||||
|
(void) title;
|
||||||
|
(void) message;
|
||||||
|
|
||||||
|
return error_set_print(PROGNAME_PANEL_MESSAGE, 2, "%s",
|
||||||
|
"X11 support not detected");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(GDK_WINDOWING_X11)
|
||||||
/* callbacks */
|
/* callbacks */
|
||||||
/* message_on_timeout */
|
/* message_on_timeout */
|
||||||
static gboolean _message_on_timeout(gpointer data)
|
static gboolean _message_on_timeout(gpointer data)
|
||||||
|
@ -148,6 +165,7 @@ static gboolean _message_on_timeout(gpointer data)
|
||||||
gtk_main_quit();
|
gtk_main_quit();
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* error */
|
/* error */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user