file_path stringlengths 3 280 | file_language stringclasses 66
values | content stringlengths 1 1.04M | repo_name stringlengths 5 92 | repo_stars int64 0 154k | repo_description stringlengths 0 402 | repo_primary_language stringclasses 108
values | developer_username stringlengths 1 25 | developer_name stringlengths 0 30 | developer_company stringlengths 0 82 |
|---|---|---|---|---|---|---|---|---|---|
src/OpenArkDrv/kprocess/kprocess.h | C/C++ Header | /****************************************************************************
**
** Copyright (C) 2019 BlackINT3
** Contact: https://github.com/BlackINT3/OpenArk
**
** GNU Lesser General Public License Usage (LGPL)
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License versi... | wsdjeg/OpenArk-backup | 0 | C++ | wsdjeg | Eric Wong | ||
src/OpenArkDrv/kstorage/kstorage.cpp | C++ | /****************************************************************************
**
** Copyright (C) 2019 BlackINT3
** Contact: https://github.com/BlackINT3/OpenArk
**
** GNU Lesser General Public License Usage (LGPL)
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License versi... | wsdjeg/OpenArk-backup | 0 | C++ | wsdjeg | Eric Wong | ||
src/OpenArkDrv/kstorage/kstorage.h | C/C++ Header | /****************************************************************************
**
** Copyright (C) 2019 BlackINT3
** Contact: https://github.com/BlackINT3/OpenArk
**
** GNU Lesser General Public License Usage (LGPL)
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License versi... | wsdjeg/OpenArk-backup | 0 | C++ | wsdjeg | Eric Wong | ||
src/OpenArkDrv/kstorage/unlock/handle.cpp | C++ | /****************************************************************************
**
** Copyright (C) 2019 BlackINT3
** Contact: https://github.com/BlackINT3/OpenArk
**
** GNU Lesser General Public License Usage (LGPL)
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License versi... | wsdjeg/OpenArk-backup | 0 | C++ | wsdjeg | Eric Wong | ||
src/OpenArkDrv/kwingui/ops-hotkey/ops-hotkey.h | C/C++ Header | /****************************************************************************
**
** Copyright (C) 2019 BlackINT3
** Contact: https://github.com/BlackINT3/OpenArk
**
** GNU Lesser General Public License Usage (LGPL)
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License versi... | wsdjeg/OpenArk-backup | 0 | C++ | wsdjeg | Eric Wong | ||
src/OpenArkDrv/kwingui/ops-hotkey/utils/utils.cpp | C++ | /****************************************************************************
**
** Copyright (C) 2019 BlackINT3
** Contact: https://github.com/BlackINT3/OpenArk
**
** GNU Lesser General Public License Usage (LGPL)
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License versi... | wsdjeg/OpenArk-backup | 0 | C++ | wsdjeg | Eric Wong | ||
src/OpenArkDrv/kwingui/ops-hotkey/utils/utils.h | C/C++ Header | /****************************************************************************
**
** Copyright (C) 2019 BlackINT3
** Contact: https://github.com/BlackINT3/OpenArk
**
** GNU Lesser General Public License Usage (LGPL)
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License versi... | wsdjeg/OpenArk-backup | 0 | C++ | wsdjeg | Eric Wong | ||
app/ConvexClientProvider.tsx | TypeScript (TSX) | 'use client'
import { ReactNode } from 'react'
import { ConvexProvider, ConvexReactClient } from 'convex/react'
const convex = new ConvexReactClient(process.env.NEXT_PUBLIC_CONVEX_URL!)
export default function ConvexClientProvider({
children
}: {
children: ReactNode
}) {
return <ConvexProvider client={convex}>... | wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
app/components/answer.tsx | TypeScript (TSX) | import { FC } from 'react'
import { BookOpenText } from 'lucide-react'
import { Highlight, themes } from 'prism-react-renderer'
import Markdown from 'react-markdown'
import {
Popover,
PopoverContent,
PopoverTrigger
} from '@/app/components/popover'
import { Skeleton } from '@/app/components/skeleton'
import { Wr... | wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
app/components/footer.tsx | TypeScript (TSX) | import { FC } from 'react'
export const Footer: FC = () => {
return (
<div className="text-center flex flex-col items-center text-xs text-zinc-700 gap-1">
<div className="text-zinc-400">
OSS perplexity.ai/phind.com implementation
</div>
<span>
Star me on{' '}
<a
... | wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
app/components/logo.tsx | TypeScript (TSX) | import React, { FC } from 'react'
export const Logo: FC = () => {
return (
<div className="flex gap-4 items-center justify-center cursor-default select-none relative">
<div className="h-10 w-10">
<svg viewBox="0 0 85 85" className="h-full w-full">
<path
fillRule="evenodd"
... | wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
app/components/popover.tsx | TypeScript (TSX) | 'use client'
import * as React from 'react'
import * as PopoverPrimitive from '@radix-ui/react-popover'
import { cn } from '@/app/utils/cn'
const Popover = PopoverPrimitive.Root
const PopoverTrigger = PopoverPrimitive.Trigger
const PopoverContent = React.forwardRef<
React.ElementRef<typeof PopoverPrimitive.Conte... | wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
app/components/preset-query.tsx | TypeScript (TSX) | import React, { FC, useMemo } from 'react'
import Link from 'next/link'
import { nanoid } from 'nanoid'
import { getSearchUrl } from '@/app/utils/get-search-url'
export const PresetQuery: FC<{ query: string }> = ({ query }) => {
return (
<Link
prefetch={false}
title={query}
href={getSearchUrl(... | wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
app/components/relates.tsx | TypeScript (TSX) | import React, { FC } from 'react'
import { MessageSquareQuote } from 'lucide-react'
import { PresetQuery } from '@/app/components/preset-query'
import { Skeleton } from '@/app/components/skeleton'
import { Wrapper } from '@/app/components/wrapper'
import { Relate } from '@/app/interfaces/relate'
export const Relates:... | wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
app/components/result.tsx | TypeScript (TSX) | 'use client'
import { FC, useEffect, useState } from 'react'
import { useAction, useMutation, useQuery } from 'convex/react'
import { Annoyed } from 'lucide-react'
import { api } from '@/convex/_generated/api'
import { Id } from '@/convex/_generated/dataModel'
import { Answer } from '@/app/components/answer'
import {... | wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
app/components/search.tsx | TypeScript (TSX) | 'use client'
import React, { FC, useState } from 'react'
import { useRouter } from 'next/navigation'
import { ArrowRight } from 'lucide-react'
import { getSearchUrl } from '@/app/utils/get-search-url'
export const Search: FC = () => {
const [value, setValue] = useState('')
const router = useRouter()
return (
... | wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
app/components/skeleton.tsx | TypeScript (TSX) | import { HTMLAttributes } from 'react'
import { cn } from '@/app/utils/cn'
function Skeleton({ className, ...props }: HTMLAttributes<HTMLDivElement>) {
return (
<div
className={cn('animate-pulse rounded-md bg-muted', className)}
{...props}
/>
)
}
export { Skeleton }
| wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
app/components/sources.tsx | TypeScript (TSX) | import { FC } from 'react'
import { BookText } from 'lucide-react'
import { Skeleton } from '@/app/components/skeleton'
import { Wrapper } from '@/app/components/wrapper'
import { Source } from '@/app/interfaces/source'
const SourceItem: FC<{ source: Source; index: number }> = ({
source,
index
}) => {
const { i... | wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
app/components/title.tsx | TypeScript (TSX) | 'use client'
import { useRouter } from 'next/navigation'
export const Title = ({ query }: { query: string }) => {
const router = useRouter()
return (
<div className="flex items-center pb-4 mb-6 border-b gap-4">
<div className="flex-1 text-lg sm:text-xl text-black" title={query}>
{query}
</... | wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
app/components/wrapper.tsx | TypeScript (TSX) | import { FC, ReactNode } from 'react'
export const Wrapper: FC<{
title: ReactNode
content: ReactNode
}> = ({ title, content }) => {
return (
<div className="flex flex-col gap-4 w-full">
<div className="flex gap-2 text-blue-500">{title}</div>
{content}
</div>
)
}
| wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
app/globals.css | CSS | @tailwind base;
@tailwind components;
@tailwind utilities;
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:foc... | wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
app/interfaces/relate.ts | TypeScript | export interface Relate {
question: string
}
| wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
app/interfaces/source.ts | TypeScript | export interface Source {
id: string
name: string
url: string
isFamilyFriendly: boolean
displayUrl: string
snippet: string
deepLinks: { snippet: string; name: string; url: string }[]
dateLastCrawled: string
cachedPageUrl: string
language: string
primaryImageOfPage?: {
thumbnailUrl: string
... | wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
app/layout.tsx | TypeScript (TSX) | import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
import './globals.css'
import { ReactNode } from 'react'
import ConvexClientProvider from './ConvexClientProvider'
const inter = Inter({ subsets: ['latin'] })
export const metadata: Metadata = {
title: 'Bobtail.DEV',
description:
... | wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
app/page.tsx | TypeScript (TSX) | 'use client'
import React from 'react'
import { Footer } from '@/app/components/footer'
import { Logo } from '@/app/components/logo'
import { PresetQuery } from '@/app/components/preset-query'
import { Search } from '@/app/components/search'
export default function Home() {
return (
<div className="absolute in... | wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
app/search/page.tsx | TypeScript (TSX) | 'use client'
import { useSearchParams } from 'next/navigation'
import { Result } from '@/app/components/result'
import { Search } from '@/app/components/search'
import { Title } from '@/app/components/title'
export default function SearchPage() {
const searchParams = useSearchParams()
const query = decodeURIComp... | wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
app/utils/cn.ts | TypeScript | import { clsx, type ClassValue } from 'clsx'
import { twMerge } from 'tailwind-merge'
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
| wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
app/utils/get-search-url.ts | TypeScript | export const getSearchUrl = (query: string) => {
return `/search?q=${encodeURIComponent(query)}`
}
| wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
convex/_generated/api.d.ts | TypeScript | /* eslint-disable */
/**
* Generated `api` utility.
*
* THIS CODE IS AUTOMATICALLY GENERATED.
*
* Generated by convex@1.8.0.
* To regenerate, run `npx convex dev`.
* @module
*/
import type {
ApiFromModules,
FilterApi,
FunctionReference,
} from "convex/server";
import type * as crons from "../crons.js";
i... | wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
convex/_generated/api.js | JavaScript | /* eslint-disable */
/**
* Generated `api` utility.
*
* THIS CODE IS AUTOMATICALLY GENERATED.
*
* Generated by convex@1.8.0.
* To regenerate, run `npx convex dev`.
* @module
*/
import { anyApi } from "convex/server";
/**
* A utility for referencing Convex functions in your app's API.
*
* Usage:
* ```js
*... | wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
convex/_generated/dataModel.d.ts | TypeScript | /* eslint-disable */
/**
* Generated data model types.
*
* THIS CODE IS AUTOMATICALLY GENERATED.
*
* Generated by convex@1.8.0.
* To regenerate, run `npx convex dev`.
* @module
*/
import type {
DataModelFromSchemaDefinition,
DocumentByName,
TableNamesInDataModel,
SystemTableNames,
} from "convex/server... | wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
convex/_generated/server.d.ts | TypeScript | /* eslint-disable */
/**
* Generated utilities for implementing server-side Convex query and mutation functions.
*
* THIS CODE IS AUTOMATICALLY GENERATED.
*
* Generated by convex@1.8.0.
* To regenerate, run `npx convex dev`.
* @module
*/
import {
ActionBuilder,
HttpActionBuilder,
MutationBuilder,
Query... | wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
convex/_generated/server.js | JavaScript | /* eslint-disable */
/**
* Generated utilities for implementing server-side Convex query and mutation functions.
*
* THIS CODE IS AUTOMATICALLY GENERATED.
*
* Generated by convex@1.8.0.
* To regenerate, run `npx convex dev`.
* @module
*/
import {
actionGeneric,
httpActionGeneric,
queryGeneric,
mutation... | wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
convex/crons.ts | TypeScript | import { cronJobs } from 'convex/server'
import { internal } from './_generated/api'
const crons = cronJobs()
crons.interval(
'update query embeddings',
{ seconds: 15 }, // every minute
internal.searches.computeQueryEmbeddingForTenItems
)
export default crons
| wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
convex/llm.ts | TypeScript | 'use node'
import { v } from 'convex/values'
import OpenAI from 'openai'
import { Serper } from 'serper'
import { api, internal } from './_generated/api'
import { action, internalAction } from './_generated/server'
function createOpenAIClient() {
const apiKey = process.env.OPENAI_API_KEY
if (!apiKey) {
throw... | wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
convex/schema.ts | TypeScript | import { defineSchema, defineTable } from 'convex/server'
import { v } from 'convex/values'
export default defineSchema({
searches: defineTable({
query: v.string(),
content: v.string(),
sources: v.array(
v.object({
name: v.string(),
url: v.string(),
snippet: v.string()
... | wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
convex/searches.ts | TypeScript | import { v } from 'convex/values'
import { internal } from './_generated/api'
import {
action,
internalAction,
internalMutation,
internalQuery,
mutation,
query
} from './_generated/server'
export const createSearch = mutation({
args: {
query: v.string()
},
handler: async (ctx, args) => {
con... | wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
postcss.config.js | JavaScript | module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
}
| wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
prettier.config.cjs | JavaScript | /** @type {import('prettier').Config} */
module.exports = {
endOfLine: 'lf',
semi: false,
useTabs: false,
singleQuote: true,
arrowParens: 'avoid',
tabWidth: 2,
trailingComma: 'none',
plugins: ['@ianvs/prettier-plugin-sort-imports'],
importOrder: [
'^(react/(.*)$)|^(react$)',
'^(next/(.*)$)|^(n... | wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
tailwind.config.ts | TypeScript | import type { Config } from 'tailwindcss'
const config: Config = {
content: ['./app/**/*.{js,ts,jsx,tsx,mdx}'],
theme: {
extend: {
backgroundImage: {
'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
'gradient-conic':
'conic-gradient(from 180deg at 50% 50%, var(--t... | wsxiaoys/bobtail.dev | 52 | Poor man's phind.com/perplexity.ai | TypeScript | wsxiaoys | Meng Zhang | TabbyML, Inc. |
cef/examples/demo.rs | Rust | use cef::{args::Args, rc::*, *};
struct DemoApp(*mut RcImpl<cef_sys::_cef_app_t, Self>);
impl DemoApp {
fn new() -> App {
App::new(Self(std::ptr::null_mut()))
}
}
impl WrapApp for DemoApp {
fn wrap_rc(&mut self, object: *mut RcImpl<cef_sys::_cef_app_t, Self>) {
self.0 = object;
}
}
i... | wusyong/cef-rs | 40 | Rust | wusyong | Wu Yuwei | ||
cef/src/args.rs | Rust | use std::ffi::{c_char, CString};
use crate::MainArgs;
#[derive(Clone, Default)]
pub struct Args {
_source: Vec<CString>,
_argv: Vec<*const c_char>,
main_args: MainArgs,
}
impl Args {
pub fn new<T: IntoIterator<Item = String>>(args: T) -> Self {
let _source = args
.into_iter()
... | wusyong/cef-rs | 40 | Rust | wusyong | Wu Yuwei | ||
cef/src/lib.rs | Rust | /*!
Use CEF in Rust.
## Supported Targets
| Target | Linux | macOS | Windows |
| ------ | ----- | ----- | ------- |
| x86_64 | ✅ | ❎ | ❎ |
| ARM64 | ✅ | ❎ | ❎ |
## Usage
### Linux
#### Manual Install
- [Download](https://cef-builds.spotifycdn.com/index.html#linux64) Linux-64bit build.
- ... | wusyong/cef-rs | 40 | Rust | wusyong | Wu Yuwei | ||
cef/src/rc.rs | Rust | //! Reference counted module
//!
//! Many cef types are reference counted, this module is the building block to create them. Users
//! typically don't need to uses these types, but anyone who want to add feaures and
//! implementations to this crate will need to understand them.
//!
//! In order to create a new Rust ty... | wusyong/cef-rs | 40 | Rust | wusyong | Wu Yuwei | ||
cef/src/string.rs | Rust | //! String module
use cef_sys::{
_cef_string_list_t, _cef_string_map_t, _cef_string_multimap_t, _cef_string_utf16_t,
_cef_string_utf8_t, _cef_string_wide_t,
};
use std::{
fmt::{self, Display, Formatter},
mem, ptr, slice,
};
use crate::CefString;
enum CefStringData<T> {
Borrowed(Option<T>),
Cl... | wusyong/cef-rs | 40 | Rust | wusyong | Wu Yuwei | ||
flatpak-cargo-generator.py | Python | #!/usr/bin/env python3
__license__ = 'MIT'
import json
from urllib.parse import urlparse, ParseResult, parse_qs
import os
import contextlib
import copy
import glob
import subprocess
import argparse
import logging
import hashlib
import asyncio
from typing import Any, Dict, List, NamedTuple, Optional, Tuple, TypedDict
... | wusyong/cef-rs | 40 | Rust | wusyong | Wu Yuwei | ||
sys/bindgen.sh | Shell | #!/bin/bash
bindgen wrapper.h -o src/bindings.rs \
--default-enum-style=rust_non_exhaustive \
--allowlist-type cef_.* \
--allowlist-function cef_.* \
--bitfield-enum .*_mask_t \
-- -I $HOME/.local/share/cef/
| wusyong/cef-rs | 40 | Rust | wusyong | Wu Yuwei | ||
sys/build.rs | Rust | #[cfg(not(feature = "dox"))]
fn main() -> Result<(), String> {
let path = std::env::var("FLATPAK")
.map(|_| String::from("/usr/lib"))
.or_else(|_| std::env::var("CEF_PATH"))
.or_else(|_| {
std::env::var("HOME").map(|mut val| {
val.push_str("/.local/share/cef");
... | wusyong/cef-rs | 40 | Rust | wusyong | Wu Yuwei | ||
sys/src/bindings.rs | Rust | /* automatically generated by rust-bindgen 0.71.1 */
pub type __uint16_t = ::std::os::raw::c_ushort;
pub type __uint_least16_t = __uint16_t;
pub type __time_t = ::std::os::raw::c_long;
pub type wchar_t = ::std::os::raw::c_int;
pub type char16_t = __uint_least16_t;
#[doc = "\n CEF string type definitions. Whomever allo... | wusyong/cef-rs | 40 | Rust | wusyong | Wu Yuwei | ||
sys/src/lib.rs | Rust | #[allow(
non_snake_case,
non_camel_case_types,
non_upper_case_globals,
dead_code,
clippy::all
)]
mod bindings;
use std::ptr::null_mut;
pub use bindings::*;
impl Default for _cef_string_utf16_t {
fn default() -> Self {
Self {
str_: null_mut(),
length: 0,
... | wusyong/cef-rs | 40 | Rust | wusyong | Wu Yuwei | ||
sys/wrapper.h | C/C++ Header | #include "include/capi/cef_base_capi.h"
#include "include/capi/cef_app_capi.h"
#include "include/capi/cef_client_capi.h"
#include "include/capi/cef_urlrequest_capi.h"
#include "include/capi/views/cef_layout_capi.h"
#include "include/capi/views/cef_box_layout_capi.h"
#include "include/capi/views/cef_fill_layout_capi.h... | wusyong/cef-rs | 40 | Rust | wusyong | Wu Yuwei | ||
update-bindings/build.rs | Rust | // Empty build.rs file to set OUT_DIR environment variable
fn main() {}
| wusyong/cef-rs | 40 | Rust | wusyong | Wu Yuwei | ||
update-bindings/src/dirs.rs | Rust | use std::{convert::From, path::PathBuf};
pub fn get_manifest_dir() -> PathBuf {
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
}
pub fn get_out_dir() -> PathBuf {
PathBuf::from(env!("OUT_DIR"))
}
pub fn get_sys_dir() -> crate::Result<PathBuf> {
let manifest_dir = get_manifest_dir();
let mut bindings_dir =... | wusyong/cef-rs | 40 | Rust | wusyong | Wu Yuwei | ||
update-bindings/src/main.rs | Rust | #[macro_use]
extern crate thiserror;
use std::{fs, io::Read, path::Path};
#[derive(Debug, Error)]
pub enum Error {
#[error("Missing Parent")]
MissingParent(std::path::PathBuf),
#[error(transparent)]
Io(#[from] std::io::Error),
#[error(transparent)]
Regex(#[from] regex::Error),
#[error(tran... | wusyong/cef-rs | 40 | Rust | wusyong | Wu Yuwei | ||
update-bindings/src/parse_tree.rs | Rust | use convert_case::{Case, Casing};
use quote::{format_ident, quote, ToTokens};
use regex::Regex;
use std::{
cell::OnceCell,
collections::BTreeMap,
fmt::{self, Debug, Display, Formatter},
fs,
io::Write,
iter::{self, Iterator},
path::{Path, PathBuf},
process::Command,
sync::OnceLock,
};... | wusyong/cef-rs | 40 | Rust | wusyong | Wu Yuwei | ||
build.rs | Rust | use cfg_aliases::cfg_aliases;
fn main() {
// The script doesn't depend on our code
println!("cargo:rerun-if-changed=build.rs");
// Setup cfg aliases
cfg_aliases! {
// Systems.
android_platform: { target_os = "android" },
wasm_platform: { all(target_family = "wasm", not(target_o... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/child_window.rs | Rust | #[cfg(any(x11_platform, macos_platform, windows_platform))]
fn main() {
use std::collections::HashMap;
use raw_window_handle::HasRawWindowHandle;
use winit::{
dpi::{LogicalPosition, LogicalSize, Position},
event::{ElementState, Event, KeyboardInput, WindowEvent},
event_loop::{Contro... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/control_flow.rs | Rust | #![allow(clippy::single_match)]
use std::{thread, time};
use simple_logger::SimpleLogger;
use winit::{
event::{Event, KeyboardInput, WindowEvent},
event_loop::EventLoop,
window::WindowBuilder,
};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
enum Mode {
Wait,
WaitUntil,
Poll,
}
const WAIT_TIM... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/cursor.rs | Rust | #![allow(clippy::single_match)]
use simple_logger::SimpleLogger;
use winit::{
event::{ElementState, Event, KeyboardInput, WindowEvent},
event_loop::EventLoop,
window::{CursorIcon, WindowBuilder},
};
fn main() {
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
let window... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/cursor_grab.rs | Rust | #![allow(clippy::single_match)]
use simple_logger::SimpleLogger;
use winit::{
event::{DeviceEvent, ElementState, Event, KeyboardInput, ModifiersState, WindowEvent},
event_loop::EventLoop,
window::{CursorGrabMode, WindowBuilder},
};
fn main() {
SimpleLogger::new().init().unwrap();
let event_loop = ... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/custom_events.rs | Rust | #![allow(clippy::single_match)]
#[cfg(not(wasm_platform))]
fn main() {
use simple_logger::SimpleLogger;
use winit::{
event::{Event, WindowEvent},
event_loop::EventLoopBuilder,
window::WindowBuilder,
};
#[derive(Debug, Clone, Copy)]
enum CustomEvent {
Timer,
}
... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/drag_window.rs | Rust | #![allow(clippy::single_match)]
use simple_logger::SimpleLogger;
use winit::{
event::{
ElementState, Event, KeyboardInput, MouseButton, StartCause, VirtualKeyCode, WindowEvent,
},
event_loop::EventLoop,
window::{Window, WindowBuilder, WindowId},
};
fn main() {
SimpleLogger::new().init().un... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/fullscreen.rs | Rust | #![allow(clippy::single_match)]
use simple_logger::SimpleLogger;
use winit::event::{ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent};
use winit::event_loop::EventLoop;
use winit::window::{Fullscreen, WindowBuilder};
#[cfg(target_os = "macos")]
use winit::platform::macos::WindowExtMacOS;
fn main() {
... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/handling_close.rs | Rust | #![allow(clippy::single_match)]
use simple_logger::SimpleLogger;
use winit::{
event::{Event, KeyboardInput, WindowEvent},
event_loop::EventLoop,
window::WindowBuilder,
};
fn main() {
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
let _window = WindowBuilder::new()
... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/ime.rs | Rust | #![allow(clippy::single_match)]
use log::LevelFilter;
use simple_logger::SimpleLogger;
use winit::{
dpi::PhysicalPosition,
event::{ElementState, Event, Ime, VirtualKeyCode, WindowEvent},
event_loop::{ControlFlow, EventLoop},
window::{ImePurpose, WindowBuilder},
};
fn main() {
SimpleLogger::new()
... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/monitor_list.rs | Rust | #![allow(clippy::single_match)]
use simple_logger::SimpleLogger;
use winit::dpi::{PhysicalPosition, PhysicalSize};
use winit::monitor::MonitorHandle;
use winit::{event_loop::EventLoop, window::WindowBuilder};
fn main() {
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
let window = ... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/mouse_wheel.rs | Rust | #![allow(clippy::single_match)]
use simple_logger::SimpleLogger;
use winit::{
event::{Event, WindowEvent},
event_loop::EventLoop,
window::WindowBuilder,
};
fn main() {
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
let window = WindowBuilder::new()
.with_title... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/multithreaded.rs | Rust | #![allow(clippy::single_match)]
#[cfg(not(wasm_platform))]
fn main() {
use std::{collections::HashMap, sync::mpsc, thread, time::Duration};
use simple_logger::SimpleLogger;
use winit::{
dpi::{PhysicalPosition, PhysicalSize, Position, Size},
event::{ElementState, Event, KeyboardInput, Virtu... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/multiwindow.rs | Rust | #![allow(clippy::single_match)]
use std::collections::HashMap;
use simple_logger::SimpleLogger;
use winit::{
event::{ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent},
event_loop::EventLoop,
window::Window,
};
fn main() {
SimpleLogger::new().init().unwrap();
let event_loop = EventL... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/request_redraw.rs | Rust | #![allow(clippy::single_match)]
use simple_logger::SimpleLogger;
use winit::{
event::{ElementState, Event, WindowEvent},
event_loop::EventLoop,
window::WindowBuilder,
};
fn main() {
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
let window = WindowBuilder::new()
... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/request_redraw_threaded.rs | Rust | #![allow(clippy::single_match)]
#[cfg(not(wasm_platform))]
fn main() {
use std::{thread, time};
use simple_logger::SimpleLogger;
use winit::{
event::{Event, WindowEvent},
event_loop::EventLoop,
window::WindowBuilder,
};
SimpleLogger::new().init().unwrap();
let event_lo... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/resizable.rs | Rust | #![allow(clippy::single_match)]
use simple_logger::SimpleLogger;
use winit::{
dpi::LogicalSize,
event::{ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent},
event_loop::EventLoop,
window::WindowBuilder,
};
fn main() {
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/theme.rs | Rust | #![allow(clippy::single_match)]
use simple_logger::SimpleLogger;
use winit::{
event::{ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent},
event_loop::{ControlFlow, EventLoop},
window::{Theme, WindowBuilder},
};
fn main() {
SimpleLogger::new().init().unwrap();
let event_loop = EventLo... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/timer.rs | Rust | #![allow(clippy::single_match)]
use instant::Instant;
use std::time::Duration;
use simple_logger::SimpleLogger;
use winit::{
event::{Event, StartCause, WindowEvent},
event_loop::EventLoop,
window::WindowBuilder,
};
fn main() {
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new()... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/touchpad_gestures.rs | Rust | use simple_logger::SimpleLogger;
use winit::{
event::{Event, WindowEvent},
event_loop::{ControlFlow, EventLoop},
window::WindowBuilder,
};
fn main() {
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
let _window = WindowBuilder::new()
.with_title("Touchpad gestur... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/transparent.rs | Rust | #![allow(clippy::single_match)]
use simple_logger::SimpleLogger;
use winit::{
event::{Event, WindowEvent},
event_loop::EventLoop,
window::WindowBuilder,
};
fn main() {
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
let window = WindowBuilder::new()
.with_decor... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/video_modes.rs | Rust | #![allow(clippy::single_match)]
use simple_logger::SimpleLogger;
use winit::event_loop::EventLoop;
fn main() {
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
let monitor = match event_loop.primary_monitor() {
Some(monitor) => monitor,
None => {
println!... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/web.rs | Rust | #![allow(clippy::single_match)]
use winit::{
event::{Event, WindowEvent},
event_loop::EventLoop,
window::WindowBuilder,
};
pub fn main() {
let event_loop = EventLoop::new();
let window = WindowBuilder::new()
.with_title("A fantastic window!")
.build(&event_loop)
.unwrap();... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/web_aspect_ratio.rs | Rust | pub fn main() {
println!("This example must be run with cargo run-wasm --example web_aspect_ratio")
}
#[cfg(wasm_platform)]
mod wasm {
use wasm_bindgen::prelude::*;
use wasm_bindgen::JsCast;
use web_sys::HtmlCanvasElement;
use winit::{
dpi::PhysicalSize,
event::{Event, WindowEvent},... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/window.rs | Rust | #![allow(clippy::single_match)]
use simple_logger::SimpleLogger;
use winit::{
event::{Event, WindowEvent},
event_loop::EventLoop,
window::WindowBuilder,
};
fn main() {
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
let window = WindowBuilder::new()
.with_title... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/window_buttons.rs | Rust | #![allow(clippy::single_match)]
// This example is used by developers to test various window functions.
use simple_logger::SimpleLogger;
use winit::{
dpi::LogicalSize,
event::{ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent},
event_loop::{DeviceEventFilter, EventLoop},
window::{WindowB... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/window_debug.rs | Rust | #![allow(clippy::single_match)]
// This example is used by developers to test various window functions.
use simple_logger::SimpleLogger;
use winit::{
dpi::{LogicalSize, PhysicalSize},
event::{DeviceEvent, ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent},
event_loop::{DeviceEventFilter, Eve... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/window_drag_resize.rs | Rust | //! Demonstrates capability to create in-app draggable regions for client-side decoration support.
use simple_logger::SimpleLogger;
use winit::{
event::{
ElementState, Event, KeyboardInput, MouseButton, StartCause, VirtualKeyCode, WindowEvent,
},
event_loop::{ControlFlow, EventLoop},
window::{C... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/window_icon.rs | Rust | #![allow(clippy::single_match)]
use std::path::Path;
use simple_logger::SimpleLogger;
use winit::{
event::Event,
event_loop::EventLoop,
window::{Icon, WindowBuilder},
};
fn main() {
SimpleLogger::new().init().unwrap();
// You'll have to choose an icon size at your own discretion. On X11, the des... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/window_option_as_alt.rs | Rust | #![allow(clippy::single_match)]
#[cfg(target_os = "macos")]
use winit::platform::macos::{OptionAsAlt, WindowExtMacOS};
#[cfg(target_os = "macos")]
use winit::{
event::ElementState,
event::{Event, MouseButton, WindowEvent},
event_loop::EventLoop,
window::WindowBuilder,
};
/// Prints the keyboard event... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/window_resize_increments.rs | Rust | use log::debug;
use simple_logger::SimpleLogger;
use winit::{
dpi::LogicalSize,
event::{ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent},
event_loop::EventLoop,
window::WindowBuilder,
};
fn main() {
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
let... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
examples/window_run_return.rs | Rust | #![allow(clippy::single_match)]
// Limit this example to only compatible platforms.
#[cfg(any(
windows_platform,
macos_platform,
x11_platform,
wayland_platform,
android_platform,
orbital_platform,
))]
fn main() {
use std::{thread::sleep, time::Duration};
use simple_logger::SimpleLogger... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
src/dpi.rs | Rust | //! UI scaling is important, so read the docs for this module if you don't want to be confused.
//!
//! ## Why should I care about UI scaling?
//!
//! Modern computer screens don't have a consistent relationship between resolution and size.
//! 1920x1080 is a common resolution for both desktop and mobile screens, despi... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
src/error.rs | Rust | use std::{error, fmt};
use crate::platform_impl;
/// An error whose cause it outside Winit's control.
#[derive(Debug)]
pub enum ExternalError {
/// The operation is not supported by the backend.
NotSupported(NotSupportedError),
/// The OS cannot perform the operation.
Os(OsError),
}
/// The error typ... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
src/event.rs | Rust | //! The [`Event`] enum and assorted supporting types.
//!
//! These are sent to the closure given to [`EventLoop::run(...)`], where they get
//! processed and used to modify the program state. For more details, see the root-level documentation.
//!
//! Some of these events represent different "parts" of a traditional e... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
src/event_loop.rs | Rust | //! The [`EventLoop`] struct and assorted supporting types, including
//! [`ControlFlow`].
//!
//! If you want to send custom events to the event loop, use
//! [`EventLoop::create_proxy`] to acquire an [`EventLoopProxy`] and call its
//! [`send_event`](`EventLoopProxy::send_event`) method.
//!
//! See the root-level do... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
src/icon.rs | Rust | use crate::platform_impl::PlatformIcon;
use std::{error::Error, fmt, io, mem};
#[repr(C)]
#[derive(Debug)]
pub(crate) struct Pixel {
pub(crate) r: u8,
pub(crate) g: u8,
pub(crate) b: u8,
pub(crate) a: u8,
}
pub(crate) const PIXEL_SIZE: usize = mem::size_of::<Pixel>();
#[derive(Debug)]
/// An error pr... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
src/lib.rs | Rust | //! Winit is a cross-platform window creation and event loop management library.
//!
//! # Building windows
//!
//! Before you can build a [`Window`], you first need to build an [`EventLoop`]. This is done with the
//! [`EventLoop::new()`] function.
//!
//! ```no_run
//! use winit::event_loop::EventLoop;
//! let event_... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
src/monitor.rs | Rust | //! Types useful for interacting with a user's monitors.
//!
//! If you want to get basic information about a monitor, you can use the
//! [`MonitorHandle`] type. This is retrieved from one of the following
//! methods, which return an iterator of [`MonitorHandle`]:
//! - [`EventLoopWindowTarget::available_monitors`](c... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
src/platform/android.rs | Rust | use crate::{
event_loop::{EventLoop, EventLoopBuilder, EventLoopWindowTarget},
window::{Window, WindowBuilder},
};
use android_activity::{AndroidApp, ConfigurationRef, Rect};
/// Additional methods on [`EventLoop`] that are specific to Android.
pub trait EventLoopExtAndroid {}
impl<T> EventLoopExtAndroid for... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
src/platform/ios.rs | Rust | use std::os::raw::c_void;
use objc2::rc::Id;
use crate::{
event_loop::EventLoop,
monitor::{MonitorHandle, VideoMode},
window::{Window, WindowBuilder},
};
/// Additional methods on [`EventLoop`] that are specific to iOS.
pub trait EventLoopExtIOS {
/// Returns the [`Idiom`] (phone/tablet/tv/etc) for t... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
src/platform/macos.rs | Rust | use std::os::raw::c_void;
use objc2::rc::Id;
use crate::{
event_loop::{EventLoopBuilder, EventLoopWindowTarget},
monitor::MonitorHandle,
window::{Window, WindowBuilder},
};
/// Additional methods on [`Window`] that are specific to MacOS.
pub trait WindowExtMacOS {
/// Returns a pointer to the cocoa `... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
src/platform/mod.rs | Rust | //! Contains traits with platform-specific methods in them.
//!
//! Contains the follow OS-specific modules:
//!
//! - `android`
//! - `ios`
//! - `macos`
//! - `unix`
//! - `windows`
//! - `web`
//!
//! And the following platform-specific module:
//!
//! - `run_return` (available on `windows`, `unix`, `macos`, a... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
src/platform/orbital.rs | Rust | // There are no Orbital specific traits yet.
| wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei | ||
src/platform/run_return.rs | Rust | use crate::{
event::Event,
event_loop::{ControlFlow, EventLoop, EventLoopWindowTarget},
};
/// Additional methods on [`EventLoop`] to return control flow to the caller.
pub trait EventLoopExtRunReturn {
/// A type provided by the user that can be passed through [`Event::UserEvent`].
type UserEvent;
... | wusyong/winit-gtk | 3 | Rust | wusyong | Wu Yuwei |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.