x11: Clean up xsettings header

- Don't use defines for renames
- Move enum into only source file using it
This commit is contained in:
Benjamin Otte 2013-02-17 00:37:09 +01:00
parent e1efe3269c
commit 200d6fe664
3 changed files with 21 additions and 27 deletions

View File

@ -135,7 +135,7 @@ _gdk_x11_screen_events_uninit (GdkScreen *screen)
if (x11_screen->xsettings_client)
{
xsettings_client_destroy (x11_screen->xsettings_client);
_gdk_x11_xsettings_client_destroy (x11_screen->xsettings_client);
x11_screen->xsettings_client = NULL;
}
}
@ -1336,7 +1336,7 @@ gdk_x11_screen_get_setting (GdkScreen *screen,
GdkX11Screen *x11_screen = GDK_X11_SCREEN (screen);
const GValue *setting;
setting = xsettings_client_get_setting (x11_screen->xsettings_client, name);
setting = _gdk_x11_xsettings_client_get_setting (x11_screen->xsettings_client, name);
if (setting == NULL)
goto out;
@ -1557,7 +1557,7 @@ _gdk_x11_screen_init_events (GdkScreen *screen)
/* Keep a flag to avoid extra notifies that we don't need
*/
x11_screen->xsettings_in_init = TRUE;
x11_screen->xsettings_client = xsettings_client_new (screen);
x11_screen->xsettings_client = _gdk_x11_xsettings_client_new (screen);
x11_screen->xsettings_in_init = FALSE;
}

View File

@ -40,6 +40,16 @@
#include "gdksettings.c"
/* Types of settings possible. Enum values correspond to
* protocol values.
*/
typedef enum
{
XSETTINGS_TYPE_INT = 0,
XSETTINGS_TYPE_STRING = 1,
XSETTINGS_TYPE_COLOR = 2
} XSettingsType;
typedef struct _XSettingsBuffer XSettingsBuffer;
struct _XSettingsBuffer
@ -543,7 +553,7 @@ gdk_xsettings_manager_window_filter (GdkXEvent *xevent,
}
XSettingsClient *
xsettings_client_new (GdkScreen *screen)
_gdk_x11_xsettings_client_new (GdkScreen *screen)
{
XSettingsClient *client;
char *selection_atom_name;
@ -568,7 +578,7 @@ xsettings_client_new (GdkScreen *screen)
}
void
xsettings_client_destroy (XSettingsClient *client)
_gdk_x11_xsettings_client_destroy (XSettingsClient *client)
{
gdk_window_remove_filter (gdk_screen_get_root_window (client->screen), gdk_xsettings_root_window_filter, client->screen);
if (client->manager_window)
@ -583,8 +593,8 @@ xsettings_client_destroy (XSettingsClient *client)
}
const GValue *
xsettings_client_get_setting (XSettingsClient *client,
const char *name)
_gdk_x11_xsettings_client_get_setting (XSettingsClient *client,
const char *name)
{
return g_hash_table_lookup (client->settings, name);
}

View File

@ -25,27 +25,11 @@
#include <gdk/gdkscreen.h>
/* Renames for GDK inclusion */
#define xsettings_client_destroy _gdk_x11_xsettings_client_destroy
#define xsettings_client_get_setting _gdk_x11_xsettings_client_get_setting
#define xsettings_client_new _gdk_x11_xsettings_client_new
typedef struct _XSettingsClient XSettingsClient;
/* Types of settings possible. Enum values correspond to
* protocol values.
*/
typedef enum
{
XSETTINGS_TYPE_INT = 0,
XSETTINGS_TYPE_STRING = 1,
XSETTINGS_TYPE_COLOR = 2
} XSettingsType;
XSettingsClient *xsettings_client_new (GdkScreen *screen);
void xsettings_client_destroy (XSettingsClient *client);
const GValue * xsettings_client_get_setting (XSettingsClient *client,
const char *name);
XSettingsClient *_gdk_x11_xsettings_client_new (GdkScreen *screen);
void _gdk_x11_xsettings_client_destroy (XSettingsClient *client);
const GValue * _gdk_x11_xsettings_client_get_setting (XSettingsClient *client,
const char *name);
#endif /* XSETTINGS_CLIENT_H */