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
#include <iostream> | |
#include <string> | |
struct Person { | |
std::string name; | |
}; | |
int main() { | |
Person* p = nullptr; | |
std::cout << (p ? p->name: nullptr) << "\n"; |
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
<check id="advanced_check" text="Advanced Options" /> | |
<vbox id="advanced"> | |
<grid columns="2"> | |
<label text="Pixel Ratio:" /> | |
<combobox id="pixel_ratio" cell_align="horizontal"> | |
<listitem text="Square Pixels (1:1)" value="1:1" /> | |
<listitem text="Double-wide Pixels (2:1)" value="2:1" /> | |
<listitem text="Double-high Pixels (1:2)" value="1:2" /> | |
<listitem text="NES/SNES (8:7)" value="8:7" /> | |
</combobox> |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<keyboard version="1"> | |
<commands> | |
<key command="Zoom" shortcut="1"><param name="percentage" value="100" /></key> | |
<key command="Zoom" shortcut="2"><param name="percentage" value="200" /></key> | |
<key command="Zoom" shortcut="3"><param name="percentage" value="400" /></key> | |
<key command="Zoom" shortcut="4"><param name="percentage" value="600" /></key> | |
<key command="Zoom" shortcut="5"><param name="percentage" value="800" /></key> | |
<key command="Zoom" shortcut="6"><param name="percentage" value="1600" /></key> | |
<key command="Zoom" shortcut="7"><param name="percentage" value="3200" /></key> |
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
#include <cassert> | |
#include <functional> | |
#include <iostream> | |
#include <vector> | |
template<typename Container> | |
std::function<void(Container&)> | |
cache_function(void (*func)(Container&)) { | |
return [func](Container& result) { | |
static Container cache; |
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
... | |
<style id="mini_check_box" extends="check_box" font="mini"> | |
<newlayer /> | |
<text color="face" align="left middle" x="14" y="1" /> | |
<text color="face" align="left middle" x="14" y="1" state="disabled" /> | |
<newlayer /> | |
<text color="text" align="left middle" x="14" /> | |
<text color="disabled" align="left middle" x="14" state="disabled" /> | |
</style> | |
... |
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
<gui> | |
<window id="new_sprite" text="@.title"> | |
<box vertical="true"> | |
<separator text="@.size" left="true" horizontal="true" /> | |
<grid columns="2"> | |
<label text="@.width" /> | |
<entry id="width" maxsize="8" magnet="true" cell_align="horizontal" suffix="px" /> | |
<label text="@.height" /> | |
<entry id="height" maxsize="8" cell_align="horizontal" suffix="px" /> |
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
JS Console output for mousedown left, right, middle, x1, x2 mouse buttons: | |
VM35:1 mousedown MouseEvent {isTrusted: true, screenX: 139, screenY: 248, clientX: 139, clientY: 128…}altKey: falsebubbles: truebutton: 0buttons: 1cancelBubble: falsecancelable: trueclientX: 139clientY: 128composed: truectrlKey: falsecurrentTarget: nulldefaultPrevented: falsedetail: 1eventPhase: 0fromElement: nullisTrusted: truelayerX: 139layerY: 128metaKey: falsemovementX: 0movementY: 0offsetX: 7offsetY: 54pageX: 139pageY: 128path: Array(9)relatedTarget: nullreturnValue: truescreenX: 139screenY: 248shiftKey: falsesourceCapabilities: InputDeviceCapabilitiessrcElement: div.news.column.two-thirdstarget: div.news.column.two-thirdstimeStamp: 227380.14500000002toElement: div.news.column.two-thirdstype: "mousedown"view: Windowwhich: 1x: 139y: 128__proto__: MouseEvent | |
VM35:1 mousedown MouseEvent {isTrusted: true, screenX: 139, screenY: 248, clientX: 139, clientY: 128…}altKey: falsebubbles: truebutton: 2buttons: 2cancelBubble: falsecancelable |
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
// Don't modify, generated file from /Users/david/Dropbox/ASEPRITE/aseprite/data/widgets/new_sprite.xml | |
#ifndef GENERATED_NEW_SPRITE_H_INCLUDED | |
#define GENERATED_NEW_SPRITE_H_INCLUDED | |
#pragma once | |
#include "app/find_widget.h" | |
#include "app/load_widget.h" | |
#include "ui/ui.h" |
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
#include <cassert> | |
#include <cmath> | |
#include <cstdio> | |
#include <cstdlib> | |
#include <limits> | |
#include <string> | |
#include <vector> | |
int main() { | |
} |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<keyboard version="1"> | |
<commands> | |
<key command="SaveFile" shortcut="Ctrl+S" /> | |
<key command="SaveFile" shortcut="5" /> | |
<key command="AdvancedMode" shortcut="F" removed="true" /> | |
<key command="Undo" shortcut="Ctrl+Z" removed="true" /> | |
<key command="Undo" shortcut="D" /> | |
<key command="Redo" shortcut="Ctrl+Y" removed="true" /> | |
<key command="Redo" shortcut="Ctrl+Shift+Z" removed="true" /> |