Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gtk
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1,147
Issues
1,147
List
Boards
Labels
Milestones
Merge Requests
96
Merge Requests
96
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
gtk
Commits
abe26764
Commit
abe26764
authored
May 24, 2010
by
Javier Jardón
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gtkbbox: Move public members to private structure
parent
12371751
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
30 deletions
+61
-30
gtk/gtkbbox.c
gtk/gtkbbox.c
+57
-25
gtk/gtkbbox.h
gtk/gtkbbox.h
+4
-5
No files found.
gtk/gtkbbox.c
View file @
abe26764
...
...
@@ -61,6 +61,16 @@
#include "gtkintl.h"
struct
_GtkButtonBoxPriv
{
GtkButtonBoxStyle
layout_style
;
gint
child_ipad_x
;
gint
child_ipad_y
;
gint
child_min_width
;
gint
child_min_height
;
};
enum
{
PROP_0
,
PROP_LAYOUT_STYLE
...
...
@@ -175,17 +185,26 @@ gtk_button_box_class_init (GtkButtonBoxClass *class)
P_
(
"If TRUE, the child appears in a secondary group of children, suitable for, e.g., help buttons"
),
FALSE
,
GTK_PARAM_READWRITE
));
g_type_class_add_private
(
class
,
sizeof
(
GtkButtonBoxPriv
));
}
static
void
gtk_button_box_init
(
GtkButtonBox
*
button_box
)
{
GTK_BOX
(
button_box
)
->
spacing
=
0
;
button_box
->
child_min_width
=
GTK_BUTTONBOX_DEFAULT
;
button_box
->
child_min_height
=
GTK_BUTTONBOX_DEFAULT
;
button_box
->
child_ipad_x
=
GTK_BUTTONBOX_DEFAULT
;
button_box
->
child_ipad_y
=
GTK_BUTTONBOX_DEFAULT
;
button_box
->
layout_style
=
GTK_BUTTONBOX_DEFAULT_STYLE
;
GtkButtonBoxPriv
*
priv
;
button_box
->
priv
=
G_TYPE_INSTANCE_GET_PRIVATE
(
button_box
,
GTK_TYPE_BUTTON_BOX
,
GtkButtonBoxPriv
);
priv
=
button_box
->
priv
;
gtk_box_set_spacing
(
GTK_BOX
(
button_box
),
0
);
priv
->
child_min_width
=
GTK_BUTTONBOX_DEFAULT
;
priv
->
child_min_height
=
GTK_BUTTONBOX_DEFAULT
;
priv
->
child_ipad_x
=
GTK_BUTTONBOX_DEFAULT
;
priv
->
child_ipad_y
=
GTK_BUTTONBOX_DEFAULT
;
priv
->
layout_style
=
GTK_BUTTONBOX_DEFAULT_STYLE
;
}
static
void
...
...
@@ -212,10 +231,12 @@ gtk_button_box_get_property (GObject *object,
GValue
*
value
,
GParamSpec
*
pspec
)
{
GtkButtonBoxPriv
*
priv
=
GTK_BUTTON_BOX
(
object
)
->
priv
;
switch
(
prop_id
)
{
case
PROP_LAYOUT_STYLE
:
g_value_set_enum
(
value
,
GTK_BUTTON_BOX
(
object
)
->
layout_style
);
g_value_set_enum
(
value
,
priv
->
layout_style
);
break
;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID
(
object
,
prop_id
,
pspec
);
...
...
@@ -273,13 +294,17 @@ void
gtk_button_box_set_layout
(
GtkButtonBox
*
widget
,
GtkButtonBoxStyle
layout_style
)
{
GtkButtonBoxPriv
*
priv
;
g_return_if_fail
(
GTK_IS_BUTTON_BOX
(
widget
));
g_return_if_fail
(
layout_style
>=
GTK_BUTTONBOX_DEFAULT_STYLE
&&
layout_style
<=
GTK_BUTTONBOX_CENTER
);
if
(
widget
->
layout_style
!=
layout_style
)
priv
=
widget
->
priv
;
if
(
priv
->
layout_style
!=
layout_style
)
{
widget
->
layout_style
=
layout_style
;
priv
->
layout_style
=
layout_style
;
g_object_notify
(
G_OBJECT
(
widget
),
"layout-style"
);
gtk_widget_queue_resize
(
GTK_WIDGET
(
widget
));
}
...
...
@@ -298,7 +323,7 @@ gtk_button_box_get_layout (GtkButtonBox *widget)
{
g_return_val_if_fail
(
GTK_IS_BUTTON_BOX
(
widget
),
GTK_BUTTONBOX_SPREAD
);
return
widget
->
layout_style
;
return
widget
->
priv
->
layout_style
;
}
/**
...
...
@@ -316,8 +341,8 @@ gboolean
gtk_button_box_get_child_secondary
(
GtkButtonBox
*
widget
,
GtkWidget
*
child
)
{
GList
*
list
;
GtkBoxChild
*
child_info
;
GList
*
list
;
g_return_val_if_fail
(
GTK_IS_BUTTON_BOX
(
widget
),
FALSE
);
g_return_val_if_fail
(
GTK_IS_WIDGET
(
child
),
FALSE
);
...
...
@@ -399,6 +424,7 @@ _gtk_button_box_child_requisition (GtkWidget *widget,
int
*
width
,
int
*
height
)
{
GtkButtonBoxPriv
*
priv
;
GtkButtonBox
*
bbox
;
GtkBoxChild
*
child
;
GList
*
children
;
...
...
@@ -422,6 +448,7 @@ _gtk_button_box_child_requisition (GtkWidget *widget,
g_return_if_fail
(
GTK_IS_BUTTON_BOX
(
widget
));
bbox
=
GTK_BUTTON_BOX
(
widget
);
priv
=
bbox
->
priv
;
gtk_widget_style_get
(
widget
,
"child-min-width"
,
&
width_default
,
...
...
@@ -429,15 +456,15 @@ _gtk_button_box_child_requisition (GtkWidget *widget,
"child-internal-pad-x"
,
&
ipad_x_default
,
"child-internal-pad-y"
,
&
ipad_y_default
,
NULL
);
child_min_width
=
bbox
->
child_min_width
!=
GTK_BUTTONBOX_DEFAULT
?
bbox
->
child_min_width
:
width_default
;
child_min_height
=
bbox
->
child_min_height
!=
GTK_BUTTONBOX_DEFAULT
?
bbox
->
child_min_height
:
height_default
;
ipad_x
=
bbox
->
child_ipad_x
!=
GTK_BUTTONBOX_DEFAULT
?
bbox
->
child_ipad_x
:
ipad_x_default
;
ipad_y
=
bbox
->
child_ipad_y
!=
GTK_BUTTONBOX_DEFAULT
?
bbox
->
child_ipad_y
:
ipad_y_default
;
child_min_width
=
priv
->
child_min_width
!=
GTK_BUTTONBOX_DEFAULT
?
priv
->
child_min_width
:
width_default
;
child_min_height
=
priv
->
child_min_height
!=
GTK_BUTTONBOX_DEFAULT
?
priv
->
child_min_height
:
height_default
;
ipad_x
=
priv
->
child_ipad_x
!=
GTK_BUTTONBOX_DEFAULT
?
priv
->
child_ipad_x
:
ipad_x_default
;
ipad_y
=
priv
->
child_ipad_y
!=
GTK_BUTTONBOX_DEFAULT
?
priv
->
child_ipad_y
:
ipad_y_default
;
nchildren
=
0
;
nsecondaries
=
0
;
...
...
@@ -497,6 +524,7 @@ static void
gtk_button_box_size_request
(
GtkWidget
*
widget
,
GtkRequisition
*
requisition
)
{
GtkButtonBoxPriv
*
priv
;
GtkBox
*
box
;
GtkButtonBox
*
bbox
;
gint
nvis_children
;
...
...
@@ -508,11 +536,12 @@ gtk_button_box_size_request (GtkWidget *widget,
box
=
GTK_BOX
(
widget
);
bbox
=
GTK_BUTTON_BOX
(
widget
);
priv
=
bbox
->
priv
;
orientation
=
gtk_orientable_get_orientation
(
GTK_ORIENTABLE
(
widget
));
spacing
=
box
->
spacing
;
layout
=
bbox
->
layout_style
!=
GTK_BUTTONBOX_DEFAULT_STYLE
?
bbox
->
layout_style
:
gtk_button_box_kludge_get_layout_default
(
GTK_BUTTON_BOX
(
widget
));
layout
=
priv
->
layout_style
!=
GTK_BUTTONBOX_DEFAULT_STYLE
?
priv
->
layout_style
:
gtk_button_box_kludge_get_layout_default
(
GTK_BUTTON_BOX
(
widget
));
_gtk_button_box_child_requisition
(
widget
,
&
nvis_children
,
...
...
@@ -569,6 +598,7 @@ static void
gtk_button_box_size_allocate
(
GtkWidget
*
widget
,
GtkAllocation
*
allocation
)
{
GtkButtonBoxPriv
*
priv
;
GtkBox
*
base_box
;
GtkButtonBox
*
box
;
GtkBoxChild
*
child
;
...
...
@@ -590,12 +620,14 @@ gtk_button_box_size_allocate (GtkWidget *widget,
gint
spacing
;
GtkOrientation
orientation
;
orientation
=
gtk_orientable_get_orientation
(
GTK_ORIENTABLE
(
widget
));
base_box
=
GTK_BOX
(
widget
);
box
=
GTK_BUTTON_BOX
(
widget
);
priv
=
box
->
priv
;
orientation
=
gtk_orientable_get_orientation
(
GTK_ORIENTABLE
(
widget
));
spacing
=
base_box
->
spacing
;
layout
=
box
->
layout_style
!=
GTK_BUTTONBOX_DEFAULT_STYLE
?
box
->
layout_style
:
gtk_button_box_kludge_get_layout_default
(
GTK_BUTTON_BOX
(
widget
));
layout
=
priv
->
layout_style
!=
GTK_BUTTONBOX_DEFAULT_STYLE
?
priv
->
layout_style
:
gtk_button_box_kludge_get_layout_default
(
GTK_BUTTON_BOX
(
widget
));
_gtk_button_box_child_requisition
(
widget
,
&
nvis_children
,
&
n_secondaries
,
...
...
gtk/gtkbbox.h
View file @
abe26764
...
...
@@ -47,16 +47,15 @@ G_BEGIN_DECLS
#define GTK_BUTTONBOX_DEFAULT -1
typedef
struct
_GtkButtonBox
GtkButtonBox
;
typedef
struct
_GtkButtonBoxPriv
GtkButtonBoxPriv
;
typedef
struct
_GtkButtonBoxClass
GtkButtonBoxClass
;
struct
_GtkButtonBox
{
GtkBox
box
;
gint
GSEAL
(
child_min_width
);
gint
GSEAL
(
child_min_height
);
gint
GSEAL
(
child_ipad_x
);
gint
GSEAL
(
child_ipad_y
);
GtkButtonBoxStyle
GSEAL
(
layout_style
);
/*< private >*/
GtkButtonBoxPriv
*
priv
;
};
struct
_GtkButtonBoxClass
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment