Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Francesco Ceccon fracek

🎯
Focusing
View GitHub Profile
@fracek
fracek / CMakeLists.txt
Last active Jan 10, 2022
CMake and GTK+ 3
View CMakeLists.txt
# Thanks to @danger89 and @Ilothar for updating the gist.
# Set the name and the supported language of the project
project(hello-world C CXX)
# Set the minimum version of cmake required to build this project
cmake_minimum_required(VERSION 3.10)
# Use the package PkgConfig to detect GTK+ headers/library files
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK REQUIRED gtkmm-3.0)
View keybase.md

Keybase proof

I hereby claim:

  • I am fracek on github.
  • I am fracek (https://keybase.io/fracek) on keybase.
  • I have a public key ASBNKBl-C187AH5zntexFUUJ9hGGF3DsoTx6KSeVsu5vFAo

To claim this, I am signing this object:

View uri.dylan
module: uri
author: Bastian Mueller
synopsis: RFC 3986: Uniform Resource Identifier (URI): Generic Syntax
Copyright: Original Code is Copyright (c) 2011 Dylan Hackers
All rights reserved.
License: See License.txt in this distribution for details.
define class <uri> (<object>)
slot uri-scheme :: <string> = "",
init-keyword: scheme:;
View uri.dylan
let scheme = "";
let host = "";
let port = #f;
let start = 0;
unless (uri[0] == '/')
let (_scheme, scheme-end) = parse-scheme();
let (_host, host-end) = parse-host(scheme-end);
let (_port, port-end) = parse-port(host-end);
scheme := _scheme;
View dynamic-content.rst

Reading a request

read-request                                0.951s
|- parse-request-line                       0.501s
|  |- parse-request-url                     0.429s
|     |- parse-uri-as                       0.409s
|        |- regex-search-string             0.322s
View gtk.dylan
define function g-value-to-dylan(instance :: <GValue>)
=> (dylan-instance);
let g-type = g-value-type(instance);
if(g-type ~= $G-TYPE-INVALID)
let dylan-type = find-gtype(g-type);
let address-thunk = curry(compose(pointer-address, g-value-peek-pointer),
instance);
if(dylan-type & subtype?(dylan-type, <GTypeInstance>))
make(dylan-type, address: address-thunk())
else
View gdk-test.dylan
for (c in current-class.direct-subclasses)
push(classes-to-visit, c);
end;
//map(curry(push, classes-to-visit), x.direct-subclasses);
View glib.dylan
module: glib
synopsis: generated bindings for the GLib library
copyright: See LICENSE file in this distribution.
define constant $ASCII-DTOSTR-BUF-SIZE = 39;
define C-struct <_GArray>
slot garray-data :: <C-string>;
slot garray-len :: <C-unsigned-int>;
pointer-type-name: <GArray>;
View Gtk.dylan
// Interface
define C-subtype <_TreeSortable> (<TreeModel>)
pointer-type-name: <TreeSortable>;
end C-subtype
define C-function gtk-tree-sortable-get-sort-column-id
input parameter self :: <TreeSortable>;
output parameter sort_column_id :: <C-signed-int>;
output parameter order :: <SortType>;
result res :: <C-boolean>;
View Gtk.dylan
// Interface
define C-subtype <_TreeSortable> (<TreeModel>)
pointer-type-name: <TreeSortable>;
end C-subtype
define C-function gtk-tree-sortable-get-sort-column-id
input parameter self :: <TreeSortable>;
output parameter sort_column_id :: <C-signed-int>;
output parameter order :: <SortType>;
result res :: <C-boolean>;