This repository has been archived by the owner on Jun 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from zeroxoneafour/typescript
- Loading branch information
Showing
8 changed files
with
264 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// print function, afaik takes anything and prints it | ||
declare function print(...values: any[]): void; | ||
declare function readConfig(key: string, defaultValue?: any): any; | ||
declare function registerShortcut(id: string, desc: string, keybind: string, callback: Function): void; | ||
|
||
declare const workspace: KWin.WorkspaceWrapper; | ||
declare const options: KWin.Options; | ||
|
||
declare interface Signal<T> { | ||
connect(callback: T): void | ||
disconnect(callback: T): void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
namespace KWin { | ||
export class AbstractClientAddons { | ||
// custom stuff, not in base kwin scripts | ||
oldTile: KWin.Tile | ||
wasTiled: boolean | ||
oldDesktop: number | ||
constructor(tile: KWin.Tile, desktop: number) { | ||
this.oldTile = tile; | ||
this.wasTiled = true; | ||
this.oldDesktop = desktop; | ||
} | ||
} | ||
} | ||
|
||
declare namespace KWin { | ||
class Toplevel { | ||
readonly popupWindow: boolean | ||
readonly frameGeometry: Qt.QRect | ||
readonly desktop: number | ||
frameGeometryChanged: Signal<(client: AbstractClient, oldGeometry: Qt.QRect) => void> | ||
screenChanged: Signal<() => void> | ||
} | ||
class AbstractClient extends Toplevel { | ||
readonly resizeable: boolean | ||
readonly moveable: boolean | ||
readonly transient: boolean | ||
readonly specialWindow: boolean | ||
tile: Tile | null | ||
keepAbove: boolean | ||
keepBelow: boolean | ||
noBorder: boolean | ||
fullScreen: boolean | ||
resourceClass: Qt.QByteArray | ||
screen: number | ||
// custom tiling stuff that isnt in base kwin but we need it | ||
addons: AbstractClientAddons | undefined | ||
//signals | ||
desktopPresenceChanged: Signal<(client: AbstractClient, desktop: number) => void> | ||
} | ||
class Tile { | ||
tiles: Array<Tile> | ||
windows: Array<AbstractClient> | ||
// null for root tile | ||
parent: Tile | null | ||
padding: number | ||
} | ||
class RootTile extends Tile { | ||
parent: null | ||
layoutModified: Signal<() => void> | ||
} | ||
class TileManager { | ||
rootTile: RootTile | ||
bestTileForPosition(x: number, y: number): Tile | ||
} | ||
|
||
class WorkspaceWrapper { | ||
activeClient: AbstractClient | null | ||
tilingForScreen(desktop: number): KWin.TileManager | ||
// doesnt actually exist in api, i made it up | ||
lastActiveClient: AbstractClient | null | undefined | ||
// signals | ||
clientAdded: Signal<(client: KWin.AbstractClient) => void> | ||
clientRemoved: Signal<(client: KWin.AbstractClient) => void> | ||
clientActivated: Signal<(client: KWin.AbstractClient) => void> | ||
clientMinimized: Signal<(client: KWin.AbstractClient) => void> | ||
clientUnminimized: Signal<(client: KWin.AbstractClient) => void> | ||
// idk what user does | ||
clientFullScreenSet: Signal<(client: KWin.AbstractClient, fullscreen: boolean, user: any) => void> | ||
} | ||
class Options { | ||
configChanged: Signal<() => void> | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// obviously not all of qt, only the stuff I need | ||
|
||
declare namespace Qt { | ||
class QRect { | ||
x: number | ||
y: number | ||
width: number | ||
height: number | ||
} | ||
class QByteArray {} | ||
} |
Oops, something went wrong.