[libwnck/wip/muktupavels/wnck-handle: 22/29] add wnck_handle_new
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libwnck/wip/muktupavels/wnck-handle: 22/29] add wnck_handle_new
- Date: Tue, 1 Mar 2022 16:45:39 +0000 (UTC)
commit 2c01584a5f3ecb2a51883659b3f25a50c2f2024b
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Mon Aug 19 17:29:54 2019 +0300
add wnck_handle_new
libwnck/application.c | 6 +++---
libwnck/class-group.c | 6 +++---
libwnck/private.h | 2 --
libwnck/screen.c | 10 +++++++++-
libwnck/screen.h | 4 ++++
libwnck/util.c | 2 +-
libwnck/window.c | 14 +++++++-------
libwnck/wnck-handle-private.h | 2 --
libwnck/wnck-handle.c | 10 +++++++++-
libwnck/wnck-handle.h | 3 +++
libwnck/xutils.c | 12 ++++++------
11 files changed, 45 insertions(+), 26 deletions(-)
---
diff --git a/libwnck/application.c b/libwnck/application.c
index f67d8c4a..e88b2938 100644
--- a/libwnck/application.c
+++ b/libwnck/application.c
@@ -319,7 +319,7 @@ get_icons (WnckApplication *app)
gsize normal_size;
gsize mini_size;
- handle = _wnck_screen_get_handle (app->priv->screen);
+ handle = wnck_screen_get_handle (app->priv->screen);
icon = NULL;
mini_icon = NULL;
@@ -505,7 +505,7 @@ _wnck_application_create (Window xwindow,
WnckApplication *application;
Screen *xscreen;
- handle = _wnck_screen_get_handle (screen);
+ handle = wnck_screen_get_handle (screen);
application = _wnck_handle_get_application (handle, xwindow);
g_return_val_if_fail (application == NULL, NULL);
@@ -554,7 +554,7 @@ _wnck_application_destroy (WnckApplication *application)
WnckHandle *handle;
Window xwindow = application->priv->xwindow;
- handle = _wnck_screen_get_handle (application->priv->screen);
+ handle = wnck_screen_get_handle (application->priv->screen);
g_return_if_fail (_wnck_handle_get_application (handle, xwindow) == application);
diff --git a/libwnck/class-group.c b/libwnck/class-group.c
index 202bef4f..2718de77 100644
--- a/libwnck/class-group.c
+++ b/libwnck/class-group.c
@@ -224,7 +224,7 @@ _wnck_class_group_create (WnckScreen *screen,
WnckHandle *handle;
WnckClassGroup *class_group;
- handle = _wnck_screen_get_handle (screen);
+ handle = wnck_screen_get_handle (screen);
class_group = _wnck_handle_get_class_group (handle, res_class);
g_return_val_if_fail (class_group == NULL, NULL);
@@ -256,7 +256,7 @@ _wnck_class_group_destroy (WnckClassGroup *class_group)
g_return_if_fail (WNCK_IS_CLASS_GROUP (class_group));
- handle = _wnck_screen_get_handle (class_group->priv->screen);
+ handle = wnck_screen_get_handle (class_group->priv->screen);
_wnck_handle_remove_class_group (handle, class_group->priv->res_class);
/* Removing from handle also removes the only ref WnckClassGroup had */
@@ -446,7 +446,7 @@ set_icon (WnckClassGroup *class_group)
{
WnckHandle *handle;
- handle = _wnck_screen_get_handle (class_group->priv->screen);
+ handle = wnck_screen_get_handle (class_group->priv->screen);
_wnck_get_fallback_icons (&icon,
_wnck_handle_get_default_icon_size (handle),
diff --git a/libwnck/private.h b/libwnck/private.h
index bc83b65b..6f378d68 100644
--- a/libwnck/private.h
+++ b/libwnck/private.h
@@ -126,8 +126,6 @@ GdkScreen *_wnck_screen_get_gdk_screen (WnckScreen *screen);
SnDisplay* _wnck_screen_get_sn_display (WnckScreen *screen);
#endif
-WnckHandle *_wnck_screen_get_handle (WnckScreen *screen);
-
void _wnck_pager_activate_workspace (WnckWorkspace *wspace,
guint32 timestamp);
int _wnck_pager_get_n_workspaces (WnckPager *pager);
diff --git a/libwnck/screen.c b/libwnck/screen.c
index 26cc5af0..baf63a82 100644
--- a/libwnck/screen.c
+++ b/libwnck/screen.c
@@ -614,8 +614,16 @@ wnck_screen_get_for_root (gulong root_window_id)
root_window_id);
}
+/**
+ * wnck_screen_get_handle:
+ * @screen: a #WnckScreen.
+ *
+ * Gets the handle.
+ *
+ * Returns: (transfer none): a #WnckHandle, or %NULL.
+ */
WnckHandle *
-_wnck_screen_get_handle (WnckScreen *screen)
+wnck_screen_get_handle (WnckScreen *screen)
{
g_return_val_if_fail (WNCK_IS_SCREEN (screen), NULL);
diff --git a/libwnck/screen.h b/libwnck/screen.h
index 3140ea51..153cf5fb 100644
--- a/libwnck/screen.h
+++ b/libwnck/screen.h
@@ -33,6 +33,7 @@ G_BEGIN_DECLS
/* forward decls */
typedef struct _WnckApplication WnckApplication;
typedef struct _WnckClassGroup WnckClassGroup;
+typedef struct _WnckHandle WnckHandle;
typedef struct _WnckWindow WnckWindow;
typedef struct _WnckWorkspace WnckWorkspace;
@@ -196,6 +197,9 @@ GType wnck_screen_get_type (void) G_GNUC_CONST;
WnckScreen* wnck_screen_get_default (void);
WnckScreen* wnck_screen_get (int index);
WnckScreen* wnck_screen_get_for_root (gulong root_window_id);
+
+WnckHandle* wnck_screen_get_handle (WnckScreen *screen);
+
int wnck_screen_get_number (WnckScreen *screen);
WnckWorkspace* wnck_screen_get_workspace (WnckScreen *screen,
int workspace);
diff --git a/libwnck/util.c b/libwnck/util.c
index b1023585..153d9a24 100644
--- a/libwnck/util.c
+++ b/libwnck/util.c
@@ -158,7 +158,7 @@ _wnck_get_handle (void)
if (client_type == 0)
client_type = WNCK_CLIENT_TYPE_APPLICATION;
- wnck_handle = _wnck_handle_new (client_type);
+ wnck_handle = wnck_handle_new (client_type);
}
return wnck_handle;
diff --git a/libwnck/window.c b/libwnck/window.c
index ec8768b6..c0ba806d 100644
--- a/libwnck/window.c
+++ b/libwnck/window.c
@@ -477,7 +477,7 @@ _wnck_window_create (Window xwindow,
WnckWindow *window;
Screen *xscreen;
- handle = _wnck_screen_get_handle (screen);
+ handle = wnck_screen_get_handle (screen);
window = _wnck_handle_get_window (handle, xwindow);
g_return_val_if_fail (window == NULL, NULL);
@@ -556,7 +556,7 @@ _wnck_window_destroy (WnckWindow *window)
g_return_if_fail (WNCK_IS_WINDOW (window));
- handle = _wnck_screen_get_handle (window->priv->screen);
+ handle = wnck_screen_get_handle (window->priv->screen);
g_return_if_fail (_wnck_handle_get_window (handle, xwindow) == window);
@@ -744,7 +744,7 @@ wnck_window_get_transient (WnckWindow *window)
g_return_val_if_fail (WNCK_IS_WINDOW (window), NULL);
- handle = _wnck_screen_get_handle (window->priv->screen);
+ handle = wnck_screen_get_handle (window->priv->screen);
return _wnck_handle_get_window (handle, window->priv->transient_for);
}
@@ -1170,7 +1170,7 @@ _wnck_window_get_startup_id (WnckWindow *window)
/* Fall back to group leader property */
- handle = _wnck_screen_get_handle (window->priv->screen);
+ handle = wnck_screen_get_handle (window->priv->screen);
app = _wnck_handle_get_application (handle, window->priv->group_leader);
if (app != NULL)
@@ -2115,7 +2115,7 @@ get_icons (WnckWindow *window)
gsize normal_size;
gsize mini_size;
- handle = _wnck_screen_get_handle (window->priv->screen);
+ handle = wnck_screen_get_handle (window->priv->screen);
icon = NULL;
mini_icon = NULL;
@@ -2364,7 +2364,7 @@ wnck_window_set_geometry (WnckWindow *window,
g_return_if_fail (WNCK_IS_WINDOW (window));
- handle = _wnck_screen_get_handle (window->priv->screen);
+ handle = wnck_screen_get_handle (window->priv->screen);
source = _wnck_handle_get_client_type (handle);
gravity_and_flags = gravity;
@@ -3102,7 +3102,7 @@ update_transient_for (WnckWindow *window)
window->priv->transient_for = parent;
- handle = _wnck_screen_get_handle (window->priv->screen);
+ handle = wnck_screen_get_handle (window->priv->screen);
screen = _wnck_handle_get_screen_for_root (handle,
window->priv->transient_for);
diff --git a/libwnck/wnck-handle-private.h b/libwnck/wnck-handle-private.h
index 417fa136..d280a8b9 100644
--- a/libwnck/wnck-handle-private.h
+++ b/libwnck/wnck-handle-private.h
@@ -24,8 +24,6 @@
G_BEGIN_DECLS
-WnckHandle *_wnck_handle_new (WnckClientType client_type);
-
WnckClientType _wnck_handle_get_client_type (WnckHandle *self);
WnckScreen *_wnck_handle_get_default_screen (WnckHandle *self);
diff --git a/libwnck/wnck-handle.c b/libwnck/wnck-handle.c
index 53ed3794..07c9d2d8 100644
--- a/libwnck/wnck-handle.c
+++ b/libwnck/wnck-handle.c
@@ -309,8 +309,16 @@ wnck_handle_init (WnckHandle *self)
gdk_window_add_filter (NULL, filter_func, self);
}
+/**
+ * wnck_handle_new:
+ * @client_type: a role for the client
+ *
+ * Creates a new #WnckHandle object with a given @client_type.
+ *
+ * Returns: (transfer full): newly created #WnckHandle.
+ */
WnckHandle *
-_wnck_handle_new (WnckClientType client_type)
+wnck_handle_new (WnckClientType client_type)
{
return g_object_new (WNCK_TYPE_HANDLE,
"client-type", client_type,
diff --git a/libwnck/wnck-handle.h b/libwnck/wnck-handle.h
index 1bb2a27d..08c100c8 100644
--- a/libwnck/wnck-handle.h
+++ b/libwnck/wnck-handle.h
@@ -23,12 +23,15 @@
#define WNCK_HANDLE_H
#include <glib-object.h>
+#include <libwnck/util.h>
G_BEGIN_DECLS
#define WNCK_TYPE_HANDLE (wnck_handle_get_type ())
G_DECLARE_FINAL_TYPE (WnckHandle, wnck_handle, WNCK, HANDLE, GObject)
+WnckHandle *wnck_handle_new (WnckClientType client_type);
+
G_END_DECLS
#endif
diff --git a/libwnck/xutils.c b/libwnck/xutils.c
index e95abef8..f2a2d3c3 100644
--- a/libwnck/xutils.c
+++ b/libwnck/xutils.c
@@ -786,7 +786,7 @@ _wnck_close (WnckScreen *screen,
Window root;
XEvent xev;
- handle = _wnck_screen_get_handle (screen);
+ handle = wnck_screen_get_handle (screen);
xscreen = _wnck_screen_get_xscreen (screen);
display = DisplayOfScreen (xscreen);
root = RootWindowOfScreen (xscreen);
@@ -835,7 +835,7 @@ _wnck_keyboard_move (WnckScreen *screen,
Window root;
XEvent xev;
- handle = _wnck_screen_get_handle (screen);
+ handle = wnck_screen_get_handle (screen);
xscreen = _wnck_screen_get_xscreen (screen);
display = DisplayOfScreen (xscreen);
root = RootWindowOfScreen (xscreen);
@@ -872,7 +872,7 @@ _wnck_keyboard_size (WnckScreen *screen,
Window root;
XEvent xev;
- handle = _wnck_screen_get_handle (screen);
+ handle = wnck_screen_get_handle (screen);
xscreen = _wnck_screen_get_xscreen (screen);
display = DisplayOfScreen (xscreen);
root = RootWindowOfScreen (xscreen);
@@ -916,7 +916,7 @@ _wnck_change_state (WnckScreen *screen,
#define _NET_WM_STATE_ADD 1 /* add/set property */
#define _NET_WM_STATE_TOGGLE 2 /* toggle property */
- handle = _wnck_screen_get_handle (screen);
+ handle = wnck_screen_get_handle (screen);
xscreen = _wnck_screen_get_xscreen (screen);
display = DisplayOfScreen (xscreen);
root = RootWindowOfScreen (xscreen);
@@ -954,7 +954,7 @@ _wnck_change_workspace (WnckScreen *screen,
Window root;
XEvent xev;
- handle = _wnck_screen_get_handle (screen);
+ handle = wnck_screen_get_handle (screen);
xscreen = _wnck_screen_get_xscreen (screen);
display = DisplayOfScreen (xscreen);
root = RootWindowOfScreen (xscreen);
@@ -996,7 +996,7 @@ _wnck_activate (WnckScreen *screen,
g_warning ("Received a timestamp of 0; window activation may not "
"function properly.\n");
- handle = _wnck_screen_get_handle (screen);
+ handle = wnck_screen_get_handle (screen);
xscreen = _wnck_screen_get_xscreen (screen);
display = DisplayOfScreen (xscreen);
root = RootWindowOfScreen (xscreen);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]