static void ease_pdf_actor_draw_page (EasePdfActor* self) { #line 415 "ease-pdf-actor.c" PopplerPage* page; double width; double height; cairo_t* cr; GError * _inner_error_ = NULL; #line 58 "ease-pdf-actor.vala" g_return_if_fail (self != NULL); #line 61 "ease-pdf-actor.vala" page = _g_object_ref0 (poppler_document_get_page (self->priv->doc, self->priv->current_page)); #line 62 "ease-pdf-actor.vala" width = (double) 0; #line 62 "ease-pdf-actor.vala" height = (double) 0; #line 63 "ease-pdf-actor.vala" poppler_page_get_size (page, &width, &height); #line 66 "ease-pdf-actor.vala" if (self->priv->texture == NULL) { #line 433 "ease-pdf-actor.c" ClutterCairoTexture* _tmp0_; ClutterActor* _tmp1_; #line 68 "ease-pdf-actor.vala" self->priv->texture = (_tmp0_ = g_object_ref_sink ((ClutterCairoTexture*) clutter_cairo_texture_new ((guint) ((gint) width), (guint) ((gint) height))), _g_object_unref0 (self->priv->texture), _tmp0_); #line 69 "ease-pdf-actor.vala" clutter_container_add_actor ((ClutterContainer*) (_tmp1_ = ((EaseActor*) self)->contents, CLUTTER_IS_GROUP (_tmp1_) ? ((ClutterGroup*) _tmp1_) : NULL), (ClutterActor*) self->priv->texture); #line 71 "ease-pdf-actor.vala" clutter_actor_set_width ((ClutterActor*) self->priv->texture, clutter_actor_get_width (((EaseActor*) self)->contents)); #line 72 "ease-pdf-actor.vala" clutter_actor_set_height ((ClutterActor*) self->priv->texture, clutter_actor_get_height (((EaseActor*) self)->contents)); #line 74 "ease-pdf-actor.vala" g_signal_connect_object ((GObject*) ((EaseActor*) self)->contents, "notify::width", (GCallback) __lambda53__g_object_notify, self, 0); #line 78 "ease-pdf-actor.vala" g_signal_connect_object ((GObject*) ((EaseActor*) self)->contents, "notify::height", (GCallback) __lambda54__g_object_notify, self, 0); #line 448 "ease-pdf-actor.c" } else { #line 86 "ease-pdf-actor.vala" clutter_cairo_texture_set_surface_size (self->priv->texture, (guint) ((gint) width), (guint) ((gint) height)); #line 452 "ease-pdf-actor.c" } #line 90 "ease-pdf-actor.vala" clutter_cairo_texture_clear (self->priv->texture); #line 91 "ease-pdf-actor.vala" cr = clutter_cairo_texture_create (self->priv->texture); #line 92 "ease-pdf-actor.vala" ease_background_cairo_render (self->priv->pdf_element->background, cr, (gint) width, (gint) height, ease_document_get_path (ease_slide_get_parent (ease_element_get_parent (((EaseActor*) self)->element))), &_inner_error_); #line 460 "ease-pdf-actor.c" if (_inner_error_ != NULL) { _cairo_destroy0 (cr); _g_object_unref0 (page); g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } #line 94 "ease-pdf-actor.vala" poppler_page_render (page, cr); #line 470 "ease-pdf-actor.c" _cairo_destroy0 (cr); _g_object_unref0 (page); }
static void matenu_menu_bar_reset_bg_pixmap (MatenuMenuBar* self) { GdkPixmap* pixmap; cairo_t* cairo; cairo_pattern_t* pattern; GtkStyle* style; GdkPixmap* _tmp0_; g_return_if_fail (self != NULL); if (matenu_menu_bar_get_background (self)->type != MATENU_BACKGROUND_TYPE_PIXMAP) { return; } if (!GTK_WIDGET_REALIZED ((GtkWidget*) self)) { return; } g_assert (GDK_IS_DRAWABLE (((GtkWidget*) self)->window)); g_assert (GDK_IS_DRAWABLE (self->priv->_background->pixmap)); pixmap = gdk_pixmap_new ((GdkDrawable*) ((GtkWidget*) self)->window, ((GtkWidget*) self)->allocation.width, ((GtkWidget*) self)->allocation.height, -1); g_assert (GDK_IS_DRAWABLE (pixmap)); cairo = gdk_cairo_create ((GdkDrawable*) pixmap); g_assert (cairo != NULL); gdk_cairo_set_source_pixmap (cairo, self->priv->_background->pixmap, (double) (-self->priv->_background->offset_x), (double) (-self->priv->_background->offset_y)); pattern = cairo_get_source (cairo); cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT); cairo_rectangle (cairo, (double) 0, (double) 0, (double) ((GtkWidget*) self)->allocation.width, (double) ((GtkWidget*) self)->allocation.height); cairo_fill (cairo); style = _g_object_ref0 (gtk_widget_get_style ((GtkWidget*) self)); style->bg_pixmap[(gint) GTK_STATE_NORMAL] = (_tmp0_ = _g_object_ref0 (pixmap), _g_object_unref0 (style->bg_pixmap[(gint) GTK_STATE_NORMAL]), _tmp0_); gtk_style_set_background (style, ((GtkWidget*) self)->window, GTK_STATE_NORMAL); gtk_widget_queue_draw ((GtkWidget*) self); _g_object_unref0 (style); _cairo_destroy0 (cairo); _g_object_unref0 (pixmap); }
void ease_welcome_actor_set_slide_size (EaseWelcomeActor* self, gint w, gint h) { #line 240 "ease-welcome-actor.c" GError * _inner_error_ = NULL; #line 150 "ease-welcome-actor.vala" g_return_if_fail (self != NULL); #line 153 "ease-welcome-actor.vala" clutter_cairo_texture_set_surface_size (self->priv->slide_actor, (guint) w, (guint) h); #line 246 "ease-welcome-actor.c" { EaseSlide* slide; cairo_t* _tmp0_; #line 158 "ease-welcome-actor.vala" slide = ease_welcome_actor_create_slide (self, w, h); #line 159 "ease-welcome-actor.vala" ease_slide_cairo_render_sized (slide, _tmp0_ = clutter_cairo_texture_create (self->priv->slide_actor), w, h, &_inner_error_); #line 254 "ease-welcome-actor.c" _cairo_destroy0 (_tmp0_); if (_inner_error_ != NULL) { _g_object_unref0 (slide); goto __catch20_g_error; } _g_object_unref0 (slide); } goto __finally20; __catch20_g_error: { GError * e; e = _inner_error_; _inner_error_ = NULL; { #line 163 "ease-welcome-actor.vala" g_critical (_ ("Error rendering preview: %s"), e->message); #line 271 "ease-welcome-actor.c" _g_error_free0 (e); } } __finally20: if (_inner_error_ != NULL) { g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } }
static GObject * main_window_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) { GObject * obj; GObjectClass * parent_class; MainWindow * self; GdkEventMask _tmp0_; GdkEventMask _tmp1_; GtkAccelGroup* _tmp2_; GtkAccelGroup* accel_group; GtkAccelGroup* _tmp3_; GdkRGBA bg_color = {0}; gchar* _tmp4_ = NULL; gchar* _tmp5_; GdkRGBA _tmp6_; AtkObject* _tmp7_ = NULL; const gchar* _tmp8_ = NULL; GdkWindow* _tmp9_ = NULL; cairo_t* _tmp10_ = NULL; cairo_t* _tmp11_; cairo_surface_t* _tmp12_ = NULL; Background* _tmp13_; Background* _tmp14_; gboolean _tmp15_ = FALSE; Background* _tmp16_; gchar* _tmp17_ = NULL; gchar* _tmp18_; Background* _tmp19_; gchar* _tmp20_ = NULL; gchar* _tmp21_; gchar* _tmp22_ = NULL; gchar* _tmp23_; Background* _tmp24_; Background* _tmp25_; Background* _tmp26_; GtkBox* _tmp27_; GtkBox* _tmp28_; Background* _tmp29_; GtkBox* _tmp30_; GtkEventBox* _tmp31_; GtkEventBox* menubox; GtkAlignment* _tmp32_; GtkAlignment* menualign; gchar* _tmp33_ = NULL; gchar* shadow_path; gchar* _tmp34_; gchar* shadow_style; const gchar* _tmp35_; gboolean _tmp36_ = FALSE; GtkEventBox* _tmp51_; GtkEventBox* _tmp52_; GtkAlignment* _tmp53_; GtkEventBox* _tmp54_; GtkAlignment* _tmp55_; GtkBox* _tmp56_; GtkEventBox* _tmp57_; GtkAlignment* _tmp58_; GtkEventBox* _tmp59_; Background* _tmp60_; GtkAccelGroup* _tmp61_; MenuBar* _tmp62_; MenuBar* _tmp63_; GtkAlignment* _tmp64_; MenuBar* _tmp65_; MenuBar* _tmp66_; GtkBox* _tmp67_; GtkBox* _tmp68_; GtkBox* _tmp69_; GtkBox* _tmp70_; GtkBox* _tmp71_; GtkAlignment* _tmp72_; GtkAlignment* align; GtkAlignment* _tmp73_; GtkAlignment* _tmp74_; GtkAlignment* _tmp75_; GtkBox* _tmp76_; GtkAlignment* _tmp77_; FlatButton* _tmp78_; GtkButton* _tmp79_; gchar* _tmp80_ = NULL; gchar* _tmp81_; GtkImage* _tmp82_; GtkImage* _tmp83_; GtkImage* image; GtkImage* _tmp84_; GtkButton* _tmp85_; GtkButton* _tmp86_; GtkImage* _tmp87_; GtkButton* _tmp88_; GtkAlignment* _tmp89_; GtkButton* _tmp90_; GtkAlignment* _tmp91_; GtkAlignment* _tmp92_; GtkBox* _tmp93_; GtkAlignment* _tmp94_; ListStack* _tmp95_; ListStack* _tmp96_; GtkAlignment* _tmp97_; ListStack* _tmp98_; UnityGreeter* _tmp99_; gboolean _tmp100_; GError * _inner_error_ = NULL; parent_class = G_OBJECT_CLASS (main_window_parent_class); obj = parent_class->constructor (type, n_construct_properties, construct_properties); self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_MAIN_WINDOW, MainWindow); _tmp0_ = gtk_widget_get_events ((GtkWidget*) self); _tmp1_ = _tmp0_; gtk_widget_set_events ((GtkWidget*) self, _tmp1_ | GDK_POINTER_MOTION_MASK); _tmp2_ = gtk_accel_group_new (); accel_group = _tmp2_; _tmp3_ = accel_group; gtk_window_add_accel_group ((GtkWindow*) self, _tmp3_); memset (&bg_color, 0, sizeof (GdkRGBA)); _tmp4_ = ug_settings_get_string (UG_SETTINGS_KEY_BACKGROUND_COLOR); _tmp5_ = _tmp4_; gdk_rgba_parse (&bg_color, _tmp5_); _g_free0 (_tmp5_); _tmp6_ = bg_color; gtk_widget_override_background_color ((GtkWidget*) self, GTK_STATE_FLAG_NORMAL, &_tmp6_); _tmp7_ = gtk_widget_get_accessible ((GtkWidget*) self); _tmp8_ = _ ("Login Screen"); atk_object_set_name (_tmp7_, _tmp8_); gtk_window_set_has_resize_grip ((GtkWindow*) self, FALSE); unity_greeter_add_style_class ((GtkWidget*) self); gtk_widget_realize ((GtkWidget*) self); _tmp9_ = gtk_widget_get_window ((GtkWidget*) self); _tmp10_ = gdk_cairo_create (_tmp9_); _tmp11_ = _tmp10_; _tmp12_ = cairo_get_target (_tmp11_); _tmp13_ = background_new (_tmp12_); g_object_ref_sink (_tmp13_); _g_object_unref0 (self->priv->background); self->priv->background = _tmp13_; _cairo_destroy0 (_tmp11_); _tmp14_ = self->priv->background; _tmp15_ = ug_settings_get_boolean (UG_SETTINGS_KEY_DRAW_GRID); background_set_draw_grid (_tmp14_, _tmp15_); _tmp16_ = self->priv->background; _tmp17_ = ug_settings_get_string (UG_SETTINGS_KEY_BACKGROUND); _tmp18_ = _tmp17_; background_set_default_background (_tmp16_, _tmp18_); _g_free0 (_tmp18_); _tmp19_ = self->priv->background; _tmp20_ = ug_settings_get_string (UG_SETTINGS_KEY_LOGO); _tmp21_ = _tmp20_; _tmp22_ = ug_settings_get_string (UG_SETTINGS_KEY_BACKGROUND_LOGO); _tmp23_ = _tmp22_; background_set_logo (_tmp19_, _tmp21_, _tmp23_); _g_free0 (_tmp23_); _g_free0 (_tmp21_); _tmp24_ = self->priv->background; gtk_widget_show ((GtkWidget*) _tmp24_); _tmp25_ = self->priv->background; gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp25_); _tmp26_ = self->priv->background; unity_greeter_add_style_class ((GtkWidget*) _tmp26_); _tmp27_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); g_object_ref_sink (_tmp27_); _g_object_unref0 (self->priv->login_box); self->priv->login_box = _tmp27_; _tmp28_ = self->priv->login_box; gtk_widget_show ((GtkWidget*) _tmp28_); _tmp29_ = self->priv->background; _tmp30_ = self->priv->login_box; gtk_container_add ((GtkContainer*) _tmp29_, (GtkWidget*) _tmp30_); _tmp31_ = (GtkEventBox*) gtk_event_box_new (); g_object_ref_sink (_tmp31_); menubox = _tmp31_; _tmp32_ = (GtkAlignment*) gtk_alignment_new (0.0f, 0.0f, 1.0f, 0.0f); g_object_ref_sink (_tmp32_); menualign = _tmp32_; _tmp33_ = g_build_filename (PKGDATADIR, "shadow.png", NULL, NULL); shadow_path = _tmp33_; _tmp34_ = g_strdup (""); shadow_style = _tmp34_; _tmp35_ = shadow_path; _tmp36_ = g_file_test (_tmp35_, G_FILE_TEST_EXISTS); if (_tmp36_) { const gchar* _tmp37_; gchar* _tmp38_ = NULL; _tmp37_ = shadow_path; _tmp38_ = g_strdup_printf ("background-image: url('%s');\n" \ " background-repeat: repeat;", _tmp37_); _g_free0 (shadow_style); shadow_style = _tmp38_; } { GtkCssProvider* _tmp39_; GtkCssProvider* style; GtkCssProvider* _tmp40_; const gchar* _tmp41_; gchar* _tmp42_ = NULL; gchar* _tmp43_; GtkEventBox* _tmp44_; GtkStyleContext* _tmp45_ = NULL; GtkStyleContext* _tmp46_; GtkStyleContext* context; GtkStyleContext* _tmp47_; GtkCssProvider* _tmp48_; _tmp39_ = gtk_css_provider_new (); style = _tmp39_; _tmp40_ = style; _tmp41_ = shadow_style; _tmp42_ = g_strdup_printf ("* {background-color: transparent;\n" \ " %s\n" \ " }", _tmp41_); _tmp43_ = _tmp42_; gtk_css_provider_load_from_data (_tmp40_, _tmp43_, (gssize) (-1), &_inner_error_); _g_free0 (_tmp43_); if (_inner_error_ != NULL) { _g_object_unref0 (style); goto __catch11_g_error; } _tmp44_ = menubox; _tmp45_ = gtk_widget_get_style_context ((GtkWidget*) _tmp44_); _tmp46_ = _g_object_ref0 (_tmp45_); context = _tmp46_; _tmp47_ = context; _tmp48_ = style; gtk_style_context_add_provider (_tmp47_, (GtkStyleProvider*) _tmp48_, (guint) GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); _g_object_unref0 (context); _g_object_unref0 (style); } goto __finally11; __catch11_g_error: { GError* e = NULL; GError* _tmp49_; const gchar* _tmp50_; e = _inner_error_; _inner_error_ = NULL; _tmp49_ = e; _tmp50_ = _tmp49_->message; g_debug ("main-window.vala:87: Internal error loading menubox style: %s", _tmp50_); _g_error_free0 (e); } __finally11: if (_inner_error_ != NULL) { _g_free0 (shadow_style); _g_free0 (shadow_path); _g_object_unref0 (menualign); _g_object_unref0 (menubox); _g_object_unref0 (accel_group); g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); } _tmp51_ = menubox; gtk_widget_set_size_request ((GtkWidget*) _tmp51_, -1, MAIN_WINDOW_MENUBAR_HEIGHT); _tmp52_ = menubox; gtk_widget_show ((GtkWidget*) _tmp52_); _tmp53_ = menualign; gtk_widget_show ((GtkWidget*) _tmp53_); _tmp54_ = menubox; _tmp55_ = menualign; gtk_container_add ((GtkContainer*) _tmp54_, (GtkWidget*) _tmp55_); _tmp56_ = self->priv->login_box; _tmp57_ = menubox; gtk_container_add ((GtkContainer*) _tmp56_, (GtkWidget*) _tmp57_); _tmp58_ = menualign; unity_greeter_add_style_class ((GtkWidget*) _tmp58_); _tmp59_ = menubox; unity_greeter_add_style_class ((GtkWidget*) _tmp59_); _tmp60_ = self->priv->background; _tmp61_ = accel_group; _tmp62_ = menu_bar_new (_tmp60_, _tmp61_); g_object_ref_sink (_tmp62_); _g_object_unref0 (self->menubar); self->menubar = _tmp62_; _tmp63_ = self->menubar; gtk_widget_show ((GtkWidget*) _tmp63_); _tmp64_ = menualign; _tmp65_ = self->menubar; gtk_container_add ((GtkContainer*) _tmp64_, (GtkWidget*) _tmp65_); _tmp66_ = self->menubar; unity_greeter_add_style_class ((GtkWidget*) _tmp66_); _tmp67_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); g_object_ref_sink (_tmp67_); _g_object_unref0 (self->priv->hbox); self->priv->hbox = _tmp67_; _tmp68_ = self->priv->hbox; g_object_set ((GtkWidget*) _tmp68_, "expand", TRUE, NULL); _tmp69_ = self->priv->hbox; gtk_widget_show ((GtkWidget*) _tmp69_); _tmp70_ = self->priv->login_box; _tmp71_ = self->priv->hbox; gtk_container_add ((GtkContainer*) _tmp70_, (GtkWidget*) _tmp71_); _tmp72_ = (GtkAlignment*) gtk_alignment_new (0.5f, 0.5f, 0.0f, 0.0f); g_object_ref_sink (_tmp72_); align = _tmp72_; _tmp73_ = align; gtk_widget_set_size_request ((GtkWidget*) _tmp73_, grid_size, -1); _tmp74_ = align; gtk_widget_set_margin_bottom ((GtkWidget*) _tmp74_, MAIN_WINDOW_MENUBAR_HEIGHT); _tmp75_ = align; gtk_widget_show ((GtkWidget*) _tmp75_); _tmp76_ = self->priv->hbox; _tmp77_ = align; gtk_container_add ((GtkContainer*) _tmp76_, (GtkWidget*) _tmp77_); _tmp78_ = flat_button_new (); g_object_ref_sink (_tmp78_); _g_object_unref0 (self->priv->back_button); self->priv->back_button = (GtkButton*) _tmp78_; _tmp79_ = self->priv->back_button; gtk_button_set_focus_on_click (_tmp79_, FALSE); _tmp80_ = g_build_filename (PKGDATADIR, "arrow_left.png", NULL, NULL); _tmp81_ = _tmp80_; _tmp82_ = (GtkImage*) gtk_image_new_from_file (_tmp81_); g_object_ref_sink (_tmp82_); _tmp83_ = _tmp82_; _g_free0 (_tmp81_); image = _tmp83_; _tmp84_ = image; gtk_widget_show ((GtkWidget*) _tmp84_); _tmp85_ = self->priv->back_button; gtk_widget_set_size_request ((GtkWidget*) _tmp85_, grid_size - (GREETER_LIST_BORDER * 2), grid_size - (GREETER_LIST_BORDER * 2)); _tmp86_ = self->priv->back_button; _tmp87_ = image; gtk_container_add ((GtkContainer*) _tmp86_, (GtkWidget*) _tmp87_); _tmp88_ = self->priv->back_button; g_signal_connect_object (_tmp88_, "clicked", (GCallback) _main_window_pop_list_gtk_button_clicked, self, 0); _tmp89_ = align; _tmp90_ = self->priv->back_button; gtk_container_add ((GtkContainer*) _tmp89_, (GtkWidget*) _tmp90_); _tmp91_ = (GtkAlignment*) gtk_alignment_new (0.0f, 0.5f, 0.0f, 1.0f); g_object_ref_sink (_tmp91_); _g_object_unref0 (align); align = _tmp91_; _tmp92_ = align; gtk_widget_show ((GtkWidget*) _tmp92_); _tmp93_ = self->priv->hbox; _tmp94_ = align; gtk_container_add ((GtkContainer*) _tmp93_, (GtkWidget*) _tmp94_); _tmp95_ = list_stack_new (); g_object_ref_sink (_tmp95_); _g_object_unref0 (self->stack); self->stack = _tmp95_; _tmp96_ = self->stack; gtk_widget_show ((GtkWidget*) _tmp96_); _tmp97_ = align; _tmp98_ = self->stack; gtk_container_add ((GtkContainer*) _tmp97_, (GtkWidget*) _tmp98_); main_window_add_user_list (self); _tmp99_ = unity_greeter_singleton; _tmp100_ = _tmp99_->test_mode; if (_tmp100_) { Monitor* _tmp101_; Monitor* _tmp102_; Background* _tmp103_; GList* _tmp104_; GList* _tmp105_; gconstpointer _tmp106_ = NULL; __g_list_free__monitor_unref0_0 (self->priv->monitors); self->priv->monitors = NULL; _tmp101_ = monitor_new (0, 0, 800, 600); self->priv->monitors = g_list_append (self->priv->monitors, _tmp101_); _tmp102_ = monitor_new (800, 120, 640, 480); self->priv->monitors = g_list_append (self->priv->monitors, _tmp102_); _tmp103_ = self->priv->background; _tmp104_ = self->priv->monitors; background_set_monitors (_tmp103_, _tmp104_); _tmp105_ = self->priv->monitors; _tmp106_ = g_list_nth_data (_tmp105_, (guint) 0); main_window_move_to_monitor (self, (Monitor*) _tmp106_); gtk_window_resize ((GtkWindow*) self, 800 + 640, 600); } else { GdkScreen* _tmp107_ = NULL; GdkScreen* _tmp108_; GdkScreen* screen; GdkScreen* _tmp109_; GdkScreen* _tmp110_; _tmp107_ = gtk_window_get_screen ((GtkWindow*) self); _tmp108_ = _g_object_ref0 (_tmp107_); screen = _tmp108_; _tmp109_ = screen; g_signal_connect_object (_tmp109_, "monitors-changed", (GCallback) _main_window_monitors_changed_cb_gdk_screen_monitors_changed, self, 0); _tmp110_ = screen; main_window_monitors_changed_cb (self, _tmp110_); _g_object_unref0 (screen); } _g_object_unref0 (image); _g_object_unref0 (align); _g_free0 (shadow_style); _g_free0 (shadow_path); _g_object_unref0 (menualign); _g_object_unref0 (menubox); _g_object_unref0 (accel_group); return obj; }
static cairo_surface_t* fading_label_make_surface (FadingLabel* self, cairo_t* orig_c) { cairo_surface_t* result = NULL; gint w = 0; gint h = 0; PangoLayout* _tmp0_ = NULL; gint _tmp1_ = 0; gint _tmp2_ = 0; gint _tmp3_ = 0; gint bw; gint _tmp4_ = 0; gint bh; cairo_t* _tmp5_; cairo_surface_t* _tmp6_ = NULL; gint _tmp7_; gint _tmp8_; cairo_surface_t* _tmp9_; cairo_surface_t* surface; cairo_surface_t* _tmp10_; cairo_t* _tmp11_; cairo_t* c; gint _tmp12_; gint _tmp13_; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (orig_c != NULL, NULL); _tmp0_ = gtk_label_get_layout ((GtkLabel*) self); pango_layout_get_pixel_size (_tmp0_, &_tmp1_, &_tmp2_); w = _tmp1_; h = _tmp2_; _tmp3_ = gtk_widget_get_allocated_width ((GtkWidget*) self); bw = _tmp3_; _tmp4_ = gtk_widget_get_allocated_height ((GtkWidget*) self); bh = _tmp4_; _tmp5_ = orig_c; _tmp6_ = cairo_get_target (_tmp5_); _tmp7_ = bw; _tmp8_ = bh; _tmp9_ = cairo_surface_create_similar (_tmp6_, CAIRO_CONTENT_COLOR_ALPHA, _tmp7_, _tmp8_); surface = _tmp9_; _tmp10_ = surface; _tmp11_ = cairo_create (_tmp10_); c = _tmp11_; _tmp12_ = w; _tmp13_ = bw; if (_tmp12_ > _tmp13_) { cairo_t* _tmp14_; cairo_t* _tmp15_; cairo_t* _tmp16_; gint _tmp17_; cairo_pattern_t* _tmp18_; cairo_pattern_t* mask; cairo_pattern_t* _tmp19_; gint _tmp20_; cairo_pattern_t* _tmp21_; gint _tmp22_; cairo_pattern_t* _tmp23_; cairo_t* _tmp24_; cairo_pattern_t* _tmp25_; _tmp14_ = c; cairo_push_group (_tmp14_); _tmp15_ = c; GTK_WIDGET_CLASS (fading_label_parent_class)->draw ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, GTK_TYPE_LABEL, GtkLabel), _tmp15_); _tmp16_ = c; cairo_pop_group_to_source (_tmp16_); _tmp17_ = bw; _tmp18_ = cairo_pattern_create_linear ((gdouble) 0, (gdouble) 0, (gdouble) _tmp17_, (gdouble) 0); mask = _tmp18_; _tmp19_ = mask; _tmp20_ = bw; cairo_pattern_add_color_stop_rgba (_tmp19_, 1.0 - (27.0 / _tmp20_), 1.0, 1.0, 1.0, 1.0); _tmp21_ = mask; _tmp22_ = bw; cairo_pattern_add_color_stop_rgba (_tmp21_, 1.0 - (21.6 / _tmp22_), 1.0, 1.0, 1.0, 0.5); _tmp23_ = mask; cairo_pattern_add_color_stop_rgba (_tmp23_, 1.0, 1.0, 1.0, 1.0, 0.0); _tmp24_ = c; _tmp25_ = mask; cairo_mask (_tmp24_, _tmp25_); _cairo_pattern_destroy0 (mask); } else { cairo_t* _tmp26_; _tmp26_ = c; GTK_WIDGET_CLASS (fading_label_parent_class)->draw ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, GTK_TYPE_LABEL, GtkLabel), _tmp26_); } result = surface; _cairo_destroy0 (c); return result; }
static gboolean slingshot_frontend_app_item_draw_background (SlingshotFrontendAppItem* self, GtkWidget* widget, GdkEventExpose* event) { gboolean result = FALSE; GtkAllocation size = {0}; GtkWidget* _tmp0_ = NULL; GtkAllocation _tmp1_ = {0}; cairo_t* context = NULL; GtkWidget* _tmp2_ = NULL; GdkWindow* _tmp3_ = NULL; cairo_t* _tmp4_ = NULL; gdouble progress = 0.0; gint _tmp5_ = 0; gboolean _tmp7_ = FALSE; gboolean _tmp8_ = FALSE; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (event != NULL, FALSE); _tmp0_ = widget; gtk_widget_get_allocation (_tmp0_, &_tmp1_); size = _tmp1_; _tmp2_ = widget; _tmp3_ = _tmp2_->window; _tmp4_ = gdk_cairo_create ((GdkDrawable*) _tmp3_); context = _tmp4_; _tmp5_ = self->priv->current_frame; if (_tmp5_ > 1) { gint _tmp6_ = 0; _tmp6_ = self->priv->current_frame; progress = ((gdouble) SLINGSHOT_FRONTEND_APP_ITEM_RUN_LENGTH) / ((gdouble) _tmp6_); } else { progress = (gdouble) 1; } g_object_get ((GtkWidget*) self, "has-focus", &_tmp7_, NULL); _tmp8_ = _tmp7_; if (_tmp8_) { cairo_pattern_t* linear_gradient = NULL; GtkAllocation _tmp9_ = {0}; gint _tmp10_ = 0; GtkAllocation _tmp11_ = {0}; gint _tmp12_ = 0; GtkAllocation _tmp13_ = {0}; gint _tmp14_ = 0; GtkAllocation _tmp15_ = {0}; gint _tmp16_ = 0; GtkAllocation _tmp17_ = {0}; gint _tmp18_ = 0; cairo_pattern_t* _tmp19_ = NULL; cairo_pattern_t* _tmp20_ = NULL; SlingshotFrontendColor _tmp21_ = {0}; gdouble _tmp22_ = 0.0; SlingshotFrontendColor _tmp23_ = {0}; gdouble _tmp24_ = 0.0; SlingshotFrontendColor _tmp25_ = {0}; gdouble _tmp26_ = 0.0; gdouble _tmp27_ = 0.0; cairo_t* _tmp28_ = NULL; cairo_pattern_t* _tmp29_ = NULL; cairo_t* _tmp30_ = NULL; GtkAllocation _tmp31_ = {0}; cairo_t* _tmp32_ = NULL; _tmp9_ = size; _tmp10_ = _tmp9_.x; _tmp11_ = size; _tmp12_ = _tmp11_.y; _tmp13_ = size; _tmp14_ = _tmp13_.x; _tmp15_ = size; _tmp16_ = _tmp15_.y; _tmp17_ = size; _tmp18_ = _tmp17_.height; _tmp19_ = cairo_pattern_create_linear ((gdouble) _tmp10_, (gdouble) _tmp12_, (gdouble) _tmp14_, (gdouble) (_tmp16_ + _tmp18_)); linear_gradient = _tmp19_; _tmp20_ = linear_gradient; _tmp21_ = self->priv->prominent; _tmp22_ = _tmp21_.R; _tmp23_ = self->priv->prominent; _tmp24_ = _tmp23_.G; _tmp25_ = self->priv->prominent; _tmp26_ = _tmp25_.B; _tmp27_ = progress; cairo_pattern_add_color_stop_rgba (_tmp20_, 0.2, _tmp22_, _tmp24_, _tmp26_, 0.25 / _tmp27_); _tmp28_ = context; _tmp29_ = linear_gradient; cairo_set_source (_tmp28_, _tmp29_); _tmp30_ = context; _tmp31_ = size; slingshot_frontend_utilities_draw_rounded_rectangle (_tmp30_, (gdouble) 0, 0.5, &_tmp31_); _tmp32_ = context; cairo_fill (_tmp32_); _cairo_pattern_destroy0 (linear_gradient); } else { gint _tmp33_ = 0; _tmp33_ = self->priv->current_frame; if (_tmp33_ > 1) { cairo_pattern_t* linear_gradient = NULL; GtkAllocation _tmp34_ = {0}; gint _tmp35_ = 0; GtkAllocation _tmp36_ = {0}; gint _tmp37_ = 0; GtkAllocation _tmp38_ = {0}; gint _tmp39_ = 0; GtkAllocation _tmp40_ = {0}; gint _tmp41_ = 0; GtkAllocation _tmp42_ = {0}; gint _tmp43_ = 0; cairo_pattern_t* _tmp44_ = NULL; cairo_pattern_t* _tmp45_ = NULL; SlingshotFrontendColor _tmp46_ = {0}; gdouble _tmp47_ = 0.0; SlingshotFrontendColor _tmp48_ = {0}; gdouble _tmp49_ = 0.0; SlingshotFrontendColor _tmp50_ = {0}; gdouble _tmp51_ = 0.0; gdouble _tmp52_ = 0.0; cairo_t* _tmp53_ = NULL; cairo_pattern_t* _tmp54_ = NULL; cairo_t* _tmp55_ = NULL; GtkAllocation _tmp56_ = {0}; cairo_t* _tmp57_ = NULL; _tmp34_ = size; _tmp35_ = _tmp34_.x; _tmp36_ = size; _tmp37_ = _tmp36_.y; _tmp38_ = size; _tmp39_ = _tmp38_.x; _tmp40_ = size; _tmp41_ = _tmp40_.y; _tmp42_ = size; _tmp43_ = _tmp42_.height; _tmp44_ = cairo_pattern_create_linear ((gdouble) _tmp35_, (gdouble) _tmp37_, (gdouble) _tmp39_, (gdouble) (_tmp41_ + _tmp43_)); linear_gradient = _tmp44_; _tmp45_ = linear_gradient; _tmp46_ = self->priv->prominent; _tmp47_ = _tmp46_.R; _tmp48_ = self->priv->prominent; _tmp49_ = _tmp48_.G; _tmp50_ = self->priv->prominent; _tmp51_ = _tmp50_.B; _tmp52_ = progress; cairo_pattern_add_color_stop_rgba (_tmp45_, 0.2, _tmp47_, _tmp49_, _tmp51_, 0.25 - (0.25 / _tmp52_)); _tmp53_ = context; _tmp54_ = linear_gradient; cairo_set_source (_tmp53_, _tmp54_); _tmp55_ = context; _tmp56_ = size; slingshot_frontend_utilities_draw_rounded_rectangle (_tmp55_, (gdouble) 0, 0.5, &_tmp56_); _tmp57_ = context; cairo_fill (_tmp57_); _cairo_pattern_destroy0 (linear_gradient); } } result = FALSE; _cairo_destroy0 (context); return result; }
static gboolean slingshot_frontend_app_item_draw_icon (SlingshotFrontendAppItem* self, GtkWidget* widget, GdkEventExpose* event) { gboolean result = FALSE; GtkAllocation size = {0}; GtkWidget* _tmp0_ = NULL; GtkAllocation _tmp1_ = {0}; cairo_t* context = NULL; GtkWidget* _tmp2_ = NULL; GdkWindow* _tmp3_ = NULL; cairo_t* _tmp4_ = NULL; GdkPixbuf* _tmp5_ = NULL; GtkAllocation _tmp6_ = {0}; gint _tmp7_ = 0; GdkPixbuf* _tmp8_ = NULL; gint _tmp9_ = 0; gint _tmp10_ = 0; GtkAllocation _tmp11_ = {0}; gint _tmp12_ = 0; GtkAllocation _tmp13_ = {0}; gint _tmp14_ = 0; cairo_text_extents_t extents = {0}; GtkAllocation _tmp15_ = {0}; const gchar* _tmp16_ = NULL; gchar* _tmp17_ = NULL; cairo_text_extents_t _tmp18_ = {0}; GtkAllocation _tmp19_ = {0}; gint _tmp20_ = 0; GtkAllocation _tmp21_ = {0}; gint _tmp22_ = 0; cairo_text_extents_t _tmp23_ = {0}; gdouble _tmp24_ = 0.0; GtkAllocation _tmp25_ = {0}; gint _tmp26_ = 0; GtkAllocation _tmp27_ = {0}; gint _tmp28_ = 0; const gchar* _tmp29_ = NULL; GtkAllocation _tmp30_ = {0}; gint _tmp31_ = 0; GtkAllocation _tmp32_ = {0}; gint _tmp33_ = 0; cairo_text_extents_t _tmp34_ = {0}; gdouble _tmp35_ = 0.0; GtkAllocation _tmp36_ = {0}; gint _tmp37_ = 0; GtkAllocation _tmp38_ = {0}; gint _tmp39_ = 0; const gchar* _tmp40_ = NULL; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (event != NULL, FALSE); _tmp0_ = widget; gtk_widget_get_allocation (_tmp0_, &_tmp1_); size = _tmp1_; _tmp2_ = widget; _tmp3_ = _tmp2_->window; _tmp4_ = gdk_cairo_create ((GdkDrawable*) _tmp3_); context = _tmp4_; _tmp5_ = self->priv->icon; _tmp6_ = size; _tmp7_ = _tmp6_.x; _tmp8_ = self->priv->icon; _tmp9_ = gdk_pixbuf_get_width (_tmp8_); _tmp10_ = _tmp9_; _tmp11_ = size; _tmp12_ = _tmp11_.width; _tmp13_ = size; _tmp14_ = _tmp13_.y; gdk_cairo_set_source_pixbuf (context, _tmp5_, _tmp7_ + ((_tmp10_ - _tmp12_) / (-2.0)), (gdouble) _tmp14_); cairo_paint (context); cairo_select_font_face (context, "Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size (context, 11.5); _tmp15_ = size; _tmp16_ = self->priv->label; slingshot_frontend_utilities_truncate_text (context, &_tmp15_, (guint) 10, _tmp16_, &_tmp17_, &_tmp18_); _g_free0 (self->priv->label); self->priv->label = _tmp17_; extents = _tmp18_; _tmp19_ = size; _tmp20_ = _tmp19_.x; _tmp21_ = size; _tmp22_ = _tmp21_.width; _tmp23_ = extents; _tmp24_ = _tmp23_.width; _tmp25_ = size; _tmp26_ = _tmp25_.y; _tmp27_ = size; _tmp28_ = _tmp27_.height; cairo_move_to (context, ((_tmp20_ + (_tmp22_ / 2)) - (_tmp24_ / 2)) + 1, (gdouble) (((_tmp26_ + _tmp28_) - 10) + 1)); cairo_set_source_rgba (context, 0.0, 0.0, 0.0, 0.8); _tmp29_ = self->priv->label; cairo_show_text (context, _tmp29_); cairo_set_source_rgba (context, 1.0, 1.0, 1.0, 1.0); _tmp30_ = size; _tmp31_ = _tmp30_.x; _tmp32_ = size; _tmp33_ = _tmp32_.width; _tmp34_ = extents; _tmp35_ = _tmp34_.width; _tmp36_ = size; _tmp37_ = _tmp36_.y; _tmp38_ = size; _tmp39_ = _tmp38_.height; cairo_move_to (context, (_tmp31_ + (_tmp33_ / 2)) - (_tmp35_ / 2), (gdouble) ((_tmp37_ + _tmp39_) - 10)); _tmp40_ = self->priv->label; cairo_show_text (context, _tmp40_); result = FALSE; _cairo_destroy0 (context); return result; }
void soy_sg_k2_png_converter_sgk2png (soySGK2PNGConverter* self, guchar* sgk_data, int sgk_data_length1) { RsvgHandle* handle = NULL; cairo_surface_t* surface = NULL; cairo_t* context = NULL; GError * _inner_error_ = NULL; #line 29 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" g_return_if_fail (self != NULL); #line 138 "sgk2png.c" { RsvgHandle* _tmp0_ = NULL; guchar* _tmp1_ = NULL; gint _tmp1__length1 = 0; RsvgHandle* _tmp2_ = NULL; RsvgHandle* _tmp3_ = NULL; gint _tmp4_ = 0; gint _tmp5_ = 0; RsvgHandle* _tmp6_ = NULL; gint _tmp7_ = 0; gint _tmp8_ = 0; cairo_surface_t* _tmp9_ = NULL; cairo_surface_t* _tmp10_ = NULL; cairo_t* _tmp11_ = NULL; RsvgHandle* _tmp12_ = NULL; cairo_t* _tmp13_ = NULL; cairo_surface_t* _tmp14_ = NULL; #line 35 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _tmp1_ = sgk_data; #line 35 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _tmp1__length1 = sgk_data_length1; #line 35 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _tmp2_ = rsvg_handle_new_from_data (_tmp1_, _tmp1__length1, &_inner_error_); #line 35 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _tmp0_ = _tmp2_; #line 35 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" if (_inner_error_ != NULL) { #line 166 "sgk2png.c" goto __catch9_g_error; } #line 35 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _g_object_unref0 (handle); #line 35 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" handle = _tmp0_; #line 36 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _tmp3_ = handle; #line 36 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" g_object_get (_tmp3_, "width", &_tmp4_, NULL); #line 36 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _tmp5_ = _tmp4_; #line 36 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _tmp6_ = handle; #line 36 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" g_object_get (_tmp6_, "height", &_tmp7_, NULL); #line 36 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _tmp8_ = _tmp7_; #line 36 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _tmp9_ = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, _tmp5_, _tmp8_); #line 36 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _cairo_surface_destroy0 (surface); #line 36 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" surface = _tmp9_; #line 37 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _tmp10_ = surface; #line 37 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _tmp11_ = cairo_create (_tmp10_); #line 37 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _cairo_destroy0 (context); #line 37 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" context = _tmp11_; #line 38 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _tmp12_ = handle; #line 38 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _tmp13_ = context; #line 38 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" rsvg_handle_render_cairo (_tmp12_, _tmp13_); #line 39 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _tmp14_ = surface; #line 39 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" cairo_surface_write_to_png_stream (_tmp14_, _soy_sg_k2_png_converter_writefunc_cairo_write_func_t, self); #line 209 "sgk2png.c" } goto __finally9; __catch9_g_error: { GError* g = NULL; FILE* _tmp15_ = NULL; GError* _tmp16_ = NULL; const gchar* _tmp17_ = NULL; #line 34 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" g = _inner_error_; #line 34 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _inner_error_ = NULL; #line 41 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _tmp15_ = stdout; #line 41 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _tmp16_ = g; #line 41 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _tmp17_ = _tmp16_->message; #line 41 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" fprintf (_tmp15_, "Error: %s\n", _tmp17_); #line 42 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _g_error_free0 (g); #line 42 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _cairo_destroy0 (context); #line 42 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _cairo_surface_destroy0 (surface); #line 42 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _g_object_unref0 (handle); #line 42 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" return; #line 240 "sgk2png.c" } __finally9: #line 34 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" if (_inner_error_ != NULL) { #line 34 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _cairo_destroy0 (context); #line 34 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _cairo_surface_destroy0 (surface); #line 34 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _g_object_unref0 (handle); #line 34 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); #line 34 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" g_clear_error (&_inner_error_); #line 34 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" return; #line 257 "sgk2png.c" } #line 44 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _cairo_destroy0 (context); #line 44 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _cairo_surface_destroy0 (surface); #line 44 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" _g_object_unref0 (handle); #line 44 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs" return; #line 267 "sgk2png.c" }
GdkPixbuf* ease_slide_button_panel_pixbuf (EaseSlide* slide, gint width) { #line 428 "ease-slide-button-panel.c" GdkPixbuf* result = NULL; gint height; cairo_surface_t* surface; cairo_t* context; char* _tmp0_; char* _tmp1_; char* _tmp2_; char* path; GError * _inner_error_ = NULL; #line 178 "ease-slide-button-panel.vala" g_return_val_if_fail (slide != NULL, NULL); #line 180 "ease-slide-button-panel.vala" height = (gint) ((((float) width) * ease_slide_get_height (slide)) / ease_slide_get_width (slide)); #line 182 "ease-slide-button-panel.vala" surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24, width, height); #line 184 "ease-slide-button-panel.vala" context = cairo_create (surface); #line 185 "ease-slide-button-panel.vala" cairo_save (context); #line 186 "ease-slide-button-panel.vala" cairo_scale (context, (double) (((float) width) / ease_slide_get_width (slide)), (double) (((float) height) / ease_slide_get_height (slide))); #line 450 "ease-slide-button-panel.c" { #line 191 "ease-slide-button-panel.vala" ease_slide_cairo_render_small (slide, context); #line 454 "ease-slide-button-panel.c" } goto __finally17; __catch17_g_error: { GError * e; e = _inner_error_; _inner_error_ = NULL; { #line 195 "ease-slide-button-panel.vala" g_critical (_ ("Error drawing slide preview: %s"), e->message); #line 465 "ease-slide-button-panel.c" _g_error_free0 (e); } } __finally17: if (_inner_error_ != NULL) { _cairo_destroy0 (context); _cairo_surface_destroy0 (surface); g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return NULL; } #line 199 "ease-slide-button-panel.vala" cairo_restore (context); #line 201 "ease-slide-button-panel.vala" cairo_rectangle (context, (double) 0, (double) 0, (double) width, (double) height); #line 202 "ease-slide-button-panel.vala" cairo_set_source_rgb (context, (double) 0, (double) 0, (double) 0); #line 203 "ease-slide-button-panel.vala" cairo_stroke (context); #line 206 "ease-slide-button-panel.vala" path = (_tmp2_ = g_build_filename (ease_slide_button_panel_get_temp_dir (), _tmp1_ = g_strconcat (_tmp0_ = g_strdup_printf ("%i", ease_slide_button_panel_temp_count++), ".png", NULL), NULL), _g_free0 (_tmp1_), _g_free0 (_tmp0_), _tmp2_); #line 208 "ease-slide-button-panel.vala" cairo_surface_write_to_png (surface, path); #line 489 "ease-slide-button-panel.c" { GdkPixbuf* pb; #line 212 "ease-slide-button-panel.vala" pb = gdk_pixbuf_new_from_file (path, &_inner_error_); #line 494 "ease-slide-button-panel.c" if (_inner_error_ != NULL) { goto __catch18_g_error; } #line 213 "ease-slide-button-panel.vala" g_remove (path); #line 500 "ease-slide-button-panel.c" result = pb; _g_free0 (path); _cairo_destroy0 (context); _cairo_surface_destroy0 (surface); #line 214 "ease-slide-button-panel.vala" return result; #line 507 "ease-slide-button-panel.c" } goto __finally18; __catch18_g_error: { GError * e; e = _inner_error_; _inner_error_ = NULL; { #line 216 "ease-slide-button-panel.vala" g_error ("ease-slide-button-panel.vala:216: %s", e->message); #line 518 "ease-slide-button-panel.c" _g_error_free0 (e); } } __finally18: { _g_free0 (path); _cairo_destroy0 (context); _cairo_surface_destroy0 (surface); g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return NULL; } _g_free0 (path); _cairo_destroy0 (context); _cairo_surface_destroy0 (surface); }
void tag_calculate_bounds (Tag* self) { gint tagWidth = 0; cairo_text_extents_t textExtents = {0}; cairo_surface_t* imageSurface = NULL; cairo_surface_t* _tmp0_ = NULL; cairo_t* context = NULL; cairo_surface_t* _tmp1_ = NULL; cairo_t* _tmp2_ = NULL; cairo_t* _tmp3_ = NULL; cairo_t* _tmp4_ = NULL; const gchar* _tmp5_ = NULL; cairo_text_extents_t _tmp6_ = {0}; cairo_text_extents_t _tmp7_ = {0}; gdouble _tmp8_ = 0.0; gint _tmp9_ = 0; Flow _tmp10_ = 0; Direction _tmp13_ = 0; g_return_if_fail (self != NULL); _tmp0_ = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 0, 0); imageSurface = _tmp0_; _tmp1_ = imageSurface; _tmp2_ = cairo_create (_tmp1_); context = _tmp2_; _tmp3_ = context; cairo_set_font_size (_tmp3_, (gdouble) 12); _tmp4_ = context; _tmp5_ = self->text; cairo_text_extents (_tmp4_, _tmp5_, &_tmp6_); textExtents = _tmp6_; _tmp7_ = textExtents; _tmp8_ = _tmp7_.width; tagWidth = ((gint) _tmp8_) + 2; _tmp9_ = tagWidth; if (_tmp9_ < 50) { tagWidth = 50; } _tmp10_ = self->flow; if (_tmp10_ == FLOW_BIDIRECTIONAL) { gint _tmp11_ = 0; _tmp11_ = tagWidth; tagWidth = _tmp11_ + 20; } else { gint _tmp12_ = 0; _tmp12_ = tagWidth; tagWidth = _tmp12_ + 10; } _tmp13_ = self->direction; switch (_tmp13_) { case DIRECTION_RIGHT: { gint _tmp14_ = 0; gint _tmp15_ = 0; gint _tmp16_ = 0; gint _tmp17_ = 0; gint _tmp18_ = 0; _tmp14_ = self->xTag; _tmp15_ = tagWidth; self->rightBound = _tmp14_ + _tmp15_; _tmp16_ = self->yTag; self->downBound = _tmp16_ + 10; _tmp17_ = self->xWire; self->leftBound = _tmp17_; _tmp18_ = self->yTag; self->upBound = _tmp18_ - 10; break; } case DIRECTION_DOWN: { gint _tmp19_ = 0; gint _tmp20_ = 0; gint _tmp21_ = 0; gint _tmp22_ = 0; gint _tmp23_ = 0; _tmp19_ = self->xTag; self->rightBound = _tmp19_ + 10; _tmp20_ = self->yTag; _tmp21_ = tagWidth; self->downBound = _tmp20_ + _tmp21_; _tmp22_ = self->xTag; self->leftBound = _tmp22_ - 10; _tmp23_ = self->yWire; self->upBound = _tmp23_; break; } case DIRECTION_LEFT: { gint _tmp24_ = 0; gint _tmp25_ = 0; gint _tmp26_ = 0; gint _tmp27_ = 0; gint _tmp28_ = 0; _tmp24_ = self->xWire; self->rightBound = _tmp24_; _tmp25_ = self->yTag; self->downBound = _tmp25_ + 10; _tmp26_ = self->xTag; _tmp27_ = tagWidth; self->leftBound = _tmp26_ - _tmp27_; _tmp28_ = self->yTag; self->upBound = _tmp28_ - 10; break; } case DIRECTION_UP: { gint _tmp29_ = 0; gint _tmp30_ = 0; gint _tmp31_ = 0; gint _tmp32_ = 0; gint _tmp33_ = 0; _tmp29_ = self->xTag; self->rightBound = _tmp29_ + 10; _tmp30_ = self->yWire; self->downBound = _tmp30_; _tmp31_ = self->xTag; self->leftBound = _tmp31_ - 10; _tmp32_ = self->yTag; _tmp33_ = tagWidth; self->upBound = _tmp32_ - _tmp33_; break; } default: break; } _cairo_destroy0 (context); _cairo_surface_destroy0 (imageSurface); }