+2007-07-25 Matthew Allum <mallum@openedhand.com>
+
+ * Makefile.am:
+ * HACKING:
+ Add with initial notes on coding bits and bobs.
+
+ * clutter/clutter-behaviour-scale.c:
+ Doc fixes.
+
+ * clutter/clutter-event.c: (clutter_event_put):
+ Doc fixes.
+
+ * clutter/glx/clutter-stage-glx.c:
+ Disable wm user resizing of stage (At least for now)
+ Doc fixes.
+
2007-07-25 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-fixed.c:
--- /dev/null
+General notes and rules on clutter core hacking;
+
+ - GNU style indentation, please wrap at 80 chars.
+
+ - All public functions with float parameters should also provide a fixed
+ point version.
+
+ - Propertys should always be float (never fixed).
+
+ - API funcs should always use g_return_*
+
+ - Really try to avoid if possible additions to clutter-private.h
+
+ - Dont add direct GL calls but wrap with cogl (also adding GL ES Version)
+
* @alpha: a #ClutterAlpha
* @scale_begin: initial scale factor
* @scale_end: final scale factor
- * @gravity: FIXME: Not currently implemented
+ * @gravity: a #ClutterGravity for the scale.
*
* Creates a new #ClutterBehaviourScale instance.
*
* @alpha: a #ClutterAlpha
* @scale_begin: initial scale factor
* @scale_end: final scale factor
- * @gravity: FIXME: Not currently implemented
+ * @gravity: a #ClutterGravity for the scale.
*
* A fixed point implementation of clutter_behaviour_scale_new()
*
/**
* clutter_event_get:
*
- * FIXME
+ * Pops an event off the event queue. Applications should not need to call
+ * this.
*
- * Return value: FIXME
+ * Return value: A #ClutterEvent or NULL if queue empty
*
* Since: 0.4
*/
-ClutterEvent *
+ClutterEvent*
clutter_event_get (void)
{
ClutterMainContext *context = clutter_context_get_default ();
/**
* clutter_event_peek:
*
- * FIXME
+ * Returns a pointer to the first event from the event queue but
+ * does not remove it.
*
- * Return value: FIXME
+ * Return value: A #ClutterEvent or NULL if queue empty.
*
* Since: 0.4
*/
* clutter_event_put:
* @event: a #ClutterEvent
*
- * FIXME
+ * Puts a copy of the event on the back on the event queue.
*
* Since: 0.4
*/
g_queue_push_head (context->events_queue, clutter_event_copy (event));
}
+/**
+ * clutter_events_pending:
+ * @event: a #ClutterEvent
+ *
+ * Checks if events are pending in the event queue.
+ *
+ * Return value: TRUE if there are pending events, FALSE otherwise.
+ *
+ * Since: 0.4
+ */
gboolean
clutter_events_pending (void)
{
G_DEFINE_TYPE (ClutterStageGLX, clutter_stage_glx, CLUTTER_TYPE_STAGE);
static void
+fix_window_size (ClutterStageGLX *stage_glx)
+{
+ /* Dont allow window to be user resize-able.
+ * FIXME: This needs to be bound to a boolean prop.
+ */
+ if (stage_glx->xwin != None && stage_glx->is_foreign_xwin == FALSE)
+ {
+ XSizeHints *size_hints;
+
+ size_hints = XAllocSizeHints();
+
+ size_hints->max_width = size_hints->min_width = stage_glx->xwin_width;
+ size_hints->max_height = size_hints->min_height = stage_glx->xwin_height;
+ size_hints->flags = PMinSize|PMaxSize;
+
+ XSetWMNormalHints (stage_glx->xdpy, stage_glx->xwin, size_hints);
+
+ XFree(size_hints);
+ }
+}
+
+static void
clutter_stage_glx_show (ClutterActor *actor)
{
ClutterStageGLX *stage_glx = CLUTTER_STAGE_GLX (actor);
ButtonPressMask | ButtonReleaseMask |
PropertyChangeMask);
+ /* no user resize.. */
+ fix_window_size (stage_glx);
+
set_wm_protocols (stage_glx->xdpy, stage_glx->xwin);
if (stage_glx->gl_context)
stage_glx->xwin_height = new_height;
if (stage_glx->xwin != None)
- XResizeWindow (stage_glx->xdpy,
- stage_glx->xwin,
- stage_glx->xwin_width,
- stage_glx->xwin_height);
+ {
+ XResizeWindow (stage_glx->xdpy,
+ stage_glx->xwin,
+ stage_glx->xwin_width,
+ stage_glx->xwin_height);
+ fix_window_size (stage_glx);
+ }
+
if (stage_glx->xpixmap != None)
{
/* Need to recreate to resize */
stage_glx->xwin,
CLUTTER_UNITS_TO_INT (box->x1),
CLUTTER_UNITS_TO_INT (box->y1));
+
+
}
static void
{
gint width, height;
- width = DisplayWidth (stage_glx->xdpy, stage_glx->xscreen);
+ width = DisplayWidth (stage_glx->xdpy, stage_glx->xscreen);
height = DisplayHeight (stage_glx->xdpy, stage_glx->xscreen);
clutter_actor_set_size (CLUTTER_ACTOR (stage_glx), width, height);
* clutter_glx_get_stage_window:
* @stage: a #ClutterStage
*
- * FIXME
+ * Gets the stages X Window.
*
- * Return value: FIXME
+ * Return value: An XID for the stage window.
*
* Since: 0.4
*/
* clutter_glx_get_stage_visual:
* @stage: a #ClutterStage
*
- * FIXME
+ * Returns the stage XVisualInfo
*
- * Return value: FIXME
+ * Return value: The XVisualInfo for the stage.
*
* Since: 0.4
*/