Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
xfce4-dict
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Apps
xfce4-dict
Commits
6319d0fa
Commit
6319d0fa
authored
16 years ago
by
Enrico Tröger
Browse files
Options
Downloads
Patches
Plain Diff
Use the G_DEFINE_TYPE() macro to generate the *_get_type() code.
(Old svn revision: 6662)
parent
b26c5e62
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/searchentry.c
+1
-28
1 addition, 28 deletions
lib/searchentry.c
lib/wraplabel.c
+3
-34
3 additions, 34 deletions
lib/wraplabel.c
with
4 additions
and
62 deletions
lib/searchentry.c
+
1
−
28
View file @
6319d0fa
...
...
@@ -28,10 +28,6 @@
#include
"sexy-icon-entry.h"
static
void
xfd_search_entry_class_init
(
XfdSearchEntryClass
*
klass
);
static
void
xfd_search_entry_init
(
XfdSearchEntry
*
self
);
enum
{
ACTIVE_CHANGED
,
...
...
@@ -41,30 +37,7 @@ enum
static
guint
signals
[
LAST_SIGNAL
];
GType
xfd_search_entry_get_type
(
void
)
{
static
GType
self_type
=
0
;
if
(
!
self_type
)
{
static
const
GTypeInfo
self_info
=
{
sizeof
(
XfdSearchEntryClass
),
NULL
,
/* base_init */
NULL
,
/* base_finalize */
(
GClassInitFunc
)
xfd_search_entry_class_init
,
NULL
,
/* class_finalize */
NULL
,
/* class_data */
sizeof
(
XfdSearchEntry
),
0
,
(
GInstanceInitFunc
)
xfd_search_entry_init
,
NULL
/* value_table */
};
self_type
=
g_type_register_static
(
GTK_TYPE_COMBO_BOX_ENTRY
,
"XfdSearchEntry"
,
&
self_info
,
0
);
}
return
self_type
;
}
G_DEFINE_TYPE
(
XfdSearchEntry
,
xfd_search_entry
,
GTK_TYPE_COMBO_BOX_ENTRY
)
static
void
xfd_search_entry_class_init
(
XfdSearchEntryClass
*
klass
)
...
...
This diff is collapsed.
Click to expand it.
lib/wraplabel.c
+
3
−
34
View file @
6319d0fa
...
...
@@ -31,15 +31,10 @@
#include
"wraplabel.h"
/* Local data */
static
GObjectClass
*
parent_class
=
NULL
;
#define XFD_WRAP_LABEL_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), \
XFD_WRAP_LABEL_TYPE, XfdWrapLabelPrivate))
struct
_XfdWrapLabelClass
{
GtkLabelClass
parent_class
;
...
...
@@ -56,43 +51,17 @@ typedef struct
}
XfdWrapLabelPrivate
;
static
void
xfd_w
rap
_l
abel
_class_init
(
XfdW
rap
L
abel
Class
*
klass
);
static
void
xfd_wrap_label_init
(
XfdWrapLabel
*
self
);
G_DEFINE_TYPE
(
XfdW
rap
L
abel
,
xfd_w
rap
_l
abel
,
GTK_TYPE_LABEL
);
static
void
xfd_wrap_label_size_request
(
GtkWidget
*
widget
,
GtkRequisition
*
req
);
static
void
xfd_wrap_label_size_allocate
(
GtkWidget
*
widget
,
GtkAllocation
*
alloc
);
static
void
xfd_wrap_label_set_wrap_width
(
GtkWidget
*
widget
,
gsize
width
);
GType
xfd_wrap_label_get_type
()
{
static
GType
type
=
G_TYPE_INVALID
;
if
(
G_UNLIKELY
(
type
==
G_TYPE_INVALID
))
{
GTypeInfo
gwl_info
=
{
sizeof
(
XfdWrapLabelClass
),
NULL
,
NULL
,
(
GClassInitFunc
)
xfd_wrap_label_class_init
,
NULL
,
NULL
,
sizeof
(
XfdWrapLabel
),
3
,
(
GInstanceInitFunc
)
xfd_wrap_label_init
,
NULL
};
type
=
g_type_register_static
(
GTK_TYPE_LABEL
,
"XfdWrapLabel"
,
&
gwl_info
,
0
);
}
return
type
;
}
static
void
xfd_wrap_label_class_init
(
XfdWrapLabelClass
*
klass
)
{
GtkWidgetClass
*
widget_class
=
GTK_WIDGET_CLASS
(
klass
);
parent_class
=
g_type_class_peek_parent
(
klass
);
widget_class
->
size_request
=
xfd_wrap_label_size_request
;
widget_class
->
size_allocate
=
xfd_wrap_label_size_allocate
;
...
...
@@ -147,7 +116,7 @@ static void xfd_wrap_label_size_request(GtkWidget *widget, GtkRequisition *req)
/* Sets the wrap width to the width allocated to us. */
static
void
xfd_wrap_label_size_allocate
(
GtkWidget
*
widget
,
GtkAllocation
*
alloc
)
{
(
*
GTK_WIDGET_CLASS
(
parent_class
)
->
size_allocate
)(
widget
,
alloc
);
(
*
GTK_WIDGET_CLASS
(
xfd_wrap_label_
parent_class
)
->
size_allocate
)(
widget
,
alloc
);
xfd_wrap_label_set_wrap_width
(
widget
,
alloc
->
width
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment