Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
upower
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
75
Issues
75
List
Boards
Labels
Service Desk
Milestones
Merge Requests
14
Merge Requests
14
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
upower
upower
Commits
c8cec18f
Commit
c8cec18f
authored
Jan 18, 2010
by
Richard Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trivial: DkpInput -> UpInput (no ABI or API break)
parent
e04b5a9e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
48 deletions
+48
-48
src/linux/up-backend.c
src/linux/up-backend.c
+3
-3
src/linux/up-input.c
src/linux/up-input.c
+29
-29
src/linux/up-input.h
src/linux/up-input.h
+16
-16
No files found.
src/linux/up-backend.c
View file @
c8cec18f
...
...
@@ -77,7 +77,7 @@ up_backend_device_new (UpBackend *backend, GUdevDevice *native)
const
gchar
*
subsys
;
const
gchar
*
native_path
;
UpDevice
*
device
=
NULL
;
Dk
pInput
*
input
;
U
pInput
*
input
;
gboolean
ret
;
subsys
=
g_udev_device_get_subsystem
(
native
);
...
...
@@ -127,8 +127,8 @@ up_backend_device_new (UpBackend *backend, GUdevDevice *native)
}
else
if
(
g_strcmp0
(
subsys
,
"input"
)
==
0
)
{
/* check input device */
input
=
dk
p_input_new
();
ret
=
dk
p_input_coldplug
(
input
,
backend
->
priv
->
daemon
,
native
);
input
=
u
p_input_new
();
ret
=
u
p_input_coldplug
(
input
,
backend
->
priv
->
daemon
,
native
);
if
(
!
ret
)
{
g_object_unref
(
input
);
goto
out
;
...
...
src/linux/up-input.c
View file @
c8cec18f
...
...
@@ -47,7 +47,7 @@
#include "up-input.h"
#include "up-daemon.h"
struct
Dk
pInputPrivate
struct
U
pInputPrivate
{
int
eventfp
;
struct
input_event
event
;
...
...
@@ -56,8 +56,8 @@ struct DkpInputPrivate
UpDaemon
*
daemon
;
};
G_DEFINE_TYPE
(
DkpInput
,
dk
p_input
,
G_TYPE_OBJECT
)
#define
DKP_INPUT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), DKP_TYPE_INPUT, Dk
pInputPrivate))
G_DEFINE_TYPE
(
UpInput
,
u
p_input
,
G_TYPE_OBJECT
)
#define
UP_INPUT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_INPUT, U
pInputPrivate))
/* we must use this kernel-compatible implementation */
#define BITS_PER_LONG (sizeof(long) * 8)
...
...
@@ -68,10 +68,10 @@ G_DEFINE_TYPE (DkpInput, dkp_input, G_TYPE_OBJECT)
#define test_bit(bit, array) ((array[LONG(bit)] >> OFF(bit)) & 1)
/**
*
dk
p_input_str_to_bitmask:
*
u
p_input_str_to_bitmask:
**/
static
gint
dk
p_input_str_to_bitmask
(
const
gchar
*
s
,
glong
*
bitmask
,
size_t
max_size
)
u
p_input_str_to_bitmask
(
const
gchar
*
s
,
glong
*
bitmask
,
size_t
max_size
)
{
gint
i
,
j
;
gchar
**
v
;
...
...
@@ -96,12 +96,12 @@ dkp_input_str_to_bitmask (const gchar *s, glong *bitmask, size_t max_size)
}
/**
*
dk
p_input_event_io:
*
u
p_input_event_io:
**/
static
gboolean
dk
p_input_event_io
(
GIOChannel
*
channel
,
GIOCondition
condition
,
gpointer
data
)
u
p_input_event_io
(
GIOChannel
*
channel
,
GIOCondition
condition
,
gpointer
data
)
{
DkpInput
*
input
=
(
Dk
pInput
*
)
data
;
UpInput
*
input
=
(
U
pInput
*
)
data
;
GError
*
error
=
NULL
;
gsize
read_bytes
;
glong
bitmask
[
NBITS
(
SW_MAX
)];
...
...
@@ -161,10 +161,10 @@ out:
}
/**
*
dk
p_input_coldplug:
*
u
p_input_coldplug:
**/
gboolean
dkp_input_coldplug
(
Dk
pInput
*
input
,
UpDaemon
*
daemon
,
GUdevDevice
*
d
)
up_input_coldplug
(
U
pInput
*
input
,
UpDaemon
*
daemon
,
GUdevDevice
*
d
)
{
gboolean
ret
=
FALSE
;
gchar
*
path
;
...
...
@@ -200,7 +200,7 @@ dkp_input_coldplug (DkpInput *input, UpDaemon *daemon, GUdevDevice *d)
}
/* convert to a bitmask */
num_bits
=
dk
p_input_str_to_bitmask
(
contents
,
bitmask
,
sizeof
(
bitmask
));
num_bits
=
u
p_input_str_to_bitmask
(
contents
,
bitmask
,
sizeof
(
bitmask
));
if
(
num_bits
!=
1
)
{
egg_debug
(
"not one bitmask entry for %s"
,
native_path
);
ret
=
FALSE
;
...
...
@@ -254,7 +254,7 @@ dkp_input_coldplug (DkpInput *input, UpDaemon *daemon, GUdevDevice *d)
input
->
priv
->
daemon
=
g_object_ref
(
daemon
);
/* watch this */
g_io_add_watch
(
input
->
priv
->
channel
,
G_IO_IN
|
G_IO_ERR
|
G_IO_HUP
|
G_IO_NVAL
,
dk
p_input_event_io
,
input
);
g_io_add_watch
(
input
->
priv
->
channel
,
G_IO_IN
|
G_IO_ERR
|
G_IO_HUP
|
G_IO_NVAL
,
u
p_input_event_io
,
input
);
/* set if we are closed */
egg_debug
(
"using %s for lid event"
,
native_path
);
...
...
@@ -268,29 +268,29 @@ out:
}
/**
*
dk
p_input_init:
*
u
p_input_init:
**/
static
void
dkp_input_init
(
Dk
pInput
*
input
)
up_input_init
(
U
pInput
*
input
)
{
input
->
priv
=
DK
P_INPUT_GET_PRIVATE
(
input
);
input
->
priv
=
U
P_INPUT_GET_PRIVATE
(
input
);
input
->
priv
->
eventfp
=
-
1
;
input
->
priv
->
channel
=
NULL
;
input
->
priv
->
daemon
=
NULL
;
}
/**
*
dk
p_input_finalize:
*
u
p_input_finalize:
**/
static
void
dk
p_input_finalize
(
GObject
*
object
)
u
p_input_finalize
(
GObject
*
object
)
{
Dk
pInput
*
input
;
U
pInput
*
input
;
g_return_if_fail
(
object
!=
NULL
);
g_return_if_fail
(
DK
P_IS_INPUT
(
object
));
g_return_if_fail
(
U
P_IS_INPUT
(
object
));
input
=
DK
P_INPUT
(
object
);
input
=
U
P_INPUT
(
object
);
g_return_if_fail
(
input
->
priv
!=
NULL
);
if
(
input
->
priv
->
daemon
!=
NULL
)
...
...
@@ -301,26 +301,26 @@ dkp_input_finalize (GObject *object)
g_io_channel_shutdown
(
input
->
priv
->
channel
,
FALSE
,
NULL
);
g_io_channel_unref
(
input
->
priv
->
channel
);
}
G_OBJECT_CLASS
(
dk
p_input_parent_class
)
->
finalize
(
object
);
G_OBJECT_CLASS
(
u
p_input_parent_class
)
->
finalize
(
object
);
}
/**
*
dk
p_input_class_init:
*
u
p_input_class_init:
**/
static
void
dkp_input_class_init
(
Dk
pInputClass
*
klass
)
up_input_class_init
(
U
pInputClass
*
klass
)
{
GObjectClass
*
object_class
=
G_OBJECT_CLASS
(
klass
);
object_class
->
finalize
=
dk
p_input_finalize
;
g_type_class_add_private
(
klass
,
sizeof
(
Dk
pInputPrivate
));
object_class
->
finalize
=
u
p_input_finalize
;
g_type_class_add_private
(
klass
,
sizeof
(
U
pInputPrivate
));
}
/**
*
dk
p_input_new:
*
u
p_input_new:
**/
Dk
pInput
*
dk
p_input_new
(
void
)
U
pInput
*
u
p_input_new
(
void
)
{
return
g_object_new
(
DK
P_TYPE_INPUT
,
NULL
);
return
g_object_new
(
U
P_TYPE_INPUT
,
NULL
);
}
src/linux/up-input.h
View file @
c8cec18f
...
...
@@ -18,8 +18,8 @@
*
*/
#ifndef __
DK
P_INPUT_H__
#define __
DK
P_INPUT_H__
#ifndef __
U
P_INPUT_H__
#define __
U
P_INPUT_H__
#include <glib-object.h>
...
...
@@ -27,33 +27,33 @@
G_BEGIN_DECLS
#define
DKP_TYPE_INPUT (dk
p_input_get_type ())
#define
DKP_INPUT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), DKP_TYPE_INPUT, Dk
pInput))
#define
DKP_INPUT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), DKP_TYPE_INPUT, Dk
pInputClass))
#define
DKP_IS_INPUT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), DK
P_TYPE_INPUT))
#define
DKP_IS_INPUT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), DK
P_TYPE_INPUT))
#define
DKP_INPUT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), DKP_TYPE_INPUT, Dk
pInputClass))
#define
UP_TYPE_INPUT (u
p_input_get_type ())
#define
UP_INPUT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), UP_TYPE_INPUT, U
pInput))
#define
UP_INPUT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), UP_TYPE_INPUT, U
pInputClass))
#define
UP_IS_INPUT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), U
P_TYPE_INPUT))
#define
UP_IS_INPUT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), U
P_TYPE_INPUT))
#define
UP_INPUT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), UP_TYPE_INPUT, U
pInputClass))
typedef
struct
DkpInputPrivate
Dk
pInputPrivate
;
typedef
struct
UpInputPrivate
U
pInputPrivate
;
typedef
struct
{
GObject
parent
;
Dk
pInputPrivate
*
priv
;
}
Dk
pInput
;
U
pInputPrivate
*
priv
;
}
U
pInput
;
typedef
struct
{
GObjectClass
parent_class
;
}
Dk
pInputClass
;
}
U
pInputClass
;
GType
dk
p_input_get_type
(
void
);
DkpInput
*
dk
p_input_new
(
void
);
gboolean
dkp_input_coldplug
(
Dk
pInput
*
input
,
GType
u
p_input_get_type
(
void
);
UpInput
*
u
p_input_new
(
void
);
gboolean
up_input_coldplug
(
U
pInput
*
input
,
UpDaemon
*
daemon
,
GUdevDevice
*
d
);
G_END_DECLS
#endif
/* __
DK
P_INPUT_H__ */
#endif
/* __
U
P_INPUT_H__ */
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