GTKWidget Structure defined differently?

Linux specific forum
Justin
Addict
Addict
Posts: 832
Joined: Sat Apr 26, 2003 2:49 pm

GTKWidget Structure defined differently?

Post by Justin »

Why is the GTKWidget structure defined diferently in gtkwidget.h than in PB?

Code: Select all

struct _GtkWidget
{
GInitiallyUnowned parent_instance;
GtkWidgetPrivate *priv;
};
In PB is different you can see it in the structure viewer.
Fred
Administrator
Administrator
Posts: 16686
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: GTKWidget Structure defined differently?

Post by Fred »

PB has GTK/GTK2 structures i think. We should update to GTK3 but it's a lot of work.
Justin
Addict
Addict
Posts: 832
Joined: Sat Apr 26, 2003 2:49 pm

Re: GTKWidget Structure defined differently?

Post by Justin »

Ok, so the GTK3 one would be the one i posted?
I am asking this because i am porting some gtk stuff to windows, another thing i noticed is that some structures are padded, like:

Code: Select all

Structure  GObject
	g_type_instance.GTypeInstance
	ref_count.l
	PB_Alignement.b[4]
	*qdata.GData
EndStructure
How do i know when i have to use padding?, or can i just use align #PB_Structure_AlignC in all of them?
Btw, the ref_count field is defined as:
volatile guint ref_count;
and guint is: typedef unsigned int guint;
so it should be .i, no?
Fred
Administrator
Administrator
Posts: 16686
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: GTKWidget Structure defined differently?

Post by Fred »

Yes, #PB_Structure_AlignC should be enough. The padding info were added before PB got this feature.
Post Reply