mirror of
https://github.com/brl/mutter.git
synced 2025-01-03 08:12:15 +00:00
2006-09-15 Matthew Allum <mallum@openedhand.com>
More fixes from Bastien Nocera (#155): * clutter/clutter-main.c: (clutter_init): * clutter/clutter-main.h: Add an enum for clutter init to return an error code. * configure.ac: Dont check for XInitThreads, there is no need, its part of xlib.
This commit is contained in:
parent
164367e547
commit
55c723b9a2
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
|||||||
|
2006-09-15 Matthew Allum <mallum@openedhand.com>
|
||||||
|
|
||||||
|
More fixes from Bastien Nocera (#155):
|
||||||
|
|
||||||
|
* clutter/clutter-main.c: (clutter_init):
|
||||||
|
* clutter/clutter-main.h:
|
||||||
|
Add an enum for clutter init to return an error code.
|
||||||
|
* configure.ac:
|
||||||
|
Dont check for XInitThreads, there is no need, its part of xlib.
|
||||||
|
|
||||||
2006-09-14 Matthew Allum <mallum@openedhand.com>
|
2006-09-14 Matthew Allum <mallum@openedhand.com>
|
||||||
|
|
||||||
Various fixes from Bastien Nocera:
|
Various fixes from Bastien Nocera:
|
||||||
|
@ -525,14 +525,14 @@ is_gl_version_at_least_12 (void)
|
|||||||
*
|
*
|
||||||
* Return value: 1 on success, < 0 on failure.
|
* Return value: 1 on success, < 0 on failure.
|
||||||
*/
|
*/
|
||||||
int
|
ClutterInitError
|
||||||
clutter_init (int *argc, char ***argv)
|
clutter_init (int *argc, char ***argv)
|
||||||
{
|
{
|
||||||
ClutterMainContext *context;
|
ClutterMainContext *context;
|
||||||
static gboolean is_initialized = FALSE;
|
static gboolean is_initialized = FALSE;
|
||||||
|
|
||||||
if (is_initialized)
|
if (is_initialized)
|
||||||
return 1;
|
return CLUTTER_INIT_SUCCESS;
|
||||||
|
|
||||||
context = clutter_context_get_default ();
|
context = clutter_context_get_default ();
|
||||||
|
|
||||||
@ -547,7 +547,8 @@ clutter_init (int *argc, char ***argv)
|
|||||||
if (!g_thread_supported ())
|
if (!g_thread_supported ())
|
||||||
g_thread_init (NULL);
|
g_thread_init (NULL);
|
||||||
|
|
||||||
XInitThreads();
|
if (!XInitThreads())
|
||||||
|
return CLUTTER_INIT_ERROR_THREADS;
|
||||||
|
|
||||||
context->main_loops = NULL;
|
context->main_loops = NULL;
|
||||||
context->main_loop_level = 0;
|
context->main_loop_level = 0;
|
||||||
@ -555,7 +556,7 @@ clutter_init (int *argc, char ***argv)
|
|||||||
if ((context->xdpy = XOpenDisplay (g_getenv ("DISPLAY"))) == NULL)
|
if ((context->xdpy = XOpenDisplay (g_getenv ("DISPLAY"))) == NULL)
|
||||||
{
|
{
|
||||||
g_critical ("Unable to connect to X DISPLAY.");
|
g_critical ("Unable to connect to X DISPLAY.");
|
||||||
return -1;
|
return CLUTTER_INIT_ERROR_DISPLAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
context->xscreen = DefaultScreen(context->xdpy);
|
context->xscreen = DefaultScreen(context->xdpy);
|
||||||
@ -575,10 +576,12 @@ clutter_init (int *argc, char ***argv)
|
|||||||
clutter_actor_realize (CLUTTER_ACTOR (context->stage));
|
clutter_actor_realize (CLUTTER_ACTOR (context->stage));
|
||||||
|
|
||||||
g_return_val_if_fail
|
g_return_val_if_fail
|
||||||
(CLUTTER_ACTOR_IS_REALIZED(CLUTTER_ACTOR(context->stage)), -4);
|
(CLUTTER_ACTOR_IS_REALIZED(CLUTTER_ACTOR(context->stage)),
|
||||||
|
CLUTTER_INIT_ERROR_INTERNAL);
|
||||||
|
|
||||||
/* At least GL 1.2 is needed for CLAMP_TO_EDGE */
|
/* At least GL 1.2 is needed for CLAMP_TO_EDGE */
|
||||||
g_return_val_if_fail(is_gl_version_at_least_12 (), -5);
|
g_return_val_if_fail(is_gl_version_at_least_12 (),
|
||||||
|
CLUTTER_INIT_ERROR_OPENGL);
|
||||||
|
|
||||||
/* Check available features */
|
/* Check available features */
|
||||||
clutter_feature_init ();
|
clutter_feature_init ();
|
||||||
|
@ -61,7 +61,16 @@ G_BEGIN_DECLS
|
|||||||
|
|
||||||
#define CLUTTER_MARK() CLUTTER_DBG("mark")
|
#define CLUTTER_MARK() CLUTTER_DBG("mark")
|
||||||
|
|
||||||
int
|
typedef enum {
|
||||||
|
CLUTTER_INIT_SUCCESS = 1,
|
||||||
|
CLUTTER_INIT_ERROR_UNKOWN = 0,
|
||||||
|
CLUTTER_INIT_ERROR_THREADS = -1,
|
||||||
|
CLUTTER_INIT_ERROR_DISPLAY = -2,
|
||||||
|
CLUTTER_INIT_ERROR_INTERNAL = -3,
|
||||||
|
CLUTTER_INIT_ERROR_OPENGL = -4
|
||||||
|
} ClutterInitError;
|
||||||
|
|
||||||
|
ClutterInitError
|
||||||
clutter_init (int *argc, char ***argv);
|
clutter_init (int *argc, char ***argv);
|
||||||
|
|
||||||
void
|
void
|
||||||
|
19
configure.ac
19
configure.ac
@ -66,25 +66,6 @@ then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# FIXME: Needed ?
|
|
||||||
AC_MSG_CHECKING([for XTHREADS in Xlib])
|
|
||||||
|
|
||||||
AC_RUN_IFELSE(
|
|
||||||
[AC_LANG_PROGRAM([[#include <X11/Xlib.h>]],
|
|
||||||
[[return XInitThreads() == 0 ? 0 : 1;]])],
|
|
||||||
[xthreads=no],
|
|
||||||
[xthreads=yes],
|
|
||||||
[xthreads=yes])
|
|
||||||
|
|
||||||
AC_MSG_RESULT($xthreads)
|
|
||||||
|
|
||||||
if test "x$xthreads" = "xyes"
|
|
||||||
then
|
|
||||||
X11_LIBS="$X11_LIBS -lpthread"
|
|
||||||
AC_DEFINE([XTHREADS], [], [1])
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_CHECK_HEADERS([GL/gl.h GL/glx.h],,
|
AC_CHECK_HEADERS([GL/gl.h GL/glx.h],,
|
||||||
[AC_MSG_ERROR([Unable to locate required GL headers])])
|
[AC_MSG_ERROR([Unable to locate required GL headers])])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user