summaryrefslogtreecommitdiffstats
path: root/src/canberra-gtk.c
blob: cb38bba41999d78284938f11f54efcae84b3caaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/* $Id$ */

/***
  This file is part of libcanberra.

  Copyright 2008 Lennart Poettering

  libcanberra is free software; you can redistribute it and/or modify
  it under the terms of the GNU Lesser General Public License as
  published by the Free Software Foundation, either version 2.1 of the
  License, or (at your option) any later version.

  libcanberra is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with libcanberra. If not, If not, see
  <http://www.gnu.org/licenses/>.
***/

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

static GtkWidget* get_toplevel(GtkWidget *w) {
    while (w) {
        if (GTK_WIDGET_TOPLEVEL(w))
            return w;

        w = gtk_widget_get_parent(w);
    }

    return NULL;
};

int ca_gtk_proplist_set_for_window(ca_proplist *p, GtkWidget *w) {
    int ret;
    const char *t;

    ca_return_val_if_fail(p, CA_ERROR_INVALID);
    ca_return_val_if_fail(w, CA_ERROR_INVALID);

    if (!(w = get_toplevel(w)))
        return CA_ERROR_INVALID;

    if ((t = gtk_window_get_title(w)))
        if ((ret = ca_proplist_sets(p, CA_PROP_WINDOW_NAME, t)) < 0)
            return ret;

    if ((t = gtk_window_get_icon_name(w)))
        if ((ret = ca_proplist_sets(p, CA_PROP_WINDOW_NAME, t)) < 0)
            return ret;



}




const char *ca_gtk_window_display(GtkWidget *w) {
}

const char *ca_gtk_window_xid(GtkWidget *w) {
}