这篇教程C++ CLUTTER_TEXTURE函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中CLUTTER_TEXTURE函数的典型用法代码示例。如果您正苦于以下问题:C++ CLUTTER_TEXTURE函数的具体用法?C++ CLUTTER_TEXTURE怎么用?C++ CLUTTER_TEXTURE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了CLUTTER_TEXTURE函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: pp_super_aa_paintstatic voidpp_super_aa_paint (ClutterActor *actor){ CoglHandle texture; gfloat width, height; PPSuperAAPrivate *priv = PP_SUPER_AA (actor)->priv; clutter_actor_get_size (actor, &width, &height); texture = clutter_texture_get_cogl_texture (CLUTTER_TEXTURE (actor)); if (!texture || (cogl_texture_get_width (texture) != (guint)(width * priv->x_res)) || (cogl_texture_get_height (texture) != (guint)(height * priv->y_res))) { texture = cogl_texture_new_with_size ((guint)(width * priv->x_res), (guint)(height * priv->y_res), COGL_TEXTURE_NO_SLICING, COGL_PIXEL_FORMAT_RGBA_8888_PRE); clutter_texture_set_cogl_texture (CLUTTER_TEXTURE (actor), texture); cogl_handle_unref (texture); } CLUTTER_ACTOR_CLASS (pp_super_aa_parent_class)->paint (actor);}
开发者ID:GNOME,项目名称:pinpoint,代码行数:25,
示例2: mex_telepathy_channel_create_previewstatic voidmex_telepathy_channel_create_preview (MexTelepathyChannel *self){ MexTelepathyChannelPrivate *priv = MEX_TELEPATHY_CHANNEL (self)->priv; ClutterActor *video_preview_area; priv->video_outgoing = clutter_texture_new (); clutter_texture_set_keep_aspect_ratio (CLUTTER_TEXTURE (priv->video_outgoing), TRUE); priv->outgoing_sink = clutter_gst_video_sink_new (CLUTTER_TEXTURE (priv->video_outgoing)); video_preview_area = mx_stack_new (); clutter_container_add (CLUTTER_CONTAINER (video_preview_area), mex_telepathy_channel_create_static_image(), priv->video_outgoing, NULL); mx_stylable_set_style_class (MX_STYLABLE (video_preview_area), "PreviewStack"); clutter_actor_set_height (video_preview_area, 150.0); clutter_actor_add_effect (video_preview_area, CLUTTER_EFFECT ( mex_telepathy_channel_create_shadow ())); priv->preview_area = mx_frame_new (); mx_stylable_set_style_class (MX_STYLABLE (priv->preview_area), "PreviewPadding"); mx_bin_set_child (MX_BIN (priv->preview_area), video_preview_area);}
开发者ID:Cyrene,项目名称:media-explorer,代码行数:34,
示例3: shell_global_create_root_pixmap_actor/** * shell_global_create_root_pixmap_actor: * @global: a #ShellGlobal * * Creates an actor showing the root window pixmap. * * Return value: (transfer none): a #ClutterActor with the root window pixmap. * The actor is floating, hence (transfer none). */ClutterActor *shell_global_create_root_pixmap_actor (ShellGlobal *global){ GdkWindow *window; ClutterActor *stage; ClutterColor stage_color; /* The actor created is actually a ClutterClone of global->root_pixmap. */ if (global->root_pixmap == NULL) { global->root_pixmap = clutter_glx_texture_pixmap_new (); clutter_texture_set_repeat (CLUTTER_TEXTURE (global->root_pixmap), TRUE, TRUE); /* The low and medium quality filters give nearest-neighbor resizing. */ clutter_texture_set_filter_quality (CLUTTER_TEXTURE (global->root_pixmap), CLUTTER_TEXTURE_QUALITY_HIGH); /* Initialize to the stage color, since that's what will be seen * in the main view if there's no actual background window. */ stage = mutter_plugin_get_stage (global->plugin); clutter_stage_get_color (CLUTTER_STAGE (stage), &stage_color); clutter_texture_set_from_rgb_data (CLUTTER_TEXTURE (global->root_pixmap), /* ClutterColor has the same layout * as one pixel of RGB(A) data. */ (const guchar *)&stage_color, FALSE, /* w, h, rowstride, bpp, flags */ 1, 1, 3, 3, 0, NULL); /* We can only clone an actor within a stage, so we hide the source * texture then add it to the stage */ clutter_actor_hide (global->root_pixmap); clutter_container_add_actor (CLUTTER_CONTAINER (stage), global->root_pixmap); /* This really should never happen; but just in case... */ g_signal_connect (global->root_pixmap, "destroy", G_CALLBACK (root_pixmap_destroy), global); /* Metacity handles changes to some root window properties in its global * event filter, though not _XROOTPMAP_ID. For all root window property * changes, the global filter returns GDK_FILTER_CONTINUE, so our * window specific filter will be called after the global one. * * Because Metacity is already handling root window property updates, * we don't have to worry about adding the PropertyChange mask to the * root window to get PropertyNotify events. */ window = gdk_get_default_root_window (); gdk_window_add_filter (window, root_window_filter, global); update_root_window_pixmap (global); } return clutter_clone_new (global->root_pixmap);}
开发者ID:MarkieMark,项目名称:gnome-shell,代码行数:69,
示例4: mex_telepathy_channel_create_incoming_videostatic voidmex_telepathy_channel_create_incoming_video (MexTelepathyChannel *self){ MexTelepathyChannelPrivate *priv = MEX_TELEPATHY_CHANNEL (self)->priv; ClutterActor *video_incoming_area; /* Setup the incoming surface to draw to */ priv->incoming_texture = clutter_texture_new (); clutter_texture_set_keep_aspect_ratio (CLUTTER_TEXTURE (priv->incoming_texture), TRUE); video_incoming_area = mx_stack_new (); clutter_container_add (CLUTTER_CONTAINER (video_incoming_area), mex_telepathy_channel_create_static_image(), priv->incoming_texture, NULL); /* Create a frame for it with a styled border */ priv->full_frame = mx_frame_new(); clutter_actor_set_name (priv->full_frame, "Incoming Frame"); mx_bin_set_fill (MX_BIN (priv->full_frame), TRUE, TRUE); mx_stylable_set_style_class (MX_STYLABLE (priv->full_frame), "CallWindow"); clutter_actor_add_effect (priv->full_frame, CLUTTER_EFFECT ( mex_telepathy_channel_create_shadow ())); clutter_container_add_actor (CLUTTER_CONTAINER (priv->full_frame), video_incoming_area); priv->incoming_sink = clutter_gst_video_sink_new (CLUTTER_TEXTURE (priv->incoming_texture));}
开发者ID:Cyrene,项目名称:media-explorer,代码行数:34,
示例5: toggle_texture_qualitystatic voidtoggle_texture_quality (ClutterActor *actor){ if (CLUTTER_IS_CONTAINER (actor)) clutter_container_foreach (CLUTTER_CONTAINER (actor), (ClutterCallback) toggle_texture_quality, NULL); if (CLUTTER_IS_TEXTURE (actor)) { ClutterTextureQuality quality; quality = clutter_texture_get_filter_quality (CLUTTER_TEXTURE (actor)); if (quality == CLUTTER_TEXTURE_QUALITY_HIGH) quality = CLUTTER_TEXTURE_QUALITY_MEDIUM; else quality = CLUTTER_TEXTURE_QUALITY_HIGH; g_print ("switching to quality %s for %p/n", quality == CLUTTER_TEXTURE_QUALITY_HIGH ? "high" : "medium", actor); clutter_texture_set_filter_quality (CLUTTER_TEXTURE (actor), quality); }}
开发者ID:Distrotech,项目名称:clutter,代码行数:27,
示例6: mainintmain (int argc, char **argv){ ClutterActor *stage, *image, *sub_image; CoglHandle texture, sub_texture; gfloat image_width, image_height; /* Initialize Clutter */ if (clutter_init (NULL, NULL) != CLUTTER_INIT_SUCCESS) return 1; /* Get the default stage */ stage = clutter_stage_get_default (); clutter_stage_set_title (CLUTTER_STAGE (stage), "Sub-texture"); /* Create a new ClutterTexture that shows smiley.png */ image = clutter_texture_new_from_file ("smiley.png", NULL); clutter_actor_get_size (image, &image_width, &image_height); clutter_actor_set_size (stage, image_width * 3 / 2 + 30, image_height + 20); /* Grab the CoglHandle of the underlying Cogl texture */ texture = clutter_texture_get_cogl_texture (CLUTTER_TEXTURE (image)); /* Create a new Cogl texture from the handle above. That new texture is a * rectangular region from image, more precisely the north ouest corner * of the image */ sub_texture = cogl_texture_new_from_sub_texture (texture, 0, 0, image_width / 2, image_height / 2); /* Finally, use the newly created Cogl texture to feed a new ClutterTexture * and thus create a new actor that displays sub_texture */ sub_image = clutter_texture_new (); clutter_texture_set_cogl_texture (CLUTTER_TEXTURE (sub_image), sub_texture); /* * You could have used the more straightforward g_object_new() function that * can create an object and set some properties on it at the same time: * sub_image = g_object_new (CLUTTER_TYPE_TEXTURE, * "cogl-texture", sub_texture, * NULL); */ /* Put the original image at (10,10) and the new sub image next to it */ clutter_actor_set_position (image, 10, 10); clutter_actor_set_position (sub_image, 20 + image_width, 10); /* Add both ClutterTexture to the stage */ clutter_container_add (CLUTTER_CONTAINER (stage), image, sub_image, NULL); clutter_actor_show_all (stage); clutter_main (); return 0;}
开发者ID:rib,项目名称:clutter,代码行数:59,
示例7: impl_constructedstatic voidimpl_constructed (GObject *object){ RBVisualizerPage *page; ClutterInitError err; GstElement *colorspace; GstElement *realsink; GstElement *capsfilter; GstCaps *caps; GstPad *pad; RB_CHAIN_GOBJECT_METHOD (rb_visualizer_page_parent_class, constructed, object); page = RB_VISUALIZER_PAGE (object); err = gtk_clutter_init (NULL, NULL); if (err != CLUTTER_INIT_SUCCESS) { /* maybe do something more sensible here. not sure if there are any user-recoverable * conditions that would cause clutter init to fail, though, so it may not be worth it. * as it is, we just won't add the page to the page tree. */ g_warning ("Unable to display visual effects due to Clutter init failure"); return; } page->texture = clutter_texture_new (); clutter_texture_set_sync_size (CLUTTER_TEXTURE (page->texture), TRUE); clutter_texture_set_keep_aspect_ratio (CLUTTER_TEXTURE (page->texture), TRUE); page->sink = gst_bin_new (NULL); g_object_ref (page->sink); /* actual sink */ realsink = gst_element_factory_make ("cluttersink", NULL); g_object_set (realsink, "texture", page->texture, NULL); colorspace = gst_element_factory_make ("ffmpegcolorspace", NULL); /* capsfilter to force rgb format (without this we end up using ayuv) */ capsfilter = gst_element_factory_make ("capsfilter", NULL); caps = gst_caps_from_string ("video/x-raw-rgb,bpp=(int)24,depth=(int)24," "endianness=(int)4321,red_mask=(int)16711680," "green_mask=(int)65280,blue_mask=(int)255"); g_object_set (capsfilter, "caps", caps, NULL); gst_caps_unref (caps); gst_bin_add_many (GST_BIN (page->sink), colorspace, capsfilter, realsink, NULL); gst_element_link (colorspace, capsfilter); gst_element_link (capsfilter, realsink); pad = gst_element_get_static_pad (colorspace, "sink"); gst_element_add_pad (page->sink, gst_ghost_pad_new ("sink", pad)); gst_object_unref (pad); g_signal_connect_object (page->fullscreen_action, "toggled", G_CALLBACK (toggle_fullscreen_cb), page, 0);}
开发者ID:dardevelin,项目名称:rhythmbox-gnome-fork,代码行数:57,
示例8: penge_magic_texture_paintstatic voidpenge_magic_texture_paint (ClutterActor *actor){ ClutterActorBox box; CoglHandle *material, *tex; float bw, bh; float aw, ah; float v; float tx1, tx2, ty1, ty2; guint8 alpha; clutter_actor_get_allocation_box (actor, &box); material = clutter_texture_get_cogl_material (CLUTTER_TEXTURE (actor)); tex = clutter_texture_get_cogl_texture (CLUTTER_TEXTURE (actor)); bw = (float) cogl_texture_get_width (tex); /* base texture width */ bh = (float) cogl_texture_get_height (tex); /* base texture height */ aw = (float) (box.x2 - box.x1); /* allocation width */ ah = (float) (box.y2 - box.y1); /* allocation height */ /* no comment */ if ((float)bw/bh < (float)aw/ah) { /* fit width */ v = (((float)ah * bw) / ((float)aw * bh)) / 2; tx1 = 0; tx2 = 1; ty1 = (0.5 - v); ty2 = (0.5 + v); } else { /* fit height */ v = (((float)aw * bh) / ((float)ah * bw)) / 2; tx1 = (0.5 - v); tx2 = (0.5 + v); ty1 = 0; ty2 = 1; } alpha = clutter_actor_get_paint_opacity (actor); cogl_material_set_color4ub (material, alpha, alpha, alpha, alpha); cogl_set_source (material); cogl_rectangle_with_texture_coords (0, 0, aw, ah, tx1, ty1, tx2, ty2);}
开发者ID:dudochkin-victor,项目名称:gogoo-panel-myzone,代码行数:53,
示例9: rc_update_pixbufstatic void rc_update_pixbuf(void *renderer, gboolean lazy){ RendererClutter *rc = (RendererClutter *)renderer; PixbufRenderer *pr = rc->pr; DEBUG_3("rc_update_pixbuf"); rc_remove_pending_updates(rc); rc->last_pixbuf_change = g_get_monotonic_time(); DEBUG_3("%s change time reset", get_exec_time()); if (pr->pixbuf) { gint width = gdk_pixbuf_get_width(pr->pixbuf); gint height = gdk_pixbuf_get_height(pr->pixbuf); DEBUG_3("pixbuf size %d x %d (%d)", width, height, gdk_pixbuf_get_has_alpha(pr->pixbuf) ? 32 : 24); gint prev_width, prev_height; if (pr->stereo_data == STEREO_PIXBUF_SBS || pr->stereo_data == STEREO_PIXBUF_CROSS) { width /= 2; } clutter_texture_get_base_size(CLUTTER_TEXTURE(rc->texture), &prev_width, &prev_height); if (width != prev_width || height != prev_height) { /* FIXME use CoglMaterial with multiple textures for background, color management, anaglyph, ... */ CoglHandle texture = cogl_texture_new_with_size(width, height, COGL_TEXTURE_NO_AUTO_MIPMAP | COGL_TEXTURE_NO_SLICING, gdk_pixbuf_get_has_alpha(pr->pixbuf) ? COGL_PIXEL_FORMAT_BGRA_8888 : COGL_PIXEL_FORMAT_BGR_888); if (texture != COGL_INVALID_HANDLE) { clutter_texture_set_cogl_texture(CLUTTER_TEXTURE(rc->texture), texture); cogl_handle_unref(texture); } } clutter_actor_set_clip(rc->texture, 0, 0, 0, 0); /* visible area is extended as area_changed events arrive */ if (!lazy) { rc_area_changed(renderer, GET_RIGHT_PIXBUF_OFFSET(rc), 0, width, height); } } rc->clut_updated = FALSE;}
开发者ID:BestImageViewer,项目名称:geeqie,代码行数:52,
示例10: bg_filename_changed_cbstatic voidbg_filename_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer userdata){ PengeViewBackground *pvb = PENGE_VIEW_BACKGROUND (userdata); const gchar *filename; GConfValue *value; GError *error = NULL; value = gconf_entry_get_value (entry); if (value) { filename = gconf_value_get_string (value); if (!clutter_texture_set_from_file (CLUTTER_TEXTURE (pvb), filename, &error)) { g_warning (G_STRLOC ": Error setting magic texture contents: %s", error->message); g_clear_error (&error); } else { clutter_actor_set_opacity ((ClutterActor *)pvb, 0xff); } } else { /* If the key is unset let's just make ourselves invisible */ clutter_actor_set_opacity ((ClutterActor *)pvb, 0x0); }}
开发者ID:kkszysiu,项目名称:gnomesocial,代码行数:31,
示例11: _update_icon_from_icon_themestatic void_update_icon_from_icon_theme (PengeAppTile *tile){ PengeAppTilePrivate *priv = GET_PRIVATE (tile); gchar *icon_path; GError *error = NULL; GIcon *icon; icon = g_app_info_get_icon (priv->app_info); if (G_IS_FILE_ICON (icon)) { icon_path = g_icon_to_string (icon); } if (!clutter_texture_set_from_file (CLUTTER_TEXTURE (priv->tex), icon_path, &error)) { g_warning (G_STRLOC ": Error loading texture from file: %s", error->message); g_clear_error (&error); } g_free (icon_path);}
开发者ID:kkszysiu,项目名称:gnomesocial,代码行数:26,
示例12: clutter_gst_yv12_fp_paintstatic voidclutter_gst_yv12_fp_paint (ClutterActor *actor, ClutterGstVideoSink *sink){ ClutterGstVideoSinkPrivate *priv = sink->priv; CoglHandle material; material = clutter_texture_get_cogl_material (CLUTTER_TEXTURE (actor)); /* Bind the U and V textures in layers 1 and 2 */ if (priv->u_tex) cogl_material_set_layer (material, 1, priv->u_tex); if (priv->v_tex) cogl_material_set_layer (material, 2, priv->v_tex); /* Cogl doesn't support changing OpenGL state to modify how Cogl primitives * work, but it also doesn't support ARBfp which we currently depend on. For * now we at least ask Cogl to flush any batched primitives so we avoid * binding our shader across the wrong geometry, but there is a risk that * Cogl may start to use ARBfp internally which will conflict with us. */ cogl_flush (); /* bind the shader */ glEnable (GL_FRAGMENT_PROGRAM_ARB); priv->syms.glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, priv->fp);}
开发者ID:3dfxmadscientist,项目名称:gnome-apps,代码行数:27,
示例13: mex_telepathy_channel_create_static_imageClutterActor *mex_telepathy_channel_create_static_image (void){ ClutterActor *actor; gchar *static_image_path; GError *error = NULL; static_image_path = g_build_filename (mex_get_data_dir (), "style", "thumb-call-pip-off.png", NULL); actor = clutter_texture_new_from_file (static_image_path, &error); if (error) { g_warning ("Error loading texture %s", error->message); g_clear_error (&error); } if (static_image_path) g_free (static_image_path); clutter_texture_set_keep_aspect_ratio (CLUTTER_TEXTURE (actor), TRUE); return actor;}
开发者ID:Cyrene,项目名称:media-explorer,代码行数:29,
示例14: create_default_texture/* We want to preserve the aspect ratio by default, also the default * pipeline for an empty texture is full opacity white, which we * definitely don't want. Skip that by setting 0 opacity. */static ClutterTexture *create_default_texture (void){ ClutterTexture * texture = CLUTTER_TEXTURE (clutter_texture_new ()); g_object_set (texture, "keep-aspect-ratio", TRUE, "opacity", 0, NULL); return texture;}
开发者ID:kenvandine,项目名称:gnome-shell,代码行数:11,
示例15: st_texture_cache_bind_cairo_surface_property/** * st_texture_cache_bind_cairo_surface_property: * @cache: * @object: A #GObject with a property @property_name of type #GdkPixbuf * @property_name: Name of a property * * Create a #ClutterTexture which tracks the #cairo_surface_t value of a GObject property * named by @property_name. Unlike other methods in StTextureCache, the underlying * #CoglTexture is not shared by default with other invocations to this method. * * If the source object is destroyed, the texture will continue to show the last * value of the property. * * Return value: (transfer none): A new #ClutterActor */ClutterActor *st_texture_cache_bind_cairo_surface_property (StTextureCache *cache, GObject *object, const char *property_name){ ClutterTexture *texture; gchar *notify_key; StTextureCachePropertyBind *bind; texture = CLUTTER_TEXTURE (clutter_texture_new ()); bind = g_new0 (StTextureCachePropertyBind, 1); bind->cache = cache; bind->texture = texture; bind->source = object; g_object_weak_ref (G_OBJECT (texture), st_texture_cache_bind_weak_notify, bind); bind->weakref_active = TRUE; st_texture_cache_reset_texture (bind, property_name); notify_key = g_strdup_printf ("notify::%s", property_name); bind->notify_signal_id = g_signal_connect_data (object, notify_key, G_CALLBACK(st_texture_cache_on_pixbuf_notify), bind, (GClosureNotify)st_texture_cache_free_bind, 0); g_free (notify_key); return CLUTTER_ACTOR(texture);}
开发者ID:kenvandine,项目名称:gnome-shell,代码行数:42,
示例16: gnibbles_worm_rescalevoidgnibbles_worm_rescale (GnibblesWorm *worm, gint tilesize){ int i; gfloat x_pos, y_pos; gint count; ClutterActor *tmp; GError *err = NULL; if (!worm) return; if (!worm->actors) return; count = clutter_group_get_n_children (CLUTTER_GROUP (worm->actors)); for (i = 0; i < count; i++) { tmp = clutter_group_get_nth_child (CLUTTER_GROUP (worm->actors), i); clutter_actor_get_position (tmp, &x_pos, &y_pos); clutter_actor_set_position (tmp, (x_pos / properties->tilesize) * tilesize, (y_pos / properties->tilesize) * tilesize); gtk_clutter_texture_set_from_pixbuf ( CLUTTER_TEXTURE (tmp), worm_pixmaps[properties->wormprops[worm->number]->color - 12], &err); if (err) gnibbles_error (err->message); }}
开发者ID:gfunkmonk2,项目名称:mate-games,代码行数:33,
示例17: clutter_cairo_texture_create_surfacestatic cairo_surface_t *clutter_cairo_texture_create_surface (ClutterCairoTexture *self, guint width, guint height){ cairo_surface_t *surface; guint cairo_stride; guint8 *cairo_data; CoglHandle cogl_texture; surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height); cairo_stride = cairo_image_surface_get_stride (surface); cairo_data = cairo_image_surface_get_data (surface); self->priv->surface_width = width; self->priv->surface_height = height; /* create a backing Cogl texture */ cogl_texture = cogl_texture_new_from_data (width, height, COGL_TEXTURE_NONE, CLUTTER_CAIRO_FORMAT_ARGB32, COGL_PIXEL_FORMAT_ANY, cairo_stride, cairo_data); clutter_texture_set_cogl_texture (CLUTTER_TEXTURE (self), cogl_texture); cogl_handle_unref (cogl_texture); return surface;}
开发者ID:spatulasnout,项目名称:clutter,代码行数:32,
示例18: st_icon_update_shadow_materialstatic voidst_icon_update_shadow_material (StIcon *icon){ StIconPrivate *priv = icon->priv; if (priv->shadow_material) { cogl_handle_unref (priv->shadow_material); priv->shadow_material = COGL_INVALID_HANDLE; } if (priv->shadow_spec) { CoglHandle material; gint width, height; clutter_texture_get_base_size (CLUTTER_TEXTURE (priv->icon_texture), &width, &height); material = _st_create_shadow_material_from_actor (priv->shadow_spec, priv->icon_texture); priv->shadow_material = material; priv->shadow_width = width; priv->shadow_height = height; }}
开发者ID:fanpenggogo,项目名称:gnome-shel,代码行数:26,
示例19: penge_grid_view_allocatestatic voidpenge_grid_view_allocate (ClutterActor *actor, const ClutterActorBox *box, ClutterAllocationFlags flags){ PengeGridViewPrivate *priv = GET_PRIVATE (actor); ClutterActorBox child_box; gint fade_height; /* Allocate the background to be the same area as the grid view */ child_box.x1 = 0; child_box.y1 = 0; child_box.x2 = box->x2 - box->x1; child_box.y2 = box->y2 - box->y1; clutter_actor_allocate (priv->background, &child_box, flags); clutter_texture_get_base_size (CLUTTER_TEXTURE (priv->background_fade), NULL, &fade_height); child_box.x1 = 0; child_box.y1 = 0; child_box.x2 = box->x2 - box->x1; child_box.y2 = fade_height; clutter_actor_allocate (priv->background_fade, &child_box, flags); CLUTTER_ACTOR_CLASS (penge_grid_view_parent_class)->allocate (actor, box, flags);}
开发者ID:dudochkin-victor,项目名称:gogoo-panel-myzone,代码行数:30,
示例20: create_clutter_texturestatic ClutterActor*create_clutter_texture(EmpathyVideoWidget *object){ EmpathyVideoWidgetPriv *priv = GET_PRIV (object); ClutterActor *texture, *stage, *box; ClutterLayoutManager *layout; stage = gtk_clutter_embed_get_stage (GTK_CLUTTER_EMBED (object)); g_assert (stage != NULL); clutter_stage_set_color (CLUTTER_STAGE(stage), CLUTTER_COLOR_Black); layout = clutter_bin_layout_new (CLUTTER_BIN_ALIGNMENT_CENTER, CLUTTER_BIN_ALIGNMENT_CENTER); g_assert (layout != NULL); box = clutter_box_new (layout); g_assert (box != NULL); clutter_container_add_actor (CLUTTER_CONTAINER (stage), box); priv->notify_allocation_id = g_signal_connect (stage, "notify::allocation", G_CALLBACK(on_stage_allocation_changed), box); texture = clutter_texture_new (); g_assert (texture != NULL); clutter_texture_set_keep_aspect_ratio (CLUTTER_TEXTURE (texture), TRUE); g_object_ref (G_OBJECT (texture)); clutter_box_pack (CLUTTER_BOX (box), texture, NULL, NULL); return texture;}
开发者ID:raluca-elena,项目名称:empathy-cheese,代码行数:32,
示例21: art_cbstatic voidart_cb (RBExtDBKey *key, const char *filename, GValue *data, MxFrame *frame){ ClutterActor *image; GdkPixbuf *pixbuf; if (data == NULL || G_VALUE_HOLDS (data, GDK_TYPE_PIXBUF) == FALSE) { return; } clutter_threads_enter (); image = gtk_clutter_texture_new (); pixbuf = GDK_PIXBUF (g_value_get_object (data)); gtk_clutter_texture_set_from_pixbuf (GTK_CLUTTER_TEXTURE (image), pixbuf, NULL); if (clutter_actor_get_height (image) > MAX_IMAGE_HEIGHT) { clutter_actor_set_height (image, MAX_IMAGE_HEIGHT); clutter_texture_set_keep_aspect_ratio (CLUTTER_TEXTURE (image), TRUE); } if (clutter_actor_get_width (image) > MAX_IMAGE_HEIGHT) { clutter_actor_set_width (image, MAX_IMAGE_HEIGHT); } mx_bin_set_child (MX_BIN (frame), image); clutter_actor_show_all (CLUTTER_ACTOR (frame)); clutter_threads_leave ();}
开发者ID:hfiguiere,项目名称:rhythmbox,代码行数:27,
示例22: penge_calendar_pane_update_calendar_iconstatic voidpenge_calendar_pane_update_calendar_icon (PengeCalendarPane *pane, JanaTime *time){ PengeCalendarPanePrivate *priv = GET_PRIVATE (pane); GError *error = NULL; gchar *path = NULL; if (jana_time_get_day (time) != priv->day_of_month) { priv->day_of_month = jana_time_get_day (time); path = g_strdup_printf (CALENDAR_ICON, priv->day_of_month); clutter_texture_set_from_file (CLUTTER_TEXTURE (priv->calendar_tex), path, &error); g_free (path); if (error) { g_warning (G_STRLOC ": Error setting path on calendar texture: %s", error->message); g_clear_error (&error); } }}
开发者ID:dudochkin-victor,项目名称:gogoo-panel-myzone,代码行数:26,
示例23: clutter_gst_video_sink_set_propertystatic voidclutter_gst_video_sink_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec){ ClutterGstVideoSink *sink; ClutterGstVideoSinkPrivate *priv; sink = CLUTTER_GST_VIDEO_SINK (object); priv = sink->priv; switch (prop_id) { case PROP_TEXTURE: if (priv->texture) g_object_unref (priv->texture); priv->texture = CLUTTER_TEXTURE (g_value_dup_object (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; }}
开发者ID:3dfxmadscientist,项目名称:gnome-apps,代码行数:25,
示例24: mpd_folder_button_set_icon_pathvoidmpd_folder_button_set_icon_path (MpdFolderButton *self, char const *icon_path){ MpdFolderButtonPrivate *priv = GET_PRIVATE (self); g_return_if_fail (MPD_IS_FOLDER_BUTTON (self)); if (0 != g_strcmp0 (icon_path, priv->icon_path)) { if (priv->icon_path) { g_free (priv->icon_path); priv->icon_path = NULL; } if (icon_path) { GError *error = NULL; priv->icon_path = g_strdup (icon_path); clutter_texture_set_from_file (CLUTTER_TEXTURE (priv->icon), priv->icon_path, &error); if (error) { g_warning ("%s : %s", G_STRLOC, error->message); g_clear_error (&error); } } g_object_notify (G_OBJECT (self), "icon-path"); }}
开发者ID:Cordia,项目名称:dawati-shell,代码行数:32,
示例25: _st_create_shadow_material_from_actorCoglHandle_st_create_shadow_material_from_actor (StShadow *shadow_spec, ClutterActor *actor){ CoglHandle shadow_material = COGL_INVALID_HANDLE; if (CLUTTER_IS_TEXTURE (actor)) { CoglHandle texture; texture = clutter_texture_get_cogl_texture (CLUTTER_TEXTURE (actor)); shadow_material = _st_create_shadow_material (shadow_spec, texture); } else { CoglHandle buffer, offscreen; ClutterActorBox box; CoglColor clear_color; float width, height; clutter_actor_get_allocation_box (actor, &box); clutter_actor_box_get_size (&box, &width, &height); if (width == 0 || height == 0) return COGL_INVALID_HANDLE; buffer = st_cogl_texture_new_with_size_wrapper (width, height, COGL_TEXTURE_NO_SLICING, COGL_PIXEL_FORMAT_ANY); if (buffer == COGL_INVALID_HANDLE) return COGL_INVALID_HANDLE; offscreen = cogl_offscreen_new_to_texture (buffer); if (offscreen == COGL_INVALID_HANDLE) { cogl_handle_unref (buffer); return COGL_INVALID_HANDLE; } cogl_color_set_from_4ub (&clear_color, 0, 0, 0, 0); cogl_push_framebuffer (offscreen); cogl_clear (&clear_color, COGL_BUFFER_BIT_COLOR); cogl_translate (-box.x1, -box.y1, 0); cogl_ortho (0, width, height, 0, 0, 1.0); clutter_actor_paint (actor); cogl_pop_framebuffer (); cogl_handle_unref (offscreen); shadow_material = _st_create_shadow_material (shadow_spec, buffer); cogl_handle_unref (buffer); } return shadow_material;}
开发者ID:AlbertJP,项目名称:Cinnamon,代码行数:57,
示例26: rc_area_changed_cbstatic gboolean rc_area_changed_cb(gpointer data){ RendererClutter *rc = (RendererClutter *)data; PixbufRenderer *pr = rc->pr; RendererClutterAreaParam *par = rc->pending_updates->data; gint h = MAX_REGION_AREA / par->w; if (h == 0) h = 1; if (h > par->h) h = par->h; DEBUG_3("%s upload start", get_exec_time()); if (pr->pixbuf) { CoglHandle texture = clutter_texture_get_cogl_texture(CLUTTER_TEXTURE(rc->texture)); cogl_texture_set_region(texture, par->x + GET_RIGHT_PIXBUF_OFFSET(rc), par->y, par->x, par->y, par->w, h, par->w, h, gdk_pixbuf_get_has_alpha(pr->pixbuf) ? COGL_PIXEL_FORMAT_BGRA_8888 : COGL_PIXEL_FORMAT_BGR_888, gdk_pixbuf_get_rowstride(pr->pixbuf), gdk_pixbuf_get_pixels(pr->pixbuf)); } DEBUG_3("%s upload end", get_exec_time()); rc_area_clip_add(rc, par->x, par->y, par->w, h); par->y += h; par->h -= h; if (par->h == 0) { rc->pending_updates = g_list_remove(rc->pending_updates, par); g_free(par); } if (!rc->pending_updates) { clutter_actor_queue_redraw(CLUTTER_ACTOR(rc->texture)); rc->idle_update = 0; /* FIXME: find a better place for this */ if (!rc->clut_updated) rc_prepare_post_process_lut(rc); return FALSE; } rc_schedule_texture_upload(rc); return FALSE; /* it was rescheduled, possibly with different prio */}
开发者ID:BestImageViewer,项目名称:geeqie,代码行数:57,
示例27: renderer_clutter_init_checker_shader/* initialize shader for transparency background checker */static void renderer_clutter_init_checker_shader(RendererClutter *rc){ const RendererClutterShaderInfo info = { 16.0, /* checker size */ {0.6, 0.6, 0.6}, /* color 0 */ {0.4, 0.4, 0.4} /* color 1 */ }; rc_set_shader(clutter_texture_get_cogl_material(CLUTTER_TEXTURE(rc->texture)), &info);}
开发者ID:BestImageViewer,项目名称:geeqie,代码行数:10,
示例28: on_depth_framestatic voidon_depth_frame (GFreenectDevice *kinect, gpointer user_data){ gint width, height; gint dimension_factor; guchar *grayscale_buffer; guint16 *depth; BufferInfo *buffer_info; gsize len; GError *error = NULL; GFreenectFrameMode frame_mode; depth = (guint16 *) gfreenect_device_get_depth_frame_raw (kinect, &len, &frame_mode); width = frame_mode.width; height = frame_mode.height; g_object_get (skeleton, "dimension-reduction", &dimension_factor, NULL); buffer_info = process_buffer (depth, width, height, dimension_factor, THRESHOLD_BEGIN, THRESHOLD_END); skeltrack_skeleton_track_joints (skeleton, buffer_info->reduced_buffer, buffer_info->reduced_width, buffer_info->reduced_height, NULL, on_track_joints, buffer_info); if (!SHOW_SKELETON) { grayscale_buffer = create_grayscale_buffer (buffer_info, dimension_factor); if (! clutter_texture_set_from_rgb_data (CLUTTER_TEXTURE (depth_tex), grayscale_buffer, FALSE, width, height, 0, 3, CLUTTER_TEXTURE_NONE, &error)) { g_debug ("Error setting texture area: %s", error->message); g_error_free (error); } g_slice_free1 (width * height * sizeof (guchar) * 3, grayscale_buffer); }}
开发者ID:Zeraphil,项目名称:Skeltrack,代码行数:56,
示例29: gb_player_pausevoidgb_player_pause (GbPlayer *self){ if (!self->priv->playing) return; gst_element_set_state (self->priv->player, GST_STATE_PAUSED); clutter_texture_set_pixbuf (CLUTTER_TEXTURE(self->priv->controls_play_pause), self->priv->play, NULL); g_object_set (self, "playing", FALSE, NULL);}
开发者ID:gabrielfalcao,项目名称:happy-time,代码行数:10,
注:本文中的CLUTTER_TEXTURE函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ CL_ASSERT函数代码示例 C++ CLUTTER_STAGE函数代码示例 |