text
stringlengths
14
100k
source
stringclasses
1 value
repo
stringclasses
810 values
language
stringclasses
13 values
use directories::BaseDirs; use std::path::PathBuf; const CONFIG_LOCATION: &str = ".config/zellij"; pub(crate) fn home_config_dir() -> Option<PathBuf> { BaseDirs::new().map(|dirs| dirs.home_dir().join(CONFIG_LOCATION)) } pub(crate) fn try_create_home_config_dir() { if let Some(user_dirs) = BaseDirs::new() { ...
fim
zellij-org/zellij
rust
<|fim_suffix|>e::home::xdg_config_dir(); if let Err(e) = std::fs::create_dir_all(config_dir) { log::error!("Failed to create config dir: {:?}", e); } } /// System-wide data directory (`C:\ProgramData\Zellij\data`). pub(crate) fn system_data_dir() -> PathBuf { use crate::consts::SYSTEM_DEFAULT_DATA_...
fim
zellij-org/zellij
rust
<|fim_prefix|>use crate::data::LayoutInfo; use crate::input::options::Options; use crate::pane_size::Size; use crate::{ home::{find_default_config_dir, get_theme_dir}, input::{config::Config, layout::Layout, theme::Themes}, setup::get_default_themes, }; use serde::{Deserialize, Serialize}; use std::path::Pa...
fim
zellij-org/zellij
rust
<|fim_prefix|>//! Trigger a command use crate::data::{Direction, OriginatingPlugin}; use serde::{Deserialize, Serialize}; use std::path::PathBuf; #[derive(Debug, Clone)] pub enum Termina<|fim_suffix|>d { fn default() -> Self { OpenFilePayload { path: PathBuf::new(), line_number: Non...
fim
zellij-org/zellij
rust
<|fim_prefix|>use crate::data::Styling; #[cfg(not(target_family = "wasm"))] use crate::data::{LayoutInfo, LayoutWithError}; use miette::{Diagnostic, LabeledSpan, NamedSource, SourceCode}; use serde::{Deserialize, Serialize}; use std::collections::HashSet; use std::fs::File; use std::io::{self, Read}; use std::path::P...
fim
zellij-org/zellij
rust
<|fim_prefix|>use std::collections::{BTreeMap, HashMap}; use super::actions::Action; use crate::data::{BareKey, InputMode, KeyWithModifier, KeybindsVec}; use serde::{Deserialize, Serialize}; use std::fmt; /// Used in the config struct #[derive(Clone, PartialEq, Deserialize, Serialize, Default)] pub struct Keybinds(p...
fim
zellij-org/zellij
rust
<|fim_suffix|>n { SplitDirection::Vertical => { following_geom.x = following_geom.x.saturating_sub(decrease_by) }, SplitDirection::Horizontal => { following_geom.y = following_geom.y.saturatin...
fim
zellij-org/zellij
rust
<|fim_prefix|>pub mod actions; pub mod cli_assets; pub mod command; pub mod config; pub mod keybinds; pub mod layout; pub mod mouse; pub mod options; pub mod permission; pub mod plugins; pub mod theme; pub mod web_client; #[cfg(not(target_family = "wasm"))] pub use not_wasm::*; #[cfg(not(target_family = "wasm"))] mod...
fim
zellij-org/zellij
rust
<|fim_prefix|>use serde::{Deserialize, Serialize}; use crate::position::Position; #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)] /// A mouse event can have any number of buttons (including no /// buttons) pressed or released. pub struct MouseEvent { /// A mouse event can current be a P...
fim
zellij-org/zellij
rust
<|fim_suffix|>py_clipboard = other.copy_clipboard.or(self.copy_clipboard); let copy_on_select = other.copy_on_select.or(self.copy_on_select); let osc8_hyperlinks = other.osc8_hyperlinks.or(self.osc8_hyperlinks); let scrollback_editor = other .scrollback_editor .or_else(||...
fim
zellij-org/zellij
rust
use std::{ collections::HashMap, fs::{self, File}, io::Write, path::PathBuf, }; use crate::{consts::ZELLIJ_PLUGIN_PERMISSIONS_CACHE, data::PermissionType}; pub type GrantedPermission = HashMap<String, Vec<PermissionType>>; #[derive(Default, Debug)] pub struct PermissionCache { path: PathBuf, ...
fim
zellij-org/zellij
rust
<|fim_suffix|>and the given /// plugin dir is "/home/bob/.zellij/plugins" the lookup chain will be this: /// /// ```bash /// /tab-bar /// /tab-bar.wasm /// ``` /// pub fn resolve_wasm_bytes(&self, plugin_dir: &Path) -> Result<Vec<u8>> { let err_context = |err: std...
fim
zellij-org/zellij
rust
<|fim_prefix|>use serde::{ de::{Error, Visitor}, Deserialize, Deserializer, Serialize, Serializer, }; use std::{ collections::{BTreeMap, HashMap}, fmt, }; use crate::data::Styling; #[derive(Debug, Default, Clone, Copy, PartialEq, Deserialize, Serialize)] pub struct UiConfig { pub pane_frames: Fram...
fim
zellij-org/zellij
rust
<|fim_prefix|>use super::super::actions::*; use super::super::keybinds::*; use crate::data::{BareKey, Direction, KeyWithModifier}; use crate::input::config::Config; use insta::assert_snapshot; use strum::IntoEnumIterator; #[test] fn can_define_keybindings_in_configfile() { let config_contents = r#" keybind...
fim
zellij-org/zellij
rust
use super::super::layout::*; use insta::assert_snapshot; #[cfg(not(windows))] fn normalize_layout_debug(s: String) -> String { s } #[cfg(windows)] fn normalize_layout_debug(s: String) -> String { // On Windows, PathBuf's Debug output uses `\\` (escaped backslash). // Replace `\\\\` (two escaped backslashe...
fim
zellij-org/zellij
rust
<|fim_prefix|>use super::super::theme::*; use insta::assert_snapshot; use std::path::{Path, PathBuf}; fn theme_test_dir(theme: String) -> PathBuf { let root = Path::<|fim_suffix|>to()); let theme = Themes::from_path(path); assert!(theme.is_err()); } <|fim_middle|>new(env!("CARGO_MANIFEST_DIR")); let th...
fim
zellij-org/zellij
rust
<|fim_prefix|>use kdl::{KdlDocument, KdlNode, KdlValue}; use serde::{Deserialize, Serialize}; use crate::{ data::PaletteColor, kdl_children_or_error, kdl_first_entry_as_string, kdl_get_child, kdl_get_child_entry_bool_value, kdl_get_child_entry_string_value, }; use super::config::ConfigError; #[derive(Debug, ...
fim
zellij-org/zellij
rust
<|fim_prefix|>use crate::{ <|fim_suffix|>eKey::Char => Err(anyhow!("Character key needs character data")), ProtoBareKey::Tab => Ok(BareKey::Tab), ProtoBareKey::Esc => Ok(BareKey::Esc), ProtoBareKey::Enter => Ok(BareKey::Enter), ProtoBareKey::CapsLock => Ok(BareKey::Caps...
fim
zellij-org/zellij
rust
<|fim_prefix|>mod roundtrip<|fim_suffix|>st_framework; <|fim_middle|>_tests; mod socket_tests; mod te<|endoftext|>
fim
zellij-org/zellij
rust
<|fim_suffix|>ld NOT be identified as a socket" ); } #[test] fn session_probe_accepts_responding_socket() { let (_guard, name) = new_ipc(); let listener = bind_listener(&name); let server = std::thread::spawn(move || { let stream = listener.incoming().next().unwrap().expect("accept failed"); ...
fim
zellij-org/zellij
rust
<|fim_suffix|>ent_roundtrip, test_server_roundtrip}; <|fim_prefix|>/// Macro for testing round-trip conversion for ClientToServerMsg variants macro_rules! test_client_roundtrip { ($msg:expr) => {{ let original: crate::ipc::ClientToServerMsg = $msg; let proto: crate::client_server_contract::client_se...
fim
zellij-org/zellij
rust
<|fim_prefix|>//! IPC stuff for starting to split things into a client and server model. use crate::{ data::{ClientId, ConnectToSession, HostTerminalThemeMode, KeyWithModifier, PaneId, Style}, errors::{prelude::*, ErrorContext}, input::{actions::Action, cli_assets::CliAssets}, pane_size::{Size, SizeInPi...
fim
zellij-org/zellij
rust
<|fim_suffix|>sm"), feature = "web_server_capability"))] pub mod web_authentication_tokens; #[cfg(all(not(target_family = "wasm"), feature = "web_server_capability"))] pub mod web_server_commands; #[cfg(all(not(target_family = "wasm"), feature = "web_server_capability"))] pub mod web_server_contract; // TODO(hartan): ...
fim
zellij-org/zellij
rust
<|fim_suffix|>end(true) .create(true) .open(&path)?; set_permissions(&path, 0o600)?; file.write_all(message) } <|fim_prefix|>//! Zellij logging utility functions. use std::{ fs, io::{self, prelude::*}, path::{Path, PathBuf}, }; use log::LevelFilter; use log4rs::append::rolling_fil...
fim
zellij-org/zellij
rust
<|fim_prefix|>use serde::{Deserialize, Serialize}; use std::{ fmt::Display, hash::{Hash, Hasher}, }; use crate::data::FloatingPaneCoordinates; use crate::input::layout::{PercentOrFixed, SplitDirection, SplitSize}; use crate::position::Position; /// Contains the position and size of a [`Pane`], or more general...
fim
zellij-org/zellij
rust
<|fim_prefix|>pub use super::generated_api::api::command::Command as ProtobufCommand; use crate::data::CommandToRun; use std::convert::TryFrom; use std::path::PathBuf; impl TryFrom<ProtobufCommand> for CommandToRun { type Error = &'static str; fn try_from(protobuf_command: ProtobufCommand) -> Result<Self, &'s...
fim
zellij-org/zellij
rust
<|fim_prefix|>pub use super::generated_api::api::file::File as ProtobufFile; use crate::data::FileToOpen; use std::convert::TryFrom; use std::path::PathBuf; impl TryFrom<ProtobufFile> for FileToOpen { type Error <|fim_suffix|>as usize); let cwd = protobuf_file.cwd.map(|c| PathBuf::from(c)); Ok(Fil...
fim
zellij-org/zellij
rust
pub use super::generated_api::api::input_mode::{ InputMode as ProtobufInputMode, InputModeMessage as ProtobufInputModeMessage, }; use crate::data::InputMode; use std::convert::TryFrom; impl TryFrom<ProtobufInputMode> for InputMode { type Error = &'static str; fn try_from(protobuf_input_mode: ProtobufInput...
fim
zellij-org/zellij
rust
<|fim_suffix|>id key modifier")? .try_into()?, ); } for key_modifier in protobuf_key.additional_modifiers { key_modifiers.insert( ProtobufKeyModifier::from_i32(key_modifier) .ok_or("invalid key modifier")? ...
fim
zellij-org/zellij
rust
<|fim_prefix|>pub use super::generated_api::api::message::Message as ProtobufMessage; use crate::data::PluginMessage; use std::convert::TryFrom; impl TryFrom<ProtobufMessage> for PluginMessage { type Error = &'static str; fn try_from(protobuf_message: ProtobufMessage) -> Result<S<|fim_suffix|>ic str; fn t...
fim
zellij-org/zellij
rust
<|fim_suffix|>; } <|fim_prefix|>pub mod action; pub mod command; pub mod event; pub mod file; pub mod input_mode; pub mod key; pub mod message; pub mod pipe_message; pub mod plugin_command; pub mod plugin_ids; pub mod plugin_permission; pub mod resize; pub mod style; // NOTE: This code is currently out of order. // Ref...
fim
zellij-org/zellij
rust
<|fim_suffix|>, arg.value)) .collect(); let is_private = protobuf_pipe_message.is_private; Ok(PipeMessage { source, name, payload, args, is_private, }) } } impl TryFrom<PipeMessage> for ProtobufPipeMessage { type Er...
fim
zellij-org/zellij
rust
<|fim_prefix|>pub use super::generated_api::api::p<|fim_suffix|>.zellij_pid as i32, initial_cwd: plugin_ids.initial_cwd.display().to_string(), client_id: plugin_ids.client_id as u32, }) } } impl TryFrom<&str> for ProtobufZellijVersion { type Error = &'static str; fn try_from...
fim
zellij-org/zellij
rust
<|fim_prefix|>pub use super::generated_a<|fim_suffix|> PermissionType::ReadCliPipes => Ok(ProtobufPermissionType::ReadCliPipes), PermissionType::MessageAndLaunchOtherPlugins => { Ok(ProtobufPermissionType::MessageAndLaunchOtherPlugins) }, PermissionType::Reco...
fim
zellij-org/zellij
rust
<|fim_prefix|>pub use super::generated_api::api::resize::{ MoveDirection as ProtobufMoveDirection, Resize as ProtobufResize, ResizeAction, ResizeDirection, ResizeDirection as ProtobufResizeDirection, }; use crate::data::{Direction, Resize, ResizeStrategy}; use std::convert::TryFrom; impl TryFrom<ProtobufResiz...
fim
zellij-org/zellij
rust
<|fim_suffix|> brown: protobuf_palette .brown .ok_or("malformed palette payload")? .try_into()?, ..Default::default() }) } } impl TryFrom<Palette> for ProtobufPalette { type Error = &'static str; fn try_from(palette: Palette) -> ...
fim
zellij-org/zellij
rust
<|fim_suffix|>, PartialEq, Eq, Hash, Deserialize, Serialize, PartialOrd)] pub struct Column(pub usize); <|fim_prefix|>use serde::{Deserialize, Serialize}; #[derive(Debug, Hash, Copy, Clone, PartialEq, Eq, PartialOrd, Deserialize, Serialize)] pub struct Position { pub line: Line, pub column: Column, } impl Pos...
fim
zellij-org/zellij
rust
<|fim_prefix|>use crate::consts::ZELLIJ_PROJ_DIR; use crate::shared::set_permissions; use rusqlite::Connection; use std::path::PathBuf; #[derive(Debug)] pub enum TokenError { Database(rusqlite::Error), Io(std::io::Error), InvalidPath, } impl std::fmt::Display for TokenError { fn fmt(&self, f: &mut std...
fim
zellij-org/zellij
rust
<|fim_prefix|>use kdl::{KdlDocument, KdlEntry, KdlNode, KdlValue}; use std::collections::{BTreeMap, HashMap, HashSet}; use std::path::PathBuf; use crate::{ input::layout::PluginUserConfiguration, input::layout::{ FloatingPaneLayout, Layout, LayoutConstraint, PercentOrFixed, Run, RunPluginOrAlias, ...
fim
zellij-org/zellij
rust
use crate::{ consts::{ is_ipc_socket, session_info_folder_for_session, session_layout_cache_file_name, ZELLIJ_SESSION_INFO_CACHE_DIR, ZELLIJ_SOCK_DIR, }, envs, input::layout::Layout, ipc::{ClientToServerMsg, IpcReceiverWithContext, IpcSenderWithContext, ServerToClientMsg}, }; use any...
fim
zellij-org/zellij
rust
<|fim_suffix|>t)) => { Layout::from_stringified_layout(raw_layout, config) .map(|(_layout, config)| (layout_info, config)) }, _ => Layout::from_path_or_default(chosen_layout.as_ref(), layout_dir.clone(), config) .map(|(_layout, config)| (layout...
fim
zellij-org/zellij
rust
<|fim_prefix|>//! Some general utility functions. use std::net::{IpAddr, Ipv4Addr}; use std::{iter, str::from_utf8}; use crate::data::{Palette, PaletteColor, PaletteSource, ThemeHue}; use crate::envs::get_session_name; use crate::errors::prelude::*; use crate::input::options::Options; use colorsys::{Ansi256, Rgb}; us...
fim
zellij-org/zellij
rust
<|fim_prefix|>#[cfg(not(target_family = "wasm")<|fim_suffix|> <|fim_middle|>)] pub mod termwiz;<|endoftext|>
fim
zellij-org/zellij
rust
<|fim_prefix|>//! A datastructure for holding key map entries use std::fmt::Debug; #[derive(Debug, Clone)] struct Node<Value: Debug> { label: u8, children: Vec<Node<Value>>, value: Option<Value>, } impl<Value: Debug> Node<Value> { fn new(label: u8) -> Self { Self { label, ...
fim
zellij-org/zellij
rust
<|fim_prefix|>// Thid module was inlined from the ter<|fim_suffix|>wiz // // Most of it was stubbed out and some parts have been adjusted to fit pub mod input; mod keymap; mod readbuf; <|fim_middle|>mwiz library: https://github.com/wezterm/wezterm/tree/main/term<|endoftext|>
fim
zellij-org/zellij
rust
<|fim_suffix|>t) } } <|fim_prefix|>/// This is a simple, small, read buffer that always has the buffer /// contents available as a contiguous slice. #[derive(Debug)] pub struct ReadBuffer { <|fim_middle|> storage: Vec<u8>, } impl ReadBuffer { pub fn new() -> Self { Self { storage: Vec::w...
fim
zellij-org/zellij
rust
<|fim_prefix|>// TODO: GATE THIS WHOLE FILE AND RELEVANT DEPS BEHIND web_server_capability use crate::consts::ZELLIJ_PROJ_DIR; use rusqlite::Connection; use sha2::{Digest, Sha256}; use std::path::PathBuf; use std::time::{SystemTime, UNIX_EPOCH}; use uuid::Uuid; #[derive(Debug)] pub struct TokenInfo { pub name: Str...
fim
zellij-org/zellij
rust
<|fim_suffix|>e std::io::{BufWriter, Read, Write}; use std::path::PathBuf; pub fn shutdown_all_webserver_instances() -> Result<()> { let entries = fs::read_dir(&*WEBSERVER_SOCKET_PATH)?; for entry in entries { let entry = entry?; let path = entry.path(); if let Some(file_name) = path....
fim
zellij-org/zellij
rust
<|fim_suffix|>at!( env!("CARGO_MANIFEST_DIR"), "/assets/prost_web_server/generated_web_server_api.rs" )); mod protobuf_conversion; <|fim_prefix|>include!(<|fim_middle|>conc<|endoftext|>
fim
zellij-org/zellij
rust
<|fim_suffix|>e to protobuf impl From<WebServerResponse> for ProtoWebServerResponse { fn from(response: WebServerResponse) -> Self { let response = match response { WebServerResponse::Version(version_info) => { web_server_response::Response::Version(VersionResponseMsg { ...
fim
zellij-org/zellij
rust
<|fim_prefix|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ import sdl from "@microsoft/eslint-plugin-sdl"; import eslintConfigPrettier from "eslint-config-pret...
fim
zen-browser/desktop
javascript
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import json import os import sys import requests from typing import Optional METADATA_FILENAME = "surfer.json" TAGS_API...
fim
zen-browser/desktop
python
<|fim_suffix|>er languages, delete the existing directory and copy files anew if os.path.exists(lang_path): shutil.rmtree(lang_path) # Remove existing directory source_path = f"./locales/{lang_id}/" copy_files(source_path, lang_path) def copy_files(source: str, destination: str): """ Copies files and ...
fim
zen-browser/desktop
python
<|fim_suffix|>rmation from Taskcluster...") with open(TASKCLUSTER_PATH, "r", encoding="utf-8") as f: benchmarks = yaml.safe_load(f) corpus_url = benchmarks[EXTENDED_CORPUS_KEY] fetch_info = corpus_url["fetch"] download_corpus(fetch_info["url"], fetch_info["sha256"], "pgo-extended-corpus") pr...
fim
zen-browser/desktop
python
<|fim_suffix|> import_test_suite( test_suite=test_suite, source_path=config["source"], output_path=os.path.join(EXTERNAL_TESTS_OUTPUT, test_suite), ignore_list=config.get("ignore", []), is_direct_path=config.get("is_direct_path", False), manifest=manifest ) write_mo...
fim
zen-browser/desktop
python
<|fim_suffix|>not l.lstrip(' ').startswith('//')) return super().decode(s) <|fim_prefix|># This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import json from typing imp...
fim
zen-browser/desktop
python
<|fim_prefix|># This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import hashlib import argparse import sys import os FLATID = "app.zen_browser.zen" def get_sha256sum(fi...
fim
zen-browser/desktop
python
<|fim_suffix|>if arg != path] engine_dir = project_root / 'engine' os.chdir(engine_dir) def run_mach_with_paths(test_paths): command = ['./mach', 'test'] + other_args + test_paths # Replace the current process with the mach command os.execvp(command[0], command) if path in ("", "all"): test_d...
fim
zen-browser/desktop
python
<|fim_suffix|>_browser_locales("en-US") <|fim_prefix|># This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from copy_language_pack import copy_browser_locales if __name__ =...
fim
zen-browser/desktop
python
<|fim_suffix|>get("replaces", {}) for replace in replaces.keys(): value = replaces[replace] with open(output_file, 'r') as f: content = f.read() if replace not in content: die(f"Replace string '{replace}' not found in {output_file}") with open(output_file, 'w') ...
fim
zen-browser/desktop
python
<|fim_prefix|># This Source Code Form is subject to the terms of the Mozilla Public<|fim_suffix|>the new engine by running 'npm run download'.") os.system("npm run download") else: print("No new Firefox RC version available.") def update_ff(is_rc: bool = False, last_version: str = "", last_build: int = 0): ...
fim
zen-browser/desktop
python
<|fim_prefix|># This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import os import json from json_with_comments import JSONWithCommentsDecoder DUMPS_FOLDER = os.path.join(...
fim
zen-browser/desktop
python
<|fim_prefix|># This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import os FILES = [ "index.d.ts", "lib.gecko.tweaks.d.ts", "lib.gecko.xpidl.d.ts", ] GENERAT...
fim
zen-browser/desktop
python
<|fim_prefix|>/* eslint-disable no-undef */ // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. const { nsZenMultiWindowFeature } = ChromeUtils.importESModule( "chrome...
fim
zen-browser/desktop
javascript
<|fim_suffix|>s.chdir('src/browser/themes/shared/zen-icons') os.system("sh ./update-resources.sh") if __name__ == "__main__": main(sys.argv[1:]) <|fim_prefix|># This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You c...
fim
zen-browser/desktop
python
<|fim_suffix|>was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef ZEN_TOOLKIT_PROFILE_OVERRIDE #define ZEN_TOOLKIT_PROFILE_OVERRIDE "Default Profile" #endif #ifndef ZEN_DO_NOT_OVERRIDE_DEFAULT_PROFILE_NAME #undef DEFAULT_NAME #define DEFAULT_NAME ZEN_TOOLKIT_PROFILE_OV...
fim
zen-browser/desktop
c
<|fim_prefix|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /// <reference lib="<|fim_suffix|>nents_Utils & nsIXPCComponents_Utils; const Services: JSService...
fim
zen-browser/desktop
typescript
// This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. /** * NOTE: Do not modify this file by hand. * Content was generated from source XPCOM .idl files. * If you're upda...
fim
zen-browser/desktop
typescript
<|fim_suffix|>; type nsHandlerInfoAction = i32; type nsTaskbarProgressState = i32; // XPCOM internal utility types. /** XPCOM inout param is passed in as a js object with a value property. */ type InOutParam<T> = { value: T }; /** XPCOM out param is written to the passed in object's value property. */ type OutParam<...
fim
zen-browser/desktop
typescript
<|fim_suffix|> */ NS_SUCCESS_LOSS_OF_INSIGNIFICANT_DATA: 0x460001; // network related codes (from nsNetError.h) /** The async request failed for some unknown reason */ NS_BINDING_FAILED: 0x804b0001; /** The async request failed because it was aborted by some user action */ NS_BINDING_ABORTED: 0x804b0002;...
fim
zen-browser/desktop
typescript
<|fim_suffix|>n: nsIZenCommonUtils; } <|fim_prefix|>// This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. /** * NOTE: Do not modify this file by hand. * Content was gener...
fim
zen-browser/desktop
typescript
// This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. /** * Gecko generic/specialized adjustments for xpcom and webidl types. */ // More specific types for parent proces...
fim
zen-browser/desktop
typescript
<|fim_prefix|>// This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. /** * NOTE: Do not modify this file by hand. * Content was generated from source XPCOM .idl files. * ...
fim
zen-browser/desktop
typescript
<|fim_prefix|>// This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. /** * Gecko XPIDL base types. */ /** * Generic IDs are created by most code which passes a nsID to j...
fim
zen-browser/desktop
typescript
<|fim_prefix|>// This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. /** * NOTE: Do not modify this file by hand. * Content was generated from source .webidl files. */ /*...
fim
zen-browser/desktop
typescript
<|fim_prefix|>/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ /* vim: set sts=2 sw=2 et tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ im...
fim
zen-browser/desktop
javascript
<|fim_suffix|> * This triggers notifications to observers but does not persist to disk. */ updateCurrentBoost() { const boost = gZenBoostsManager.loadBoostFromStore( this.boostInfo.domain, this.boostInfo.id ); boost.boostEntry.boostData = this.currentBoostData; gZenBoostsManager.update...
fim
zen-browser/desktop
javascript
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ import { JSONFile } from "resource://gre/modules/JSONFile.sys.mjs"; import { nsZenBoostStyles } from "resource:///...
fim
zen-browser/desktop
javascript
<|fim_suffix|>"; } const parent = element.parentNode; const index = Array.prototype.indexOf.call(parent.children, element) + 1; if (index === 1) { return ":first-child"; } if (index === parent.children.length) { return ":last-child"; } return `:nth-child(...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ export class ZapDissolve { FRAG = ` precision mediump float; uniform sampler2D u_DissolveTexture; ...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { ZapDissolve: "resource:///modules/zen/...
fim
zen-browser/desktop
javascript
<|fim_prefix|>// This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. const AGENT_SHEET = Ci.nsIStyleSheetService.AGENT_SHEET; const lazy = {}; ChromeUtils.defineESModuleG...
fim
zen-browser/desktop
javascript
<|fim_prefix|>// This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a <|fim_suffix|> */ observe(subject, topic) { switch (topic) { case "zen-boosts-update": case "zen-space-gradient-update": this.sendAsyncMessage("ZenBoost:BoostDataUpdated", { ...
fim
zen-browser/desktop
javascript
<|fim_suffix|>EST_F(ZenBoostsAccentCache, RepeatEnsureDoesNotChurnTheCache) { ASSERT_EQ(AccentCacheSize(), 4u); EnsureCachedAccent(kAccentA, 0.0f); EnsureCachedAccent(kAccentB, 0.0f); EnsureCachedAccent(kAccentC, 0.0f); for (int i = 0; i < 16; ++i) { EnsureCachedAccent(kAccentA, 0.0f); } EXPECT_TRU...
fim
zen-browser/desktop
cpp
<|fim_suffix|>me output (no hidden global state in // the math itself; the production cache lives outside these primitives). TEST(ZenBoostsColorFilter, Deterministic) { const zen::nsZenAccentOklab accent = MakeAccent(33, 200, 90, 200); const zen::nsZenAccentOklab complementary = RotateAccent(accent, 200.0f); for...
fim
zen-browser/desktop
cpp
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "gtest/gtest.h" #include "mozilla/nsZenBoostsBackend.h" using zen::nsZenBoostsBackend; namespace { co...
fim
zen-browser/desktop
cpp
<|fim_prefix|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "nsZenBoostsBackend.h" #include "nsIXULRuntime.h" #include "nsPresContext.h" #include "mo...
fim
zen-browser/desktop
cpp
<|fim_suffix|> linearToSrgb(gF) * 255.0f + 0.5f, 0.0f, 255.0f)), static_cast<uint8_t>(std::clamp( linearToSrgb(bF) * 255.0f + 0.5f, 0.0f, 255.0f)), oL); } /** * @brief Inverts a color by inverting each RGB channel while preserving * perceived l...
fim
zen-browser/desktop
cpp
<|fim_prefix|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef mozilla_ZenBoostsBackend_h_ #define mozilla_ZenBoostsBackend_h_ #include "nsColor.h" #inclu...
fim
zen-browser/desktop
c
<|fim_suffix|>r.loadSubScript("chrome://browser/content/zen-components/ZenDragAndDrop.js", this); } <|fim_prefix|>// This Source Code Form is subject to the terms of the Mozilla Public // License<|fim_middle|>, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/...
fim
zen-browser/desktop
javascript
<|fim_suffix|> this); } handleEvent(event) { switch (event.type) { case "popupshowing": this.#onPopupShowing(event); break; case "popuphidden": this.#onPopupHidden(event); break; case "command": if (event.target.id === "PanelUI-zen-emojis-picker-none") ...
fim
zen-browser/desktop
javascript
<|fim_prefix|># This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import os import requests import json def get_emojis(url): """ Fetches emojis from the given URL and...
fim
zen-browser/desktop
python
<|fim_suffix|>nit.bind(this); document.addEventListener("DOMContentLoaded", initBound, { once: true }); } } export class nsZenPreloadedFeature { constructor() { var initBound = this.init.bind(this); document.addEventListener("MozBeforeInitialXULLayout", initBound, { once: true, }); } } win...
fim
zen-browser/desktop
javascript
<|fim_prefix|>// This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. class nsHasPolyfill { constructor() { this.observers = []; this.idStore = 0; } /** * ...
fim
zen-browser/desktop
javascript
<|fim_prefix|>// This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. const WINDOW_SCHEME_PREF = "zen.view.window.scheme"; const WINDOW_SCHEME_MAPPING = { dark: 0, light...
fim
zen-browser/desktop
javascript
<|fim_prefix|>// This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. import { nsZenPreloadedFeature } from "chrome://browser/content/zen-components/ZenCommonUtils.mjs"; cl...
fim
zen-browser/desktop
javascript
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ import { html } from "chrome://global/content/vendor/lit.all.mjs"; import { MozLitElement } from "chrome://global/...
fim
zen-browser/desktop
javascript
<|fim_suffix|>if (this.#shouldUseWatermark) { let elementsToIgnore = this.#watermarkIgnoreElements .map(id => "#" + id) .join(", "); gZenUIManager.motion .animate( "#browser > *:not(" + elementsToIgnore + "), #urlbar, #tabbrowser-tabbox > *", ...
fim
zen-browser/desktop
javascript
// This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. import { nsZenMultiWindowFeature } from "chrome://browser/content/zen-components/ZenCommonUtils.mjs"; import { nsZenM...
fim
zen-browser/desktop
javascript
<|fim_suffix|>s.prefs.setStringPref(ZEN_BUILD_ID_PREF, appID); await gZenWorkspaces.promiseInitialized; const appWrapper = document.getElementById("zen-main-app-wrapper"); const element = document.createElement("div"); element.id = "zen-update-animation"; const elementBorder = document.createElement("div"); ...
fim
zen-browser/desktop
javascript