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
xfce4-screensaver
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
56
Issues
56
List
Boards
Labels
Service Desk
Milestones
Custom Issue Tracker
Custom Issue Tracker
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Apps
xfce4-screensaver
Commits
ee379857
Commit
ee379857
authored
Sep 30, 2018
by
Sean Davis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tidy up xfcekbd-util.{c,h}
parent
7ba00e25
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
90 deletions
+0
-90
src/xfcekbd-config-private.h
src/xfcekbd-config-private.h
+0
-5
src/xfcekbd-util.c
src/xfcekbd-util.c
+0
-79
src/xfcekbd-util.h
src/xfcekbd-util.h
+0
-6
No files found.
src/xfcekbd-config-private.h
View file @
ee379857
...
...
@@ -25,11 +25,6 @@
#define XFCEKBD_CONFIG_SCHEMA "org.mate.peripherals-keyboard-xkb"
extern
const
gchar
MATEKBD_PREVIEW_CONFIG_KEY_X
[];
extern
const
gchar
MATEKBD_PREVIEW_CONFIG_KEY_Y
[];
extern
const
gchar
MATEKBD_PREVIEW_CONFIG_KEY_WIDTH
[];
extern
const
gchar
MATEKBD_PREVIEW_CONFIG_KEY_HEIGHT
[];
/**
* General config functions (private)
*/
...
...
src/xfcekbd-util.c
View file @
ee379857
...
...
@@ -33,85 +33,6 @@
#include <xfcekbd-config-private.h>
static
void
xfcekbd_log_appender
(
const
char
file
[],
const
char
function
[],
int
level
,
const
char
format
[],
va_list
args
)
{
time_t
now
=
time
(
NULL
);
g_log
(
NULL
,
G_LOG_LEVEL_DEBUG
,
"[%08ld,%03d,%s:%s/]
\t
"
,
(
long
)
now
,
level
,
file
,
function
);
g_logv
(
NULL
,
G_LOG_LEVEL_DEBUG
,
format
,
args
);
}
void
xfcekbd_install_glib_log_appender
(
void
)
{
xkl_set_log_appender
(
xfcekbd_log_appender
);
}
#define MATEKBD_PREVIEW_CONFIG_SCHEMA XFCEKBD_CONFIG_SCHEMA ".preview"
const
gchar
MATEKBD_PREVIEW_CONFIG_KEY_X
[]
=
"x"
;
const
gchar
MATEKBD_PREVIEW_CONFIG_KEY_Y
[]
=
"y"
;
const
gchar
MATEKBD_PREVIEW_CONFIG_KEY_WIDTH
[]
=
"width"
;
const
gchar
MATEKBD_PREVIEW_CONFIG_KEY_HEIGHT
[]
=
"height"
;
/**
* xfcekbd_preview_load_position:
*
* Returns: (transfer full): A rectangle to use
*/
GdkRectangle
*
xfcekbd_preview_load_position
(
void
)
{
GdkRectangle
*
rv
=
NULL
;
gint
x
,
y
,
w
,
h
;
GSettings
*
settings
=
g_settings_new
(
MATEKBD_PREVIEW_CONFIG_SCHEMA
);
x
=
g_settings_get_int
(
settings
,
MATEKBD_PREVIEW_CONFIG_KEY_X
);
y
=
g_settings_get_int
(
settings
,
MATEKBD_PREVIEW_CONFIG_KEY_Y
);
w
=
g_settings_get_int
(
settings
,
MATEKBD_PREVIEW_CONFIG_KEY_WIDTH
);
h
=
g_settings_get_int
(
settings
,
MATEKBD_PREVIEW_CONFIG_KEY_HEIGHT
);
g_object_unref
(
settings
);
rv
=
g_new
(
GdkRectangle
,
1
);
if
(
x
==
-
1
||
y
==
-
1
||
w
==
-
1
||
h
==
-
1
)
{
/* default values should be treated as
* "0.75 of the screen size" */
GdkScreen
*
scr
=
gdk_screen_get_default
();
gint
w
=
WidthOfScreen
(
gdk_x11_screen_get_xscreen
(
scr
));
gint
h
=
HeightOfScreen
(
gdk_x11_screen_get_xscreen
(
scr
));
rv
->
x
=
w
>>
3
;
rv
->
y
=
h
>>
3
;
rv
->
width
=
w
-
(
w
>>
2
);
rv
->
height
=
h
-
(
h
>>
2
);
}
else
{
rv
->
x
=
x
;
rv
->
y
=
y
;
rv
->
width
=
w
;
rv
->
height
=
h
;
}
return
rv
;
}
void
xfcekbd_preview_save_position
(
GdkRectangle
*
rect
)
{
GSettings
*
settings
=
g_settings_new
(
MATEKBD_PREVIEW_CONFIG_SCHEMA
);
g_settings_delay
(
settings
);
g_settings_set_int
(
settings
,
MATEKBD_PREVIEW_CONFIG_KEY_X
,
rect
->
x
);
g_settings_set_int
(
settings
,
MATEKBD_PREVIEW_CONFIG_KEY_Y
,
rect
->
y
);
g_settings_set_int
(
settings
,
MATEKBD_PREVIEW_CONFIG_KEY_WIDTH
,
rect
->
width
);
g_settings_set_int
(
settings
,
MATEKBD_PREVIEW_CONFIG_KEY_HEIGHT
,
rect
->
height
);
g_settings_apply
(
settings
);
g_object_unref
(
settings
);
}
/**
* xfcekbd_strv_append:
*
...
...
src/xfcekbd-util.h
View file @
ee379857
...
...
@@ -23,12 +23,6 @@
#include <glib.h>
#include <gdk/gdk.h>
extern
void
xfcekbd_install_glib_log_appender
(
void
);
extern
GdkRectangle
*
xfcekbd_preview_load_position
(
void
);
extern
void
xfcekbd_preview_save_position
(
GdkRectangle
*
rect
);
/* Missing in glib */
extern
gchar
**
xfcekbd_strv_append
(
gchar
**
arr
,
gchar
*
element
);
...
...
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