From 73ff6900d0e1d914d858c8ff5d6e3096c85f76a5 Mon Sep 17 00:00:00 2001 From: Matthew Allum Date: Wed, 25 Jul 2007 22:09:53 +0000 Subject: [PATCH] 2007-07-25 Matthew Allum * 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. --- ChangeLog | 16 ++++++++++ HACKING | 15 ++++++++++ Makefile.am | 2 +- clutter/clutter-behaviour-scale.c | 4 +-- clutter/clutter-event.c | 24 +++++++++++---- clutter/glx/clutter-stage-glx.c | 49 +++++++++++++++++++++++++------ 6 files changed, 92 insertions(+), 18 deletions(-) create mode 100644 HACKING diff --git a/ChangeLog b/ChangeLog index 716076d58..d333a1f7b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2007-07-25 Matthew Allum + + * 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 * clutter/clutter-fixed.c: diff --git a/HACKING b/HACKING new file mode 100644 index 000000000..effcc4b7a --- /dev/null +++ b/HACKING @@ -0,0 +1,15 @@ +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) + diff --git a/Makefile.am b/Makefile.am index d228676c6..bb2bc72eb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -18,7 +18,7 @@ uninstall-local: rm -f $(DESTDIR)$(pkgconfigdir)/clutter-@CLUTTER_MAJORMINOR@.pc -EXTRA_DIST = clutter.pc.in +EXTRA_DIST = clutter.pc.in HACKING CLEANFILES = $(pcfiles) diff --git a/clutter/clutter-behaviour-scale.c b/clutter/clutter-behaviour-scale.c index b94d386c6..b16cc24f0 100644 --- a/clutter/clutter-behaviour-scale.c +++ b/clutter/clutter-behaviour-scale.c @@ -232,7 +232,7 @@ clutter_behaviour_scale_init (ClutterBehaviourScale *self) * @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. * @@ -259,7 +259,7 @@ clutter_behaviour_scale_new (ClutterAlpha *alpha, * @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() * diff --git a/clutter/clutter-event.c b/clutter/clutter-event.c index 90162e7cb..cc398bbaf 100644 --- a/clutter/clutter-event.c +++ b/clutter/clutter-event.c @@ -374,13 +374,14 @@ clutter_event_free (ClutterEvent *event) /** * 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 (); @@ -391,9 +392,10 @@ clutter_event_get (void) /** * 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 */ @@ -414,7 +416,7 @@ clutter_event_peek (void) * clutter_event_put: * @event: a #ClutterEvent * - * FIXME + * Puts a copy of the event on the back on the event queue. * * Since: 0.4 */ @@ -429,6 +431,16 @@ clutter_event_put (ClutterEvent *event) 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) { diff --git a/clutter/glx/clutter-stage-glx.c b/clutter/glx/clutter-stage-glx.c index ea518c80e..0b7f9ebd6 100644 --- a/clutter/glx/clutter-stage-glx.c +++ b/clutter/glx/clutter-stage-glx.c @@ -50,6 +50,28 @@ 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) { @@ -215,6 +237,9 @@ clutter_stage_glx_realize (ClutterActor *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) @@ -370,11 +395,15 @@ clutter_stage_glx_request_coords (ClutterActor *self, 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 */ @@ -390,6 +419,8 @@ clutter_stage_glx_request_coords (ClutterActor *self, stage_glx->xwin, CLUTTER_UNITS_TO_INT (box->x1), CLUTTER_UNITS_TO_INT (box->y1)); + + } static void @@ -408,7 +439,7 @@ clutter_stage_glx_set_fullscreen (ClutterStage *stage, { 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); @@ -645,9 +676,9 @@ clutter_stage_glx_init (ClutterStageGLX *stage) * 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 */ @@ -663,9 +694,9 @@ clutter_glx_get_stage_window (ClutterStage *stage) * 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 */