File: wck-utils.h

package info (click to toggle)
xfce4-windowck-plugin 0.5.1-1
  • links: PTS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 3,388 kB
  • sloc: sh: 4,360; ansic: 2,841; makefile: 283
file content (71 lines) | stat: -rw-r--r-- 2,771 bytes parent folder | download
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
68
69
70
71
/*  $Id$
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program 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 General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 *  Copyright (C) 2013 Cedric Leporcq  <cedl38@gmail.com>
 *
 *  This code is derived from original 'Window Applets' from Andrej Belcijan.
 */

#ifndef __WCK_UTILS_H__
#define __WCK_UTILS_H__

#ifndef WNCK_I_KNOW_THIS_IS_UNSTABLE
#define WNCK_I_KNOW_THIS_IS_UNSTABLE
#endif
#include <libwnck/libwnck.h>

G_BEGIN_DECLS

/* Wnck structure */
typedef struct {
    WnckScreen *activescreen;          // Active screen
    WnckWorkspace *activeworkspace;    // Active workspace
    WnckWindow *controlwindow;          // Controled window according to only_maximized option
    WnckWindow *activewindow;          // Active window
    WnckWindow *umaxwindow;            // Upper maximized window

    gulong msh;                         // upper maximized window state handler id
    gulong ash;                         // active state handler id
    gulong mwh;                         // upper maximized workspace handler id

    gulong sah;                         // active window changed handler id
    gulong sch;                         // window closed handler id
    gulong soh;                         // window opened handler id
    gulong svh;                         // viewport changed handler id
    gulong swh;                         // workspace changed handler id

    gboolean only_maximized;           // [T/F] Only track maximized windows

    gpointer data;
} WckUtils;

void init_wnck (WckUtils *win, gboolean only_maximized, gpointer data);
void disconnect_wnck (WckUtils *win);
void on_wck_state_changed (WnckWindow *controlwindow, gpointer data);
void on_control_window_changed(WnckWindow *controlwindow, WnckWindow *previous, gpointer data);
void reload_wnck (WckUtils *win, gboolean only_maximized, gpointer data);
void toggle_maximize (WnckWindow *window);
gboolean wck_signal_handler_disconnect (GObject *object, gulong handler);

inline gboolean
window_is_desktop (WnckWindow *window)
{
    return wnck_window_get_window_type (window) == WNCK_WINDOW_DESKTOP;
}

G_END_DECLS

#endif /* __WCK_UTILS_H__ */