summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/libwnck-sections.txt2
-rw-r--r--libwnck/application.c11
-rw-r--r--libwnck/class-group.c8
-rw-r--r--libwnck/private.h6
-rw-r--r--libwnck/tasklist.c2
-rw-r--r--libwnck/util.c46
-rw-r--r--libwnck/util.h6
-rw-r--r--libwnck/window.c11
-rw-r--r--libwnck/xutils.c8
9 files changed, 76 insertions, 24 deletions
diff --git a/doc/libwnck-sections.txt b/doc/libwnck-sections.txt
index 4b39118..d8fef5d 100644
--- a/doc/libwnck-sections.txt
+++ b/doc/libwnck-sections.txt
@@ -424,8 +424,6 @@ WnckWorkspaceAccessibleClass
#<FILE>private</FILE>
<SUBSECTION Private>
WNCK_ACTIVATE_TIMEOUT
-DEFAULT_ICON_SIZE
-DEFAULT_MINI_ICON_SIZE
WNCK_SCREEN_XSCREEN
#</SECTION>
#
diff --git a/libwnck/application.c b/libwnck/application.c
index 56d10f9..89125ff 100644
--- a/libwnck/application.c
+++ b/libwnck/application.c
@@ -337,18 +337,19 @@ get_icons (WnckApplication *app)
{
GdkPixbuf *icon;
GdkPixbuf *mini_icon;
+ gsize normal_size;
+ gsize mini_size;
icon = NULL;
mini_icon = NULL;
+ normal_size = _wnck_get_default_icon_size ();
+ mini_size = _wnck_get_default_mini_icon_size ();
if (_wnck_read_icons (WNCK_SCREEN_XSCREEN (app->priv->screen),
app->priv->xwindow,
app->priv->icon_cache,
- &icon,
- DEFAULT_ICON_SIZE, DEFAULT_ICON_SIZE,
- &mini_icon,
- DEFAULT_MINI_ICON_SIZE,
- DEFAULT_MINI_ICON_SIZE))
+ &icon, normal_size, normal_size,
+ &mini_icon, mini_size, mini_size))
{
app->priv->need_emit_icon_changed = TRUE;
app->priv->icon_from_leader = TRUE;
diff --git a/libwnck/class-group.c b/libwnck/class-group.c
index f1cd021..ac4b086 100644
--- a/libwnck/class-group.c
+++ b/libwnck/class-group.c
@@ -423,11 +423,11 @@ set_icon (WnckClassGroup *class_group)
if (!icon || !mini_icon)
{
_wnck_get_fallback_icons (&icon,
- DEFAULT_ICON_SIZE,
- DEFAULT_ICON_SIZE,
+ _wnck_get_default_icon_size (),
+ _wnck_get_default_icon_size (),
&mini_icon,
- DEFAULT_MINI_ICON_SIZE,
- DEFAULT_MINI_ICON_SIZE);
+ _wnck_get_default_mini_icon_size (),
+ _wnck_get_default_mini_icon_size ());
icons_reffed = TRUE;
}
diff --git a/libwnck/private.h b/libwnck/private.h
index 250fd24..7129996 100644
--- a/libwnck/private.h
+++ b/libwnck/private.h
@@ -42,6 +42,9 @@ G_BEGIN_DECLS
WnckClientType _wnck_get_client_type (void);
+gsize _wnck_get_default_icon_size (void);
+gsize _wnck_get_default_mini_icon_size (void);
+
void _wnck_application_process_property_notify (WnckApplication *app,
XEvent *xevent);
void _wnck_window_process_property_notify (WnckWindow *window,
@@ -115,9 +118,6 @@ gboolean _wnck_workspace_set_viewport (WnckWorkspace *space, int x, int y);
void _wnck_init (void);
Display *_wnck_get_default_display (void);
-#define DEFAULT_ICON_SIZE 32
-#define DEFAULT_MINI_ICON_SIZE 16
-
#define WNCK_SCREEN_XSCREEN(screen) (_wnck_screen_get_xscreen (screen))
Screen *_wnck_screen_get_xscreen (WnckScreen *screen);
diff --git a/libwnck/tasklist.c b/libwnck/tasklist.c
index 1720f4d..756dc1e 100644
--- a/libwnck/tasklist.c
+++ b/libwnck/tasklist.c
@@ -91,7 +91,7 @@ typedef struct _WnckTaskClass WnckTaskClass;
#define DEFAULT_GROUPING_LIMIT 80
-#define MINI_ICON_SIZE DEFAULT_MINI_ICON_SIZE
+#define MINI_ICON_SIZE _wnck_get_default_mini_icon_size ()
#define TASKLIST_BUTTON_PADDING 4
#define TASKLIST_TEXT_MAX_WIDTH 25 /* maximum width in characters */
diff --git a/libwnck/util.c b/libwnck/util.c
index 607b7b2..0e5b7b7 100644
--- a/libwnck/util.c
+++ b/libwnck/util.c
@@ -657,6 +657,52 @@ _wnck_get_client_type (void)
return client_type;
}
+static gsize default_icon_size = WNCK_DEFAULT_ICON_SIZE;
+
+/**
+ * wnck_set_default_icon_size:
+ * @size: the default size for windows and application standard icons.
+ *
+ * The default main icon size is %WNCK_DEFAULT_ICON_SIZE. This function allows
+ * to change this value.
+ *
+ * Since: 2.4.6
+ */
+void
+wnck_set_default_icon_size (gsize size)
+{
+ default_icon_size = size;
+}
+
+gsize
+_wnck_get_default_icon_size (void)
+{
+ return default_icon_size;
+}
+
+static gsize default_mini_icon_size = WNCK_DEFAULT_MINI_ICON_SIZE;
+
+/**
+ * wnck_set_default_mini_icon_size:
+ * @size: the default size for windows and application mini icons.
+ *
+ * The default main icon size is %WNCK_DEFAULT_MINI_ICON_SIZE. This function
+ * allows to change this value.
+ *
+ * Since: 2.4.6
+ */
+void
+wnck_set_default_mini_icon_size (gsize size)
+{
+ default_mini_icon_size = size;
+}
+
+gsize
+_wnck_get_default_mini_icon_size (void)
+{
+ return default_mini_icon_size;
+}
+
/**
* _make_gtk_label_bold:
* @label: The label.
diff --git a/libwnck/util.h b/libwnck/util.h
index 5cdf367..5b5360c 100644
--- a/libwnck/util.h
+++ b/libwnck/util.h
@@ -104,6 +104,12 @@ typedef enum {
void wnck_set_client_type (WnckClientType ewmh_sourceindication_client_type);
+#define WNCK_DEFAULT_ICON_SIZE 32
+#define WNCK_DEFAULT_MINI_ICON_SIZE 16
+
+void wnck_set_default_icon_size (gsize size);
+void wnck_set_default_mini_icon_size (gsize size);
+
void wnck_shutdown (void);
void wnck_xid_read_resource_usage (GdkDisplay *gdk_display,
diff --git a/libwnck/window.c b/libwnck/window.c
index 7d01012..729c51d 100644
--- a/libwnck/window.c
+++ b/libwnck/window.c
@@ -2100,18 +2100,19 @@ get_icons (WnckWindow *window)
{
GdkPixbuf *icon;
GdkPixbuf *mini_icon;
+ gsize normal_size;
+ gsize mini_size;
icon = NULL;
mini_icon = NULL;
+ normal_size = _wnck_get_default_icon_size ();
+ mini_size = _wnck_get_default_mini_icon_size ();
if (_wnck_read_icons (WNCK_SCREEN_XSCREEN (window->priv->screen),
window->priv->xwindow,
window->priv->icon_cache,
- &icon,
- DEFAULT_ICON_SIZE, DEFAULT_ICON_SIZE,
- &mini_icon,
- DEFAULT_MINI_ICON_SIZE,
- DEFAULT_MINI_ICON_SIZE))
+ &icon, normal_size, normal_size,
+ &mini_icon, mini_size, mini_size))
{
window->priv->need_emit_icon_changed = TRUE;
diff --git a/libwnck/xutils.c b/libwnck/xutils.c
index 90f18ab..b58df06 100644
--- a/libwnck/xutils.c
+++ b/libwnck/xutils.c
@@ -2303,15 +2303,15 @@ _wnck_get_fallback_icons (GdkPixbuf **iconp,
{
if (iconp)
*iconp = default_icon_at_size (ideal_width > 0 ? ideal_width :
- DEFAULT_ICON_SIZE,
+ _wnck_get_default_icon_size (),
ideal_height > 0 ? ideal_height :
- DEFAULT_ICON_SIZE);
+ _wnck_get_default_icon_size ());
if (mini_iconp)
*mini_iconp = default_icon_at_size (ideal_mini_width > 0 ? ideal_mini_width :
- DEFAULT_MINI_ICON_SIZE,
+ _wnck_get_default_mini_icon_size (),
ideal_mini_height > 0 ? ideal_mini_height :
- DEFAULT_MINI_ICON_SIZE);
+ _wnck_get_default_mini_icon_size ());
}