diff options
-rw-r--r-- | matchbox2/mb-window-manager.c | 19 | ||||
-rw-r--r-- | matchbox2/mb-window-manager.h | 21 | ||||
-rw-r--r-- | matchbox2/mb-wm-atoms.h | 4 | ||||
-rw-r--r-- | matchbox2/mb-wm-client-dialog.c | 1 | ||||
-rw-r--r-- | matchbox2/mb-wm-client-dialog.h | 7 | ||||
-rw-r--r-- | matchbox2/mb-wm-client-window.h | 4 | ||||
-rw-r--r-- | matchbox2/mb-wm-client.c | 4 | ||||
-rw-r--r-- | matchbox2/mb-wm-client.h | 17 | ||||
-rw-r--r-- | matchbox2/mb-wm-comp-mgr-xrender.h | 8 | ||||
-rw-r--r-- | matchbox2/mb-wm-comp-mgr.h | 20 | ||||
-rw-r--r-- | matchbox2/mb-wm-debug.c | 5 | ||||
-rw-r--r-- | matchbox2/mb-wm-decor.h | 5 | ||||
-rw-r--r-- | matchbox2/mb-wm-keys.h | 21 | ||||
-rw-r--r-- | matchbox2/mb-wm-layout.h | 6 | ||||
-rw-r--r-- | matchbox2/mb-wm-main-context.h | 11 | ||||
-rw-r--r-- | matchbox2/mb-wm-object.c | 7 | ||||
-rw-r--r-- | matchbox2/mb-wm-root-window.h | 3 | ||||
-rw-r--r-- | matchbox2/mb-wm-theme.h | 13 | ||||
-rw-r--r-- | matchbox2/mb-wm-types.h | 57 | ||||
-rw-r--r-- | matchbox2/mb-wm-util.c | 26 | ||||
-rw-r--r-- | matchbox2/mb-wm-util.h | 6 |
21 files changed, 174 insertions, 91 deletions
diff --git a/matchbox2/mb-window-manager.c b/matchbox2/mb-window-manager.c index 6468873..71485b9 100644 --- a/matchbox2/mb-window-manager.c +++ b/matchbox2/mb-window-manager.c @@ -2250,3 +2250,22 @@ mb_wm_select_desktop (MBWindowManager *wm, int desktop) #endif } +int +mb_wm_util_pixels_to_points (MBWindowManager *wm, int pixels) +{ + static double scale = 0.0; /* Points per pixel */ + int points; + + if (scale == 0.0) + { + scale = + ((double)DisplayHeightMM (wm->xdpy, wm->xscreen) * 2.8346456693) + / (double) DisplayHeight(wm->xdpy, wm->xscreen); + } + + /* Scale and round */ + points = (((int)((double)(pixels << 10) * scale) + 512) >> 10); + + return points; +} + diff --git a/matchbox2/mb-window-manager.h b/matchbox2/mb-window-manager.h index ff22fe5..7f9643f 100644 --- a/matchbox2/mb-window-manager.h +++ b/matchbox2/mb-window-manager.h @@ -23,16 +23,30 @@ #include <matchbox2/mb-wm-config.h> #include <matchbox2/mb-wm-object.h> +#include <matchbox2/mb-wm-keys.h> #include <matchbox2/mb-wm-root-window.h> +#include <matchbox2/mb-wm-theme.h> +#include <matchbox2/mb-wm-layout.h> +#include <matchbox2/mb-wm-main-context.h> +#if ENABLE_COMPOSITE +#include <matchbox2/mb-wm-comp-mgr.h> +#endif #include <matchbox2/xas.h> -typedef struct MBWindowManagerClass MBWindowManagerClass; -typedef struct MBWindowManagerPriv MBWindowManagerPriv; +/* XXX: we have a circular dependency between mb-wm-main-context.h + * and mb-window-manager.h */ +#ifndef MB_WM_MAIN_CONTEXT_TYPEDEF_DEFINED +typedef struct MBWMMainContext MBWMMainContext; +#define MB_WM_MAIN_CONTEXT_TYPEDEF_DEFINED +#endif #define MB_WINDOW_MANAGER(c) ((MBWindowManager*)(c)) #define MB_WINDOW_MANAGER_CLASS(c) ((MBWindowManagerClass*)(c)) #define MB_TYPE_WINDOW_MANAGER (mb_wm_class_type ()) +typedef struct MBWindowManagerClass MBWindowManagerClass; +typedef struct MBWindowManagerPriv MBWindowManagerPriv; + typedef enum MBWindowManagerFlag { MBWindowManagerFlagDesktop = (1<<0), @@ -238,4 +252,7 @@ mb_wm_set_n_desktops (MBWindowManager *wm, int n_desktops); void mb_wm_select_desktop (MBWindowManager *wm, int desktop); +int +mb_wm_util_pixels_to_points (MBWindowManager *wm, int pixels); + #endif diff --git a/matchbox2/mb-wm-atoms.h b/matchbox2/mb-wm-atoms.h index ef06083..1ccca4f 100644 --- a/matchbox2/mb-wm-atoms.h +++ b/matchbox2/mb-wm-atoms.h @@ -1,4 +1,4 @@ -/* +/* * Matchbox Window Manager II - A lightweight window manager not for the * desktop. * @@ -21,6 +21,8 @@ #ifndef _HAVE_MB_WM_ATOMS_H #define _HAVE_MB_WM_ATOMS_H +#include <matchbox2/mb-window-manager.h> + void mb_wm_atoms_init(MBWindowManager *wm); diff --git a/matchbox2/mb-wm-client-dialog.c b/matchbox2/mb-wm-client-dialog.c index e4bcdfb..b854c7c 100644 --- a/matchbox2/mb-wm-client-dialog.c +++ b/matchbox2/mb-wm-client-dialog.c @@ -1,4 +1,5 @@ #include "mb-wm-client-dialog.h" +#include "mb-window-manager.h" #include "mb-wm-theme.h" diff --git a/matchbox2/mb-wm-client-dialog.h b/matchbox2/mb-wm-client-dialog.h index 9dd1424..b7c2ec1 100644 --- a/matchbox2/mb-wm-client-dialog.h +++ b/matchbox2/mb-wm-client-dialog.h @@ -22,15 +22,16 @@ #define _HAVE_MB_CLIENT_DIALOG_H #include <matchbox2/mb-wm-client-base.h> - -typedef struct MBWMClientDialog MBWMClientDialog; -typedef struct MBWMClientDialogClass MBWMClientDialogClass; +#include <matchbox2/mb-wm-decor.h> #define MB_WM_CLIENT_DIALOG(c) ((MBWMClientDialog*)(c)) #define MB_WM_CLIENT_DIALOG_CLASS(c) ((MBWMClientDialogClass*)(c)) #define MB_WM_TYPE_CLIENT_DIALOG (mb_wm_client_dialog_class_type ()) #define MB_WM_IS_CLIENT_DIALOG(c) (MB_WM_OBJECT_TYPE(c)==MB_WM_TYPE_CLIENT_DIALOG) +typedef struct MBWMClientDialog MBWMClientDialog; +typedef struct MBWMClientDialogClass MBWMClientDialogClass; + struct MBWMClientDialog { MBWMClientBase parent; diff --git a/matchbox2/mb-wm-client-window.h b/matchbox2/mb-wm-client-window.h index 50b0aea..b26c001 100644 --- a/matchbox2/mb-wm-client-window.h +++ b/matchbox2/mb-wm-client-window.h @@ -22,6 +22,7 @@ #define _HAVE_MB_WM_CLIENT_WINDOW_H #include <matchbox2/mb-wm-object.h> +#include <matchbox2/mb-wm-types.h> /* FIXME: below limits to 32 props */ @@ -112,6 +113,9 @@ MBWMClientWindowAllowedActions; #define MB_WM_CLIENT_WINDOW_CLASS(c) ((MBWMClientWindowClass*)(c)) #define MB_WM_TYPE_CLIENT_WINDOW (mb_wm_client_window_class_type ()) +typedef struct MBWMClientWindow MBWMClientWindow; +typedef struct MBWMClientWindowClass MBWMClientWindowClass; + struct MBWMClientWindow { MBWMObject parent; diff --git a/matchbox2/mb-wm-client.c b/matchbox2/mb-wm-client.c index f88a8d8..6deeb13 100644 --- a/matchbox2/mb-wm-client.c +++ b/matchbox2/mb-wm-client.c @@ -18,7 +18,9 @@ * */ -#include "mb-wm.h" +#include "mb-wm-config.h" +#include "mb-wm-client.h" +#include "mb-window-manager.h" #include "mb-wm-theme.h" #include <unistd.h> diff --git a/matchbox2/mb-wm-client.h b/matchbox2/mb-wm-client.h index e752fef..4e01dd9 100644 --- a/matchbox2/mb-wm-client.h +++ b/matchbox2/mb-wm-client.h @@ -23,6 +23,16 @@ #include <matchbox2/mb-wm-client-window.h> #include <matchbox2/mb-wm-config.h> +#if ENABLE_COMPOSITE +#include <matchbox2/mb-wm-comp-mgr.h> +#endif + +/* XXX: We have a circular dependency between mb-wm-comp-mgr.h + * and mb-wm-client.h */ +#ifndef MB_WM_COMP_MGR_TYPEDEF_DEFINED +typedef struct MBWMCompMgr MBWMCompMgr; +#define MB_WM_COMP_MGR_TYPEDEF_DEFINED +#endif #define MB_WM_CLIENT(c) ((MBWindowManagerClient*)(c)) #define MB_WM_CLIENT_CLASS(c) ((MBWindowManagerClientClass*)(c)) @@ -31,7 +41,14 @@ #define MB_WM_CLIENT_CLIENT_TYPE(c) \ (MB_WM_CLIENT_CLASS(MB_WM_OBJECT_GET_CLASS(c))->client_type) +/* XXX: We have a circular dependency between mb-wm-comp-mgr.h + * and mb-wm-client.h */ +#ifndef MB_WM_CLIENT_TYPEDEF_DEFINED typedef struct MBWindowManagerClient MBWindowManagerClient; +#define MB_WM_CLIENT_TYPEDEF_DEFINED +#endif +typedef struct MBWindowManagerClientClass MBWindowManagerClientClass; +typedef struct MBWindowManagerClientPriv MBWindowManagerClientPriv; typedef void (*MBWindowManagerClientInitMethod) (MBWindowManagerClient *client); diff --git a/matchbox2/mb-wm-comp-mgr-xrender.h b/matchbox2/mb-wm-comp-mgr-xrender.h index 0a36bbc..0d8afaf 100644 --- a/matchbox2/mb-wm-comp-mgr-xrender.h +++ b/matchbox2/mb-wm-comp-mgr-xrender.h @@ -28,10 +28,18 @@ #define MB_WM_COMP_MGR_DEFAULT_CLASS(c) ((MBWMCompMgrDefaultClass*)(c)) #define MB_WM_TYPE_COMP_MGR_DEFAULT (mb_wm_comp_mgr_xrender_class_type ()) +typedef struct MBWMCompMgrDefault MBWMCompMgrDefault; +typedef struct MBWMCompMgrDefaultPrivate MBWMCompMgrDefaultPrivate; +typedef struct MBWMCompMgrDefaultClass MBWMCompMgrDefaultClass; + #define MB_WM_COMP_MGR_DEFAULT_CLIENT(c) ((MBWMCompMgrDefaultClient*)(c)) #define MB_WM_COMP_MGR_DEFAULT_CLIENT_CLASS(c) ((MBWMCompMgrDefaultClientClass*)(c)) #define MB_WM_TYPE_COMP_MGR_DEFAULT_CLIENT (mb_wm_comp_mgr_xrender_client_class_type ()) +typedef struct MBWMCompMgrDefaultClient MBWMCompMgrDefaultClient; +typedef struct MBWMCompMgrDefaultClientClass MBWMCompMgrDefaultClientClass; +typedef struct MBWMCompMgrDefaultClentPrivate MBWMCompMgrDefaultClientPrivate; + struct MBWMCompMgrDefault { MBWMCompMgr parent; diff --git a/matchbox2/mb-wm-comp-mgr.h b/matchbox2/mb-wm-comp-mgr.h index 98e9cbd..6e09043 100644 --- a/matchbox2/mb-wm-comp-mgr.h +++ b/matchbox2/mb-wm-comp-mgr.h @@ -21,16 +21,36 @@ #ifndef _HAVE_MB_WM_COMP_MGR_H #define _HAVE_MB_WM_COMP_MGR_H +#include <matchbox2/mb-wm-client.h> + #include <X11/extensions/Xdamage.h> +/* XXX: We have a circular dependency between mb-wm-comp-mgr.h + * and mb-wm-client.h */ +#ifndef MB_WM_CLIENT_TYPEDEF_DEFINED +typedef struct MBWindowManagerClient MBWindowManagerClient; +#define MB_WM_CLIENT_TYPEDEF_DEFINED +#endif + #define MB_WM_COMP_MGR(c) ((MBWMCompMgr*)(c)) #define MB_WM_COMP_MGR_CLASS(c) ((MBWMCompMgrClass*)(c)) #define MB_WM_TYPE_COMP_MGR (mb_wm_comp_mgr_class_type ()) +/* XXX: We have a circular dependency between mb-wm-comp-mgr.h + * and mb-wm-client.h */ +#ifndef MB_WM_COMP_MGR_TYPEDEF_DEFINED +typedef struct MBWMCompMgr MBWMCompMgr; +#define MB_WM_COMP_MGR_TYPEDEF_DEFINED +#endif +typedef struct MBWMCompMgrClass MBWMCompMgrClass; + #define MB_WM_COMP_MGR_CLIENT(c) ((MBWMCompMgrClient*)(c)) #define MB_WM_COMP_MGR_CLIENT_CLASS(c) ((MBWMCompMgrClientClass*)(c)) #define MB_WM_TYPE_COMP_MGR_CLIENT (mb_wm_comp_mgr_client_class_type ()) +typedef struct MBWMCompMgrClient MBWMCompMgrClient; +typedef struct MBWMCompMgrClientClass MBWMCompMgrClientClass; + struct MBWMCompMgr { MBWMObject parent; diff --git a/matchbox2/mb-wm-debug.c b/matchbox2/mb-wm-debug.c index 75d6e63..834ed30 100644 --- a/matchbox2/mb-wm-debug.c +++ b/matchbox2/mb-wm-debug.c @@ -18,10 +18,11 @@ * */ -#include "mb-wm.h" - +#include "mb-wm-config.h" #include "mb-wm-debug.h" +#include <stdlib.h> + #if MBWM_WANT_DEBUG int mbwm_debug_flags = 0; diff --git a/matchbox2/mb-wm-decor.h b/matchbox2/mb-wm-decor.h index db0b219..b3f2365 100644 --- a/matchbox2/mb-wm-decor.h +++ b/matchbox2/mb-wm-decor.h @@ -27,11 +27,16 @@ #define MB_WM_DECOR_CLASS(c) ((MBWMDecorClass*)(c)) #define MB_WM_TYPE_DECOR (mb_wm_decor_class_type ()) +typedef struct MBWMDecor MBWMDecor; +typedef struct MBWMDecorClass MBWMDecorClass; #define MB_WM_DECOR_BUTTON(c) ((MBWMDecorButton*)(c)) #define MB_WM_DECOR_BUTTON_CLASS(c) ((MBWMDecorButtonClass*)(c)) #define MB_WM_TYPE_DECOR_BUTTON (mb_wm_decor_button_class_type ()) +typedef struct MBWMDecorButton MBWMDecorButton; +typedef struct MBWMDecorButtonClass MBWMDecorButtonClass; + typedef void (*MBWMDecorButtonPressedFunc) (MBWindowManager *wm, MBWMDecorButton *button, void *userdata); diff --git a/matchbox2/mb-wm-keys.h b/matchbox2/mb-wm-keys.h index b16fe95..656c6e6 100644 --- a/matchbox2/mb-wm-keys.h +++ b/matchbox2/mb-wm-keys.h @@ -23,6 +23,27 @@ #include <matchbox2/mb-wm.h> +typedef struct MBWMKeys MBWMKeys; +typedef struct MBWMKeyBinding MBWMKeyBinding; + +typedef void (*MBWMKeyPressedFunc) (MBWindowManager *wm, + MBWMKeyBinding *binding, + void *userdata); + +typedef void (*MBWMKeyDestroyFunc) (MBWindowManager *wm, + MBWMKeyBinding *binding, + void *userdata); + +struct MBWMKeyBinding +{ + KeySym keysym; + int modifier_mask; + MBWMKeyPressedFunc pressed; + MBWMKeyDestroyFunc destroy; + void *userdata; + /* FIXME: free func */ +}; + void mb_wm_keys_binding_remove_all (MBWindowManager *wm); diff --git a/matchbox2/mb-wm-layout.h b/matchbox2/mb-wm-layout.h index 7d824ee..ade8740 100644 --- a/matchbox2/mb-wm-layout.h +++ b/matchbox2/mb-wm-layout.h @@ -21,12 +21,16 @@ #ifndef _HAVE_MB_WM_LAYOUT_MANAGER_H #define _HAVE_MB_WM_LAYOUT_MANAGER_H -#include <matchbox2/mb-wm.h> +#include <matchbox2/mb-wm-object.h> +#include <matchbox2/mb-wm-types.h> #define MB_WM_LAYOUT(c) ((MBWMLayout*)(c)) #define MB_WM_LAYOUT_CLASS(c) ((MBWMLayoutClass*)(c)) #define MB_WM_TYPE_LAYOUT (mb_wm_layout_class_type ()) +typedef struct MBWMLayout MBWMLayout; +typedef struct MBWMLayoutClass MBWMLayoutClass; + struct MBWMLayout { MBWMObject parent; diff --git a/matchbox2/mb-wm-main-context.h b/matchbox2/mb-wm-main-context.h index b8be944..1f83fa5 100644 --- a/matchbox2/mb-wm-main-context.h +++ b/matchbox2/mb-wm-main-context.h @@ -21,7 +21,8 @@ #ifndef _HAVE_MB_MAIN_CONTEXT_H #define _HAVE_MB_MAIN_CONTEXT_H -#include <matchbox2/mb-wm.h> +#include <matchbox2/mb-wm-object.h> +#include <matchbox2/mb-window-manager.h> #include <poll.h> #define MB_WM_MAIN_CONTEXT(c) ((MBWMMainContext*)(c)) @@ -29,6 +30,14 @@ #define MB_WM_TYPE_MAIN_CONTEXT (mb_wm_main_context_class_type ()) #define MB_WM_IS_MAIN_CONTEXT(c) (MB_WM_OBJECT_TYPE(c)==MB_WM_TYPE_MAIN_CONTEXT) +/* XXX: we have a circular dependency between mb-wm-main-context.h + * and mb-window-manager.h */ +#ifndef MB_WM_MAIN_CONTEXT_TYPEDEF_DEFINED +typedef struct MBWMMainContext MBWMMainContext; +#define MB_WM_MAIN_CONTEXT_TYPEDEF_DEFINED +#endif +typedef struct MBWMMainContextClass MBWMMainContextClass; + typedef Bool (*MBWMMainContextXEventFunc) (XEvent * xev, void * userdata); typedef struct MBWMEventFuncs diff --git a/matchbox2/mb-wm-object.c b/matchbox2/mb-wm-object.c index 09a6ad4..63f4ffc 100644 --- a/matchbox2/mb-wm-object.c +++ b/matchbox2/mb-wm-object.c @@ -18,11 +18,16 @@ * */ -#include "mb-wm.h" +#include "mb-wm-config.h" +#include "mb-wm-object.h" +#include "mb-wm-util.h" +#include "mb-wm-macros.h" #if MBWM_WANT_DEBUG #include <execinfo.h> #endif +#include <stdlib.h> +#include <string.h> static MBWMObjectClassInfo **ObjectClassesInfo = NULL; static MBWMObjectClass **ObjectClasses = NULL; diff --git a/matchbox2/mb-wm-root-window.h b/matchbox2/mb-wm-root-window.h index 7d3cdbe..ace9c42 100644 --- a/matchbox2/mb-wm-root-window.h +++ b/matchbox2/mb-wm-root-window.h @@ -21,6 +21,9 @@ #ifndef _HAVE_MB_WM_ROOT_WINDOW_H #define _HAVE_MB_WM_ROOT_WINDOW_H +#include <matchbox2/mb-wm-object.h> +#include <matchbox2/mb-window-manager.h> + typedef struct MBWMRootWindow MBWMRootWindow; typedef struct MBWMRootWindowClass MBWMRootWindowClass; diff --git a/matchbox2/mb-wm-theme.h b/matchbox2/mb-wm-theme.h index fb4b6f5..4b6a78e 100644 --- a/matchbox2/mb-wm-theme.h +++ b/matchbox2/mb-wm-theme.h @@ -22,17 +22,24 @@ #define _HAVE_MB_WM_THEME_H #include <matchbox2/mb-wm-config.h> -#include <matchbox2/mb-wm.h> +#include <matchbox2/mb-wm-object.h> +#include <matchbox2/mb-wm-decor.h> #define MB_WM_THEME(c) ((MBWMTheme*)(c)) #define MB_WM_THEME_CLASS(c) ((MBWMThemeClass*)(c)) #define MB_WM_TYPE_THEME (mb_wm_theme_class_type ()) +typedef struct MBWMTheme MBWMTheme; +typedef struct MBWMThemeClass MBWMThemeClass; + #define MB_WM_THEME_PNG(c) ((MBWMThemePng*)(c)) #define MB_WM_THEME_PNG_CLASS(c) ((MBWMThemePngClass*)(c)) #define MB_WM_TYPE_THEME_PNG (mb_wm_theme_png_class_type ()) -enum MBWMThemeCaps +typedef struct MBWMThemePng MBWMThemePng; +typedef struct MBWMThemePngClass MBWMThemePngClass; + +typedef enum MBWMThemeCaps { MBWMThemeCapsFrameMainButtonActionAccept = (1<<0), MBWMThemeCapsFrameDlgButtonActionAccept = (1<<1), @@ -40,7 +47,7 @@ enum MBWMThemeCaps MBWMThemeCapsFrameDlgButtonActionHelp = (1<<3), MBWMThemeCapsFrameMainButtonActionCustom = (1<<4), MBWMThemeCapsFrameDlgButtonActionCustom = (1<<5), -}; +} MBWMThemeCaps; struct MBWMThemeClass diff --git a/matchbox2/mb-wm-types.h b/matchbox2/mb-wm-types.h index 4b73603..26272db 100644 --- a/matchbox2/mb-wm-types.h +++ b/matchbox2/mb-wm-types.h @@ -29,6 +29,11 @@ #include <X11/Xlib.h> +/* XXX: The plan is to eventually move this into mb-wm-window-manager.h + * the way we expose private struct members currently ends up resulting + * in *lots* of circular typedef dependencies! */ +typedef struct MBWindowManager MBWindowManager; + typedef struct MBWMFuncInfo { void *func; @@ -83,35 +88,6 @@ typedef struct MBWMRgbaIcon unsigned long *pixels; } MBWMRgbaIcon; -typedef struct MBWindowManager MBWindowManager; -typedef struct MBWindowManagerClientClass MBWindowManagerClientClass; -typedef struct MBWindowManagerClientPriv MBWindowManagerClientPriv; -typedef struct MBWMClientWindow MBWMClientWindow; -typedef struct MBWMClientWindowClass MBWMClientWindowClass; -typedef struct MBWMTheme MBWMTheme; -typedef struct MBWMThemeClass MBWMThemeClass; -typedef struct MBWMThemePng MBWMThemePng; -typedef struct MBWMThemePngClass MBWMThemePngClass; -typedef enum MBWMThemeCaps MBWMThemeCaps; -typedef struct MBWMDecor MBWMDecor; -typedef struct MBWMDecorClass MBWMDecorClass; -typedef struct MBWMDecorButton MBWMDecorButton; -typedef struct MBWMDecorButtonClass MBWMDecorButtonClass; -typedef struct MBWMLayout MBWMLayout; -typedef struct MBWMLayoutClass MBWMLayoutClass; -typedef struct MBWMMainContext MBWMMainContext; -typedef struct MBWMMainContextClass MBWMMainContextClass; -typedef struct MBWMCompMgr MBWMCompMgr; -typedef struct MBWMCompMgrClass MBWMCompMgrClass; -typedef struct MBWMCompMgrDefault MBWMCompMgrDefault; -typedef struct MBWMCompMgrDefaultPrivate MBWMCompMgrDefaultPrivate; -typedef struct MBWMCompMgrDefaultClass MBWMCompMgrDefaultClass; -typedef struct MBWMCompMgrClient MBWMCompMgrClient; -typedef struct MBWMCompMgrClientClass MBWMCompMgrClientClass; -typedef struct MBWMCompMgrDefaultClient MBWMCompMgrDefaultClient; -typedef struct MBWMCompMgrDefaultClientClass MBWMCompMgrDefaultClientClass; -typedef struct MBWMCompMgrDefaultClentPrivate MBWMCompMgrDefaultClientPrivate; - typedef enum MBWMClientType { MBWMClientTypeApp = (1 << 0), @@ -274,29 +250,6 @@ typedef enum MBWMAtom } MBWMAtom; -/* Keys */ - -typedef struct MBWMKeyBinding MBWMKeyBinding; -typedef struct MBWMKeys MBWMKeys; - -typedef void (*MBWMKeyPressedFunc) (MBWindowManager *wm, - MBWMKeyBinding *binding, - void *userdata); - -typedef void (*MBWMKeyDestroyFunc) (MBWindowManager *wm, - MBWMKeyBinding *binding, - void *userdata); - -struct MBWMKeyBinding -{ - KeySym keysym; - int modifier_mask; - MBWMKeyPressedFunc pressed; - MBWMKeyDestroyFunc destroy; - void *userdata; - /* FIXME: free func */ -}; - /* Event Callbacks */ typedef Bool (*MBWMXEventFunc) diff --git a/matchbox2/mb-wm-util.c b/matchbox2/mb-wm-util.c index 792cb81..f99777c 100644 --- a/matchbox2/mb-wm-util.c +++ b/matchbox2/mb-wm-util.c @@ -1,4 +1,9 @@ -#include "mb-wm.h" +#include "mb-wm-config.h" +#include "mb-wm-util.h" + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> #include <stdarg.h> static int TrappedErrorCode = 0; @@ -268,22 +273,3 @@ mb_wm_rgba_icon_free (MBWMRgbaIcon *icon) free (icon); } -int -mb_wm_util_pixels_to_points (MBWindowManager *wm, int pixels) -{ - static double scale = 0.0; /* Points per pixel */ - int points; - - if (scale == 0.0) - { - scale = - ((double)DisplayHeightMM (wm->xdpy, wm->xscreen) * 2.8346456693) - / (double) DisplayHeight(wm->xdpy, wm->xscreen); - } - - /* Scale and round */ - points = (((int)((double)(pixels << 10) * scale) + 512) >> 10); - - return points; -} - diff --git a/matchbox2/mb-wm-util.h b/matchbox2/mb-wm-util.h index 66a0149..7ccc975 100644 --- a/matchbox2/mb-wm-util.h +++ b/matchbox2/mb-wm-util.h @@ -1,7 +1,8 @@ #ifndef _MB_HAVE_UTIL_H #define _MB_HAVE_UTIL_H -#include <matchbox2/mb-wm.h> +#include <matchbox2/mb-wm-config.h> +#include <matchbox2/mb-wm-types.h> /* See http://rlove.org/log/2005102601 */ #if __GNUC__ >= 3 @@ -112,7 +113,4 @@ mb_wm_rgba_icon_new (); void mb_wm_rgba_icon_free (MBWMRgbaIcon *icon); -int -mb_wm_util_pixels_to_points (MBWindowManager *wm, int pixels); - #endif |