static void st_background_effect_paint_target (ClutterOffscreenEffect *effect) { StBackgroundEffect *self = ST_BACKGROUND_EFFECT (effect); if ((self->bg_texture != NULL) && (self->opacity == 0xff)) { cogl_push_source (self->pipeline2); cogl_rectangle (0.0f, 0.0f, (self->fg_width_i), (self->fg_height_i)); cogl_pop_source (); CoglOffscreen *vertical_FBO; vertical_FBO = cogl_offscreen_new_to_texture (self->bg_sub_texture); cogl_push_framebuffer ((CoglFramebuffer*)vertical_FBO); cogl_push_source (self->pipeline0); cogl_rectangle (-1.0f, 1.0f, 1.0f, -1.0f); cogl_pop_source (); cogl_pop_framebuffer (); cogl_handle_unref (vertical_FBO); cogl_pipeline_set_layer_texture (self->pipeline1, 0, self->bg_sub_texture); cogl_push_source (self->pipeline1); cogl_rectangle (4.0f, 4.0f, (self->bg_width_i) + 4.0f, (self->bg_height_i) + 4.0f); cogl_pop_source (); } cogl_pipeline_set_color4ub (self->pipeline3, 0x00, 0x00, 0x00, 0x80); cogl_push_source (self->pipeline3); cogl_rectangle (0.0f, 0.0f, (self->fg_width_i), (self->fg_height_i)); cogl_pop_source (); clutter_actor_queue_redraw (self->actor); cogl_pipeline_set_color4ub (self->pipeline4, self->opacity, self->opacity, self->opacity, self->opacity); cogl_push_source (self->pipeline4); cogl_rectangle (0.0f, 0.0f, (self->fg_width_i), (self->fg_height_i)); cogl_pop_source (); clutter_actor_queue_redraw (self->actor); }
static gboolean fps_queue_redraw () { clutter_actor_queue_redraw (CLUTTER_ACTOR (mex_get_stage ())); return TRUE; }
/** * shell_recorder_close: * @recorder: the #ShellRecorder * * Stops recording. It's possible to call shell_recorder_record() * again to reopen a new recording stream, but unless change the * recording filename, this may result in the old recording being * overwritten. */ void shell_recorder_close (ShellRecorder *recorder) { g_return_if_fail (SHELL_IS_RECORDER (recorder)); g_return_if_fail (recorder->state != RECORDER_STATE_CLOSED); /* We want to record one more frame since some time may have * elapsed since the last frame */ recorder_record_frame (recorder, TRUE); recorder_remove_update_pointer_timeout (recorder); recorder_close_pipeline (recorder); /* Queue a redraw to remove the recording indicator */ clutter_actor_queue_redraw (CLUTTER_ACTOR (recorder->stage)); if (recorder->repaint_hook_id != 0) { clutter_threads_remove_repaint_func (recorder->repaint_hook_id); recorder->repaint_hook_id = 0; } recorder->state = RECORDER_STATE_CLOSED; /* Reenable after the recording */ meta_enable_unredirect_for_screen (shell_global_get_screen (shell_global_get ())); /* Release the refcount we took when we started recording */ g_object_unref (recorder); }
static void champlain_group_real_lower (ClutterContainer *container, ClutterActor *actor, ClutterActor *sibling) { ChamplainGroup *self = CHAMPLAIN_GROUP (container); ChamplainGroupPrivate *priv = self->priv; GList *link; link = g_list_find (priv->children, actor); if (link) { if (link == priv->children_end) priv->children_end = g_list_previous (priv->children_end); priv->children = g_list_delete_link (priv->children, link); } /* Push to bottom */ if (!sibling || !priv->children_end) { priv->children = g_list_prepend (priv->children, actor); if (!priv->children_end) priv->children_end = priv->children; } else { gint index_ = g_list_index (priv->children, sibling); priv->children = g_list_insert (priv->children, actor, index_); } clutter_actor_queue_redraw (CLUTTER_ACTOR (container)); }
static gboolean queue_redraw (gpointer data) { ClutterActor *stage = CLUTTER_ACTOR (data); clutter_actor_queue_redraw (stage); do_events (stage); return TRUE; }
static void champlain_group_real_remove (ClutterContainer *container, ClutterActor *actor) { ChamplainGroupPrivate *priv = CHAMPLAIN_GROUP (container)->priv; GList *link; g_object_ref (actor); link = g_list_find (priv->children, actor); if (link) { if (link == priv->children_end) priv->children_end = g_list_previous (priv->children_end); priv->children = g_list_delete_link (priv->children, link); } clutter_actor_unparent (actor); /* queue a relayout, to get the correct positioning inside * the ::actor-removed signal handlers */ clutter_actor_queue_relayout (CLUTTER_ACTOR (container)); /* at this point, the actor passed to the "actor-removed" signal * handlers is not parented anymore to the container but since we * are holding a reference on it, it's still valid */ g_signal_emit_by_name (container, "actor-removed", actor); clutter_actor_queue_redraw (CLUTTER_ACTOR (container)); g_object_unref (actor); }
static void clutter_group_real_remove (ClutterContainer *container, ClutterActor *actor) { ClutterGroupPrivate *priv = CLUTTER_GROUP (container)->priv; g_object_ref (actor); priv->children = g_list_remove (priv->children, actor); clutter_actor_unparent (actor); /* queue a relayout, to get the correct positioning inside * the ::actor-removed signal handlers */ clutter_actor_queue_relayout (CLUTTER_ACTOR (container)); /* at this point, the actor passed to the "actor-removed" signal * handlers is not parented anymore to the container but since we * are holding a reference on it, it's still valid */ g_signal_emit_by_name (container, "actor-removed", actor); clutter_actor_queue_redraw (CLUTTER_ACTOR (container)); g_object_unref (actor); }
/** * clutter_rectangle_set_border_color: * @rectangle: a #ClutterRectangle * @color: the color of the border * * Sets the color of the border used by @rectangle using @color * * Deprecated: 1.10: Use #ClutterActor and a #ClutterCanvas to draw * the border with Cairo */ void clutter_rectangle_set_border_color (ClutterRectangle *rectangle, const ClutterColor *color) { ClutterRectanglePrivate *priv; g_return_if_fail (CLUTTER_IS_RECTANGLE (rectangle)); g_return_if_fail (color != NULL); priv = rectangle->priv; if (priv->border_color.red != color->red || priv->border_color.green != color->green || priv->border_color.blue != color->blue || priv->border_color.alpha != color->alpha) { g_object_ref (rectangle); priv->border_color.red = color->red; priv->border_color.green = color->green; priv->border_color.blue = color->blue; priv->border_color.alpha = color->alpha; if (clutter_color_equal (&priv->color, &priv->border_color)) priv->has_border = FALSE; else priv->has_border = TRUE; clutter_actor_queue_redraw (CLUTTER_ACTOR (rectangle)); g_object_notify (G_OBJECT (rectangle), "border-color"); g_object_notify (G_OBJECT (rectangle), "has-border"); g_object_unref (rectangle); } }
/** * mx_slider_set_value: * @bar: A #MxSlider * @value: A value between 0.0 and 1.0 * * Set the value of the slider */ void mx_slider_set_value (MxSlider *bar, gdouble value) { MxSliderPrivate *priv = bar->priv; g_return_if_fail (MX_IS_SLIDER (bar)); if (priv->value == value) return; if (G_UNLIKELY ((value < 0.0) || (value > 1.0))) { g_warning ("MxSlider:value must be a number between 0.0 and 1.0"); return; } priv->value = value; if (!priv->capture_handler) { mx_slider_allocate_fill_handle (bar, NULL, 0); clutter_actor_queue_redraw (CLUTTER_ACTOR (bar)); } g_object_notify (G_OBJECT (bar), "value"); }
/* * StScrollable Interface Implementation */ static void adjustment_value_notify_cb (StAdjustment *adjustment, GParamSpec *pspec, StBoxLayout *box) { clutter_actor_queue_redraw (CLUTTER_ACTOR (box)); }
static void drag_handle (MxSlider *bar, gfloat x, gfloat y) { MxSliderPrivate *priv = bar->priv; gdouble value; gfloat ux, pos, handle_width_2, fill_size, offset; if (!clutter_actor_transform_stage_point (CLUTTER_ACTOR (bar), x, y, &ux, NULL)) { return; } fill_size = priv->handle_middle_end - priv->handle_middle_start; /* offset is the difference between the middle of the handle and where one * clicked on it */ handle_width_2 = clutter_actor_get_width (priv->handle) / 2; offset = handle_width_2 - priv->x_origin; pos = ux - priv->handle_middle_start + offset; pos = CLAMP (pos, 0, fill_size); value = pos / fill_size; mx_slider_set_value (bar, value); /* update the handle position */ mx_slider_allocate_fill_handle (bar, NULL, 0); clutter_actor_queue_redraw (CLUTTER_ACTOR (bar)); }
static void shell_overflow_list_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { ShellOverflowList *self = SHELL_OVERFLOW_LIST (object); ShellOverflowListPrivate *priv = self->priv; switch (prop_id) { case PROP_SPACING: priv->spacing = g_value_get_float (value); clutter_actor_queue_relayout (CLUTTER_ACTOR (self)); break; case PROP_ITEM_HEIGHT: priv->item_height = g_value_get_float (value); clutter_actor_queue_relayout (CLUTTER_ACTOR (self)); break; case PROP_PAGE: priv->page = g_value_get_uint (value); clutter_actor_queue_redraw (CLUTTER_ACTOR (self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } }
static void pkg_graph_place_child (PkgGraph *graph, ClutterActor *child) { PkgGraphPrivate *priv; gfloat w, h, x = 0, y = 0; g_return_if_fail(PKG_IS_GRAPH(graph)); g_return_if_fail(CLUTTER_IS_ACTOR(child)); priv = graph->priv; clutter_actor_get_size(CLUTTER_ACTOR(graph), &w, &h); if (priv->xpad) { x = priv->xpad; } if (priv->ypad) { y = priv->ypad; } w -= 2 * priv->xpad; h -= 2 * priv->ypad; clutter_actor_set_size(child, w, h); clutter_actor_set_position(child, x, y); clutter_actor_queue_redraw(child); }
static gboolean clutter_clock_prepare (GSource *source, gint *timeout) { ClutterClockSource *clock_source = (ClutterClockSource *) source; ClutterMasterClockDefault *master_clock = clock_source->master_clock; int delay; _clutter_threads_acquire_lock (); if (G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_CONTINUOUS_REDRAW)) { ClutterStageManager *stage_manager = clutter_stage_manager_get_default (); const GSList *stages, *l; stages = clutter_stage_manager_peek_stages (stage_manager); /* Queue a full redraw on all of the stages */ for (l = stages; l != NULL; l = l->next) clutter_actor_queue_redraw (l->data); } delay = master_clock_next_frame_delay (master_clock); _clutter_threads_release_lock (); *timeout = delay; return delay == 0; }
static gboolean queue_redraw (gpointer stage) { clutter_actor_queue_redraw (CLUTTER_ACTOR (stage)); return TRUE; }
static void calculate_and_scroll (ClutterActor *self, gint mouse_x, gint mouse_y, gfloat box_x, gfloat box_y, gfloat width, gfloat height) { StScrollViewPrivate *priv = ST_SCROLL_VIEW (self)->priv; gboolean up; gint sub_region; gdouble delta, vvalue; up = get_sub_region_y (mouse_y, box_y, height, &sub_region); if (up) delta = sub_region * -1.0 / AUTO_SCROLL_SPEED_DIVISOR; else delta = sub_region / AUTO_SCROLL_SPEED_DIVISOR; g_object_get (priv->vadjustment, "value", &vvalue, NULL); st_adjustment_set_value (priv->vadjustment, vvalue + delta); clutter_actor_queue_redraw (self); }
void pp_super_aa_set_resolution (PPSuperAA *aa, gfloat x_res, gfloat y_res) { aa->priv->x_res = x_res; aa->priv->y_res = y_res; clutter_actor_queue_redraw (CLUTTER_ACTOR (aa)); }
static gboolean idle_cb (gpointer data) { clutter_actor_queue_redraw (data); return G_SOURCE_CONTINUE; }
static void st_container_remove (ClutterContainer *container, ClutterActor *actor) { StContainerPrivate *priv = ST_CONTAINER (container)->priv; g_object_ref (actor); priv->children = g_list_remove (priv->children, actor); clutter_actor_unparent (actor); /* queue a relayout, to get the correct positioning inside * the ::actor-removed signal handlers */ clutter_actor_queue_relayout (CLUTTER_ACTOR (container)); /* at this point, the actor passed to the "actor-removed" signal * handlers is not parented anymore to the container but since we * are holding a reference on it, it's still valid */ g_signal_emit_by_name (container, "actor-removed", actor); st_container_update_pseudo_classes (ST_CONTAINER (container)); if (CLUTTER_ACTOR_IS_VISIBLE (container)) clutter_actor_queue_redraw (CLUTTER_ACTOR (container)); g_object_unref (actor); }
static void clone_source_queue_redraw_cb (ClutterActor *source, ClutterActor *origin, ClutterClone *self) { clutter_actor_queue_redraw (CLUTTER_ACTOR (self)); }
/** * clutter_rectangle_set_border_width: * @rectangle: a #ClutterRectangle * @width: the width of the border * * Sets the width (in pixel) of the border used by @rectangle. * A @width of 0 will unset the border. * * Since: 0.2 */ void clutter_rectangle_set_border_width (ClutterRectangle *rectangle, guint width) { ClutterRectanglePrivate *priv; g_return_if_fail (CLUTTER_IS_RECTANGLE (rectangle)); priv = rectangle->priv; if (priv->border_width != width) { g_object_ref (rectangle); priv->border_width = width; if (priv->border_width != 0) priv->has_border = TRUE; else priv->has_border = FALSE; if (CLUTTER_ACTOR_IS_VISIBLE (CLUTTER_ACTOR (rectangle))) clutter_actor_queue_redraw (CLUTTER_ACTOR (rectangle)); g_object_notify (G_OBJECT (rectangle), "border-width"); g_object_notify (G_OBJECT (rectangle), "has-border"); g_object_unref (rectangle); } }
static gboolean queue_redraw (gpointer stage) { clutter_actor_queue_redraw (CLUTTER_ACTOR (stage)); return G_SOURCE_CONTINUE; }
static void mex_shell_sort_depth_order (ClutterContainer *container) { MexShellPrivate *priv = MEX_SHELL (container)->priv; priv->children = g_list_sort (priv->children, mex_shell_sort_depth_order_cb); clutter_actor_queue_redraw (CLUTTER_ACTOR (container)); }
/** * clutter_rectangle_set_color: * @rectangle: a #ClutterRectangle * @color: a #ClutterColor * * Sets the color of @rectangle. */ void clutter_rectangle_set_color (ClutterRectangle *rectangle, const ClutterColor *color) { ClutterRectanglePrivate *priv; g_return_if_fail (CLUTTER_IS_RECTANGLE (rectangle)); g_return_if_fail (color != NULL); g_object_ref (rectangle); priv = rectangle->priv; priv->color.red = color->red; priv->color.green = color->green; priv->color.blue = color->blue; priv->color.alpha = color->alpha; #if 0 /* FIXME - appears to be causing border to always get drawn */ if (clutter_color_equal (&priv->color, &priv->border_color)) priv->has_border = FALSE; else priv->has_border = TRUE; #endif if (CLUTTER_ACTOR_IS_VISIBLE (rectangle)) clutter_actor_queue_redraw (CLUTTER_ACTOR (rectangle)); g_object_notify (G_OBJECT (rectangle), "color"); g_object_notify (G_OBJECT (rectangle), "has-border"); g_object_unref (rectangle); }
/** * shell_screenshot_screenshot_area: * @screenshot: the #ShellScreenshot * @x: The X coordinate of the area * @y: The Y coordinate of the area * @width: The width of the area * @height: The height of the area * @filename: The filename for the screenshot * @callback: (scope async): function to call returning success or failure * of the async grabbing * * Takes a screenshot of the passed in area and saves it * in @filename as png image. * */ void shell_screenshot_screenshot_area (ShellScreenshot *screenshot, int x, int y, int width, int height, const char *filename, ShellScreenshotCallback callback) { ClutterActor *stage; _screenshot_data *data = g_new0 (_screenshot_data, 1); data->screenshot = g_object_ref (screenshot); data->filename = g_strdup (filename); data->screenshot_area.x = x; data->screenshot_area.y = y; data->screenshot_area.width = width; data->screenshot_area.height = height; data->callback = callback; stage = CLUTTER_ACTOR (shell_global_get_stage (screenshot->global)); g_signal_connect_after (stage, "paint", G_CALLBACK (grab_area_screenshot), (gpointer)data); clutter_actor_queue_redraw (stage); }
/** * st_scroll_view_update_vfade_effect: * @self: a #StScrollView * @fade_offset: The length of the fade effect, in pixels. * * Sets the height of the fade area area in pixels. A value of 0 * disables the effect. */ static void st_scroll_view_update_vfade_effect (StScrollView *self, float fade_offset) { StScrollViewPrivate *priv = ST_SCROLL_VIEW (self)->priv; /* A fade amount of more than 0 enables the effect. */ if (fade_offset > 0.) { if (priv->vfade_effect == NULL) { priv->vfade_effect = g_object_new (ST_TYPE_SCROLL_VIEW_FADE, NULL); clutter_actor_add_effect_with_name (CLUTTER_ACTOR (self), "vfade", CLUTTER_EFFECT (priv->vfade_effect)); } g_object_set (priv->vfade_effect, "fade-offset", fade_offset, NULL); } else { if (priv->vfade_effect != NULL) { clutter_actor_remove_effect (CLUTTER_ACTOR (self), CLUTTER_EFFECT (priv->vfade_effect)); priv->vfade_effect = NULL; } } clutter_actor_queue_redraw (CLUTTER_ACTOR (self)); }
static void clutter_glx_texture_pixmap_update_area (ClutterX11TexturePixmap *texture, gint x, gint y, gint width, gint height) { ClutterGLXTexturePixmapPrivate *priv; Display *dpy; CLUTTER_NOTE (TEXTURE, "Updating texture pixmap"); priv = CLUTTER_GLX_TEXTURE_PIXMAP (texture)->priv; dpy = clutter_x11_get_default_display(); if (!CLUTTER_ACTOR_IS_REALIZED (texture)) return; if (priv->use_fallback) { CLUTTER_NOTE (TEXTURE, "Falling back to X11"); parent_class->update_area (texture, x, y, width, height); return; } if (priv->glx_pixmap == None) return; if (texture_bind (CLUTTER_GLX_TEXTURE_PIXMAP(texture))) { CLUTTER_NOTE (TEXTURE, "Really updating via GLX"); clutter_x11_trap_x_errors (); (_gl_bind_tex_image) (dpy, priv->glx_pixmap, GLX_FRONT_LEFT_EXT, NULL); XSync (clutter_x11_get_default_display(), FALSE); /* Note above fires X error for non name pixmaps - but * things still seem to work - i.e pixmap updated */ if (clutter_x11_untrap_x_errors ()) CLUTTER_NOTE (TEXTURE, "Update bind_tex_image failed"); priv->bound = TRUE; } else g_warning ("Failed to bind initial tex"); if (CLUTTER_ACTOR_IS_VISIBLE (CLUTTER_ACTOR(texture))) clutter_actor_queue_redraw (CLUTTER_ACTOR(texture)); }
/* * Used to force full stage redraws during recording to avoid artifacts * * Note: That this will cause the stage to be repainted on * every animation frame even if the frame wouldn't normally cause any new * drawing */ static gboolean recorder_repaint_hook (gpointer data) { ClutterActor *stage = data; clutter_actor_queue_redraw (stage); return TRUE; }
static void mex_column_adjustment_changed_cb (MexColumn *self) { MexColumnPrivate *priv = self->priv; priv->adjustment_value = mx_adjustment_get_value (priv->adjustment); clutter_actor_queue_redraw (CLUTTER_ACTOR (self)); }
static void mx_stack_sort_depth_order (ClutterContainer *container) { MxStackPrivate *priv = MX_STACK (container)->priv; priv->children = g_list_sort (priv->children, mx_stack_depth_sort_cb); clutter_actor_queue_redraw (CLUTTER_ACTOR (container)); }