This file contains hidden or 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
| void gral_window_warp_cursor(struct gral_window *window, float x, float y) { | |
| NSRect window_rect = [[(GralWindow *)window contentView] convertRect:NSMakeRect(x, y, 0, 0) toView:nil]; | |
| NSRect screen_rect = [(GralWindow *)window convertRectToScreen:window_rect]; | |
| //CGWarpMouseCursorPosition(screen_rect.origin); | |
| CGPoint point = [[(GralWindow *)window contentView] convertPoint:NSMakePoint(x, y) toView:nil]; | |
| NSRect frame = [(GralWindow *)window frame]; | |
| point = CGPointMake(NSMinX(frame) + point.x, NSMaxY(NSScreen.screens[0].frame) - (NSMinY(frame) + point.y)); | |
| //CGPoint display_point = CGPointMake(NSMinX(frame) + window_point.x, NSMaxY(NSScreen.screens[0].frame) - (NSMinY(frame) + window_point.y)); | |
| CGWarpMouseCursorPosition(point); | |
| } |
This file contains hidden or 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
| #include <nitro.hpp> | |
| using namespace nitro; | |
| class DemoAnimation: public Animation { | |
| Node* node; | |
| public: | |
| DemoAnimation(Node* node): node(node) {} | |
| bool apply() override { | |
| float t = (time % 2000) / 1000.f; |
This file contains hidden or 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
| #!/bin/sh | |
| pdftocairo -svg $1 /tmp/print.svg | |
| sed -i 's/rgb(0%,0%,0%)/rgb(12%,12%,12%)/g' /tmp/print.svg | |
| rsvg-convert -f pdf /tmp/print.svg > $1.print.pdf |
This file contains hidden or 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
| // library code | |
| enum SystemEvent { | |
| Draw, | |
| Mouse | |
| } | |
| enum Event<E> { | |
| SystemEvent(SystemEvent), | |
| UserEvent(E) |
This file contains hidden or 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
| const S: &str = r#" | |
| fn main() { | |
| print!("const S: &str = r#\x22{}\x22#;{}", S, S); | |
| } | |
| "#; | |
| fn main() { | |
| print!("const S: &str = r#\x22{}\x22#;{}", S, S); | |
| } |
This file contains hidden or 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
| #include <cstdio> | |
| class A { | |
| public: | |
| A() { | |
| method(); | |
| } | |
| virtual void method() { | |
| printf("A\n"); | |
| } |
This file contains hidden or 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
| sieve (x:xs) = x : sieve (filter (\y -> mod y x /= 0) xs) | |
| primes = sieve [2..] |
This file contains hidden or 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
| { | |
| "app-id": "com.github.alecaddd.akira", | |
| "runtime": "org.gnome.Platform", | |
| "runtime-version": "3.26", | |
| "sdk": "org.gnome.Sdk", | |
| "command": "com.github.alecaddd.akira", | |
| "finish-args": [ | |
| "--socket=x11", | |
| "--socket=wayland", | |
| "--filesystem=home" |
This file contains hidden or 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
| project('scintilla', 'cpp', 'c', default_options: ['cpp_std=c++14']) | |
| scintilla = library( | |
| 'scintilla', | |
| files( | |
| 'lexlib/Accessor.cxx', | |
| 'lexlib/CharacterSet.cxx', | |
| 'lexlib/DefaultLexer.cxx', | |
| 'lexlib/LexerBase.cxx', | |
| 'lexlib/LexerModule.cxx', |
This file contains hidden or 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
| template <typename T> struct A { | |
| virtual void foo() = 0; | |
| }; | |
| template <typename T> struct B: A<T> { | |
| template <typename T2> void foo(A<T2>& a) { | |
| a.foo(); | |
| } | |
| }; |