Example #1
0
static void soy_widgets_vbox_real_render (soywidgetsWidget* base, gint x, gint y, gint width, gint height) {
	soywidgetsVBox * self;
	gint _tmp0_;
	gint _x;
	gint _tmp1_;
	gint _y;
	self = (soywidgetsVBox*) base;
	_tmp0_ = x;
	_x = _tmp0_;
	_tmp1_ = y;
	_y = _tmp1_;
	{
		GeeLinkedList* _tmp2_;
		GeeLinkedList* _tmp3_;
		GeeLinkedList* _widget_list;
		GeeLinkedList* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		gint _widget_size;
		gint _widget_index;
		_tmp2_ = ((soywidgetsContainer*) self)->children;
		_tmp3_ = _g_object_ref0 (_tmp2_);
		_widget_list = _tmp3_;
		_tmp4_ = _widget_list;
		_tmp5_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp4_);
		_tmp6_ = _tmp5_;
		_widget_size = _tmp6_;
		_widget_index = -1;
		while (TRUE) {
			gint _tmp7_;
			gint _tmp8_;
			gint _tmp9_;
			GeeLinkedList* _tmp10_;
			gint _tmp11_;
			gpointer _tmp12_ = NULL;
			soywidgetsWidget* widget;
			soywidgetsWidget* _tmp13_;
			gint _tmp14_;
			gint _tmp15_;
			soywidgetsWidget* _tmp16_;
			gint _tmp17_;
			soywidgetsWidget* _tmp18_;
			gint _tmp19_;
			gint _tmp20_;
			soywidgetsWidget* _tmp21_;
			gint _tmp22_;
			_tmp7_ = _widget_index;
			_widget_index = _tmp7_ + 1;
			_tmp8_ = _widget_index;
			_tmp9_ = _widget_size;
			if (!(_tmp8_ < _tmp9_)) {
				break;
			}
			_tmp10_ = _widget_list;
			_tmp11_ = _widget_index;
			_tmp12_ = gee_abstract_list_get ((GeeAbstractList*) _tmp10_, _tmp11_);
			widget = (soywidgetsWidget*) _tmp12_;
			_tmp13_ = widget;
			_tmp14_ = _x;
			_tmp15_ = _y;
			_tmp16_ = widget;
			_tmp17_ = _tmp16_->width;
			_tmp18_ = widget;
			_tmp19_ = _tmp18_->height;
			soy_widgets_widget_render (_tmp13_, _tmp14_, _tmp15_, _tmp17_, _tmp19_);
			_tmp20_ = _y;
			_tmp21_ = widget;
			_tmp22_ = _tmp21_->height;
			_y = _tmp20_ + _tmp22_;
			_g_object_unref0 (widget);
		}
		_g_object_unref0 (_widget_list);
	}
}
Example #2
0
static void soy_widgets_vscroll_real_render (soywidgetsWidget* base, gint x, gint y, gint width, gint height) {
	soywidgetsVScroll * self;
	gint _tmp0_;
	gint _x;
	gint _tmp1_;
	gint _y;
	gboolean _tmp23_;
	GLfloat* _tmp24_ = NULL;
	GLushort* _tmp25_ = NULL;
	gboolean _tmp26_ = FALSE;
	GLuint _tmp27_;
	gboolean _tmp29_;
	gdouble _posy;
	soyatomsSize* _tmp38_;
	gfloat _tmp39_;
	gfloat _tmp40_;
	gdouble _tmp41_;
	gint _tmp42_;
	soyatomsSize* _tmp43_;
	soyatomsSize* _tmp44_;
	soyatomsSize* _tmp45_;
	gfloat _tmp46_;
	gfloat _tmp47_;
	gdouble viewPort2Height;
	soyatomsSize* _tmp48_;
	soyatomsSize* _tmp49_;
	soyatomsSize* _tmp50_;
	gfloat _tmp51_;
	gfloat _tmp52_;
	gfloat _tmp53_;
	gboolean _tmp54_;
	soyatomsSize* _tmp66_;
	gfloat _tmp67_;
	gfloat _tmp68_;
	soyatomsPosition* _tmp69_;
	gfloat _tmp70_;
	gfloat _tmp71_;
	gint _tmp72_;
	gdouble _tmp73_;
	self = (soywidgetsVScroll*) base;
	_tmp0_ = x;
	_x = _tmp0_;
	_tmp1_ = y;
	_y = _tmp1_;
	{
		GeeLinkedList* _tmp2_;
		GeeLinkedList* _tmp3_;
		GeeLinkedList* _widget_list;
		GeeLinkedList* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		gint _widget_size;
		gint _widget_index;
		_tmp2_ = ((soywidgetsContainer*) self)->children;
		_tmp3_ = _g_object_ref0 (_tmp2_);
		_widget_list = _tmp3_;
		_tmp4_ = _widget_list;
		_tmp5_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp4_);
		_tmp6_ = _tmp5_;
		_widget_size = _tmp6_;
		_widget_index = -1;
		while (TRUE) {
			gint _tmp7_;
			gint _tmp8_;
			gint _tmp9_;
			GeeLinkedList* _tmp10_;
			gint _tmp11_;
			gpointer _tmp12_ = NULL;
			soywidgetsWidget* widget;
			soywidgetsWidget* _tmp13_;
			gint _tmp14_;
			gint _tmp15_;
			soywidgetsWidget* _tmp16_;
			gint _tmp17_;
			soywidgetsWidget* _tmp18_;
			gint _tmp19_;
			gint _tmp20_;
			soywidgetsWidget* _tmp21_;
			gint _tmp22_;
			_tmp7_ = _widget_index;
			_widget_index = _tmp7_ + 1;
			_tmp8_ = _widget_index;
			_tmp9_ = _widget_size;
			if (!(_tmp8_ < _tmp9_)) {
				break;
			}
			_tmp10_ = _widget_list;
			_tmp11_ = _widget_index;
			_tmp12_ = gee_abstract_list_get ((GeeAbstractList*) _tmp10_, _tmp11_);
			widget = (soywidgetsWidget*) _tmp12_;
			_tmp13_ = widget;
			_tmp14_ = _x;
			_tmp15_ = _y;
			_tmp16_ = widget;
			_tmp17_ = _tmp16_->width;
			_tmp18_ = widget;
			_tmp19_ = _tmp18_->height;
			soy_widgets_widget_render (_tmp13_, _tmp14_, _tmp15_, _tmp17_, _tmp19_);
			_tmp20_ = _y;
			_tmp21_ = widget;
			_tmp22_ = _tmp21_->height;
			_y = _tmp20_ + _tmp22_;
			_g_object_unref0 (widget);
		}
		_g_object_unref0 (_widget_list);
	}
	_tmp23_ = self->priv->_hasBar;
	if (!_tmp23_) {
		return;
	}
	_tmp24_ = g_new0 (GLfloat, 20);
	_tmp24_[0] = (GLfloat) 0.0f;
	_tmp24_[1] = (GLfloat) 0.0f;
	_tmp24_[2] = (GLfloat) 0.0f;
	_tmp24_[3] = (GLfloat) 0.0f;
	_tmp24_[4] = (GLfloat) 0.0f;
	_tmp24_[5] = (GLfloat) 1.0f;
	_tmp24_[6] = (GLfloat) 0.0f;
	_tmp24_[7] = (GLfloat) 0.0f;
	_tmp24_[8] = (GLfloat) 1.0f;
	_tmp24_[9] = (GLfloat) 0.0f;
	_tmp24_[10] = (GLfloat) 1.0f;
	_tmp24_[11] = (GLfloat) 1.0f;
	_tmp24_[12] = (GLfloat) 0.0f;
	_tmp24_[13] = (GLfloat) 1.0f;
	_tmp24_[14] = (GLfloat) 1.0f;
	_tmp24_[15] = (GLfloat) 0.0f;
	_tmp24_[16] = (GLfloat) 1.0f;
	_tmp24_[17] = (GLfloat) 0.0f;
	_tmp24_[18] = (GLfloat) 0.0f;
	_tmp24_[19] = (GLfloat) 1.0f;
	soy_widgets_vscroll__verts = (g_free (soy_widgets_vscroll__verts), NULL);
	soy_widgets_vscroll__verts = _tmp24_;
	soy_widgets_vscroll__verts_length1 = 20;
	_soy_widgets_vscroll__verts_size_ = soy_widgets_vscroll__verts_length1;
	_tmp25_ = g_new0 (GLushort, 6);
	_tmp25_[0] = (GLushort) 0;
	_tmp25_[1] = (GLushort) 1;
	_tmp25_[2] = (GLushort) 2;
	_tmp25_[3] = (GLushort) 2;
	_tmp25_[4] = (GLushort) 3;
	_tmp25_[5] = (GLushort) 0;
	soy_widgets_vscroll__faces = (g_free (soy_widgets_vscroll__faces), NULL);
	soy_widgets_vscroll__faces = _tmp25_;
	soy_widgets_vscroll__faces_length1 = 6;
	_soy_widgets_vscroll__faces_size_ = soy_widgets_vscroll__faces_length1;
	_tmp27_ = self->priv->_vbuffer;
	if (_tmp27_ == ((GLuint) 0)) {
		_tmp26_ = TRUE;
	} else {
		GLuint _tmp28_;
		_tmp28_ = self->priv->_ibuffer;
		_tmp26_ = _tmp28_ == ((GLuint) 0);
	}
	_tmp29_ = _tmp26_;
	if (_tmp29_) {
		GLuint _tmp30_ = 0U;
		GLuint _tmp31_;
		GLfloat* _tmp32_;
		gint _tmp32__length1;
		GLuint _tmp33_ = 0U;
		GLuint _tmp34_;
		GLushort* _tmp35_;
		gint _tmp35__length1;
		glGenBuffers ((GLsizei) 1, &_tmp30_);
		self->priv->_vbuffer = _tmp30_;
		_tmp31_ = self->priv->_vbuffer;
		glBindBuffer (GL_ARRAY_BUFFER, _tmp31_);
		_tmp32_ = soy_widgets_vscroll__verts;
		_tmp32__length1 = soy_widgets_vscroll__verts_length1;
		glBufferData (GL_ARRAY_BUFFER, ((GLsizei) sizeof (GLfloat)) * 20, _tmp32_, GL_STATIC_DRAW);
		glGenBuffers ((GLsizei) 1, &_tmp33_);
		self->priv->_ibuffer = _tmp33_;
		_tmp34_ = self->priv->_ibuffer;
		glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, _tmp34_);
		_tmp35_ = soy_widgets_vscroll__faces;
		_tmp35__length1 = soy_widgets_vscroll__faces_length1;
		glBufferData (GL_ELEMENT_ARRAY_BUFFER, ((GLsizei) sizeof (GLushort)) * 6, _tmp35_, GL_STATIC_DRAW);
	} else {
		GLuint _tmp36_;
		GLuint _tmp37_;
		_tmp36_ = self->priv->_vbuffer;
		glBindBuffer (GL_ARRAY_BUFFER, _tmp36_);
		_tmp37_ = self->priv->_ibuffer;
		glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, _tmp37_);
	}
	_posy = 0.0;
	_tmp38_ = self->priv->_viewPort;
	_tmp39_ = soy_atoms_size_get_width (_tmp38_);
	_tmp40_ = _tmp39_;
	_tmp41_ = _posy;
	_tmp42_ = ((soywidgetsScroller*) self)->scrollbarThickness;
	_tmp43_ = soy_widgets_widget_get_size ((soywidgetsWidget*) self);
	_tmp44_ = _tmp43_;
	_tmp45_ = _tmp44_;
	_tmp46_ = soy_atoms_size_get_height (_tmp45_);
	_tmp47_ = _tmp46_;
	glViewport ((GLint) _tmp40_, (GLint) _tmp41_, (GLsizei) ((GLint) _tmp42_), (GLsizei) ((GLint) _tmp47_));
	_g_object_unref0 (_tmp45_);
	glMatrixMode (GL_PROJECTION);
	glLoadIdentity ();
	glOrthof ((GLfloat) 0.0f, (GLfloat) 1.0f, (GLfloat) 1.0f, (GLfloat) 0.0f, (GLfloat) (-1.0f), (GLfloat) 1.0f);
	glMatrixMode (GL_MODELVIEW);
	glLoadIdentity ();
	glDisableClientState (GL_NORMAL_ARRAY);
	glVertexPointer ((GLint) 3, GL_FLOAT, (GLsizei) 20, (void*) 0);
	glDrawElements (GL_TRIANGLES, (GLsizei) 6, GL_UNSIGNED_SHORT, (void*) 0);
	glColor4f ((GLfloat) 0, (GLfloat) 1, (GLfloat) 0, (GLfloat) 1);
	viewPort2Height = 0.0;
	_tmp48_ = soy_widgets_widget_get_size ((soywidgetsWidget*) self);
	_tmp49_ = _tmp48_;
	_tmp50_ = _tmp49_;
	_tmp51_ = soy_atoms_size_get_height (_tmp50_);
	_tmp52_ = _tmp51_;
	_tmp53_ = self->priv->_totalHeight;
	_tmp54_ = _tmp52_ < _tmp53_;
	_g_object_unref0 (_tmp50_);
	if (_tmp54_) {
		soyatomsSize* _tmp55_;
		soyatomsSize* _tmp56_;
		soyatomsSize* _tmp57_;
		gfloat _tmp58_;
		gfloat _tmp59_;
		gfloat _tmp60_;
		soyatomsSize* _tmp61_;
		soyatomsSize* _tmp62_;
		soyatomsSize* _tmp63_;
		gfloat _tmp64_;
		gfloat _tmp65_;
		_tmp55_ = soy_widgets_widget_get_size ((soywidgetsWidget*) self);
		_tmp56_ = _tmp55_;
		_tmp57_ = _tmp56_;
		_tmp58_ = soy_atoms_size_get_height (_tmp57_);
		_tmp59_ = _tmp58_;
		_tmp60_ = self->priv->_totalHeight;
		_tmp61_ = soy_widgets_widget_get_size ((soywidgetsWidget*) self);
		_tmp62_ = _tmp61_;
		_tmp63_ = _tmp62_;
		_tmp64_ = soy_atoms_size_get_height (_tmp63_);
		_tmp65_ = _tmp64_;
		viewPort2Height = (gdouble) ((_tmp59_ / _tmp60_) * _tmp65_);
		_g_object_unref0 (_tmp63_);
		_g_object_unref0 (_tmp57_);
	}
	_tmp66_ = self->priv->_viewPort;
	_tmp67_ = soy_atoms_size_get_width (_tmp66_);
	_tmp68_ = _tmp67_;
	_tmp69_ = ((soywidgetsScroller*) self)->scrollPosition;
	_tmp70_ = soy_atoms_position_get_y (_tmp69_);
	_tmp71_ = _tmp70_;
	_tmp72_ = ((soywidgetsScroller*) self)->scrollbarThickness;
	_tmp73_ = viewPort2Height;
	glViewport ((GLint) _tmp68_, (GLint) _tmp71_, (GLsizei) ((GLint) _tmp72_), (GLsizei) ((GLint) _tmp73_));
	glDrawElements (GL_TRIANGLES, (GLsizei) 6, GL_UNSIGNED_SHORT, (void*) 0);
	glColor4f ((GLfloat) 1, (GLfloat) 1, (GLfloat) 1, (GLfloat) 1);
}