-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Dan Printzell <[email protected]>
- Loading branch information
Showing
15 changed files
with
906 additions
and
223 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
; Configurue which static analysis checks are enabled | ||
[analysis.config.StaticAnalysisConfig] | ||
; Check variable, class, struct, interface, union, and function names against t | ||
; he Phobos style guide | ||
style_check="false" | ||
; Check for array literals that cause unnecessary allocation | ||
enum_array_literal_check="true" | ||
; Check for poor exception handling practices | ||
exception_check="true" | ||
; Check for use of the deprecated 'delete' keyword | ||
delete_check="true" | ||
; Check for use of the deprecated floating point operators | ||
float_operator_check="true" | ||
; Check number literals for readability | ||
number_style_check="true" | ||
; Checks that opEquals, opCmp, toHash, and toString are either const, immutable | ||
; , or inout. | ||
object_const_check="true" | ||
; Checks for .. expressions where the left side is larger than the right. | ||
backwards_range_check="true" | ||
; Checks for if statements whose 'then' block is the same as the 'else' block | ||
if_else_same_check="true" | ||
; Checks for some problems with constructors | ||
constructor_check="true" | ||
; Checks for unused variables and function parameters | ||
unused_variable_check="true" | ||
; Checks for unused labels | ||
unused_label_check="true" | ||
; Checks for duplicate attributes | ||
duplicate_attribute="true" | ||
; Checks that opEquals and toHash are both defined or neither are defined | ||
opequals_tohash_check="true" | ||
; Checks for subtraction from .length properties | ||
length_subtraction_check="true" | ||
; Checks for methods or properties whose names conflict with built-in propertie | ||
; s | ||
builtin_property_names_check="true" | ||
; Checks for confusing code in inline asm statements | ||
asm_style_check="true" | ||
; Checks for confusing logical operator precedence | ||
logical_precedence_check="true" | ||
; Checks for undocumented public declarations | ||
undocumented_declaration_check="true" | ||
; Checks for poor placement of function attributes | ||
function_attribute_check="true" | ||
; Checks for use of the comma operator | ||
comma_expression_check="true" | ||
; Checks for local imports that are too broad | ||
local_import_check="true" | ||
; Checks for variables that could be declared immutable | ||
could_be_immutable_check="true" | ||
; Checks for redundant expressions in if statements | ||
redundant_if_check="true" | ||
; Checks for redundant parenthesis | ||
redundant_parens_check="true" | ||
; Checks for labels with the same name as variables | ||
label_var_same_name_check="true" |
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
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
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,5 @@ | ||
module dwin.backend.hotkeymanager; | ||
|
||
final class HotKeyManager { | ||
|
||
} |
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,76 @@ | ||
module dwin.backend.xcb.atom; | ||
|
||
import xcb.xcb; | ||
import dwin.backend.xcb.xcb; | ||
import dwin.backend.xcb.window; | ||
import std.string : toStringz; | ||
import std.conv : to; | ||
import std.c.stdlib : free; | ||
|
||
struct Atom { | ||
this(XCB xcb, string name, bool createOnMissing = true) { | ||
atom = XCB_ATOM_NONE; | ||
xcb_intern_atom_cookie_t c = xcb_intern_atom_unchecked(xcb.Connection, !createOnMissing, cast(ushort)name.length, name.toStringz); | ||
if (auto reply = xcb_intern_atom_reply(xcb.Connection, c, null)) { | ||
atom = reply.atom; | ||
free(reply); | ||
} | ||
} | ||
|
||
this(xcb_atom_t atom) { | ||
this.atom = atom; | ||
} | ||
|
||
Atom[] GetPropertyAtom(XCB xcb, Window window) { | ||
Atom[] ret; | ||
xcb_get_property_cookie_t c = xcb_get_property_unchecked(xcb.Connection, 0, window.Window, atom, XCB_ATOM_ATOM, 0, 0); | ||
if (auto reply = xcb_get_property_reply(xcb.Connection, c, null)) { | ||
xcb_atom_t[] tmp = (cast(xcb_atom_t *)xcb_get_property_value(reply))[0 .. xcb_get_property_value_length(reply)]; | ||
foreach (atom; tmp) | ||
ret ~= Atom(atom); | ||
free(reply); | ||
} | ||
return ret; | ||
} | ||
|
||
Window[] GetPropertyWindow(XCB xcb, Window window) { | ||
Window[] ret; | ||
xcb_get_property_cookie_t c = xcb_get_property_unchecked(xcb.Connection, 0, window.Window, atom, XCB_ATOM_WINDOW, 0, 0); | ||
if (auto reply = xcb_get_property_reply(xcb.Connection, c, null)) { | ||
xcb_window_t[] tmp = (cast(xcb_window_t *)xcb_get_property_value(reply))[0 .. xcb_get_property_value_length(reply)]; | ||
foreach (win; tmp) | ||
ret ~= new Window(xcb, win); | ||
free(reply); | ||
} | ||
return ret; | ||
} | ||
|
||
string GetPropertyString(XCB xcb, Window window) { | ||
string ret = null; | ||
xcb_get_property_cookie_t c = xcb_get_property_unchecked(xcb.Connection, 0, window.Window, atom, XCB_ATOM_STRING, 0, 0); | ||
if (auto reply = xcb_get_property_reply(xcb.Connection, c, null)) { | ||
char[] tmp = (cast(char *)xcb_get_property_value(reply))[0 .. xcb_get_property_value_length(reply)]; | ||
ret = tmp.to!string; | ||
free(reply); | ||
} | ||
return ret; | ||
} | ||
|
||
void ChangeProperty(XCB xcb, Window window, Atom atom) { | ||
xcb_change_property(xcb.Connection, XCB_PROP_MODE_REPLACE, window.Window, atom, XCB_ATOM_ATOM, 32, 1, cast(ubyte *)&atom); | ||
} | ||
|
||
void ChangeProperty(XCB xcb, Window window, Window value) { | ||
xcb_change_property(xcb.Connection, XCB_PROP_MODE_REPLACE, window.Window, atom, XCB_ATOM_WINDOW, 32, 1, cast(ubyte *)&value); | ||
} | ||
|
||
void ChangeProperty(XCB xcb, Window window, string str) { | ||
xcb_change_property(xcb.Connection, XCB_PROP_MODE_REPLACE, window.Window, atom, XCB_ATOM_STRING, 8, cast(uint)str.length, str.toStringz); | ||
} | ||
|
||
@property bool IsValid() { return atom != XCB_ATOM_NONE; } | ||
|
||
|
||
alias atom this; | ||
xcb_atom_t atom; | ||
} |
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,6 @@ | ||
module dwin.backend.xcb.color; | ||
|
||
struct Color { | ||
public: | ||
private: | ||
} |
Oops, something went wrong.