Advance Wayland and KDE package bring-up

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-04-14 10:51:06 +01:00
parent 51f3c21121
commit cf12defd28
15214 changed files with 20594243 additions and 269 deletions
@@ -0,0 +1,261 @@
diff --git a/drivers/inputd/src/main.rs b/drivers/inputd/src/main.rs
--- a/drivers/inputd/src/main.rs
+++ b/drivers/inputd/src/main.rs
@@ -35,6 +35,9 @@
enum Handle {
Producer,
+ NamedProducer {
+ name: String,
+ },
Consumer {
events: EventFlags,
pending: Vec<u8>,
@@ -58,9 +61,11 @@
struct InputScheme {
handles: BTreeMap<usize, Handle>,
+ devices: BTreeMap<String, u32>,
next_id: AtomicUsize,
next_vt_id: AtomicUsize,
+ next_device_id: AtomicUsize,
display: Option<String>,
vts: BTreeSet<usize>,
@@ -73,13 +78,30 @@
has_new_events: bool,
}
+const RESERVED_DEVICE_NAMES: [&str; 7] = [
+ "producer",
+ "consumer",
+ "consumer_bootlog",
+ "events",
+ "handle",
+ "handle_early",
+ "control",
+];
+
+enum ProducerKind {
+ Legacy,
+ Named(String),
+}
+
impl InputScheme {
fn new() -> Self {
Self {
handles: BTreeMap::new(),
+ devices: BTreeMap::new(),
next_id: AtomicUsize::new(0),
next_vt_id: AtomicUsize::new(2), // VT 1 is reserved for the bootlog
+ next_device_id: AtomicUsize::new(0),
display: None,
vts: BTreeSet::new(),
@@ -91,6 +113,46 @@
rshift: false,
has_new_events: false,
}
+ }
+
+ fn register_named_producer(&mut self, name: &str) -> syscall::Result<Handle> {
+ if name.is_empty() || RESERVED_DEVICE_NAMES.contains(&name) {
+ return Err(SysError::new(EINVAL));
+ }
+
+ if self.devices.contains_key(name) {
+ return Err(SysError::new(EEXIST));
+ }
+
+ let device_id = self.next_device_id.fetch_add(1, Ordering::SeqCst) as u32;
+ self.devices.insert(name.to_owned(), device_id);
+ Ok(Handle::NamedProducer {
+ name: name.to_owned(),
+ })
+ }
+
+ fn route_legacy_consumer_events(&mut self, buf: &[u8]) {
+ if let Some(active_vt) = self.active_vt {
+ for handle in self.handles.values_mut() {
+ match handle {
+ Handle::Consumer {
+ pending,
+ notified,
+ vt,
+ ..
+ } if *vt == active_vt => {
+ pending.extend_from_slice(buf);
+ *notified = false;
+ }
+ _ => continue,
+ }
+ }
+ }
+ }
+
+ fn route_named_producer_events(&mut self, _name: &str, _buf: &[u8]) {
+ // DeviceConsumer routing is added in a follow-up patch. Named producers already share the
+ // legacy consumer path, so existing callers continue to receive these events.
}
fn switch_vt(&mut self, new_active: usize) {
@@ -175,7 +237,13 @@
let command = path_parts.next().ok_or(SysError::new(EINVAL))?;
let handle_ty = match command {
- "producer" => Handle::Producer,
+ "producer" => match path_parts.next() {
+ None => Handle::Producer,
+ Some(name) if !name.is_empty() && path_parts.next().is_none() => {
+ self.register_named_producer(name)?
+ }
+ _ => return Err(SysError::new(EINVAL)),
+ },
"consumer" => {
let vt = self.next_vt_id.fetch_add(1, Ordering::Relaxed);
self.vts.insert(vt);
@@ -338,7 +406,7 @@
}
}
- Handle::Producer => {
+ Handle::Producer | Handle::NamedProducer { .. } => {
log::error!("producer tried to read");
return Err(SysError::new(EINVAL));
}
@@ -360,9 +428,7 @@
) -> syscall::Result<usize> {
self.has_new_events = true;
- let handle = self.handles.get_mut(&id).ok_or(SysError::new(EINVAL))?;
-
- match handle {
+ let producer_kind = match self.handles.get(&id).ok_or(SysError::new(EINVAL))? {
Handle::Control => {
if buf.len() != size_of::<ControlEvent>() {
log::error!("control tried to write incorrectly sized command");
@@ -391,9 +457,10 @@
log::error!("display tried to write");
return Err(SysError::new(EINVAL));
}
- Handle::Producer => {}
+ Handle::Producer => ProducerKind::Legacy,
+ Handle::NamedProducer { name } => ProducerKind::Named(name.clone()),
Handle::SchemeRoot => return Err(SysError::new(EBADF)),
- }
+ };
if buf.len() == 1 && buf[0] > 0xf4 {
return Ok(1);
@@ -445,9 +512,6 @@
}
}
- let handle = self.handles.get_mut(&id).ok_or(SysError::new(EINVAL))?;
- assert!(matches!(handle, Handle::Producer));
-
let buf = unsafe {
core::slice::from_raw_parts(
(events.as_ptr()) as *const u8,
@@ -455,26 +519,11 @@
)
};
- if let Some(active_vt) = self.active_vt {
- for handle in self.handles.values_mut() {
- match handle {
- Handle::Consumer {
- pending,
- notified,
- vt,
- ..
- } => {
- if *vt != active_vt {
- continue;
- }
-
- pending.extend_from_slice(buf);
- *notified = false;
- }
- _ => continue,
- }
- }
- }
+ if let ProducerKind::Named(name) = &producer_kind {
+ self.route_named_producer_events(name, buf);
+ }
+
+ self.route_legacy_consumer_events(buf);
Ok(buf.len())
}
@@ -506,7 +555,7 @@
*notified = false;
Ok(EventFlags::empty())
}
- Handle::Producer | Handle::Control => {
+ Handle::Producer | Handle::NamedProducer { .. } | Handle::Control => {
log::error!("producer or control tried to use an event queue");
Err(SysError::new(EINVAL))
}
@@ -515,9 +564,15 @@
}
fn on_close(&mut self, id: usize) {
- let handle = self.handles.remove(&id).unwrap();
+ let Some(handle) = self.handles.remove(&id) else {
+ log::warn!("received close for unknown input handle {id}");
+ return;
+ };
match handle {
+ Handle::NamedProducer { name } => {
+ self.devices.remove(&name);
+ }
Handle::Consumer { vt, .. } => {
self.vts.remove(&vt);
if self.active_vt == Some(vt) {
diff --git a/drivers/inputd/src/lib.rs b/drivers/inputd/src/lib.rs
--- a/drivers/inputd/src/lib.rs
+++ b/drivers/inputd/src/lib.rs
@@ -197,6 +197,38 @@
pub vt: usize,
}
+/// Handle for opening a named producer on the input scheme.
+/// Opens /scheme/input/producer/{name}
+pub struct NamedProducerHandle {
+ fd: File,
+}
+
+impl NamedProducerHandle {
+ pub fn new(name: &str) -> io::Result<Self> {
+ if name.is_empty() {
+ return Err(io::Error::new(
+ io::ErrorKind::InvalidInput,
+ "input producer name must not be empty",
+ ));
+ }
+
+ if name.contains('/') {
+ return Err(io::Error::new(
+ io::ErrorKind::InvalidInput,
+ "input producer name must not contain '/'",
+ ));
+ }
+
+ let path = format!("/scheme/input/producer/{name}");
+ File::open(path).map(|fd| Self { fd })
+ }
+
+ pub fn write_event(&mut self, event: &orbclient::Event) -> io::Result<()> {
+ self.fd.write(unsafe { any_as_u8_slice(event) })?;
+ Ok(())
+ }
+}
+
pub struct ProducerHandle(File);
impl ProducerHandle {
@@ -0,0 +1,450 @@
diff --git a/drivers/inputd/src/main.rs b/drivers/inputd/src/main.rs
--- a/drivers/inputd/src/main.rs
+++ b/drivers/inputd/src/main.rs
@@ -17,7 +17,7 @@
use std::mem::transmute;
use std::sync::atomic::{AtomicUsize, Ordering};
-use inputd::{ControlEvent, VtEvent, VtEventKind};
+use inputd::{ControlEvent, HotplugEventHeader, VtEvent, VtEventKind};
use libredox::errno::ESTALE;
use redox_scheme::scheme::{SchemeState, SchemeSync};
@@ -47,6 +47,17 @@
notified: bool,
vt: usize,
},
+ DeviceConsumer {
+ device_name: String,
+ events: EventFlags,
+ pending: Vec<u8>,
+ notified: bool,
+ },
+ HotplugEvents {
+ events: EventFlags,
+ pending: Vec<u8>,
+ notified: bool,
+ },
Display {
events: EventFlags,
pending: Vec<VtEvent>,
@@ -88,6 +99,9 @@
"control",
];
+const DEVICE_ADD: u32 = 1;
+const DEVICE_REMOVE: u32 = 2;
+
enum ProducerKind {
Legacy,
Named(String),
@@ -116,7 +130,7 @@
}
fn register_named_producer(&mut self, name: &str) -> syscall::Result<Handle> {
- if name.is_empty() || RESERVED_DEVICE_NAMES.contains(&name) {
+ if name.is_empty() || name.contains('/') || RESERVED_DEVICE_NAMES.contains(&name) {
return Err(SysError::new(EINVAL));
}
@@ -126,11 +140,57 @@
let device_id = self.next_device_id.fetch_add(1, Ordering::SeqCst) as u32;
self.devices.insert(name.to_owned(), device_id);
+ self.queue_hotplug_event(DEVICE_ADD, device_id, name)?;
Ok(Handle::NamedProducer {
name: name.to_owned(),
})
}
+ fn drain_pending_bytes(pending: &mut Vec<u8>, buf: &mut [u8]) -> usize {
+ let copy = core::cmp::min(pending.len(), buf.len());
+
+ for (i, byte) in pending.drain(..copy).enumerate() {
+ buf[i] = byte;
+ }
+
+ copy
+ }
+
+ fn queue_hotplug_event(
+ &mut self,
+ kind: u32,
+ device_id: u32,
+ name: &str,
+ ) -> syscall::Result<()> {
+ let name_len = u32::try_from(name.len()).map_err(|_| SysError::new(EINVAL))?;
+ let header = HotplugEventHeader {
+ kind,
+ device_id,
+ name_len,
+ _reserved: 0,
+ };
+ let header_bytes = unsafe {
+ core::slice::from_raw_parts(
+ (&header as *const HotplugEventHeader).cast::<u8>(),
+ size_of::<HotplugEventHeader>(),
+ )
+ };
+
+ for handle in self.handles.values_mut() {
+ if let Handle::HotplugEvents {
+ pending, notified, ..
+ } = handle
+ {
+ pending.extend_from_slice(header_bytes);
+ pending.extend_from_slice(name.as_bytes());
+ *notified = false;
+ }
+ }
+
+ self.has_new_events = true;
+ Ok(())
+ }
+
fn route_legacy_consumer_events(&mut self, buf: &[u8]) {
if let Some(active_vt) = self.active_vt {
for handle in self.handles.values_mut() {
@@ -150,9 +210,21 @@
}
}
- fn route_named_producer_events(&mut self, _name: &str, _buf: &[u8]) {
- // DeviceConsumer routing is added in a follow-up patch. Named producers already share the
- // legacy consumer path, so existing callers continue to receive these events.
+ fn route_named_producer_events(&mut self, name: &str, buf: &[u8]) {
+ for handle in self.handles.values_mut() {
+ match handle {
+ Handle::DeviceConsumer {
+ device_name,
+ pending,
+ notified,
+ ..
+ } if device_name == name => {
+ pending.extend_from_slice(buf);
+ *notified = false;
+ }
+ _ => continue,
+ }
+ }
}
fn switch_vt(&mut self, new_active: usize) {
@@ -324,7 +396,24 @@
is_earlyfb: command == "handle_early",
}
}
+ "events" if path_parts.next().is_none() => Handle::HotplugEvents {
+ events: EventFlags::empty(),
+ pending: Vec::new(),
+ notified: false,
+ },
"control" => Handle::Control,
+ device_name
+ if !device_name.is_empty()
+ && !RESERVED_DEVICE_NAMES.contains(&device_name)
+ && path_parts.next().is_none() =>
+ {
+ Handle::DeviceConsumer {
+ device_name: device_name.to_owned(),
+ events: EventFlags::empty(),
+ pending: Vec::new(),
+ notified: false,
+ }
+ }
_ => {
log::error!("invalid path '{path}'");
@@ -380,13 +469,11 @@
return Err(SysError::new(ESTALE));
}
- let copy = core::cmp::min(pending.len(), buf.len());
-
- for (i, byte) in pending.drain(..copy).enumerate() {
- buf[i] = byte;
- }
+ Ok(Self::drain_pending_bytes(pending, buf))
+ }
- Ok(copy)
+ Handle::DeviceConsumer { pending, .. } | Handle::HotplugEvents { pending, .. } => {
+ Ok(Self::drain_pending_bytes(pending, buf))
}
Handle::Display { pending, .. } => {
@@ -453,6 +540,10 @@
log::error!("consumer tried to write");
return Err(SysError::new(EINVAL));
}
+ Handle::DeviceConsumer { .. } | Handle::HotplugEvents { .. } => {
+ log::error!("consumer or hotplug handle tried to write");
+ return Err(SysError::new(EINVAL));
+ }
Handle::Display { .. } => {
log::error!("display tried to write");
return Err(SysError::new(EINVAL));
@@ -541,6 +632,16 @@
ref mut events,
ref mut notified,
..
+ }
+ | Handle::DeviceConsumer {
+ ref mut events,
+ ref mut notified,
+ ..
+ }
+ | Handle::HotplugEvents {
+ ref mut events,
+ ref mut notified,
+ ..
} => {
*events = flags;
*notified = false;
@@ -571,7 +672,12 @@
match handle {
Handle::NamedProducer { name } => {
- self.devices.remove(&name);
+ if let Some(device_id) = self.devices.remove(&name) {
+ self.queue_hotplug_event(DEVICE_REMOVE, device_id, &name)
+ .unwrap_or_else(|err| {
+ log::error!("failed to queue removal hotplug event for {name}: {err}");
+ });
+ }
}
Handle::Consumer { vt, .. } => {
self.vts.remove(&vt);
@@ -658,6 +764,28 @@
socket_file.write_response(
Response::post_fevent(*id, EventFlags::EVENT_READ.bits()),
SignalBehavior::Restart,
+ )?;
+
+ *notified = true;
+ }
+ Handle::DeviceConsumer {
+ events,
+ pending,
+ ref mut notified,
+ ..
+ }
+ | Handle::HotplugEvents {
+ events,
+ pending,
+ ref mut notified,
+ } => {
+ if pending.is_empty() || *notified || !events.contains(EventFlags::EVENT_READ) {
+ continue;
+ }
+
+ socket_file.write_response(
+ Response::post_fevent(*id, EventFlags::EVENT_READ.bits()),
+ SignalBehavior::Restart,
)?;
*notified = true;
diff --git a/drivers/inputd/src/lib.rs b/drivers/inputd/src/lib.rs
--- a/drivers/inputd/src/lib.rs
+++ b/drivers/inputd/src/lib.rs
@@ -1,5 +1,5 @@
use std::fs::{File, OpenOptions};
-use std::io::{self, Read, Write};
+use std::io::{self, ErrorKind, Read, Write};
use std::mem::size_of;
use std::os::fd::{AsFd, AsRawFd, BorrowedFd, FromRawFd, RawFd};
use std::os::unix::fs::OpenOptionsExt;
@@ -31,6 +31,24 @@
slice::from_raw_parts_mut((p as *mut T) as *mut u8, size_of::<T>())
}
+fn validate_input_name(kind: &str, name: &str) -> io::Result<()> {
+ if name.is_empty() {
+ return Err(io::Error::new(
+ io::ErrorKind::InvalidInput,
+ format!("input {kind} name must not be empty"),
+ ));
+ }
+
+ if name.contains('/') {
+ return Err(io::Error::new(
+ io::ErrorKind::InvalidInput,
+ format!("input {kind} name must not contain '/'"),
+ ));
+ }
+
+ Ok(())
+}
+
pub struct ConsumerHandle(File);
pub enum ConsumerHandleEvent<'a> {
@@ -197,6 +215,22 @@
pub vt: usize,
}
+#[derive(Debug, Clone, Copy)]
+#[repr(C)]
+pub struct HotplugEventHeader {
+ pub kind: u32,
+ pub device_id: u32,
+ pub name_len: u32,
+ pub _reserved: u32,
+}
+
+#[derive(Debug, Clone)]
+pub struct HotplugEvent {
+ pub kind: u32,
+ pub device_id: u32,
+ pub name: String,
+}
+
/// Handle for opening a named producer on the input scheme.
/// Opens /scheme/input/producer/{name}
pub struct NamedProducerHandle {
@@ -205,19 +239,7 @@
impl NamedProducerHandle {
pub fn new(name: &str) -> io::Result<Self> {
- if name.is_empty() {
- return Err(io::Error::new(
- io::ErrorKind::InvalidInput,
- "input producer name must not be empty",
- ));
- }
-
- if name.contains('/') {
- return Err(io::Error::new(
- io::ErrorKind::InvalidInput,
- "input producer name must not contain '/'",
- ));
- }
+ validate_input_name("producer", name)?;
let path = format!("/scheme/input/producer/{name}");
File::open(path).map(|fd| Self { fd })
@@ -229,6 +251,124 @@
}
}
+pub struct DeviceConsumerHandle {
+ fd: File,
+}
+
+impl DeviceConsumerHandle {
+ pub fn new(device_name: &str) -> io::Result<Self> {
+ validate_input_name("device", device_name)?;
+
+ let fd = OpenOptions::new()
+ .read(true)
+ .custom_flags(O_NONBLOCK as i32)
+ .open(format!("/scheme/input/{device_name}"))?;
+
+ Ok(Self { fd })
+ }
+
+ pub fn event_handle(&self) -> BorrowedFd<'_> {
+ self.fd.as_fd()
+ }
+
+ pub fn read_event(&mut self) -> io::Result<Option<orbclient::Event>> {
+ let mut raw = [0_u8; size_of::<orbclient::Event>()];
+
+ match self.fd.read(&mut raw) {
+ Ok(0) => Ok(None),
+ Ok(read) => {
+ assert_eq!(read, raw.len());
+ Ok(Some(unsafe {
+ core::ptr::read_unaligned(raw.as_ptr().cast::<orbclient::Event>())
+ }))
+ }
+ Err(err) if err.kind() == ErrorKind::WouldBlock => Ok(None),
+ Err(err) => Err(err),
+ }
+ }
+}
+
+pub struct HotplugHandle {
+ fd: File,
+ partial: Vec<u8>,
+}
+
+impl HotplugHandle {
+ pub fn new() -> io::Result<Self> {
+ let fd = OpenOptions::new()
+ .read(true)
+ .custom_flags(O_NONBLOCK as i32)
+ .open("/scheme/input/events")?;
+
+ Ok(Self {
+ fd,
+ partial: Vec::new(),
+ })
+ }
+
+ pub fn event_handle(&self) -> BorrowedFd<'_> {
+ self.fd.as_fd()
+ }
+
+ pub fn read_event(&mut self) -> io::Result<Option<HotplugEvent>> {
+ let mut buf = [0_u8; 1024];
+
+ loop {
+ if let Some(event) = Self::try_parse_event(&mut self.partial)? {
+ return Ok(Some(event));
+ }
+
+ match self.fd.read(&mut buf) {
+ Ok(0) => return Ok(None),
+ Ok(read) => self.partial.extend_from_slice(&buf[..read]),
+ Err(err) if err.kind() == ErrorKind::WouldBlock => return Ok(None),
+ Err(err) => return Err(err),
+ }
+ }
+ }
+
+ fn try_parse_event(partial: &mut Vec<u8>) -> io::Result<Option<HotplugEvent>> {
+ if partial.len() < size_of::<HotplugEventHeader>() {
+ return Ok(None);
+ }
+
+ let header =
+ unsafe { core::ptr::read_unaligned(partial.as_ptr().cast::<HotplugEventHeader>()) };
+ let name_len = usize::try_from(header.name_len).map_err(|_| {
+ io::Error::new(
+ io::ErrorKind::InvalidData,
+ "invalid input hotplug name length",
+ )
+ })?;
+ let total_len = size_of::<HotplugEventHeader>()
+ .checked_add(name_len)
+ .ok_or_else(|| {
+ io::Error::new(io::ErrorKind::InvalidData, "input hotplug event too large")
+ })?;
+
+ if partial.len() < total_len {
+ return Ok(None);
+ }
+
+ let name = std::str::from_utf8(&partial[size_of::<HotplugEventHeader>()..total_len])
+ .map_err(|_| {
+ io::Error::new(
+ io::ErrorKind::InvalidData,
+ "input hotplug name is not UTF-8",
+ )
+ })?
+ .to_owned();
+
+ partial.drain(..total_len);
+
+ Ok(Some(HotplugEvent {
+ kind: header.kind,
+ device_id: header.device_id,
+ name,
+ }))
+ }
+}
+
pub struct ProducerHandle(File);
impl ProducerHandle {
+78 -32
View File
@@ -1,5 +1,5 @@
diff --git a/drivers/acpid/src/acpi.rs b/drivers/acpid/src/acpi.rs diff --git a/drivers/acpid/src/acpi.rs b/drivers/acpid/src/acpi.rs
index 94a1eb17..c3a5bfdc 100644 index 94a1eb17..3fd91156 100644
--- a/drivers/acpid/src/acpi.rs --- a/drivers/acpid/src/acpi.rs
+++ b/drivers/acpid/src/acpi.rs +++ b/drivers/acpid/src/acpi.rs
@@ -25,6 +25,8 @@ use amlserde::{AmlSerde, AmlSerdeValue}; @@ -25,6 +25,8 @@ use amlserde::{AmlSerde, AmlSerdeValue};
@@ -24,7 +24,7 @@ index 94a1eb17..c3a5bfdc 100644
aml_symbols: RwLock<AmlSymbols>, aml_symbols: RwLock<AmlSymbols>,
@@ -424,6 +432,62 @@ impl AcpiContext { @@ -424,6 +432,63 @@ impl AcpiContext {
.flatten() .flatten()
} }
@@ -35,7 +35,8 @@ index 94a1eb17..c3a5bfdc 100644
+ args: &[u64], + args: &[u64],
+ ) -> Result<Vec<u64>, AmlEvalError> { + ) -> Result<Vec<u64>, AmlEvalError> {
+ let full_path = format!("{path}.{method}"); + let full_path = format!("{path}.{method}");
+ let aml_name = AmlName::from_str(&full_path).map_err(|_| AmlEvalError::DeserializationError)?; + let aml_name =
+ AmlName::from_str(&full_path).map_err(|_| AmlEvalError::DeserializationError)?;
+ let args = args + let args = args
+ .iter() + .iter()
+ .copied() + .copied()
@@ -87,7 +88,7 @@ index 94a1eb17..c3a5bfdc 100644
pub fn init( pub fn init(
rxsdt_physaddrs: impl Iterator<Item = u64>, rxsdt_physaddrs: impl Iterator<Item = u64>,
ec: Vec<(RegionSpace, Box<dyn RegionHandler>)>, ec: Vec<(RegionSpace, Box<dyn RegionHandler>)>,
@@ -444,6 +508,12 @@ impl AcpiContext { @@ -444,6 +509,12 @@ impl AcpiContext {
tables, tables,
dsdt: None, dsdt: None,
fadt: None, fadt: None,
@@ -100,7 +101,7 @@ index 94a1eb17..c3a5bfdc 100644
// Temporary values // Temporary values
aml_symbols: RwLock::new(AmlSymbols::new(ec)), aml_symbols: RwLock::new(AmlSymbols::new(ec)),
@@ -458,7 +528,10 @@ impl AcpiContext { @@ -458,7 +529,10 @@ impl AcpiContext {
} }
Fadt::init(&mut this); Fadt::init(&mut this);
@@ -112,7 +113,7 @@ index 94a1eb17..c3a5bfdc 100644
this this
} }
@@ -562,92 +635,83 @@ impl AcpiContext { @@ -562,92 +636,83 @@ impl AcpiContext {
aml_symbols.symbol_cache = FxHashMap::default(); aml_symbols.symbol_cache = FxHashMap::default();
} }
@@ -268,7 +269,7 @@ index 94a1eb17..c3a5bfdc 100644
loop { loop {
core::hint::spin_loop(); core::hint::spin_loop();
} }
@@ -707,7 +771,7 @@ unsafe impl plain::Plain for FadtStruct {} @@ -707,7 +772,7 @@ unsafe impl plain::Plain for FadtStruct {}
#[repr(C, packed)] #[repr(C, packed)]
#[derive(Clone, Copy, Debug, Default)] #[derive(Clone, Copy, Debug, Default)]
@@ -277,7 +278,7 @@ index 94a1eb17..c3a5bfdc 100644
address_space: u8, address_space: u8,
bit_width: u8, bit_width: u8,
bit_offset: u8, bit_offset: u8,
@@ -715,11 +779,67 @@ pub struct GenericAddressStructure { @@ -715,11 +780,77 @@ pub struct GenericAddressStructure {
address: u64, address: u64,
} }
@@ -290,14 +291,23 @@ index 94a1eb17..c3a5bfdc 100644
+ pub fn write_u8(&self, value: u8) { + pub fn write_u8(&self, value: u8) {
+ match self.address_space { + match self.address_space {
+ 0 => { + 0 => {
+ let Ok(address) = usize::try_from(self.address) else { + let address_val = self.address;
+ log::error!("Reset register physical address is invalid: {:#X}", self.address); + let Ok(address) = usize::try_from(address_val) else {
+ log::error!(
+ "Reset register physical address is invalid: {:#X}",
+ address_val
+ );
+ return; + return;
+ }; + };
+ let page = address / PAGE_SIZE * PAGE_SIZE; + let page = address / PAGE_SIZE * PAGE_SIZE;
+ let offset = address % PAGE_SIZE; + let offset = address % PAGE_SIZE;
+ let virt = unsafe { + let virt = unsafe {
+ common::physmap(page, PAGE_SIZE, common::Prot::RW, common::MemoryType::default()) + common::physmap(
+ page,
+ PAGE_SIZE,
+ common::Prot::RW,
+ common::MemoryType::default(),
+ )
+ }; + };
+ +
+ match virt { + match virt {
@@ -315,7 +325,8 @@ index 94a1eb17..c3a5bfdc 100644
+ Pio::<u8>::new(port).write(value); + Pio::<u8>::new(port).write(value);
+ } + }
+ Err(_) => { + Err(_) => {
+ log::error!("Reset register I/O port is invalid: {:#X}", self.address); + let address_val = self.address;
+ log::error!("Reset register I/O port is invalid: {:#X}", address_val);
+ } + }
+ }, + },
+ address_space => { + address_space => {
@@ -346,7 +357,7 @@ index 94a1eb17..c3a5bfdc 100644
pub reset_value: u8, pub reset_value: u8,
reserved3: [u8; 3], reserved3: [u8; 3],
@@ -728,14 +848,14 @@ pub struct FadtAcpi2Struct { @@ -728,14 +859,14 @@ pub struct FadtAcpi2Struct {
pub x_firmware_control: u64, pub x_firmware_control: u64,
pub x_dsdt: u64, pub x_dsdt: u64,
@@ -369,7 +380,7 @@ index 94a1eb17..c3a5bfdc 100644
} }
unsafe impl plain::Plain for FadtAcpi2Struct {} unsafe impl plain::Plain for FadtAcpi2Struct {}
@@ -793,9 +913,25 @@ impl Fadt { @@ -793,9 +924,27 @@ impl Fadt {
None => usize::try_from(fadt.dsdt).expect("expected any given u32 to fit within usize"), None => usize::try_from(fadt.dsdt).expect("expected any given u32 to fit within usize"),
}; };
@@ -379,7 +390,9 @@ index 94a1eb17..c3a5bfdc 100644
+ let pm1a_cnt_blk = u64::from(fadt.pm1a_control_block); + let pm1a_cnt_blk = u64::from(fadt.pm1a_control_block);
+ let pm1b_cnt_blk = u64::from(fadt.pm1b_control_block); + let pm1b_cnt_blk = u64::from(fadt.pm1b_control_block);
+ let (reset_reg, reset_value) = match fadt.acpi_2_struct() { + let (reset_reg, reset_value) = match fadt.acpi_2_struct() {
+ Some(fadt2) if !fadt2.reset_reg.is_empty() => (Some(fadt2.reset_reg), fadt2.reset_value), + Some(fadt2) if !fadt2.reset_reg.is_empty() => {
+ (Some(fadt2.reset_reg), fadt2.reset_value)
+ }
+ _ => (None, 0), + _ => (None, 0),
+ }; + };
@@ -397,22 +410,24 @@ index 94a1eb17..c3a5bfdc 100644
Ok(dsdt) => dsdt, Ok(dsdt) => dsdt,
Err(error) => { Err(error) => {
log::error!("Failed to load DSDT: {}", error); log::error!("Failed to load DSDT: {}", error);
@@ -803,8 +939,46 @@ impl Fadt { @@ -803,8 +952,48 @@ impl Fadt {
} }
}; };
+ let (slp_typa_s5, slp_typb_s5) = match AmlName::from_str("\\_S5") { + let (slp_typa_s5, slp_typb_s5) = match AmlName::from_str("\\_S5") {
+ Ok(s5_name) => match context.aml_eval(s5_name, Vec::new()) { + Ok(s5_name) => match context.aml_eval(s5_name, Vec::new()) {
+ Ok(AmlSerdeValue::Package { contents }) => match (contents.get(0), contents.get(1)) { + Ok(AmlSerdeValue::Package { contents }) => match (contents.get(0), contents.get(1))
+ (Some(AmlSerdeValue::Integer(slp_typa)), Some(AmlSerdeValue::Integer(slp_typb))) => { + {
+ match (u8::try_from(*slp_typa), u8::try_from(*slp_typb)) { + (
+ (Ok(slp_typa_s5), Ok(slp_typb_s5)) => (slp_typa_s5, slp_typb_s5), + Some(AmlSerdeValue::Integer(slp_typa)),
+ _ => { + Some(AmlSerdeValue::Integer(slp_typb)),
+ log::warn!("\\_S5 values do not fit in u8: {:?}", contents); + ) => match (u8::try_from(*slp_typa), u8::try_from(*slp_typb)) {
+ (0, 0) + (Ok(slp_typa_s5), Ok(slp_typb_s5)) => (slp_typa_s5, slp_typb_s5),
+ } + _ => {
+ log::warn!("\\_S5 values do not fit in u8: {:?}", contents);
+ (0, 0)
+ } + }
+ } + },
+ _ => { + _ => {
+ log::warn!("\\_S5 package did not contain two integers: {:?}", contents); + log::warn!("\\_S5 package did not contain two integers: {:?}", contents);
+ (0, 0) + (0, 0)
@@ -557,7 +572,7 @@ index 0933f638..d4b0f3d0 100644
fn main() { fn main() {
diff --git a/drivers/pcid/src/scheme.rs b/drivers/pcid/src/scheme.rs diff --git a/drivers/pcid/src/scheme.rs b/drivers/pcid/src/scheme.rs
index ce55b33f..c06bdec4 100644 index c2caf804..95acdb57 100644
--- a/drivers/pcid/src/scheme.rs --- a/drivers/pcid/src/scheme.rs
+++ b/drivers/pcid/src/scheme.rs +++ b/drivers/pcid/src/scheme.rs
@@ -21,6 +21,7 @@ enum Handle { @@ -21,6 +21,7 @@ enum Handle {
@@ -591,7 +606,7 @@ index ce55b33f..c06bdec4 100644
} }
fn is_scheme_root(&self) -> bool { fn is_scheme_root(&self) -> bool {
matches!(self, Self::SchemeRoot) matches!(self, Self::SchemeRoot)
@@ -153,6 +160,7 @@ impl SchemeSync for PciScheme { @@ -132,6 +139,7 @@ impl SchemeSync for PciScheme {
let (len, mode) = match handle.inner { let (len, mode) = match handle.inner {
Handle::TopLevel { ref entries } => (entries.len(), MODE_DIR | 0o755), Handle::TopLevel { ref entries } => (entries.len(), MODE_DIR | 0o755),
Handle::Device => (DEVICE_CONTENTS.len(), MODE_DIR | 0o755), Handle::Device => (DEVICE_CONTENTS.len(), MODE_DIR | 0o755),
@@ -599,7 +614,7 @@ index ce55b33f..c06bdec4 100644
Handle::Access | Handle::Channel { .. } => (0, MODE_CHR | 0o600), Handle::Access | Handle::Channel { .. } => (0, MODE_CHR | 0o600),
Handle::SchemeRoot => return Err(Error::new(EBADF)), Handle::SchemeRoot => return Err(Error::new(EBADF)),
}; };
@@ -177,6 +185,18 @@ impl SchemeSync for PciScheme { @@ -156,6 +164,18 @@ impl SchemeSync for PciScheme {
match handle.inner { match handle.inner {
Handle::TopLevel { .. } => Err(Error::new(EISDIR)), Handle::TopLevel { .. } => Err(Error::new(EISDIR)),
Handle::Device => Err(Error::new(EISDIR)), Handle::Device => Err(Error::new(EISDIR)),
@@ -618,7 +633,7 @@ index ce55b33f..c06bdec4 100644
Handle::Channel { Handle::Channel {
addr: _, addr: _,
ref mut st, ref mut st,
@@ -214,7 +234,9 @@ impl SchemeSync for PciScheme { @@ -193,7 +213,9 @@ impl SchemeSync for PciScheme {
return Ok(buf); return Ok(buf);
} }
Handle::Device => DEVICE_CONTENTS, Handle::Device => DEVICE_CONTENTS,
@@ -629,7 +644,7 @@ index ce55b33f..c06bdec4 100644
Handle::SchemeRoot => return Err(Error::new(EBADF)), Handle::SchemeRoot => return Err(Error::new(EBADF)),
}; };
@@ -244,6 +266,20 @@ impl SchemeSync for PciScheme { @@ -223,6 +245,20 @@ impl SchemeSync for PciScheme {
} }
match handle.inner { match handle.inner {
@@ -650,7 +665,7 @@ index ce55b33f..c06bdec4 100644
Handle::Channel { addr, ref mut st } => { Handle::Channel { addr, ref mut st } => {
Self::write_channel(&self.pcie, &mut self.tree, addr, st, buf) Self::write_channel(&self.pcie, &mut self.tree, addr, st, buf)
} }
@@ -339,6 +375,10 @@ impl PciScheme { @@ -318,6 +354,10 @@ impl PciScheme {
func.enabled = false; func.enabled = false;
} }
} }
@@ -661,7 +676,7 @@ index ce55b33f..c06bdec4 100644
_ => {} _ => {}
} }
} }
@@ -365,6 +405,7 @@ impl PciScheme { @@ -343,6 +383,7 @@ impl PciScheme {
let path = &after[1..]; let path = &after[1..];
match path { match path {
@@ -669,3 +684,34 @@ index ce55b33f..c06bdec4 100644
"channel" => { "channel" => {
if func.enabled { if func.enabled {
return Err(Error::new(ENOLCK)); return Err(Error::new(ENOLCK));
diff --git a/init/src/scheduler.rs b/init/src/scheduler.rs
index 670a5526..24ce3d68 100644
--- a/init/src/scheduler.rs
+++ b/init/src/scheduler.rs
@@ -1,8 +1,8 @@
use std::collections::VecDeque;
-use crate::InitConfig;
use crate::script::Command;
use crate::unit::{Unit, UnitId, UnitKind, UnitStore};
+use crate::InitConfig;
pub struct Scheduler {
pending: VecDeque<Job>,
@@ -96,14 +96,9 @@ fn run(unit: &mut Unit, config: &mut InitConfig) {
eprintln!("Skipping '{} {}'", service.cmd, service.args.join(" "));
return;
}
- if config.log_debug {
- eprintln!(
- "Starting {} ({})",
- unit.info.description.as_ref().unwrap_or(&unit.id.0),
- service.cmd,
- );
- }
+ eprintln!("init: starting {} ({:?})", service.cmd, &service.type_,);
service.spawn(&config.envs);
+ eprintln!("init: started {} done", service.cmd,);
}
UnitKind::Target {} => {
if config.log_debug {
+2 -3
View File
@@ -1,13 +1,12 @@
diff --git a/src/header/mod.rs b/src/header/mod.rs diff --git a/src/header/mod.rs b/src/header/mod.rs
--- a/src/header/mod.rs --- a/src/header/mod.rs
+++ b/src/header/mod.rs +++ b/src/header/mod.rs
@@ -85,5 +85,6 @@ @@ -88,6 +88,7 @@
pub mod strings;
// TODO: stropts.h (deprecated)
pub mod sys_auxv; pub mod sys_auxv;
pub mod sys_epoll; pub mod sys_epoll;
+pub mod sys_eventfd; +pub mod sys_eventfd;
pub mod sys_file; pub mod sys_file;
pub mod sys_ioctl;
diff --git a/src/header/sys_eventfd/cbindgen.toml b/src/header/sys_eventfd/cbindgen.toml diff --git a/src/header/sys_eventfd/cbindgen.toml b/src/header/sys_eventfd/cbindgen.toml
new file mode 100644 new file mode 100644
--- /dev/null --- /dev/null
+3 -7
View File
@@ -1,19 +1,15 @@
diff --git a/src/header/signal/mod.rs b/src/header/signal/mod.rs diff --git a/src/header/signal/mod.rs b/src/header/signal/mod.rs
--- a/src/header/signal/mod.rs --- a/src/header/signal/mod.rs
+++ b/src/header/signal/mod.rs +++ b/src/header/signal/mod.rs
@@ -27,9 +27,12 @@ @@ -33,6 +33,10 @@
#[cfg(target_os = "linux")]
#[path = "linux.rs"]
pub mod sys;
#[cfg(target_os = "redox")]
#[path = "redox.rs"]
pub mod sys; pub mod sys;
+mod signalfd; +mod signalfd;
+pub use self::signalfd::*; +pub use self::signalfd::*;
+ +
type SigSet = BitSet<[u64; 1]>; type SigSet = BitSet<[u64; 1]>;
pub(crate) const SIG_DFL: usize = 0;
diff --git a/src/header/signal/signalfd.rs b/src/header/signal/signalfd.rs diff --git a/src/header/signal/signalfd.rs b/src/header/signal/signalfd.rs
new file mode 100644 new file mode 100644
--- /dev/null --- /dev/null
@@ -2,4 +2,16 @@
path = "source" path = "source"
[build] [build]
template = "cargo" template = "custom"
script = """
DYNAMIC_INIT
mkdir -p "${COOKBOOK_STAGE}/usr/lib"
cargo build --lib --target "${TARGET}"
cp "${COOKBOOK_SOURCE}/target/${TARGET}/debug/libredox_driver_sys.a" \
"${COOKBOOK_STAGE}/usr/lib/libredox_driver_sys.a"
cp "${COOKBOOK_SOURCE}/target/${TARGET}/debug/libredox_driver_sys.rlib" \
"${COOKBOOK_STAGE}/usr/lib/libredox_driver_sys.rlib"
"""
@@ -113,6 +113,7 @@ pub struct PciCapability {
} }
pub const PCI_CAP_ID_MSI: u8 = 0x05; pub const PCI_CAP_ID_MSI: u8 = 0x05;
pub const PCI_CAP_ID_ATS: u8 = 0x0B;
pub const PCI_CAP_ID_MSIX: u8 = 0x11; pub const PCI_CAP_ID_MSIX: u8 = 0x11;
pub const PCI_CAP_ID_PCIE: u8 = 0x10; pub const PCI_CAP_ID_PCIE: u8 = 0x10;
pub const PCI_CAP_ID_POWER: u8 = 0x01; pub const PCI_CAP_ID_POWER: u8 = 0x01;
+9 -7
View File
@@ -1,6 +1,6 @@
# AMD GPU driver port for Redox OS — Phase P2: Display Core (modesetting only) # AMD GPU driver port for Redox OS — Phase P2+P5: Display Core + DML2 + TTM
# Scope: AMD DC modesetting, connector detection, EDID, CRTC programming. # Scope: AMD DC modesetting, DML2 display modeling, TTM memory manager, connector detection.
# Full amdgpu (acceleration, compute, video decode) is Phase P5. # Full acceleration (compute, video decode) requires Mesa radeonsi backend.
[source] [source]
# Local overlay recipe. The extracted Linux 7.0-rc7 AMDGPU tree lives next to this # Local overlay recipe. The extracted Linux 7.0-rc7 AMDGPU tree lives next to this
@@ -26,8 +26,9 @@ LINUX_KPI="${COOKBOOK_SYSROOT}/include/linux-kpi"
REDOX_GLUE="${COOKBOOK_SOURCE}" REDOX_GLUE="${COOKBOOK_SOURCE}"
TARGET_CC="${COOKBOOK_TARGET}-gcc" TARGET_CC="${COOKBOOK_TARGET}-gcc"
# Compiler flags for AMD driver # Compiler flags for AMD driver — DML2 enabled
export CFLAGS="-D__redox__ -D__KERNEL__ -DCONFIG_DRM_AMDGPU -DCONFIG_DRM_AMD_DC \ export CFLAGS="-D__redox__ -D__KERNEL__ -DCONFIG_DRM_AMDGPU -DCONFIG_DRM_AMD_DC \
-DCONFIG_DRM_AMD_DC_DML2=1 \
-DCONFIG_DRM_AMD_DC_FP -DCONFIG_DRM_AMD_ACP \ -DCONFIG_DRM_AMD_DC_FP -DCONFIG_DRM_AMD_ACP \
-I${LINUX_KPI} \ -I${LINUX_KPI} \
-I${REDOX_GLUE} \ -I${REDOX_GLUE} \
@@ -38,6 +39,8 @@ export CFLAGS="-D__redox__ -D__KERNEL__ -DCONFIG_DRM_AMDGPU -DCONFIG_DRM_AMD_DC
-I${AMD_SRC}/display \ -I${AMD_SRC}/display \
-I${AMD_SRC}/display/dc \ -I${AMD_SRC}/display/dc \
-I${AMD_SRC}/display/dc/dml \ -I${AMD_SRC}/display/dc/dml \
-I${AMD_SRC}/display/dc/dml2_0 \
-I${AMD_SRC}/display/dc/dml2_0/dml21 \
-I${AMD_SRC}/display/dc/dcn20 \ -I${AMD_SRC}/display/dc/dcn20 \
-I${AMD_SRC}/display/dc/dcn21 \ -I${AMD_SRC}/display/dc/dcn21 \
-I${AMD_SRC}/display/dc/dcn30 \ -I${AMD_SRC}/display/dc/dcn30 \
@@ -45,7 +48,6 @@ export CFLAGS="-D__redox__ -D__KERNEL__ -DCONFIG_DRM_AMDGPU -DCONFIG_DRM_AMD_DC
-I${AMD_SRC}/display/dc/dcn31 \ -I${AMD_SRC}/display/dc/dcn31 \
-I${AMD_SRC}/display/dc/dcn32 \ -I${AMD_SRC}/display/dc/dcn32 \
-I${AMD_SRC}/display/dc/dcn35 \ -I${AMD_SRC}/display/dc/dcn35 \
-I${AMD_SRC}/display/dc/dml2 \
-I${AMD_SRC}/display/dmub \ -I${AMD_SRC}/display/dmub \
-I${AMD_SRC}/display/modules \ -I${AMD_SRC}/display/modules \
-I${AMD_SRC}/display/modules/freesync \ -I${AMD_SRC}/display/modules/freesync \
@@ -64,11 +66,11 @@ export CFLAGS="-D__redox__ -D__KERNEL__ -DCONFIG_DRM_AMDGPU -DCONFIG_DRM_AMD_DC
"${TARGET_CC}" -c ${CFLAGS} "${REDOX_GLUE}/amdgpu_redox_main.c" -o amdgpu_redox_main.o "${TARGET_CC}" -c ${CFLAGS} "${REDOX_GLUE}/amdgpu_redox_main.c" -o amdgpu_redox_main.o
"${TARGET_CC}" -c ${CFLAGS} "${REDOX_GLUE}/redox_stubs.c" -o redox_stubs.o "${TARGET_CC}" -c ${CFLAGS} "${REDOX_GLUE}/redox_stubs.c" -o redox_stubs.o
# Stage 2: Compile AMD Display Core (DC) — display pipeline only # Stage 2: Compile AMD Display Core (DC) — all display sources including DML/DML2
# Each file MUST compile. Any failure is a hard error. # Each file MUST compile. Any failure is a hard error.
success=0 success=0
failed=0 failed=0
find "${AMD_SRC}/display/" -name '*.c' | grep -v '/dml2/' | grep -v '/dml/' | while read -r src; do find "${AMD_SRC}/display/" -name '*.c' | while read -r src; do
obj=$(basename "${src%.c}.o") obj=$(basename "${src%.c}.o")
if "${TARGET_CC}" -c ${CFLAGS} "$src" -o "$obj" 2>"${obj}.log"; then if "${TARGET_CC}" -c ${CFLAGS} "$src" -o "$obj" 2>"${obj}.log"; then
success=$((success + 1)) success=$((success + 1))
@@ -7,6 +7,7 @@ AMDGPU_INCLUDES ?= ../amdgpu-source/include
LINUX_KPI ?= ../../drivers/linux-kpi/src/c_headers LINUX_KPI ?= ../../drivers/linux-kpi/src/c_headers
CFLAGS ?= -D__redox__ -D__KERNEL__ -DCONFIG_DRM_AMDGPU -DCONFIG_DRM_AMD_DC \ CFLAGS ?= -D__redox__ -D__KERNEL__ -DCONFIG_DRM_AMDGPU -DCONFIG_DRM_AMD_DC \
-DCONFIG_DRM_AMD_DC_DML2=1 \
-DCONFIG_DRM_AMD_DC_FP -DCONFIG_DRM_AMD_ACP \ -DCONFIG_DRM_AMD_DC_FP -DCONFIG_DRM_AMD_ACP \
-I$(LINUX_KPI) \ -I$(LINUX_KPI) \
-I. \ -I. \
@@ -24,7 +25,8 @@ CFLAGS ?= -D__redox__ -D__KERNEL__ -DCONFIG_DRM_AMDGPU -DCONFIG_DRM_AMD_DC \
-I$(AMDGPU_SRC)/display/dc/dcn31 \ -I$(AMDGPU_SRC)/display/dc/dcn31 \
-I$(AMDGPU_SRC)/display/dc/dcn32 \ -I$(AMDGPU_SRC)/display/dc/dcn32 \
-I$(AMDGPU_SRC)/display/dc/dcn35 \ -I$(AMDGPU_SRC)/display/dc/dcn35 \
-I$(AMDGPU_SRC)/display/dc/dml2 \ -I$(AMDGPU_SRC)/display/dc/dml2_0 \
-I$(AMDGPU_SRC)/display/dc/dml2_0/dml21 \
-I$(AMDGPU_SRC)/display/dmub \ -I$(AMDGPU_SRC)/display/dmub \
-I$(AMDGPU_SRC)/display/modules \ -I$(AMDGPU_SRC)/display/modules \
-I$(AMDGPU_SRC)/display/modules/freesync \ -I$(AMDGPU_SRC)/display/modules/freesync \
@@ -63,7 +65,7 @@ CORE_SRCS := \
$(AMDGPU_SRC)/amdgpu/amdgpu_ttm.c \ $(AMDGPU_SRC)/amdgpu/amdgpu_ttm.c \
$(AMDGPU_SRC)/amdgpu/amdgpu_bo_list.c $(AMDGPU_SRC)/amdgpu/amdgpu_bo_list.c
CORE_OBJS := $(patsubst %.c,%.o,$(notdir $(CORE_SRCS))) CORE_OBJS := $(patsubst %.c,%.o,$(notdir $(CORE_SRCS)))
DISPLAY_SRCS := $(shell find $(AMDGPU_SRC)/display -name '*.c' ! -path '*/dml/*' ! -path '*/dml2/*') DISPLAY_SRCS := $(shell find $(AMDGPU_SRC)/display -name '*.c')
DISPLAY_OBJS := $(patsubst %.c,%.o,$(notdir $(DISPLAY_SRCS))) DISPLAY_OBJS := $(patsubst %.c,%.o,$(notdir $(DISPLAY_SRCS)))
TTM_SRCS := $(shell find $(TTM_SRC) -name '*.c') TTM_SRCS := $(shell find $(TTM_SRC) -name '*.c')
TTM_OBJS := $(patsubst %.c,%.o,$(notdir $(TTM_SRCS))) TTM_OBJS := $(patsubst %.c,%.o,$(notdir $(TTM_SRCS)))
+1 -1
View File
@@ -416,7 +416,7 @@ extern unsigned long usecs_to_jiffies(unsigned int usecs);
#define CONFIG_DRM_AMD_DC_DCN 1 #define CONFIG_DRM_AMD_DC_DCN 1
#endif #endif
#ifndef CONFIG_DRM_AMD_DC_DML2 #ifndef CONFIG_DRM_AMD_DC_DML2
#define CONFIG_DRM_AMD_DC_DML2 0 #define CONFIG_DRM_AMD_DC_DML2 1
#endif #endif
#ifndef CONFIG_DRM_AMD_DC_SMU #ifndef CONFIG_DRM_AMD_DC_SMU
#define CONFIG_DRM_AMD_DC_SMU 0 #define CONFIG_DRM_AMD_DC_SMU 0
+1
View File
@@ -0,0 +1 @@
/mnt/data/homes/kellito/Builds/rbos/local/recipes/drivers/linux-kpi/source
+1
View File
@@ -0,0 +1 @@
/mnt/data/homes/kellito/Builds/rbos/local/recipes/drivers/redox-driver-sys/source
+51
View File
@@ -0,0 +1,51 @@
#TODO: KDecoration3 — window decoration library. Required by KWin.
[source]
tar = "https://invent.kde.org/plasma/kdecoration/-/archive/v6.3.4/kdecoration-v6.3.4.tar.gz"
[build]
template = "custom"
dependencies = [
"qtbase",
"kf6-extra-cmake-modules",
"kf6-kcoreaddons",
"kf6-ki18n",
]
script = """
DYNAMIC_INIT
HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build"
for qtdir in plugins mkspecs metatypes modules; do
if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then
ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}"
fi
done
sed -i "s/^ecm_install_po_files_as_qm/#ecm_install_po_files_as_qm/" \
"${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true
sed -i 's/^ki18n_install(po)/#ki18n_install(po)/' \
"${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true
sed -i 's/ Test//' \
"${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true
rm -f CMakeCache.txt
rm -rf CMakeFiles
cmake "${COOKBOOK_SOURCE}" \
-DCMAKE_TOOLCHAIN_FILE="${COOKBOOK_ROOT}/local/recipes/qt/redox-toolchain.cmake" \
-DQT_HOST_PATH="${HOST_BUILD}" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="${COOKBOOK_SYSROOT}" \
-DBUILD_TESTING=OFF \
-DBUILD_QCH=OFF \
-Wno-dev
cmake --build . -j${COOKBOOK_MAKE_JOBS}
cmake --install . --prefix "${COOKBOOK_STAGE}/usr"
for lib in "${COOKBOOK_STAGE}/usr/lib/"libKDecoration3*.so.*; do
[ -f "${lib}" ] || continue
patchelf --remove-rpath "${lib}" 2>/dev/null || true
done
"""
@@ -0,0 +1,2 @@
# clang-format
2a523449997260eb1d4585a673f81477c47b9979
@@ -0,0 +1,7 @@
.clang-format
/compile_commands.json
.clangd
.idea
/cmake-build*
.cache
/build*
@@ -0,0 +1,8 @@
# SPDX-FileCopyrightText: None
# SPDX-License-Identifier: CC0-1.0
include:
- project: sysadmin/ci-utilities
file:
- /gitlab-templates/linux-qt6.yml
- /gitlab-templates/freebsd-qt6.yml
@@ -0,0 +1,10 @@
# SPDX-FileCopyrightText: None
# SPDX-License-Identifier: CC0-1.0
Dependencies:
- 'on': ['@all']
'require':
'frameworks/extra-cmake-modules': '@latest-kf6'
'frameworks/ki18n': '@latest-kf6'
Options:
require-passing-tests-on: [ 'Linux', 'FreeBSD']
@@ -0,0 +1,93 @@
cmake_minimum_required(VERSION 3.16)
project(decoration-api)
set(PROJECT_VERSION "6.3.4")
set(PROJECT_VERSION_MAJOR 6)
set(QT_MIN_VERSION "6.7.0")
set(KF6_MIN_VERSION "6.10.0")
set(KDE_COMPILERSETTINGS_LEVEL "5.82")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(ECM ${KF6_MIN_VERSION} REQUIRED NO_MODULE)
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} )
include(KDEInstallDirs)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMGenerateExportHeader)
include(FeatureSummary)
include(GenerateExportHeader)
include(CMakePackageConfigHelpers)
include(KDEClangFormat)
include(KDEGitCommitHooks)
include(ECMDeprecationSettings)
ecm_setup_version(${PROJECT_VERSION} VARIABLE_PREFIX KDECORATION3
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kdecoration3_version.h"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KDecoration3ConfigVersion.cmake"
SOVERSION ${PROJECT_VERSION_MAJOR})
#dependencies
find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
Core
Gui
)
# require at least gcc 4.8
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if ("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.8")
message(SEND_ERROR "Version ${CMAKE_CXX_COMPILER_VERSION} of the ${CMAKE_CXX_COMPILER_ID} C++ compiler is not supported. Please use version 4.8 or later.")
endif()
endif()
set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].")
set(KDECORATION3_INCLUDEDIR "${KDE_INSTALL_INCLUDEDIR}/KDecoration3")
find_package(KF6I18n ${KF6_MIN_VERSION} CONFIG REQUIRED)
ecm_set_disabled_deprecation_versions(QT 5.15.2
KF 5.240.0
)
add_definitions(-DQT_NO_KEYWORDS)
# Subdirectories
add_subdirectory(src)
if(BUILD_TESTING)
add_subdirectory(autotests)
endif()
# add clang-format target for all our real source files
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
# create a Config.cmake and a ConfigVersion.cmake file and install them
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KDecoration3")
configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/KDecoration3Config.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/KDecoration3Config.cmake"
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/KDecoration3Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/KDecoration3ConfigVersion.cmake"
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
COMPONENT Devel )
install(EXPORT KDecoration3Targets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KDecoration3Targets.cmake NAMESPACE KDecoration3:: )
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kdecoration3_version.h
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF} COMPONENT Devel )
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
#ki18n_install(po)
@@ -0,0 +1,10 @@
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
find_dependency(Qt6Gui @QT_MIN_VERSION@)
set(KDECORATION_PLUGIN_DIR "org.kde.kdecoration3")
set(KDECORATION_KCM_PLUGIN_DIR "org.kde.kdecoration3.kcm")
include("${CMAKE_CURRENT_LIST_DIR}/KDecoration3Targets.cmake")
@@ -0,0 +1,121 @@
Creative Commons Legal Code
CC0 1.0 Universal
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
HEREUNDER.
Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator
and subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work for
the purpose of contributing to a commons of creative, cultural and
scientific works ("Commons") that the public can reliably and without fear
of later claims of infringement build upon, modify, incorporate in other
works, reuse and redistribute as freely as possible in any form whatsoever
and for any purposes, including without limitation commercial purposes.
These owners may contribute to the Commons to promote the ideal of a free
culture and the further production of creative, cultural and scientific
works, or to gain reputation or greater distribution for their Work in
part through the use and efforts of others.
For these and/or other purposes and motivations, and without any
expectation of additional consideration or compensation, the person
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
is an owner of Copyright and Related Rights in the Work, voluntarily
elects to apply CC0 to the Work and publicly distribute the Work under its
terms, with knowledge of his or her Copyright and Related Rights in the
Work and the meaning and intended legal effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not
limited to, the following:
i. the right to reproduce, adapt, distribute, perform, display,
communicate, and translate a Work;
ii. moral rights retained by the original author(s) and/or performer(s);
iii. publicity and privacy rights pertaining to a person's image or
likeness depicted in a Work;
iv. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(a), below;
v. rights protecting the extraction, dissemination, use and reuse of data
in a Work;
vi. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation
thereof, including any amended or successor version of such
directive); and
vii. other similar, equivalent or corresponding rights throughout the
world based on applicable law or treaty, and any national
implementations thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention
of, applicable law, Affirmer hereby overtly, fully, permanently,
irrevocably and unconditionally waives, abandons, and surrenders all of
Affirmer's Copyright and Related Rights and associated claims and causes
of action, whether now known or unknown (including existing as well as
future claims and causes of action), in the Work (i) in all territories
worldwide, (ii) for the maximum duration provided by applicable law or
treaty (including future time extensions), (iii) in any current or future
medium and for any number of copies, and (iv) for any purpose whatsoever,
including without limitation commercial, advertising or promotional
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
member of the public at large and to the detriment of Affirmer's heirs and
successors, fully intending that such Waiver shall not be subject to
revocation, rescission, cancellation, termination, or any other legal or
equitable action to disrupt the quiet enjoyment of the Work by the public
as contemplated by Affirmer's express Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason
be judged legally invalid or ineffective under applicable law, then the
Waiver shall be preserved to the maximum extent permitted taking into
account Affirmer's express Statement of Purpose. In addition, to the
extent the Waiver is so judged Affirmer hereby grants to each affected
person a royalty-free, non transferable, non sublicensable, non exclusive,
irrevocable and unconditional license to exercise Affirmer's Copyright and
Related Rights in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including future
time extensions), (iii) in any current or future medium and for any number
of copies, and (iv) for any purpose whatsoever, including without
limitation commercial, advertising or promotional purposes (the
"License"). The License shall be deemed effective as of the date CC0 was
applied by Affirmer to the Work. Should any part of the License for any
reason be judged legally invalid or ineffective under applicable law, such
partial invalidity or ineffectiveness shall not invalidate the remainder
of the License, and in such case Affirmer hereby affirms that he or she
will not (i) exercise any of his or her remaining Copyright and Related
Rights in the Work or (ii) assert any associated claims and causes of
action with respect to the Work, in either case contrary to Affirmer's
express Statement of Purpose.
4. Limitations and Disclaimers.
a. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
b. Affirmer offers the Work as-is and makes no representations or
warranties of any kind concerning the Work, express, implied,
statutory or otherwise, including without limitation warranties of
title, merchantability, fitness for a particular purpose, non
infringement, or the absence of latent or other defects, accuracy, or
the present or absence of errors, whether or not discoverable, all to
the greatest extent permissible under applicable law.
c. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without
limitation any person's Copyright and Related Rights in the Work.
Further, Affirmer disclaims responsibility for obtaining any necessary
consents, permissions or other rights required for any use of the
Work.
d. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to
this CC0 or use of the Work.
@@ -0,0 +1,467 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts as the
successor of the GNU Library Public License, version 2, hence the version
number 2.1.]
Preamble
The licenses for most software are designed to take away your freedom to share
and change it. By contrast, the GNU General Public Licenses are intended to
guarantee your freedom to share and change free software--to make sure the
software is free for all its users.
This license, the Lesser General Public License, applies to some specially
designated software packages--typically libraries--of the Free Software Foundation
and other authors who decide to use it. You can use it too, but we suggest
you first think carefully about whether this license or the ordinary General
Public License is the better strategy to use in any particular case, based
on the explanations below.
When we speak of free software, we are referring to freedom of use, not price.
Our General Public Licenses are designed to make sure that you have the freedom
to distribute copies of free software (and charge for this service if you
wish); that you receive source code or can get it if you want it; that you
can change the software and use pieces of it in new free programs; and that
you are informed that you can do these things.
To protect your rights, we need to make restrictions that forbid distributors
to deny you these rights or to ask you to surrender these rights. These restrictions
translate to certain responsibilities for you if you distribute copies of
the library or if you modify it.
For example, if you distribute copies of the library, whether gratis or for
a fee, you must give the recipients all the rights that we gave you. You must
make sure that they, too, receive or can get the source code. If you link
other code with the library, you must provide complete object files to the
recipients, so that they can relink them with the library after making changes
to the library and recompiling it. And you must show them these terms so they
know their rights.
We protect your rights with a two-step method: (1) we copyright the library,
and (2) we offer you this license, which gives you legal permission to copy,
distribute and/or modify the library.
To protect each distributor, we want to make it very clear that there is no
warranty for the free library. Also, if the library is modified by someone
else and passed on, the recipients should know that what they have is not
the original version, so that the original author's reputation will not be
affected by problems that might be introduced by others.
Finally, software patents pose a constant threat to the existence of any free
program. We wish to make sure that a company cannot effectively restrict the
users of a free program by obtaining a restrictive license from a patent holder.
Therefore, we insist that any patent license obtained for a version of the
library must be consistent with the full freedom of use specified in this
license.
Most GNU software, including some libraries, is covered by the ordinary GNU
General Public License. This license, the GNU Lesser General Public License,
applies to certain designated libraries, and is quite different from the ordinary
General Public License. We use this license for certain libraries in order
to permit linking those libraries into non-free programs.
When a program is linked with a library, whether statically or using a shared
library, the combination of the two is legally speaking a combined work, a
derivative of the original library. The ordinary General Public License therefore
permits such linking only if the entire combination fits its criteria of freedom.
The Lesser General Public License permits more lax criteria for linking other
code with the library.
We call this license the "Lesser" General Public License because it does Less
to protect the user's freedom than the ordinary General Public License. It
also provides other free software developers Less of an advantage over competing
non-free programs. These disadvantages are the reason we use the ordinary
General Public License for many libraries. However, the Lesser license provides
advantages in certain special circumstances.
For example, on rare occasions, there may be a special need to encourage the
widest possible use of a certain library, so that it becomes a de-facto standard.
To achieve this, non-free programs must be allowed to use the library. A more
frequent case is that a free library does the same job as widely used non-free
libraries. In this case, there is little to gain by limiting the free library
to free software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free programs
enables a greater number of people to use a large body of free software. For
example, permission to use the GNU C Library in non-free programs enables
many more people to use the whole GNU operating system, as well as its variant,
the GNU/Linux operating system.
Although the Lesser General Public License is Less protective of the users'
freedom, it does ensure that the user of a program that is linked with the
Library has the freedom and the wherewithal to run that program using a modified
version of the Library.
The precise terms and conditions for copying, distribution and modification
follow. Pay close attention to the difference between a "work based on the
library" and a "work that uses the library". The former contains code derived
from the library, whereas the latter must be combined with the library in
order to run.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other program
which contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Lesser General
Public License (also called "this License"). Each licensee is addressed as
"you".
A "library" means a collection of software functions and/or data prepared
so as to be conveniently linked with application programs (which use some
of those functions and data) to form executables.
The "Library", below, refers to any such software library or work which has
been distributed under these terms. A "work based on the Library" means either
the Library or any derivative work under copyright law: that is to say, a
work containing the Library or a portion of it, either verbatim or with modifications
and/or translated straightforwardly into another language. (Hereinafter, translation
is included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for making modifications
to it. For a library, complete source code means all the source code for all
modules it contains, plus any associated interface definition files, plus
the scripts used to control compilation and installation of the library.
Activities other than copying, distribution and modification are not covered
by this License; they are outside its scope. The act of running a program
using the Library is not restricted, and output from such a program is covered
only if its contents constitute a work based on the Library (independent of
the use of the Library in a tool for writing it). Whether that is true depends
on what the Library does and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's complete source
code as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and disclaimer
of warranty; keep intact all the notices that refer to this License and to
the absence of any warranty; and distribute a copy of this License along with
the Library.
You may charge a fee for the physical act of transferring a copy, and you
may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Library or any portion of it,
thus forming a work based on the Library, and copy and distribute such modifications
or work under the terms of Section 1 above, provided that you also meet all
of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices stating that
you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no charge to all
third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a table of
data to be supplied by an application program that uses the facility, other
than as an argument passed when the facility is invoked, then you must make
a good faith effort to ensure that, in the event an application does not supply
such function or table, the facility still operates, and performs whatever
part of its purpose remains meaningful.
(For example, a function in a library to compute square roots has a purpose
that is entirely well-defined independent of the application. Therefore, Subsection
2d requires that any application-supplied function or table used by this function
must be optional: if the application does not supply it, the square root function
must still compute square roots.)
These requirements apply to the modified work as a whole. If identifiable
sections of that work are not derived from the Library, and can be reasonably
considered independent and separate works in themselves, then this License,
and its terms, do not apply to those sections when you distribute them as
separate works. But when you distribute the same sections as part of a whole
which is a work based on the Library, the distribution of the whole must be
on the terms of this License, whose permissions for other licensees extend
to the entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest your
rights to work written entirely by you; rather, the intent is to exercise
the right to control the distribution of derivative or collective works based
on the Library.
In addition, mere aggregation of another work not based on the Library with
the Library (or with a work based on the Library) on a volume of a storage
or distribution medium does not bring the other work under the scope of this
License.
3. You may opt to apply the terms of the ordinary GNU General Public License
instead of this License to a given copy of the Library. To do this, you must
alter all the notices that refer to this License, so that they refer to the
ordinary GNU General Public License, version 2, instead of to this License.
(If a newer version than version 2 of the ordinary GNU General Public License
has appeared, then you can specify that version instead if you wish.) Do not
make any other change in these notices.
Once this change is made in a given copy, it is irreversible for that copy,
so the ordinary GNU General Public License applies to all subsequent copies
and derivative works made from that copy.
This option is useful when you wish to copy part of the code of the Library
into a program that is not a library.
4. You may copy and distribute the Library (or a portion or derivative of
it, under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you accompany it with the complete corresponding
machine-readable source code, which must be distributed under the terms of
Sections 1 and 2 above on a medium customarily used for software interchange.
If distribution of object code is made by offering access to copy from a designated
place, then offering equivalent access to copy the source code from the same
place satisfies the requirement to distribute the source code, even though
third parties are not compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the Library, but
is designed to work with the Library by being compiled or linked with it,
is called a "work that uses the Library". Such a work, in isolation, is not
a derivative work of the Library, and therefore falls outside the scope of
this License.
However, linking a "work that uses the Library" with the Library creates an
executable that is a derivative of the Library (because it contains portions
of the Library), rather than a "work that uses the library". The executable
is therefore covered by this License. Section 6 states terms for distribution
of such executables.
When a "work that uses the Library" uses material from a header file that
is part of the Library, the object code for the work may be a derivative work
of the Library even though the source code is not. Whether this is true is
especially significant if the work can be linked without the Library, or if
the work is itself a library. The threshold for this to be true is not precisely
defined by law.
If such an object file uses only numerical parameters, data structure layouts
and accessors, and small macros and small inline functions (ten lines or less
in length), then the use of the object file is unrestricted, regardless of
whether it is legally a derivative work. (Executables containing this object
code plus portions of the Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may distribute
the object code for the work under the terms of Section 6. Any executables
containing that work also fall under Section 6, whether or not they are linked
directly with the Library itself.
6. As an exception to the Sections above, you may also combine or link a "work
that uses the Library" with the Library to produce a work containing portions
of the Library, and distribute that work under terms of your choice, provided
that the terms permit modification of the work for the customer's own use
and reverse engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the Library
is used in it and that the Library and its use are covered by this License.
You must supply a copy of this License. If the work during execution displays
copyright notices, you must include the copyright notice for the Library among
them, as well as a reference directing the user to the copy of this License.
Also, you must do one of these things:
a) Accompany the work with the complete corresponding machine-readable source
code for the Library including whatever changes were used in the work (which
must be distributed under Sections 1 and 2 above); and, if the work is an
executable linked with the Library, with the complete machine-readable "work
that uses the Library", as object code and/or source code, so that the user
can modify the Library and then relink to produce a modified executable containing
the modified Library. (It is understood that the user who changes the contents
of definitions files in the Library will not necessarily be able to recompile
the application to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the Library. A
suitable mechanism is one that (1) uses at run time a copy of the library
already present on the user's computer system, rather than copying library
functions into the executable, and (2) will operate properly with a modified
version of the library, if the user installs one, as long as the modified
version is interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at least three years,
to give the same user the materials specified in Subsection 6a, above, for
a charge no more than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy from a designated
place, offer equivalent access to copy the above specified materials from
the same place.
e) Verify that the user has already received a copy of these materials or
that you have already sent this user a copy.
For an executable, the required form of the "work that uses the Library" must
include any data and utility programs needed for reproducing the executable
from it. However, as a special exception, the materials to be distributed
need not include anything that is normally distributed (in either source or
binary form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component itself
accompanies the executable.
It may happen that this requirement contradicts the license restrictions of
other proprietary libraries that do not normally accompany the operating system.
Such a contradiction means you cannot use both them and the Library together
in an executable that you distribute.
7. You may place library facilities that are a work based on the Library side-by-side
in a single library together with other library facilities not covered by
this License, and distribute such a combined library, provided that the separate
distribution of the work based on the Library and of the other library facilities
is otherwise permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work based on the
Library, uncombined with any other library facilities. This must be distributed
under the terms of the Sections above.
b) Give prominent notice with the combined library of the fact that part of
it is a work based on the Library, and explaining where to find the accompanying
uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute the Library
except as expressly provided under this License. Any attempt otherwise to
copy, modify, sublicense, link with, or distribute the Library is void, and
will automatically terminate your rights under this License. However, parties
who have received copies, or rights, from you under this License will not
have their licenses terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not signed
it. However, nothing else grants you permission to modify or distribute the
Library or its derivative works. These actions are prohibited by law if you
do not accept this License. Therefore, by modifying or distributing the Library
(or any work based on the Library), you indicate your acceptance of this License
to do so, and all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the Library),
the recipient automatically receives a license from the original licensor
to copy, distribute, link with or modify the Library subject to these terms
and conditions. You may not impose any further restrictions on the recipients'
exercise of the rights granted herein. You are not responsible for enforcing
compliance by third parties with this License.
11. If, as a consequence of a court judgment or allegation of patent infringement
or for any other reason (not limited to patent issues), conditions are imposed
on you (whether by court order, agreement or otherwise) that contradict the
conditions of this License, they do not excuse you from the conditions of
this License. If you cannot distribute so as to satisfy simultaneously your
obligations under this License and any other pertinent obligations, then as
a consequence you may not distribute the Library at all. For example, if a
patent license would not permit royalty-free redistribution of the Library
by all those who receive copies directly or indirectly through you, then the
only way you could satisfy both it and this License would be to refrain entirely
from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents
or other property right claims or to contest validity of any such claims;
this section has the sole purpose of protecting the integrity of the free
software distribution system which is implemented by public license practices.
Many people have made generous contributions to the wide range of software
distributed through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing to
distribute software through any other system and a licensee cannot impose
that choice.
This section is intended to make thoroughly clear what is believed to be a
consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in certain
countries either by patents or by copyrighted interfaces, the original copyright
holder who places the Library under this License may add an explicit geographical
distribution limitation excluding those countries, so that distribution is
permitted only in or among countries not thus excluded. In such case, this
License incorporates the limitation as if written in the body of this License.
13. The Free Software Foundation may publish revised and/or new versions of
the Lesser General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to address
new problems or concerns.
Each version is given a distinguishing version number. If the Library specifies
a version number of this License which applies to it and "any later version",
you have the option of following the terms and conditions either of that version
or of any later version published by the Free Software Foundation. If the
Library does not specify a license version number, you may choose any version
ever published by the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free programs
whose distribution conditions are incompatible with these, write to the author
to ask for permission. For software which is copyrighted by the Free Software
Foundation, write to the Free Software Foundation; we sometimes make exceptions
for this. Our decision will be guided by the two goals of preserving the free
status of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY
"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE
THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE
OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA
OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES
OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH
HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest possible
use to the public, we recommend making it free software that everyone can
redistribute and change. You can do so by permitting redistribution under
these terms (or, alternatively, under the terms of the ordinary General Public
License).
To apply these terms, attach the following notices to the library. It is safest
to attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the "copyright"
line and a pointer to where the full notice is found.
< one line to give the library's name and an idea of what it does. >
Copyright (C) < year > < name of author >
This library is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 2.1 of the License, or (at your option)
any later version.
This library is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.
You should have received a copy of the GNU Lesser General Public License along
with this library; if not, write to the Free Software Foundation, Inc., 51
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information
on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your school,
if any, to sign a "copyright disclaimer" for the library, if necessary. Here
is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in
the library `Frob' (a library for tweaking knobs) written
by James Random Hacker.
< signature of Ty Coon > , 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
@@ -0,0 +1,163 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates the terms
and conditions of version 3 of the GNU General Public License, supplemented
by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser General
Public License, and the "GNU GPL" refers to version 3 of the GNU General Public
License.
"The Library" refers to a covered work governed by this License, other than
an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided by the
Library, but which is not otherwise based on the Library. Defining a subclass
of a class defined by the Library is deemed a mode of using an interface provided
by the Library.
A "Combined Work" is a work produced by combining or linking an Application
with the Library. The particular version of the Library with which the Combined
Work was made is also called the "Linked Version".
The "Minimal Corresponding Source" for a Combined Work means the Corresponding
Source for the Combined Work, excluding any source code for portions of the
Combined Work that, considered in isolation, are based on the Application,
and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the object
code and/or source code for the Application, including any data and utility
programs needed for reproducing the Combined Work from the Application, but
excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License without
being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a facility
refers to a function or data to be supplied by an Application that uses the
facility (other than as an argument passed when the facility is invoked),
then you may convey a copy of the modified version:
a) under this License, provided that you make a good faith effort to ensure
that, in the event an Application does not supply the function or data, the
facility still operates, and performs whatever part of its purpose remains
meaningful, or
b) under the GNU GPL, with none of the additional permissions of this License
applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from a header
file that is part of the Library. You may convey such object code under terms
of your choice, provided that, if the incorporated material is not limited
to numerical parameters, data structure layouts and accessors, or small macros,
inline functions and templates (ten or fewer lines in length), you do both
of the following:
a) Give prominent notice with each copy of the object code that the Library
is used in it and that the Library and its use are covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that, taken together,
effectively do not restrict modification of the portions of the Library contained
in the Combined Work and reverse engineering for debugging such modifications,
if you also do each of the following:
a) Give prominent notice with each copy of the Combined Work that the Library
is used in it and that the Library and its use are covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during execution, include
the copyright notice for the Library among these notices, as well as a reference
directing the user to the copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this License,
and the Corresponding Application Code in a form suitable for, and under terms
that permit, the user to recombine or relink the Application with a modified
version of the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying Corresponding Source.
1) Use a suitable shared library mechanism for linking with the Library. A
suitable mechanism is one that (a) uses at run time a copy of the Library
already present on the user's computer system, and (b) will operate properly
with a modified version of the Library that is interface-compatible with the
Linked Version.
e) Provide Installation Information, but only if you would otherwise be required
to provide such information under section 6 of the GNU GPL, and only to the
extent that such information is necessary to install and execute a modified
version of the Combined Work produced by recombining or relinking the Application
with a modified version of the Linked Version. (If you use option 4d0, the
Installation Information must accompany the Minimal Corresponding Source and
Corresponding Application Code. If you use option 4d1, you must provide the
Installation Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the Library side
by side in a single library together with other library facilities that are
not Applications and are not covered by this License, and convey such a combined
library under terms of your choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based on the
Library, uncombined with any other library facilities, conveyed under the
terms of this License.
b) Give prominent notice with the combined library that part of it is a work
based on the Library, and explaining where to find the accompanying uncombined
form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions of the
GNU Lesser General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to address
new problems or concerns.
Each version is given a distinguishing version number. If the Library as you
received it specifies that a certain numbered version of the GNU Lesser General
Public License "or any later version" applies to it, you have the option of
following the terms and conditions either of that published version or of
any later version published by the Free Software Foundation. If the Library
as you received it does not specify a version number of the GNU Lesser General
Public License, you may choose any version of the GNU Lesser General Public
License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide whether
future versions of the GNU Lesser General Public License shall apply, that
proxy's public statement of acceptance of any version is permanent authorization
for you to choose that version for the Library.
@@ -0,0 +1,12 @@
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the license or (at your option) any later version
that is accepted by the membership of KDE e.V. (or its successor
approved by the membership of KDE e.V.), which shall act as a
proxy as defined in Section 6 of version 3 of the license.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
@@ -0,0 +1,57 @@
# KDecoration3
Plugin based library to create window decorations.
## Introduction
KDecoration3 is a library to create window decorations. These window decorations can be used by
for example an X11 based window manager which re-parents a Client window to a window decoration
frame.
The library consists of two parts:
* Decoration API for implementing a Decoration theme
* Private API to implement the backend part (e.g. from Window Manager side)
## Providing a Decoration
To provide a custom decoration one needs to create a plugin and provide an own implementation
of KDecoration3::Decoration. For a framework to load and find the plugin it needs to be compiled
with the proper json metadata. An example for such metadata (deco.json):
```json
{
"KPlugin": {
"Id": "org.kde.myAweseomeDecoration",
"ServiceTypes": [
"org.kde.kdecoration3"
]
},
"X-KDE-ConfigModule": "kcm_name", /* comes with a configuration module */
"org.kde.kdecoration3": {
"blur": false, /* blur behind not needed */
}
}
```
To simplify one can use the KPluginFactory macro from the KCoreAddons framework:
```cpp
K_PLUGIN_FACTORY_WITH_JSON(
MyAwesomeDecorationFactory,
"deco.json",
registerPlugin<MyAwesomeDecoration::Decoration>();
)
```
The plugin needs to get installed to `${KDE_INSTALL_PLUGINDIR}/org.kde.kdecoration3`.
## Configuring the Decoration
It is possible to provide a configuration module to tweak some aspects of the decoration. This is done
by creating a plugin that provides such a configuration module.
The `kcmoduleName` specifies the name of the configuration module. It needs to be installed under
`${KDE_INSTALL_PLUGINDIR}/org.kde.kdecoration3.kcm` so that it can be looked up.
# KDecoration2 -> KDecoration3
The porting guide can be found [here](docs/KDecoration 3 porting guide.md).
@@ -0,0 +1,35 @@
include(ECMMarkAsTest)
set(decorationButtonTest_SRCS
mockbridge.cpp mockbridge.h
mockbutton.cpp mockbutton.h
mockwindow.cpp mockwindow.h
mockdecoration.cpp mockdecoration.h
mocksettings.cpp mocksettings.h
decorationbuttontest.cpp
)
add_executable(decorationButtonTest ${decorationButtonTest_SRCS})
target_link_libraries(decorationButtonTest kdecorations3 kdecorations3private Qt::Test)
add_test(NAME kdecoration3-decorationButtonTest COMMAND decorationButtonTest)
ecm_mark_as_test(decorationButtonTest)
set(decorationTest_SRCS
mockbridge.cpp mockbridge.h
mockbutton.cpp mockbutton.h
mockwindow.cpp mockwindow.h
mockdecoration.cpp mockdecoration.h
mocksettings.cpp mocksettings.h
decorationtest.cpp
)
add_executable(decorationTest ${decorationTest_SRCS})
target_link_libraries(decorationTest kdecorations3 kdecorations3private Qt::Test)
add_test(NAME kdecoration3-decorationTest COMMAND decorationTest)
ecm_mark_as_test(decorationTest)
set(decorationShadowTest_SRCS
shadowtest.cpp
)
add_executable(decorationShadowTest ${decorationShadowTest_SRCS})
target_link_libraries(decorationShadowTest kdecorations3 Qt::Test)
add_test(NAME kdecoration3-decorationShadowTest COMMAND decorationShadowTest)
ecm_mark_as_test(decorationShadowTest)
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,151 @@
/*
* SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
*
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "../src/decorationsettings.h"
#include "mockbridge.h"
#include "mockdecoration.h"
#include "mocksettings.h"
#include "mockwindow.h"
#include <QSignalSpy>
#include <QTest>
#include <QVariant>
class DecorationTest : public QObject
{
Q_OBJECT
private Q_SLOTS:
void testCreate();
void testOpaque();
void testSection_data();
void testSection();
};
#ifdef _MSC_VER
QMap<QString, QVariant> makeMap(const QString &key, const QVariant &value);
#endif
void DecorationTest::testCreate()
{
// just test that creating the Decoration doesn't crash
MockBridge bridge;
const QString bridgeKey = QStringLiteral("bridge");
MockDecoration deco1(nullptr,
QVariantList({
#ifdef _MSC_VER
makeMap(bridgeKey, QVariant::fromValue(5)),
#else
QVariantMap({{bridgeKey, QVariant::fromValue(5)}}),
#endif
QVariant::fromValue(bridgeKey),
QVariantMap(),
#ifdef _MSC_VER
makeMap(bridgeKey, QVariant::fromValue(&bridge)),
#else
QVariantMap({{bridgeKey, QVariant::fromValue(&bridge)}})
#endif
}));
QVERIFY(deco1.window());
}
void DecorationTest::testOpaque()
{
MockBridge bridge;
MockDecoration deco(&bridge);
QSignalSpy opaqueChangedSpy(&deco, &KDecoration3::Decoration::opaqueChanged);
QVERIFY(opaqueChangedSpy.isValid());
QCOMPARE(deco.isOpaque(), false);
deco.setOpaque(false);
QVERIFY(opaqueChangedSpy.isEmpty());
deco.setOpaque(true);
QCOMPARE(opaqueChangedSpy.count(), 1);
QCOMPARE(opaqueChangedSpy.first().first().toBool(), true);
QCOMPARE(deco.isOpaque(), true);
deco.setOpaque(true);
QCOMPARE(opaqueChangedSpy.count(), 1);
deco.setOpaque(false);
QCOMPARE(opaqueChangedSpy.count(), 2);
QCOMPARE(opaqueChangedSpy.first().first().toBool(), true);
QCOMPARE(opaqueChangedSpy.last().first().toBool(), false);
QCOMPARE(deco.isOpaque(), false);
}
Q_DECLARE_METATYPE(QMargins)
Q_DECLARE_METATYPE(Qt::WindowFrameSection)
void DecorationTest::testSection_data()
{
QTest::addColumn<QRect>("titleBar");
QTest::addColumn<QMargins>("margins");
QTest::addColumn<QPoint>("pos");
QTest::addColumn<Qt::WindowFrameSection>("expected");
QRect r(1, 1, 98, 8);
QMargins m(1, 10, 1, 1);
QTest::newRow("topLeft") << r << m << QPoint(0, 0) << Qt::TopLeftSection;
QTest::newRow("top@Left") << r << m << QPoint(1, 0) << Qt::TopSection;
QTest::newRow("top@Right") << r << m << QPoint(100, 0) << Qt::TopSection;
QTest::newRow("topRight") << r << m << QPoint(101, 0) << Qt::TopRightSection;
QTest::newRow("right@top") << r << m << QPoint(101, 1) << Qt::RightSection;
QTest::newRow("right@bottom") << r << m << QPoint(101, 109) << Qt::RightSection;
QTest::newRow("bottomRight") << r << m << QPoint(101, 110) << Qt::BottomRightSection;
QTest::newRow("bottom@right") << r << m << QPoint(100, 110) << Qt::BottomSection;
QTest::newRow("bottom@left") << r << m << QPoint(1, 110) << Qt::BottomSection;
QTest::newRow("bottomLeft") << r << m << QPoint(0, 110) << Qt::BottomLeftSection;
QTest::newRow("left@Top") << r << m << QPoint(0, 1) << Qt::LeftSection;
QTest::newRow("left@Bottom") << r << m << QPoint(0, 109) << Qt::LeftSection;
QTest::newRow("title") << r << m << QPoint(1, 1) << Qt::TitleBarArea;
}
void DecorationTest::testSection()
{
MockBridge bridge;
auto decoSettings = std::make_shared<KDecoration3::DecorationSettings>(&bridge);
MockDecoration deco(&bridge);
deco.setSettings(decoSettings);
MockSettings *settings = bridge.lastCreatedSettings();
settings->setLargeSpacing(0);
MockWindow *client = bridge.lastCreatedWindow();
client->setWidth(100);
client->setHeight(100);
QCOMPARE(deco.size(), QSize(100, 100));
QCOMPARE(deco.borderLeft(), 0);
QCOMPARE(deco.borderTop(), 0);
QCOMPARE(deco.borderRight(), 0);
QCOMPARE(deco.borderBottom(), 0);
QCOMPARE(deco.titleBar(), QRect());
QCOMPARE(deco.sectionUnderMouse(), Qt::NoSection);
QFETCH(QRect, titleBar);
QFETCH(QMargins, margins);
deco.setBorders(margins);
QCOMPARE(deco.borderLeft(), margins.left());
QCOMPARE(deco.borderTop(), margins.top());
QCOMPARE(deco.borderRight(), margins.right());
QCOMPARE(deco.borderBottom(), margins.bottom());
deco.setTitleBar(titleBar);
QCOMPARE(deco.titleBar(), titleBar);
QCOMPARE(deco.size(), QSize(100 + deco.borderLeft() + deco.borderRight(), 100 + deco.borderTop() + deco.borderBottom()));
QSignalSpy spy(&deco, &KDecoration3::Decoration::sectionUnderMouseChanged);
QVERIFY(spy.isValid());
QFETCH(QPoint, pos);
QHoverEvent event(QEvent::HoverMove, QPointF(pos), QPointF(pos));
QCoreApplication::sendEvent(&deco, &event);
QFETCH(Qt::WindowFrameSection, expected);
QCOMPARE(deco.sectionUnderMouse(), expected);
QCOMPARE(spy.count(), 1);
QCOMPARE(spy.first().first().value<Qt::WindowFrameSection>(), expected);
QHoverEvent event2(QEvent::HoverMove, QPointF(50, 50), QPointF(50, 50));
QCoreApplication::sendEvent(&deco, &event2);
QCOMPARE(deco.sectionUnderMouse(), Qt::NoSection);
QCOMPARE(spy.count(), 2);
QCOMPARE(spy.first().first().value<Qt::WindowFrameSection>(), expected);
QCOMPARE(spy.last().first().value<Qt::WindowFrameSection>(), Qt::NoSection);
}
QTEST_MAIN(DecorationTest)
#include "decorationtest.moc"
@@ -0,0 +1,25 @@
/*
* SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
*
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "mockbridge.h"
#include "mocksettings.h"
#include "mockwindow.h"
#include <QtGlobal>
std::unique_ptr<KDecoration3::DecoratedWindowPrivate> MockBridge::createClient(KDecoration3::DecoratedWindow *client, KDecoration3::Decoration *decoration)
{
auto ptr = std::make_unique<MockWindow>(client, decoration);
m_lastCreatedWindow = ptr.get();
return ptr;
}
std::unique_ptr<KDecoration3::DecorationSettingsPrivate> MockBridge::settings(KDecoration3::DecorationSettings *parent)
{
auto ptr = std::make_unique<MockSettings>(parent);
m_lastCreatedSettings = ptr.get();
return ptr;
}
#include "moc_mockbridge.cpp"
@@ -0,0 +1,33 @@
/*
* SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
*
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#pragma once
#include "../src/private/decorationbridge.h"
#include <QObject>
class MockWindow;
class MockSettings;
class MockBridge : public KDecoration3::DecorationBridge
{
Q_OBJECT
public:
std::unique_ptr<KDecoration3::DecoratedWindowPrivate> createClient(KDecoration3::DecoratedWindow *client, KDecoration3::Decoration *decoration) override;
std::unique_ptr<KDecoration3::DecorationSettingsPrivate> settings(KDecoration3::DecorationSettings *parent) override;
MockWindow *lastCreatedWindow() const
{
return m_lastCreatedWindow;
}
MockSettings *lastCreatedSettings() const
{
return m_lastCreatedSettings;
}
private:
MockWindow *m_lastCreatedWindow = nullptr;
MockSettings *m_lastCreatedSettings = nullptr;
};
@@ -0,0 +1,19 @@
/*
* SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
*
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "mockbutton.h"
MockButton::MockButton(KDecoration3::DecorationButtonType type, KDecoration3::Decoration *decoration, QObject *parent)
: DecorationButton(type, decoration, parent)
{
}
void MockButton::paint(QPainter *painter, const QRectF &repaintRegion)
{
Q_UNUSED(painter)
Q_UNUSED(repaintRegion)
}
#include "moc_mockbutton.cpp"
@@ -0,0 +1,16 @@
/*
* SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
*
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#pragma once
#include "../src/decorationbutton.h"
class MockButton : public KDecoration3::DecorationButton
{
Q_OBJECT
public:
MockButton(KDecoration3::DecorationButtonType type, KDecoration3::Decoration *decoration, QObject *parent = nullptr);
void paint(QPainter *painter, const QRectF &repaintRegion) override;
};
@@ -0,0 +1,67 @@
/*
* SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
*
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "mockdecoration.h"
#include "mockbridge.h"
#include <QMap>
#include <QVariantMap>
#include <utility>
MockDecoration::MockDecoration(QObject *parent, const QVariantList &args)
: Decoration(parent, args)
{
}
#ifdef _MSC_VER
QMap<QString, QVariant> makeMap(const QString &key, const QVariant &value)
{
QMap<QString, QVariant> ret;
ret.insert(key, value);
return ret;
}
MockDecoration::MockDecoration(MockBridge *bridge)
: MockDecoration(nullptr, QVariantList({makeMap(QStringLiteral("bridge"), QVariant::fromValue(bridge))}))
#else
MockDecoration::MockDecoration(MockBridge *bridge)
: MockDecoration(nullptr, QVariantList({QVariantMap({{QStringLiteral("bridge"), QVariant::fromValue(bridge)}})}))
#endif
{
create();
init();
apply(nextState()->clone());
connect(this, &MockDecoration::nextStateChanged, this, [this]() {
apply(nextState()->clone());
});
}
bool MockDecoration::init()
{
return true;
}
void MockDecoration::paint(QPainter *painter, const QRectF &repaintRegion)
{
Q_UNUSED(painter)
Q_UNUSED(repaintRegion)
}
void MockDecoration::setOpaque(bool set)
{
Decoration::setOpaque(set);
}
void MockDecoration::setBorders(const QMargins &m)
{
Decoration::setBorders(m);
}
void MockDecoration::setTitleBar(const QRect &rect)
{
Decoration::setTitleBar(rect);
}
#include "moc_mockdecoration.cpp"
@@ -0,0 +1,25 @@
/*
* SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
*
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#pragma once
#include "../src/decoration.h"
class MockBridge;
class MockDecoration : public KDecoration3::Decoration
{
Q_OBJECT
public:
explicit MockDecoration(QObject *parent, const QVariantList &args);
explicit MockDecoration(MockBridge *bridge);
bool init() override;
void paint(QPainter *painter, const QRectF &repaintRegion) override;
void setOpaque(bool set);
using Decoration::setBorders;
void setBorders(const QMargins &m);
using Decoration::setTitleBar;
void setTitleBar(const QRect &rect);
};
@@ -0,0 +1,60 @@
/*
* SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
*
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "mocksettings.h"
#include "../src/decorationsettings.h"
MockSettings::MockSettings(KDecoration3::DecorationSettings *parent)
: DecorationSettingsPrivate(parent)
{
}
KDecoration3::BorderSize MockSettings::borderSize() const
{
return KDecoration3::BorderSize::Normal;
}
QList<KDecoration3::DecorationButtonType> MockSettings::decorationButtonsLeft() const
{
return QList<KDecoration3::DecorationButtonType>();
}
QList<KDecoration3::DecorationButtonType> MockSettings::decorationButtonsRight() const
{
return QList<KDecoration3::DecorationButtonType>();
}
bool MockSettings::isAlphaChannelSupported() const
{
return true;
}
bool MockSettings::isCloseOnDoubleClickOnMenu() const
{
return m_closeDoubleClickOnMenu;
}
bool MockSettings::isOnAllDesktopsAvailable() const
{
return m_onAllDesktopsAvailable;
}
void MockSettings::setOnAllDesktopsAvailabe(bool set)
{
if (m_onAllDesktopsAvailable == set) {
return;
}
m_onAllDesktopsAvailable = set;
Q_EMIT decorationSettings()->onAllDesktopsAvailableChanged(m_onAllDesktopsAvailable);
}
void MockSettings::setCloseOnDoubleClickOnMenu(bool set)
{
if (m_closeDoubleClickOnMenu == set) {
return;
}
m_closeDoubleClickOnMenu = set;
Q_EMIT decorationSettings()->closeOnDoubleClickOnMenuChanged(m_closeDoubleClickOnMenu);
}
@@ -0,0 +1,28 @@
/*
* SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
*
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#pragma once
#include "../src/private/decorationsettingsprivate.h"
class MockSettings : public KDecoration3::DecorationSettingsPrivate
{
public:
explicit MockSettings(KDecoration3::DecorationSettings *parent);
KDecoration3::BorderSize borderSize() const override;
QList<KDecoration3::DecorationButtonType> decorationButtonsLeft() const override;
QList<KDecoration3::DecorationButtonType> decorationButtonsRight() const override;
bool isAlphaChannelSupported() const override;
bool isCloseOnDoubleClickOnMenu() const override;
bool isOnAllDesktopsAvailable() const override;
void setOnAllDesktopsAvailabe(bool set);
void setCloseOnDoubleClickOnMenu(bool set);
private:
bool m_onAllDesktopsAvailable = false;
bool m_closeDoubleClickOnMenu = false;
};
@@ -0,0 +1,302 @@
/*
* SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
*
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "mockwindow.h"
#include <decoratedwindow.h>
#include <QPalette>
MockWindow::MockWindow(KDecoration3::DecoratedWindow *client, KDecoration3::Decoration *decoration)
: QObject()
, DecoratedWindowPrivateV2(client, decoration)
{
}
Qt::Edges MockWindow::adjacentScreenEdges() const
{
return Qt::Edges();
}
QString MockWindow::caption() const
{
return QString();
}
qreal MockWindow::height() const
{
return m_height;
}
QIcon MockWindow::icon() const
{
return QIcon();
}
bool MockWindow::isActive() const
{
return false;
}
bool MockWindow::isCloseable() const
{
return m_closeable;
}
bool MockWindow::isKeepAbove() const
{
return m_keepAbove;
}
bool MockWindow::isKeepBelow() const
{
return m_keepBelow;
}
bool MockWindow::isMaximizeable() const
{
return m_maximizable;
}
bool MockWindow::isMaximized() const
{
return isMaximizedHorizontally() && isMaximizedVertically();
}
bool MockWindow::isMaximizedHorizontally() const
{
return m_maximizedHorizontally;
}
bool MockWindow::isMaximizedVertically() const
{
return m_maximizedVertically;
}
bool MockWindow::isMinimizeable() const
{
return m_minimizable;
}
bool MockWindow::isModal() const
{
return false;
}
bool MockWindow::isMoveable() const
{
return false;
}
bool MockWindow::isOnAllDesktops() const
{
return m_onAllDesktops;
}
bool MockWindow::isResizeable() const
{
return false;
}
bool MockWindow::isShadeable() const
{
return m_shadeable;
}
bool MockWindow::isShaded() const
{
return m_shaded;
}
QPalette MockWindow::palette() const
{
return QPalette();
}
bool MockWindow::hasApplicationMenu() const
{
return true;
}
bool MockWindow::isApplicationMenuActive() const
{
return false;
}
bool MockWindow::providesContextHelp() const
{
return m_contextHelp;
}
void MockWindow::requestClose()
{
Q_EMIT closeRequested();
}
void MockWindow::requestContextHelp()
{
Q_EMIT quickHelpRequested();
}
void MockWindow::requestToggleMaximization(Qt::MouseButtons buttons)
{
bool maximizedHorizontally = m_maximizedHorizontally;
bool maximizedVertically = m_maximizedVertically;
if (buttons.testFlag(Qt::LeftButton)) {
maximizedHorizontally = !m_maximizedHorizontally;
maximizedVertically = !m_maximizedVertically;
}
if (buttons.testFlag(Qt::MiddleButton)) {
maximizedHorizontally = !m_maximizedHorizontally;
}
if (buttons.testFlag(Qt::RightButton)) {
maximizedVertically = !m_maximizedVertically;
}
const bool wasMaximized = isMaximized();
if (m_maximizedHorizontally != maximizedHorizontally) {
m_maximizedHorizontally = maximizedHorizontally;
Q_EMIT window()->maximizedHorizontallyChanged(m_maximizedHorizontally);
}
if (m_maximizedVertically != maximizedVertically) {
m_maximizedVertically = maximizedVertically;
Q_EMIT window()->maximizedVerticallyChanged(m_maximizedVertically);
}
if (wasMaximized != isMaximized()) {
Q_EMIT window()->maximizedChanged(isMaximized());
}
}
void MockWindow::requestMinimize()
{
Q_EMIT minimizeRequested();
}
void MockWindow::requestShowWindowMenu(const QRect &rect)
{
Q_EMIT menuRequested();
}
void MockWindow::requestShowApplicationMenu(const QRect &rect, int actionId)
{
Q_UNUSED(rect);
Q_UNUSED(actionId);
Q_EMIT applicationMenuRequested(); // FIXME TODO pass geometry
}
void MockWindow::requestToggleKeepAbove()
{
m_keepAbove = !m_keepAbove;
Q_EMIT window()->keepAboveChanged(m_keepAbove);
}
void MockWindow::requestToggleKeepBelow()
{
m_keepBelow = !m_keepBelow;
Q_EMIT window()->keepBelowChanged(m_keepBelow);
}
void MockWindow::requestToggleOnAllDesktops()
{
m_onAllDesktops = !m_onAllDesktops;
Q_EMIT window()->onAllDesktopsChanged(m_onAllDesktops);
}
void MockWindow::requestToggleShade()
{
m_shaded = !m_shaded;
Q_EMIT window()->shadedChanged(m_shaded);
}
void MockWindow::requestShowToolTip(const QString &text)
{
Q_UNUSED(text);
}
void MockWindow::requestHideToolTip()
{
}
QSizeF MockWindow::size() const
{
return QSize(m_width, m_height);
}
qreal MockWindow::width() const
{
return m_width;
}
QString MockWindow::windowClass() const
{
return QString();
}
void MockWindow::setCloseable(bool set)
{
m_closeable = set;
Q_EMIT window()->closeableChanged(set);
}
void MockWindow::setMinimizable(bool set)
{
m_minimizable = set;
Q_EMIT window()->minimizeableChanged(set);
}
void MockWindow::setProvidesContextHelp(bool set)
{
m_contextHelp = set;
Q_EMIT window()->providesContextHelpChanged(set);
}
void MockWindow::setShadeable(bool set)
{
m_shadeable = set;
Q_EMIT window()->shadeableChanged(set);
}
void MockWindow::setMaximizable(bool set)
{
m_maximizable = set;
Q_EMIT window()->maximizeableChanged(set);
}
void MockWindow::setWidth(int w)
{
m_width = w;
Q_EMIT window()->widthChanged(w);
}
void MockWindow::setHeight(int h)
{
m_height = h;
Q_EMIT window()->heightChanged(h);
}
void MockWindow::showApplicationMenu(int actionId)
{
Q_UNUSED(actionId)
}
qreal MockWindow::scale() const
{
return 1;
}
qreal MockWindow::nextScale() const
{
return 1;
}
QString MockWindow::applicationMenuServiceName() const
{
return QString();
}
QString MockWindow::applicationMenuObjectPath() const
{
return QString();
}
#include "moc_mockwindow.cpp"
@@ -0,0 +1,93 @@
/*
* SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
*
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#pragma once
#include "../src/private/decoratedwindowprivate.h"
#include <QObject>
class MockWindow : public QObject, public KDecoration3::DecoratedWindowPrivateV2
{
Q_OBJECT
public:
explicit MockWindow(KDecoration3::DecoratedWindow *client, KDecoration3::Decoration *decoration);
Qt::Edges adjacentScreenEdges() const override;
QString caption() const override;
qreal height() const override;
QIcon icon() const override;
bool isActive() const override;
bool isCloseable() const override;
bool isKeepAbove() const override;
bool isKeepBelow() const override;
bool isMaximizeable() const override;
bool isMaximized() const override;
bool isMaximizedHorizontally() const override;
bool isMaximizedVertically() const override;
bool isMinimizeable() const override;
bool isModal() const override;
bool isMoveable() const override;
bool isOnAllDesktops() const override;
bool isResizeable() const override;
bool isShadeable() const override;
bool isShaded() const override;
QPalette palette() const override;
bool hasApplicationMenu() const override;
bool isApplicationMenuActive() const override;
bool providesContextHelp() const override;
void requestClose() override;
void requestContextHelp() override;
void requestToggleMaximization(Qt::MouseButtons buttons) override;
void requestMinimize() override;
void requestShowWindowMenu(const QRect &rect) override;
void requestShowApplicationMenu(const QRect &rect, int actionId) override;
void requestToggleKeepAbove() override;
void requestToggleKeepBelow() override;
void requestToggleOnAllDesktops() override;
void requestToggleShade() override;
void requestShowToolTip(const QString &text) override;
void requestHideToolTip() override;
QSizeF size() const override;
qreal width() const override;
QString windowClass() const override;
qreal scale() const override;
qreal nextScale() const override;
QString applicationMenuServiceName() const override;
QString applicationMenuObjectPath() const override;
void showApplicationMenu(int actionId) override;
void setCloseable(bool set);
void setMinimizable(bool set);
void setProvidesContextHelp(bool set);
void setShadeable(bool set);
void setMaximizable(bool set);
void setWidth(int w);
void setHeight(int h);
Q_SIGNALS:
void closeRequested();
void minimizeRequested();
void quickHelpRequested();
void menuRequested();
void applicationMenuRequested();
private:
bool m_closeable = false;
bool m_minimizable = false;
bool m_contextHelp = false;
bool m_keepAbove = false;
bool m_keepBelow = false;
bool m_shadeable = false;
bool m_shaded = false;
bool m_maximizable = false;
bool m_maximizedVertically = false;
bool m_maximizedHorizontally = false;
bool m_onAllDesktops = false;
qreal m_width = 0;
qreal m_height = 0;
};
@@ -0,0 +1,127 @@
/*
* SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
*
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "../src/decorationshadow.h"
#include <QSignalSpy>
#include <QTest>
Q_DECLARE_METATYPE(QMargins)
class DecorationShadowTest : public QObject
{
Q_OBJECT
private Q_SLOTS:
void testPadding_data();
void testPadding();
void testSizes_data();
void testSizes();
};
void DecorationShadowTest::testPadding_data()
{
QTest::addColumn<QByteArray>("propertyName");
QTest::addColumn<QMargins>("padding");
QTest::newRow("top") << QByteArrayLiteral("paddingTop") << QMargins(0, 10, 0, 0);
QTest::newRow("right") << QByteArrayLiteral("paddingRight") << QMargins(0, 0, 10, 0);
QTest::newRow("bottom") << QByteArrayLiteral("paddingBottom") << QMargins(0, 0, 0, 10);
QTest::newRow("left") << QByteArrayLiteral("paddingLeft") << QMargins(10, 0, 0, 0);
}
void DecorationShadowTest::testPadding()
{
using namespace KDecoration3;
DecorationShadow shadow;
QFETCH(QByteArray, propertyName);
const int propertyIndex = shadow.metaObject()->indexOfProperty(propertyName.constData());
QVERIFY(propertyIndex != -1);
QMetaProperty metaProperty = shadow.metaObject()->property(propertyIndex);
QCOMPARE(metaProperty.isReadable(), true);
QCOMPARE(metaProperty.hasNotifySignal(), true);
QSignalSpy changedSpy(&shadow, &KDecoration3::DecorationShadow::paddingChanged);
QVERIFY(changedSpy.isValid());
QCOMPARE(shadow.property(propertyName.constData()).isValid(), true);
QCOMPARE(shadow.property(propertyName.constData()).toDouble(), 0);
QFETCH(QMargins, padding);
shadow.setPadding(padding);
QCOMPARE(shadow.padding(), padding);
QCOMPARE(shadow.property(propertyName.constData()).toDouble(), 10);
QCOMPARE(changedSpy.count(), 1);
// trying to set to same value shouldn't emit the signal
shadow.setPadding(padding);
QCOMPARE(shadow.property(propertyName.constData()).toDouble(), 10);
QCOMPARE(changedSpy.count(), 1);
// changing to different value should emit signal
padding += 1;
shadow.setPadding(padding);
QCOMPARE(shadow.padding(), padding);
QCOMPARE(shadow.property(propertyName.constData()).toDouble(), 11);
QCOMPARE(changedSpy.count(), 2);
}
void DecorationShadowTest::testSizes_data()
{
QTest::addColumn<QByteArray>("propertyName");
QTest::addColumn<QRect>("innerShadowRect");
QTest::addColumn<QRect>("shadowRect");
QTest::addColumn<QSize>("shadowSize");
QTest::newRow("topLeft") << QByteArrayLiteral("topLeftGeometry") << QRect(1, 2, 5, 5) << QRect(0, 0, 1, 2) << QSize(6, 7);
QTest::newRow("top") << QByteArrayLiteral("topGeometry") << QRect(1, 2, 1, 5) << QRect(1, 0, 1, 2) << QSize(3, 7);
QTest::newRow("topRight") << QByteArrayLiteral("topRightGeometry") << QRect(0, 2, 2, 1) << QRect(2, 0, 1, 2) << QSize(3, 3);
QTest::newRow("right") << QByteArrayLiteral("rightGeometry") << QRect(0, 0, 1, 2) << QRect(1, 0, 1, 2) << QSize(2, 4);
QTest::newRow("bottomRight") << QByteArrayLiteral("bottomRightGeometry") << QRect(0, 0, 1, 4) << QRect(1, 4, 1, 2) << QSize(2, 6);
QTest::newRow("bottom") << QByteArrayLiteral("bottomGeometry") << QRect(0, 0, 1, 1) << QRect(0, 1, 1, 2) << QSize(1, 3);
QTest::newRow("bottomLeft") << QByteArrayLiteral("bottomLeftGeometry") << QRect(1, 0, 1, 1) << QRect(0, 1, 1, 2) << QSize(2, 3);
QTest::newRow("left") << QByteArrayLiteral("leftGeometry") << QRect(1, 0, 1, 2) << QRect(0, 0, 1, 2) << QSize(2, 2);
}
void DecorationShadowTest::testSizes()
{
using namespace KDecoration3;
DecorationShadow shadow;
QFETCH(QByteArray, propertyName);
const int propertyIndex = shadow.metaObject()->indexOfProperty(propertyName.constData());
QVERIFY(propertyIndex != -1);
QMetaProperty metaProperty = shadow.metaObject()->property(propertyIndex);
QCOMPARE(metaProperty.isReadable(), true);
QCOMPARE(metaProperty.hasNotifySignal(), true);
QSignalSpy changedSpy(&shadow, &KDecoration3::DecorationShadow::innerShadowRectChanged);
QVERIFY(changedSpy.isValid());
QCOMPARE(shadow.innerShadowRect(), QRectF());
QCOMPARE(shadow.property(propertyName.constData()).isValid(), true);
QCOMPARE(shadow.property(propertyName.constData()).toRectF(), QRectF());
QFETCH(QRect, innerShadowRect);
QFETCH(QRect, shadowRect);
QFETCH(QSize, shadowSize);
shadow.setInnerShadowRect(innerShadowRect);
QCOMPARE(shadow.innerShadowRect(), innerShadowRect);
// property should still be invalid as the image is not yet set
QCOMPARE(shadow.property(propertyName.constData()).toRectF(), QRectF());
shadow.setShadow(QImage(shadowSize, QImage::Format_ARGB32));
QCOMPARE(shadow.property(propertyName.constData()).toRectF(), shadowRect);
QCOMPARE(changedSpy.count(), 1);
// trying to set to same value shouldn't emit the signal
shadow.setInnerShadowRect(innerShadowRect);
QCOMPARE(shadow.property(propertyName.constData()).toRectF(), shadowRect);
QCOMPARE(changedSpy.count(), 1);
// changing to different value should emit signal
shadow.setInnerShadowRect(innerShadowRect.adjusted(1, 1, 1, 1));
QCOMPARE(changedSpy.count(), 2);
QCOMPARE(shadow.innerShadowRect(), innerShadowRect.adjusted(1, 1, 1, 1));
}
QTEST_MAIN(DecorationShadowTest)
#include "shadowtest.moc"
@@ -0,0 +1,35 @@
# Renames
The `KDecoration2` library and namespace were renamed to `KDecoration3`.
`DecoratedClient` was renamed to `DecoratedWindow`
`Decoration::client()` was renamed to `Decoration::window()`
# Fractional scaling
All geometry has been switched from integer logical units to floating point logical units, which are snapped to the pixel grid.
The pixel grid is defined by the scale factor of the window — in logical coordinates, each pixel is `1.0 / window()->scale()` large.
A naive port that should make things work the same as before is to just round all geometry from the API to integers. However, to make fractional scaling work well, the decoration must snap all geometry values to the pixel grid.
Currently, that only affects the border sizes, which you can snap to the pixel grid with `KDecoration3::snapToPixelGrid(value, scale)` from the `KDecoration3/scalehelpers.h` header. Note that this *may* end up snapping the value towards zero with scale factors below 100%; if you want to prevent that, take the maximum of that and the size of a single pixel: `std::max(KDecoration3::snapToPixelGrid(value, scale), KDecoration3::pixelSize(scale))`.
The fractional parts of geometry and the scale factor have to be taken into account when painting as well.
QPainter automatically applies scaling for you on its own, but it doesn't do a great job at it. To make it paint without blurriness or cut off parts, you need to:
1. avoid integer versions of QPainter methods. More specifically, watch out for `QPainter::setClipRect(int, int, int, int)`, as it silently clips floating point numbers. Instead, use `QPainter::setClipRect(QRectF(...))`
2. adjust the size and position of lines to be snapped to the pixel grid
For example, to paint a 1px wide outline for the title bar, you can't just do
```
painter->setClipRect(titleBarRect.x(), titleBarRect.y(), titleBarRect.width(), titleBarRect.height(), Qt::IntersectClip)
painter->setBrush(QPen(QColor::red, 1));
painter->paintRect(rect());
```
because QPainter paints the line *around* the window rather than in the outermost pixels, and applies anti-aliasing on top of that. Instead, do
```
painter->setClipRect(titleBarRect, Qt::IntersectClip);
const qreal width = KDecoration3::pixelSize(window()->scale());
painter->setBrush(QPen(QColor::red, width));
painter->paintRect(rect().adjusted(width / 2, width / 2, -width / 2, -width / 2));
```
# Reacting to scale changes
When the `nextScale` of the decorated window changes, the decoration needs to update the border sizes with values that are snapped to the new scale, or there may be gaps between the window content and the decoration.
@@ -0,0 +1,18 @@
maintainer: graesslin
fancyname: KDecoration3
description: Plugin based library to create window decorations.
irc: kwin
mailinglist: kwin
type: integration
platforms:
- name: Linux
- name: FreeBSD
portingAid: false
deprecated: false
release: false
libraries:
- cmake: KDecoration3::KDecoration
cmakename: KDecoration3
group: plasma
public_lib: true
@@ -0,0 +1,93 @@
# Copyright (C) YEAR This file is copyright:
# This file is distributed under the same license as the kdecoration package.
#
# Zayed Al-Saidi <zayed.alsaidi@gmail.com>, 2023.
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2023-03-16 12:41+0400\n"
"Last-Translator: Zayed Al-Saidi <zayed.alsaidi@gmail.com>\n"
"Language-Team: ar\n"
"Language: ar\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "إجراءات أكثر لهذه النافذة"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "قائمة التّطبيق"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "على سطح مكتب واحد"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "على كلّ أسطح المكتب"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "صغّر"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "استعد"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "كبّر"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "أغلق"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "مساعدة السياقية"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "ألغ التظليل"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "ظلل"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "لا تبقها أسفل النوافذ الأخرى"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "أبقها أسفل النوافذ الأخرى"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "لا تبقها أعلى النوافذ الأخرى"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "أبقها أعلى النوافذ الأخرى"
@@ -0,0 +1,93 @@
# Copyright (C) YEAR This file is copyright:
# This file is distributed under the same license as the kdecoration package.
#
# Enol P. <enolp@softastur.org>, 2023.
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2023-05-03 23:37+0200\n"
"Last-Translator: Enol P. <enolp@softastur.org>\n"
"Language-Team: \n"
"Language: ast\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Lokalize 23.04.0\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr ""
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr ""
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr ""
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr ""
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr ""
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr ""
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr ""
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr ""
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr ""
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr ""
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr ""
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr ""
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr ""
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr ""
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr ""
@@ -0,0 +1,102 @@
# Copyright (C) YEAR This file is copyright:
# This file is distributed under the same license as the kdecoration package.
#
# Xəyyam Qocayev <xxmn77@gmail.com>, 2020, 2021, 2022.
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2022-07-03 13:56+0400\n"
"Last-Translator: Kheyyam <xxmn77@gmail.com>\n"
"Language-Team: Azerbaijani <kde-i18n-doc@kde.org>\n"
"Language: az\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Lokalize 22.04.2\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Bu pəncərə üçün daha çox əməllər"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Tətbiq menyusu"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "İş masasında"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "Bütün İş Masalarında"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Kiçiltmək"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Bərpa etmək"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Tam açmaq"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Bağlamaq"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Uyğun kömək"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Kölgəsiz"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Kölgə"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Digər pəncərələrin altında tutmamaq"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Digər pəncərələrin altında tutmaq"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Digər pəncərələrin üzərində tutmamaq"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Digər pəncərələrin üzərində tutmaq"
#~ msgid "Menu"
#~ msgstr "Menyu"
#~ msgid "Keep below"
#~ msgstr "Aşağıda tutmaq"
#~ msgid "Keep above"
#~ msgstr "Yuxarıda tutmaq"
@@ -0,0 +1,93 @@
# Copyright (C) YEAR This file is copyright:
# This file is distributed under the same license as the kdecoration package.
#
# Mincho Kondarev <mkondarev@yahoo.de>, 2022.
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2022-05-20 19:35+0200\n"
"Last-Translator: Mincho Kondarev <mkondarev@yahoo.de>\n"
"Language-Team: Bulgarian <kde-i18n-doc@kde.org>\n"
"Language: bg\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Lokalize 22.04.0\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Допълнителни действия за този прозорец"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Меню на приложение"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "На един работен плот"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "На всички работни плотове"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Минимизиране"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Възстановяване"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Максимизиране"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Затваряне"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Контекстна помощ"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Разгъване"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Сгъване"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Без задържане под другите прозорци"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Задържане под другите прозорците"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Без задържане над другите прозорци"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Задържане над другите прозорци"
@@ -0,0 +1,98 @@
# Translation of kdecoration.po to Catalan
# Copyright (C) 2018-2021 This_file_is_part_of_KDE
# This file is distributed under the license LGPL version 2.1 or
# version 3 or later versions approved by the membership of KDE e.V.
#
# Josep M. Ferrer <txemaq@gmail.com>, 2018.
# Empar Montoro Martín <montoro_mde@gva.es>, 2019.
# Antoni Bella Pérez <antonibella5@yahoo.com>, 2021.
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2021-05-05 16:55+0200\n"
"Last-Translator: Antoni Bella Pérez <antonibella5@yahoo.com>\n"
"Language-Team: Catalan <kde-i18n-ca@kde.org>\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Lokalize 20.12.3\n"
"X-Accelerator-Marker: &\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Més accions per a aquesta finestra"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Menú d'aplicacions"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "A un escriptori"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "A tots els escriptoris"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Minimitza"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Restaura"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Maximitza"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Tanca"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Ajuda contextual"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Desplega"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Plega"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "No mantinguis per sota de les altres finestres"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Mantén per sota de les altres finestres"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "No mantinguis al damunt de les altres finestres"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Mantén al damunt de les altres finestres"
@@ -0,0 +1,98 @@
# Translation of kdecoration.po to Catalan (Valencian)
# Copyright (C) 2018-2021 This_file_is_part_of_KDE
# This file is distributed under the license LGPL version 2.1 or
# version 3 or later versions approved by the membership of KDE e.V.
#
# Josep M. Ferrer <txemaq@gmail.com>, 2018.
# Empar Montoro Martín <montoro_mde@gva.es>, 2019.
# Antoni Bella Pérez <antonibella5@yahoo.com>, 2021.
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2021-05-05 16:55+0200\n"
"Last-Translator: Antoni Bella Pérez <antonibella5@yahoo.com>\n"
"Language-Team: Catalan <kde-i18n-ca@kde.org>\n"
"Language: ca@valencia\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Lokalize 20.12.3\n"
"X-Accelerator-Marker: &\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Més accions per a esta finestra"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Menú d'aplicacions"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "A un escriptori"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "A tots els escriptoris"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Minimitza"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Restaura"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Maximitza"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Tanca"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Ajuda contextual"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Desplega"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Plega"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "No mantinges per davall de les altres finestres"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Mantín per davall de les altres finestres"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "No mantinges al damunt de les altres finestres"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Mantín al damunt de les altres finestres"
@@ -0,0 +1,93 @@
# Copyright (C) YEAR This_file_is_part_of_KDE
# This file is distributed under the same license as the PACKAGE package.
# Vit Pelcak <vit@pelcak.org>, 2018, 2020, 2021.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2021-05-13 13:38+0200\n"
"Last-Translator: Vit Pelcak <vpelcak@suse.cz>\n"
"Language-Team: Czech <kde-i18n-doc@kde.org>\n"
"Language: cs\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
"X-Generator: Lokalize 21.04.0\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Více činností pro toto okno"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Nabídka aplikací"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "Na pracovní ploše"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "Na všech plochách"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Minimalizovat"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Obnovit"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Maximalizovat"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Zavřít"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Kontextová nápověda"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Rozbalit"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Sbalit"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Neponechat pod ostatními okny"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Ponechat pod ostatními okny"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Neponechat nad jinými okny"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Podržet nad jinými okny"
@@ -0,0 +1,104 @@
# Copyright (C) YEAR This_file_is_part_of_KDE
# This file is distributed under the same license as the PACKAGE package.
#
# Martin Schlander <mschlander@opensuse.org>, 2018, 2019.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2019-05-07 13:23+0100\n"
"Last-Translator: Martin Schlander <mschlander@opensuse.org>\n"
"Language-Team: Danish <kde-i18n-doc@kde.org>\n"
"Language: da\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Lokalize 2.0\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr ""
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Programmenu"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "På et skrivebord"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "På alle skriveborde"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Minimér"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Genskab"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Maksimér"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Luk"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Sammenhængsafhængig hjælp"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Skyg ikke"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Skyg"
#: decorationbutton.cpp:329
#, fuzzy, kde-format
#| msgid "Don't keep below"
msgid "Don't keep below other windows"
msgstr "Hold ikke under"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr ""
#: decorationbutton.cpp:334
#, fuzzy, kde-format
#| msgid "Don't keep above"
msgid "Don't keep above other windows"
msgstr "Hold ikke over"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr ""
#~ msgid "Menu"
#~ msgstr "Menu"
#~ msgid "Keep below"
#~ msgstr "Hold under"
#~ msgid "Keep above"
#~ msgstr "Hold over"
@@ -0,0 +1,102 @@
# Copyright (C) YEAR This_file_is_part_of_KDE
# This file is distributed under the same license as the PACKAGE package.
#
# Frederik Schwarzer <schwarzer@kde.org>, 2018.
# Burkhard Lück <lueck@hube-lueck.de>, 2018, 2021.
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2021-05-05 05:59+0200\n"
"Last-Translator: Burkhard Lück <lueck@hube-lueck.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Weitere Aktionen für dieses Fenster"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Anwendungsmenü"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "Auf einer Arbeitsfläche"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "Auf allen Arbeitsflächen"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Minimieren"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Wiederherstellen"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Maximieren"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Schließen"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Kontexthilfe"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Einrollen rückgängig"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Einrollen"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Nicht hinter anderen Fenstern halten"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Fenster im Hintergrund halten"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Nicht vor anderen Fenstern halten"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Fenster im Vordergrund halten"
#~ msgid "Menu"
#~ msgstr "Menü"
#~ msgid "Keep below"
#~ msgstr "Im Hintergrund halten"
#~ msgid "Keep above"
#~ msgstr "Im Vordergrund halten"
@@ -0,0 +1,102 @@
# Copyright (C) YEAR This file is copyright:
# This file is distributed under the same license as the kdecoration package.
#
# Stelios <sstavra@gmail.com>, 2020, 2021.
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2021-06-14 16:27+0300\n"
"Last-Translator: Stelios <sstavra@gmail.com>\n"
"Language-Team: Greek <kde-i18n-el@kde.org>\n"
"Language: el\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Lokalize 20.04.2\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Περισσότερες ενέργειες για αυτό το παράθυρο"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Μενού εφαρμογής"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "Σε μία επιφάνεια εργασίας"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "Σε όλες τις επιφάνειες εργασίας"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Ελαχιστοποίηση"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Επαναφορά"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Μεγιστοποίηση"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Κλείσιμο"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Βοήθεια στο κείμενο"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Αναίρεση σκίασης"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Σκίαση"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Να μη μείνει κάτω από άλλα παράθυρα"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Να μείνει κάτω από άλλα παράθυρα"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Να μη μείνει πάνω από άλλα παράθυρα"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Να μείνει πάνω από άλλα παράθυρα"
#~ msgid "Menu"
#~ msgstr "Μενού"
#~ msgid "Keep below"
#~ msgstr "Να μείνει από κάτω"
#~ msgid "Keep above"
#~ msgstr "Να μείνει από πάνω"
@@ -0,0 +1,102 @@
# Copyright (C) YEAR This_file_is_part_of_KDE
# This file is distributed under the same license as the PACKAGE package.
#
# Steve Allewell <steve.allewell@gmail.com>, 2018, 2021.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2021-06-12 14:20+0100\n"
"Last-Translator: Steve Allewell <steve.allewell@gmail.com>\n"
"Language-Team: British English <kde-l10n-en_gb@kde.org>\n"
"Language: en_GB\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Lokalize 21.04.1\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "More actions for this window"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Application menu"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "On one desktop"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "On all desktops"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Minimise"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Restore"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Maximise"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Close"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Context help"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Unshade"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Shade"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Do not keep below other windows"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Keep below other windows"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Do not keep above other windows"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Keep above other windows"
#~ msgid "Menu"
#~ msgstr "Menu"
#~ msgid "Keep below"
#~ msgstr "Keep below"
#~ msgid "Keep above"
#~ msgstr "Keep above"
@@ -0,0 +1,92 @@
# translation of kdecoration.pot to Esperanto
# Copyright (C) 2017 Free Software Foundation, Inc.
# Oliver Kellogg <olivermkellogg@gmail.com>, 2023.
#
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2023-04-28 23:02+0100\n"
"Last-Translator: Oliver Kellogg <olivermkellogg@gmail.com>\n"
"Language-Team: Esperanto <kde-i18n-eo@kde.org>\n"
"Language: eo\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Pliaj agoj por ĉi tiu fenestro"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Aplikaĵa menuo"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "Sur unu labortablo"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "Sur ĉiuj labortabloj"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Minimumigi"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Restaŭri"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Maksimumigi"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Fermi"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Kunteksta helpo"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Malombrigi"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Ombrigi"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Ne teni sub aliaj fenestroj"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Teni sub aliaj fenestroj"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Ne teni super aliaj fenestroj"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Teni super aliaj fenestroj"
@@ -0,0 +1,104 @@
# Spanish translations for kdecoration.po package.
# Copyright (C) 2018 This_file_is_part_of_KDE
# This file is distributed under the same license as the PACKAGE package.
#
# Automatically generated, 2018.
# Eloy Cuadra <ecuadra@eloihr.net>, 2018, 2021.
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2021-05-05 12:13+0200\n"
"Last-Translator: Eloy Cuadra <ecuadra@eloihr.net>\n"
"Language-Team: Spanish <kde-l10n-es@kde.org>\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Lokalize 21.04.0\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Más acciones para esta ventana"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Menú de la aplicación"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "En un escritorio"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "En todos los escritorios"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Minimizar"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Restaurar"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Maximizar"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Cerrar"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Ayuda de contexto"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Desenrollar"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Enrollar"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "No mantener por debajo de otras ventanas"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Mantener por debajo de otras ventanas"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "No mantener por encima de otras ventanas"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Mantener por encima de otras ventanas"
#~ msgid "Menu"
#~ msgstr "Menú"
#~ msgid "Keep below"
#~ msgstr "Mantener por debajo"
#~ msgid "Keep above"
#~ msgstr "Mantener por encima"
@@ -0,0 +1,104 @@
# Copyright (C) YEAR This file is copyright:
# This file is distributed under the same license as the kdecoration package.
#
# Marek Laane <qiilaq69@gmail.com>, 2019.
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2019-11-08 21:30+0200\n"
"Last-Translator: Marek Laane <qiilaq69@gmail.com>\n"
"Language-Team: Estonian <kde-et@lists.linux.ee>\n"
"Language: et\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Lokalize 19.08.1\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr ""
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Rakenduste menüü"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "Ühel töölaual"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "Kõigil töölaudadel"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Minimeeri"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Taasta"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Maksimeeri"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Sulge"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Kontekstiabi"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Keri lahti"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Keri kokku"
#: decorationbutton.cpp:329
#, fuzzy, kde-format
#| msgid "Don't keep below"
msgid "Don't keep below other windows"
msgstr "Ära hoia teiste all"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr ""
#: decorationbutton.cpp:334
#, fuzzy, kde-format
#| msgid "Don't keep above"
msgid "Don't keep above other windows"
msgstr "Ära hoia teiste peal"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr ""
#~ msgid "Menu"
#~ msgstr "Menüü"
#~ msgid "Keep below"
#~ msgstr "Hoia teiste all"
#~ msgid "Keep above"
#~ msgstr "Hoia teiste peal"
@@ -0,0 +1,106 @@
# Translation for kdecoration.po to Euskara/Basque (eu).
# Copyright (C) 2018, Free Software Foundation, Inc.
# Copyright (C) 2019-2021, This file is copyright:
# This file is distributed under the same license as kdecoration package.
# KDE euskaratzeko proiektuko arduraduna <xalba@ni.eus>.
#
# Translators:
# Iñigo Salvador Azurmendi <xalba@ni.eus>, 2018, 2021.
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2021-07-26 19:57+0200\n"
"Last-Translator: Iñigo Salvador Azurmendi <xalba@ni.eus>\n"
"Language-Team: Basque <kde-i18n-eu@kde.org>\n"
"Language: eu\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Lokalize 21.04.3\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Leiho honetarako ekintza gehiago"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Aplikazio-menua"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "Mahaigain bakarrean"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "Mahaigain guztietan"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Minimizatu"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Lehengoratu"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Maximizatu"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Itxi"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Testuinguru-laguntza"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Zabaldu"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Bildu"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Ez eutsi beste leihoen azpian"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Eutsi beste leihoen azpian"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Ez eutsi beste leihoen gainean"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Eutsi beste leiho batzuen gainean"
#~ msgid "Menu"
#~ msgstr "Menua"
#~ msgid "Keep below"
#~ msgstr "Egon azpian"
#~ msgid "Keep above"
#~ msgstr "Egon gainean"
@@ -0,0 +1,101 @@
# Copyright (C) YEAR This_file_is_part_of_KDE
# This file is distributed under the same license as the PACKAGE package.
# Tommi Nieminen <translator@legisign.org>, 2018, 2021.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2021-05-07 11:01+0300\n"
"Last-Translator: Tommi Nieminen <translator@legisign.org>\n"
"Language-Team: Finnish <kde-i18n-doc@kde.org>\n"
"Language: fi\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Lisää toimintoja tälle ikkunalle"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Sovellusvalikko"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "Yhdellä työpöydällä"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "Kaikilla työpöydillä"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Pienennä"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Palauta"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Suurenna"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Sulje"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Kontekstiohje"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Avaa rullaus"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Rullaa"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Älä pidä muiden ikkunoiden alla"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Pidä muiden ikkunoiden alla"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Älä pidä muiden ikkunoiden yllä"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Pidä muiden ikkunoiden yllä"
#~ msgid "Menu"
#~ msgstr "Valikko"
#~ msgid "Keep below"
#~ msgstr "Pidä alinna"
#~ msgid "Keep above"
#~ msgstr "Pidä ylinnä"
@@ -0,0 +1,103 @@
# Yoann Laissus <yoann.laissus@gmail.com>, 2018.
# Xavier Besnard <xavier.besnard@kde.org>, 2021.
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2021-05-05 13:56+0200\n"
"Last-Translator: Xavier Besnard <xavier.besnard@neuf.fr>\n"
"Language-Team: French <kde-francophone@kde.org>\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Lokalize 21.04.0\n"
"X-Environment: kde\n"
"X-Accelerator-Marker: &\n"
"X-Text-Markup: kde4\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Plus d'actions pour cette fenêtre"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Menu d'application"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "Sur un seul bureau"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "Sur tous les bureaux"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Minimiser"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Restaurer"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Maximiser"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Fermer"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Aide contextuelle"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Enlever l'ombrage"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Ombre"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Ne pas conserver en dessous des autres fenêtres"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Conserver en dessous des autres fenêtres"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Ne pas conserver en dessus des autres fenêtres"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Conserver en dessus des autres fenêtres"
#~ msgid "Menu"
#~ msgstr "Menu"
#~ msgid "Keep below"
#~ msgstr "Conserver au-dessous "
#~ msgid "Keep above"
#~ msgstr "Conserver au-dessus "
@@ -0,0 +1,102 @@
# Copyright (C) YEAR This_file_is_part_of_KDE
# This file is distributed under the same license as the PACKAGE package.
# Adrián Chaves (Gallaecio) <adrian@chaves.io>, 2018, 2019, 2023.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2023-04-28 17:26+0200\n"
"Last-Translator: Adrián Chaves (Gallaecio) <adrian@chaves.io>\n"
"Language-Team: Galician <proxecto@trasno.gal>\n"
"Language: gl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Lokalize 23.04.0\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Máis accións para esta xanela"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Menú das aplicacións"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "Nun escritorio"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "En todos os escritorios"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Minimizar"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Restaurar"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Maximizar"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Pechar"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Axuda contextual"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Desenrolar"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Enrolar"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Non manter debaixo doutras xanelas"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Manter debaixo doutras xanelas"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Non manter enriba doutras xanelas"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Manter enriba doutras xanelas"
#~ msgid "Menu"
#~ msgstr "Menú"
#~ msgid "Keep below"
#~ msgstr "Manter debaixo"
#~ msgid "Keep above"
#~ msgstr "Manter enriba"
@@ -0,0 +1,94 @@
# Copyright (C) 2024 This file is copyright:
# This file is distributed under the same license as the kdecoration package.
#
# SPDX-FileCopyrightText: 2024 Yaron Shahrabani <sh.yaron@gmail.com>
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2024-03-19 08:16+0200\n"
"Last-Translator: Yaron Shahrabani <sh.yaron@gmail.com>\n"
"Language-Team: צוות התרגום של KDE ישראל\n"
"Language: he\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=4; plural=(n == 1) ? 0 : ((n == 2) ? 1 : ((n > 10 && "
"n % 10 == 0) ? 2 : 3));\n"
"X-Generator: Lokalize 23.08.5\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "פעולות נוספות לחלון הזה"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "תפריט היישום"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "בשולחן עבודה אחד"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "בכל שולחנות העבודה"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "מזעור"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "שחזור"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "הגדלה"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "סגירה"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "עזרה לפי הקשר"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "ביטול הצללה"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "הצללה"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "לא להסתיר מאחורי חלונות אחרים"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "להסתיר מאחורי חלונות אחרים"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "לא לקדם מעל חלונות אחרים"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "לקדם מעל חלונות אחרים"
@@ -0,0 +1,97 @@
# Copyright (C) YEAR This file is copyright:
# This file is distributed under the same license as the kdecoration package.
#
# Sameer Singh <lumarzeli30@gmail.com>, 2021.
# Raghavendra Kamath <raghu@raghukamath.com>, 2021.
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2021-06-29 17:56+0530\n"
"Last-Translator: Raghavendra Kamath <raghu@raghukamath.com>\n"
"Language-Team: kde-hindi\n"
"Language: hi\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n"
"X-Generator: Lokalize 21.04.2\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "इस विंडो के लिए और क्रियाएँ"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "अनुप्रयोग मेन्यू"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "एक डेस्कटॉप पर"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "सभी डेस्कटॉप पर"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "न्यूनतम"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "पुरानी स्तिथी में लाऐं"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "अधिकतम"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "बंद करें"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "प्रासंगिक सहायता"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "छाया हटाएँ"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "छाया"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "अन्य विंडो के नीचे न रखें"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "अन्य विंडो के नीचे रखें"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "अन्य विंडो के ऊपर न रखें"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "अन्य विंडो के ऊपर रखें"
#~ msgid "Menu"
#~ msgstr "मेन्यू"
@@ -0,0 +1,103 @@
# Copyright (C) YEAR This file is copyright:
# This file is distributed under the same license as the kdecoration package.
#
# Kristóf Kiszel <ulysses@kubuntu.org>, 2019.
# Kristof Kiszel <ulysses@fsf.hu>, 2021.
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2021-11-24 13:23+0100\n"
"Last-Translator: Kristof Kiszel <ulysses@fsf.hu>\n"
"Language-Team: Hungarian <kde-l10n-hu@kde.org>\n"
"Language: hu\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Lokalize 21.08.3\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "További műveletek"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Alkalmazásmenü"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "Egy asztalon"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "Az összes asztalra"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Minimalizálás"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Visszaállítás"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Maximalizálás"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Bezárás"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Helyi súgó"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Világosítás"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Árnyékolás"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Ne maradjon más ablakok alatt"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Maradjon más ablakok alatt"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Ne maradjon más ablakok fölött"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Maradjon más ablakok fölött"
#~ msgid "Menu"
#~ msgstr "Menü"
#~ msgid "Keep below"
#~ msgstr "Mindig alul"
#~ msgid "Keep above"
#~ msgstr "Mindig felül"
@@ -0,0 +1,102 @@
# Copyright (C) YEAR This file is copyright:
# This file is distributed under the same license as the kdecoration package.
#
# Giovanni Sora <g.sora@tiscali.it>, 2019, 2020, 2021.
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2021-05-11 23:13+0100\n"
"Last-Translator: Giovanni Sora <g.sora@tiscali.it>\n"
"Language-Team: Interlingua <kde-i18n-doc@kde.org>\n"
"Language: ia\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Lokalize 2.0\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Altere actiones per iste fenestra"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Menu de application"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "Sur un scriptorio"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "Super omne scriptorios"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Minimisa"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Restabili"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Maximiza"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Claude"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Adjuta de contexto"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "De-Umbra"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Umbra"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Non mantene infra altere fenestras"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Mantene infra altere fenestras"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Non mantene supra altere fenestras"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Mantene supra altere fenestras"
#~ msgid "Menu"
#~ msgstr "Menu"
#~ msgid "Keep below"
#~ msgstr "Mantene infra"
#~ msgid "Keep above"
#~ msgstr "Mantene supra"
@@ -0,0 +1,103 @@
# Copyright (C) YEAR This_file_is_part_of_KDE
# This file is distributed under the same license as the PACKAGE package.
# Wantoyo <wantoyek@gmail.com>, 2018, 2019, 2022.
# Aziz Adam Adrian <4.adam.adrian@gmail.com>, 2022.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2022-09-27 17:54+0700\n"
"Last-Translator: Wantoyèk <wantoyek@gmail.com>\n"
"Language-Team: Indonesian <kde-i18n-doc@kde.org>\n"
"Language: id\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Lokalize 21.12.3\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Aksi selebihnya untuk jendela ini"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Menu aplikasi"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "Pada satu desktop"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "Pada semua desktop"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Minimalkan"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Kembalikan"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Maksimalkan"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Tutup"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Bantuan konteks"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Tak bertirai"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Tiraikan"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Jangan tetap di bawah jendela lainnya"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Tetap di bawah jendela lainnya"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Jangan tetap di atas jendela lainnya"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Tetap di atas jendela lainnya"
#~ msgid "Menu"
#~ msgstr "Menu"
#~ msgid "Keep below"
#~ msgstr "Tetap di bawah"
#~ msgid "Keep above"
#~ msgstr "Tetap di atas"
@@ -0,0 +1,94 @@
# Copyright (C) 2024 This file is copyright:
# This file is distributed under the same license as the kdecoration package.
#
# Sveinn í Felli <sv1@fellsnet.is>, 2023.
# SPDX-FileCopyrightText: 2024 Guðmundur Erlingsson <gudmundure@gmail.com>
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2024-03-25 13:52+0000\n"
"Last-Translator: Guðmundur Erlingsson <gudmundure@gmail.com>\n"
"Language-Team: Icelandic <kde-i18n-doc@kde.org>\n"
"Language: is\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Lokalize 23.08.3\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Fleiri aðgerðir fyrir þennan glugga"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Forritavalmynd"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "Á einu skjáborði"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "Á öllum skjáborðum"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Fela"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Endurheimta"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Fullstækka"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Loka"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Samhengishjálp"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Rúlla niður"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Rúlla upp"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Ekki hafa undir öðrum gluggum"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Hafa undir öðrum gluggum"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Ekki hafa yfir öðrum gluggum"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Hafa yfir öðrum gluggum"
@@ -0,0 +1,102 @@
# Copyright (C) YEAR This_file_is_part_of_KDE
# This file is distributed under the same license as the kdecoration package.
# Paolo Zamponi <feus73@gmail.com>, 2018, 2021.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2021-05-12 08:49+0200\n"
"Last-Translator: Paolo Zamponi <zapaolo@email.it>\n"
"Language-Team: Italian <kde-i18n-it@kde.org>\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Lokalize 21.04.0\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Altre azioni per questa finestra"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Menu dell'applicazione"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "Su un desktop"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "Su tutti i desktop"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Minimizza"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Ripristina"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Massimizza"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Chiudi"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Aiuto contestuale"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Srotola"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Arrotola"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Non tenere sotto le altre finestre"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Tieni sotto le altre finestre"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Non tenere sopra le altre finestre"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Tieni sopra le altre finestre"
#~ msgid "Menu"
#~ msgstr "Menu"
#~ msgid "Keep below"
#~ msgstr "Tieni sotto"
#~ msgid "Keep above"
#~ msgstr "Tieni sopra"
@@ -0,0 +1,93 @@
# Tomohiro Hyakutake <tomhioo@outlook.jp>, 2019.
# Ryuichi Yamada <ryuichi_ya220@outlook.jp>, 2023.
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2023-05-18 00:36+0900\n"
"Last-Translator: Ryuichi Yamada <ryuichi_ya220@outlook.jp>\n"
"Language-Team: Japanese <kde-jp@kde.org>\n"
"Language: ja\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Accelerator-Marker: &\n"
"X-Text-Markup: kde4\n"
"X-Generator: Lokalize 23.04.0\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "このウィンドウに対するその他のアクション"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "アプリケーションメニュー"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "一つのデスクトップに表示"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "すべてのデスクトップに表示"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "最小化"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "復元"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "最大化"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "閉じる"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "コンテキストヘルプ"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "シェード解除"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "シェード"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "他のウィンドウの下に保持しない"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "他のウィンドウより下に表示"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "他のウィンドウの上に保持しない"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "他のウィンドウより上に表示"
@@ -0,0 +1,94 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR This file is copyright:
# This file is distributed under the same license as the kdecoration package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2022-05-21 14:43+0200\n"
"Last-Translator: Temuri Doghonadze <temuri.doghonadze@gmail.com>\n"
"Language-Team: Georgian <kde-i18n-doc@kde.org>\n"
"Language: ka\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.0.1\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "მეტი ქმედება ამ ფანჯრისთვის"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "პროგრამის მენიუ"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "1 სამუშაო მაგიდაზე"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "ყველა სამუშაო მაგიდაზე"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "ჩაკეცვა"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "აღდგენა"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "გადიდება"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "დახურვა"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "კონტექსტური დახმარება"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "განჩრდილვა"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "დაჩრდილვა"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "დანარჩენი ფანჯრების ქვემოთ ქონის გამორთვა"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "დანარჩენი ფანჯრების ქვემოთ ქონა"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "დანარჩენი ფანჯრების ზემოთ ქონის გამორთვა"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "დანარჩენი ფანჯრების ზემოთ ქონა"
@@ -0,0 +1,102 @@
# Copyright (C) YEAR This_file_is_part_of_KDE
# This file is distributed under the same license as the PACKAGE package.
# Shinjo Park <kde@peremen.name>, 2018, 2020, 2021.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2021-05-16 21:48+0200\n"
"Last-Translator: Shinjo Park <kde@peremen.name>\n"
"Language-Team: Korean <kde-kr@kde.org>\n"
"Language: ko\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Lokalize 20.12.3\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "이 창의 더 많은 동작"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "앱 메뉴"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "한 바탕 화면에만"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "모든 바탕 화면에 두기"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "최소화"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "복원"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "최대화"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "닫기"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "문맥 도움말"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "풀어 내리기"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "말아 올리기"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "다른 창 아래에 두지 않기"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "다른 창 아래에 두기"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "다른 창 위에 두지 않기"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "다른 창 위에 두기"
#~ msgid "Menu"
#~ msgstr "메뉴"
#~ msgid "Keep below"
#~ msgstr "항상 아래에 두기"
#~ msgid "Keep above"
#~ msgstr "항상 위에 두기"
@@ -0,0 +1,104 @@
# Lithuanian translations for kdecoration package.
# Copyright (C) 2019 This file is copyright:
# This file is distributed under the same license as the kdecoration package.
# Automatically generated, 2019.
#
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2021-06-15 22:43+0300\n"
"Last-Translator: Moo\n"
"Language-Team: lt\n"
"Language: lt\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : n%10>=2 && (n%100<10 || n"
"%100>=20) ? 1 : n%10==0 || (n%100>10 && n%100<20) ? 2 : 3);\n"
"X-Generator: Poedit 3.0\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Daugiau veiksmų šiam langui"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Programos meniu"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "Viename darbalaukyje"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "Visuose darbalaukiuose"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Suskleisti"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Grąžinti iš suskleidimo"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Išskleisti"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Užverti"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Kontekstinė pagalba"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Rodyti ne tik lango antraštės juostą"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Rodyti tik lango antraštės juostą"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Nelaikyti po kitais langais"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Laikyti po kitais langais"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Nelaikyti virš kitų langų"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Laikyti virš kitų langų"
#~ msgid "Menu"
#~ msgstr "Meniu"
#~ msgid "Keep below"
#~ msgstr "Laikyti apačioje"
#~ msgid "Keep above"
#~ msgstr "Laikyti viršuje"
@@ -0,0 +1,94 @@
# Copyright (C) 2024 This file is copyright:
# This file is distributed under the same license as the kdecoration package.
#
# SPDX-FileCopyrightText: 2024 Toms Trasūns <toms.trasuns@posteo.net>
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2024-01-27 12:55+0200\n"
"Last-Translator: Toms Trasūns <toms.trasuns@posteo.net>\n"
"Language-Team: Latvian <kde-i18n-doc@kde.org>\n"
"Language: lv\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : "
"2);\n"
"X-Generator: Lokalize 23.08.4\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Vairāk darbību šim logam"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Programmas izvēlne"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "Uz vienas darbvirsmas"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "Uz visām darbvirsmām"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Minimizēt"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Atjaunot"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Maksimizēt"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Aizvērt"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Konteksta palīdzība"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Atritināt"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Saritināt"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Neturēt zem citiem logiem"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Turēt zem citiem logiem"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Neturēt virs citiem logiem"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Turēt virs citiem logiem"
@@ -0,0 +1,94 @@
# Malayalam translations for kdecoration package.
# Copyright (C) 2019 This file is copyright:
# This file is distributed under the same license as the kdecoration package.
# Automatically generated, 2019.
#
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2018-08-16 09:14+0200\n"
"Last-Translator: Automatically generated\n"
"Language-Team: Swathanthra|സ്വതന്ത്ര Malayalam|മലയാളം Computing|കമ്പ്യൂട്ടിങ്ങ് <smc."
"org.in>\n"
"Language: ml\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr ""
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr ""
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr ""
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr ""
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr ""
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr ""
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr ""
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr ""
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr ""
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr ""
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr ""
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr ""
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr ""
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr ""
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr ""
@@ -0,0 +1,94 @@
# Translation of kdecoration to Norwegian Bokmål
#
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2025-02-22 07:56+0100\n"
"Last-Translator: Martin Hansen <mh306602@gmail.com>\n"
"Language-Team: Norwegian Bokmål <l10n-no@lister.huftis.org>\n"
"Language: nb\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Lokalize 24.12.2\n"
"X-Environment: kde\n"
"X-Accelerator-Marker: &\n"
"X-Text-Markup: kde4\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Flere handlinger for vinduet"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Programmeny"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "På ett skrivebord"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "På alle skrivebordene"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Minimer"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Gjenopprett"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Maksimer"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Lukk"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Emnehjelp"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Rull ned"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Rull opp"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Ikke hold under andre vinduer"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Hold under andre vinduer"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Ikke hold over andre vinduer"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Hold over andre vinduer"
@@ -0,0 +1,102 @@
# Copyright (C) YEAR This_file_is_part_of_KDE
# This file is distributed under the same license as the PACKAGE package.
#
# Freek de Kruijf <freekdekruijf@kde.nl>, 2018, 2021.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2021-05-05 09:39+0200\n"
"Last-Translator: Freek de Kruijf <freekdekruijf@kde.nl>\n"
"Language-Team: Dutch <kde-i18n-nl@kde.org>\n"
"Language: nl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Lokalize 21.04.0\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Meer acties voor dit venster"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Menu van toepassing"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "Op één bureaublad"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "Op alle bureaubladen"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Minimaliseren"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Herstellen"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Maximaliseren"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Sluiten"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Contexthelp"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Schaduw weghalen"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Oprollen"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Niet onder andere vensters houden"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Onder andere vensters houden"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Niet boven andere vensters houden"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Boven andere vensters houden"
#~ msgid "Menu"
#~ msgstr "Menu"
#~ msgid "Keep below"
#~ msgstr "Altijd op achtergrond"
#~ msgid "Keep above"
#~ msgstr "Altijd op voorgrond"
@@ -0,0 +1,96 @@
# Translation of kdecoration to Norwegian Nynorsk
#
# Karl Ove Hufthammer <karl@huftis.org>, 2018, 2022.
# Øystein Steffensen-Alværvik <oysteins.omsetting@protonmail.com>, 2021.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2022-06-19 13:54+0200\n"
"Last-Translator: Karl Ove Hufthammer <karl@huftis.org>\n"
"Language-Team: Norwegian Nynorsk <l10n-no@lister.huftis.org>\n"
"Language: nn\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Lokalize 22.04.2\n"
"X-Environment: kde\n"
"X-Accelerator-Marker: &\n"
"X-Text-Markup: kde4\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Fleire handlingar for vindauget"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Programmeny"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "På eitt skrivebord"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "På alle skriveborda"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Minimer"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Gjenopprett"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Maksimer"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Lukk"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Emnehjelp"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Rull ned"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Rull opp"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Ikkje hald under andre vindauge"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Hald under andre vindauge"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Ikkje hald over andre vindauge"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Hald over andre vindauge"
@@ -0,0 +1,93 @@
# Copyright (C) YEAR This file is copyright:
# This file is distributed under the same license as the kdecoration package.
#
# A S Alam <aalam@satluj.org>, 2023.
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2023-05-19 20:09-0700\n"
"Last-Translator: A S Alam <aalam@satluj.org>\n"
"Language-Team: Punjabi <kde-i18n-doc@kde.org>\n"
"Language: pa\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Lokalize 23.04.1\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "ਇਸ ਵਿੰਡੋ ਲਈ ਹੋਰ ਕਾਰਵਾਈਆਂ"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "ਐਪਲੀਕੇਸ਼ਨ ਮੇਨੂ"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "ਇੱਕ ਡੈਸਕਟਾਪ ਉੱਤੇ"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "ਸਾਰੇ ਡੈਸਕਟਾਪਾਂ ਉੱਤੇ"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "ਘੱਟੋ-ਘੱਟ"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "ਬਹਾਲ ਕਰੋ"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "ਵੱਧੋ-ਵੱਧ"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "ਬੰਦ ਕਰੋ"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "ਪ੍ਰਸੰਗ ਮਦਦ"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "ਬਿਨਾਂ-ਸ਼ੇਡ"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "ਸ਼ੇਡ"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "ਹੋਰ ਵਿੰਡੋਆਂ ਦੇ ਹੇਠਾਂ ਨਾ ਰੱਖੋ"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "ਹੋਰ ਵਿੰਡੋਆਂ ਦੇ ਹੇਠਾਂ ਰੱਖੋ"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "ਹੋਰ ਵਿੰਡੋਆਂ ਦੇ ਉੱਤੇ ਨਾ ਰੱਖੋ"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "ਹੋਰ ਵਿੰਡੋਆਂ ਦੇ ਉੱਤੇ ਰੱਖੋ"
@@ -0,0 +1,102 @@
# Copyright (C) YEAR This_file_is_part_of_KDE
# This file is distributed under the same license as the PACKAGE package.
#
# Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com>, 2018, 2021.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2021-12-30 13:22+0100\n"
"Last-Translator: Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com>\n"
"Language-Team: Polish <kde-i18n-doc@kde.org>\n"
"Language: pl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2);\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Więcej działań dla tego okna"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Menu programów"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "Na pulpicie"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "Na wszystkich pulpitach"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Zminimalizuj"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Przywróć"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Zmaksymalizuj"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Zamknij"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Pomoc podręczna"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Rozwiń"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Zwiń"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Nie utrzymuj pod innymi oknami"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Utrzymuj pod innymi oknami"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Nie utrzymuj nad innymi oknami"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Utrzymuj nad innymi oknami"
#~ msgid "Menu"
#~ msgstr "Menu"
#~ msgid "Keep below"
#~ msgstr "Zawsze pod spodem"
#~ msgid "Keep above"
#~ msgstr "Zawsze na wierzchu"
@@ -0,0 +1,88 @@
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2021-05-06 16:43+0100\n"
"Last-Translator: José Nuno Coelho Pires <zepires@gmail.com>\n"
"Language-Team: Portuguese <kde-i18n-pt@kde.org>\n"
"Language: pt\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Mais acções para esta janela"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Menu da aplicação"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "Num ecrã"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "Em todos os ecrãs"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Minimizar"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Repor"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Maximizar"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Fechar"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Ajuda de contexto"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Desenrolar"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Enrolar"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Não manter abaixo das outras janelas"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Manter abaixo das outras janelas"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Não manter acima das outras janelas"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Manter acima das outras janelas"
@@ -0,0 +1,102 @@
# Copyright (C) YEAR This_file_is_part_of_KDE
# This file is distributed under the same license as the PACKAGE package.
#
# Luiz Fernando Ranghetti <elchevive@opensuse.org>, 2018, 2021.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2021-05-06 14:05-0300\n"
"Last-Translator: Luiz Fernando Ranghetti <elchevive@opensuse.org>\n"
"Language-Team: Brazilian Portuguese <kde-i18n-pt_BR@kde.org>\n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Lokalize 20.04.2\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Mais ações para esta janela"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Menu do aplicativo"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "Em uma área de trabalho"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "Em todas as áreas de trabalho"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Minimizar"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Restaurar"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Maximizar"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Fechar"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Ajuda de contexto"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Sem sombras"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Sombrear"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Não manter abaixo de outras janelas"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Manter abaixo de outras janelas"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Não manter acima de outras janelas"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Manter acima de outras janelas"
#~ msgid "Menu"
#~ msgstr "Menu"
#~ msgid "Keep below"
#~ msgstr "Manter abaixo"
#~ msgid "Keep above"
#~ msgstr "Manter acima"
@@ -0,0 +1,103 @@
# Copyright (C) YEAR This file is copyright:
# This file is distributed under the same license as the kdecoration package.
# Sergiu Bivol <sergiu@cip.md>, 2020, 2021.
#
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2021-06-02 20:19+0100\n"
"Last-Translator: Sergiu Bivol <sergiu@cip.md>\n"
"Language-Team: Romanian\n"
"Language: ro\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < "
"20)) ? 1 : 2;\n"
"X-Generator: Lokalize 19.12.3\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Acțiuni suplimentare pentru această fereastră"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Meniul aplicației"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "Pe un birou"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "Pe toate birourile"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Minimizează"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Restabilește"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Maximizează"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Închide"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Ajutor contextual"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Desfășoară"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Strânge"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Nu ține sub alte ferestre"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Ține sub alte ferestre"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Nu ține deasupra altor ferestre"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Ține deasupra altor ferestre"
#~ msgid "Menu"
#~ msgstr "Meniu"
#~ msgid "Keep below"
#~ msgstr "Ține dedesubt"
#~ msgid "Keep above"
#~ msgstr "Ține deasupra"
@@ -0,0 +1,104 @@
# Copyright (C) YEAR This_file_is_part_of_KDE
# This file is distributed under the same license as the PACKAGE package.
#
# Alexander Potashev <aspotashev@gmail.com>, 2018.
# Alexander Yavorsky <kekcuha@gmail.com>, 2021.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2021-06-08 16:54+0300\n"
"Last-Translator: Alexander Yavorsky <kekcuha@gmail.com>\n"
"Language-Team: Russian <kde-russian@lists.kde.ru>\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=4; plural=n==1 ? 3 : n%10==1 && n%100!=11 ? 0 : n"
"%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Lokalize 21.04.1\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Дополнительные действия для этого окна"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Меню приложения"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "На одном рабочем столе"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "На всех рабочих столах"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Свернуть"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Восстановить"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Распахнуть"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Закрыть"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Контекстная справка"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Развернуть из заголовка"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Свернуть в заголовок"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Не удерживать ниже других окон"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Удерживать ниже других окон"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Не удерживать поверх других окон"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Удерживать поверх других окон"
#~ msgid "Menu"
#~ msgstr "Меню"
#~ msgid "Keep below"
#~ msgstr "Поддерживать на заднем плане"
#~ msgid "Keep above"
#~ msgstr "Поддерживать поверх других"
@@ -0,0 +1,94 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR This file is copyright:
# This file is distributed under the same license as the kdecoration package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2023-09-27 19:49+0530\n"
"Last-Translator: \n"
"Language-Team: Sanskrit <kde-i18n-doc@kde.org>\n"
"Language: sa\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.3.2\n"
"Plural-Forms: nplurals=2; plural=(n>2);\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "अस्य गवाक्ष कृते अधिकानि क्रियाणि"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "अनुप्रयोग सूचि"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "एकस्मिन् कार्यमुखे"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "सर्वेषु कार्यमुखेषु"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "न्यूनतमं करोतु"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "निर्यत्"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "अधिकतमं कुर्वन्तु"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "निमील्यताम्"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "सन्दर्भ सहाय्यम्"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "अनच्छाया"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "छाया"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "अन्येषां गवाक्षानां अधः न स्थापयन्तु"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "अन्येषां गवाक्षानां अधः स्थापयन्तु"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "अन्येषां गवाक्षानां उपरि न स्थापयन्तु"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "अन्येषां गवाक्षानां उपरि स्थापयन्तु"
@@ -0,0 +1,101 @@
# translation of kdecoration.po Slovak
# Roman Paholík <wizzardsk@gmail.com>, 2018.
# Matej Mrenica <matejm98mthw@gmail.com>, 2019, 2021.
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2021-07-20 17:50+0200\n"
"Last-Translator: Matej Mrenica <matejm98mthw@gmail.com>\n"
"Language-Team: Slovak <kde-i18n-doc@kde.org>\n"
"Language: sk\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Lokalize 21.07.80\n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Viac akcií pre toto okno"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Aplikačná ponuka"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "Na jednej ploche"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "Na všetkých plochách"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Minimalizovať"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Obnoviť"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Maximalizovať"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Zavrieť"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Kontextový pomocník"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Odtieňovať"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Tieňovať"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Nedržať pod ostatnými oknami"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Držať pod ostatnými oknami"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Nedržať nad ostatnými oknami"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Držať nad ostatnými oknami"
#~ msgid "Menu"
#~ msgstr "Ponuka"
#~ msgid "Keep below"
#~ msgstr "Držať pod"
#~ msgid "Keep above"
#~ msgstr "Držať nad"
@@ -0,0 +1,103 @@
# Copyright (C) YEAR This file is copyright:
# This file is distributed under the same license as the kdecoration package.
#
# Matjaž Jeran <matjaz.jeran@amis.net>, 2020, 2021.
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2021-05-08 08:39+0200\n"
"Last-Translator: Matjaž Jeran <matjaz.jeran@amis.net>\n"
"Language-Team: Slovenian <lugos-slo@lugos.si>\n"
"Language: sl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Lokalize 20.12.2\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n"
"%100==4 ? 3 : 0);\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Več dejavnosti za to okno"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Meni aplikacije"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "Na enem namizju"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "Na vseh namizjih"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Strni"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Obnovi"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Razpni"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Zapri"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Kontekstna pomoč"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Odpravi senčenje"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Osenči"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Ne zadržuj pod drugimi okni"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Zadržuj pod drugimi okni"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Ne zadržuj nad drugimi okni"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Zadržuj nad drugimi okni"
#~ msgid "Menu"
#~ msgstr "Meni"
#~ msgid "Keep below"
#~ msgstr "Zadržuj spodaj"
#~ msgid "Keep above"
#~ msgstr "Zadržuj na vrhu"
@@ -0,0 +1,102 @@
# Copyright (C) YEAR This_file_is_part_of_KDE
# This file is distributed under the same license as the PACKAGE package.
#
# Stefan Asserhäll <stefan.asserhall@gmail.com>, 2018, 2021.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2021-05-05 08:09+0200\n"
"Last-Translator: Stefan Asserhäll <stefan.asserhall@gmail.com>\n"
"Language-Team: Swedish <kde-i18n-doc@kde.org>\n"
"Language: sv\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Lokalize 20.08.1\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Fler åtgärder för fönstret"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Programmeny"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "På ett skrivbord"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "På alla skrivbord"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Minimera"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Återställ"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Maximera"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Stäng"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Sammanhangsberoende hjälp"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Rulla ner"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Rulla upp"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Behåll inte under andra fönster"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Behåll under andra fönster"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Behåll inte över andra fönster"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Behåll över andra fönster"
#~ msgid "Menu"
#~ msgstr "Meny"
#~ msgid "Keep below"
#~ msgstr "Behåll under"
#~ msgid "Keep above"
#~ msgstr "Behåll över"
@@ -0,0 +1,93 @@
# Copyright (C) 2024 This file is copyright:
# This file is distributed under the same license as the kdecoration package.
#
# SPDX-FileCopyrightText: 2024 Kishore G <kishore96@gmail.com>
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2024-06-30 12:37+0530\n"
"Last-Translator: Kishore G <kishore96@gmail.com>\n"
"Language-Team: Tamil <kde-i18n-doc@kde.org>\n"
"Language: ta\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Lokalize 24.05.1\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "இச்சாளரத்திற்கான கூடுதல் செயல்கள்"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "செயலி பட்டி"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "ஒரு பணிமேடையில்"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "அனைத்து பணிமேடைகளிலும்"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "ஒதுக்கு"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "மீட்டெடு"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "அதிகபட்ச பெரிதாக்கு"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "மூடு"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "சூழலை பொறுத்த உதவி"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "நிழல்நீக்கு"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "நிழலிடு"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "மற்ற சாளரங்களுக்கு கீழே வைக்க வேண்டாம்"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "மற்ற சாளரங்களுக்கு கீழே வை"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "மற்ற சாளரங்களுக்கு மேலே வைக்க வேண்டாம்"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "மற்ற சாளரங்களுக்கு மேலே வை"
@@ -0,0 +1,93 @@
# Copyright (C) 2024 This file is copyright:
# This file is distributed under the same license as the kdecoration package.
#
# SPDX-FileCopyrightText: 2022, 2023, 2024 Emir SARI <emir_sari@icloud.com>
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2024-06-20 13:53+0300\n"
"Last-Translator: Emir SARI <emir_sari@icloud.com>\n"
"Language-Team: Turkish <kde-l10n-tr@kde.org>\n"
"Language: tr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Lokalize 24.07.70\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Bu pencere için daha fazla eylem"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Uygulama menüsü"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "Bir masaüstünde"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "Tüm masaüstlerinde"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Simge Durumuna Küçült"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Eski Haline Döndür"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Ekranı Kapla"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Kapat"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Bağlam Yardımı"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Panjuru Aç"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Panjuru Kapat"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Diğer pencerelerin altında tutma"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Diğer pencerelerin altında tut"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Diğer pencerelerin üzerinde tutma"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Diğer pencerelerin üzerinde tut"
@@ -0,0 +1,105 @@
# Translation of kdecoration.po to Ukrainian
# Copyright (C) 2018 This_file_is_part_of_KDE
# This file is distributed under the license LGPL version 2.1 or
# version 3 or later versions approved by the membership of KDE e.V.
#
# Yuri Chornoivan <yurchor@ukr.net>, 2018, 2021.
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2021-05-05 08:29+0300\n"
"Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n"
"Language-Team: Ukrainian <kde-i18n-uk@kde.org>\n"
"Language: uk\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=4; plural=n==1 ? 3 : n%10==1 && n%100!=11 ? 0 : n"
"%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Lokalize 20.12.0\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "Додаткові дії для цього вікна"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "Меню програм"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "На одній стільниці"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "На всіх стільницях"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "Мінімізувати"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "Відновити"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "Максимізувати"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "Закрити"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "Контекстна довідка"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "Розгорнути"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "Згорнути"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "Не утримувати під іншими вікнами"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "Утримувати під іншими вікнами"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "Не утримувати над іншими вікнами"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "Утримувати над іншими вікнами"
#~ msgid "Menu"
#~ msgstr "Меню"
#~ msgid "Keep below"
#~ msgstr "Тримати знизу"
#~ msgid "Keep above"
#~ msgstr "Тримати зверху"
@@ -0,0 +1,93 @@
msgid ""
msgstr ""
"Project-Id-Version: kdeorg\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2024-04-22 15:58\n"
"Last-Translator: \n"
"Language-Team: Chinese Simplified\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Crowdin-Project: kdeorg\n"
"X-Crowdin-Project-ID: 269464\n"
"X-Crowdin-Language: zh-CN\n"
"X-Crowdin-File: /kf6-stable/messages/kdecoration/kdecoration.pot\n"
"X-Crowdin-File-ID: 52644\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "此窗口的更多操作"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "应用程序菜单"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "在一个桌面"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "在全部桌面"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "最小化"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "还原"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "最大化"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "关闭"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "相关帮助"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "展开"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "折叠"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "不要保持在其他窗口之下"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "保持在其他窗口之下"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "不要保持在其他窗口之上"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "保持在其他窗口之上"
@@ -0,0 +1,103 @@
# Copyright (C) YEAR This file is copyright:
# This file is distributed under the same license as the kdecoration package.
#
# pan93412 <pan93412@gmail.com>, 2019.
# Kisaragi Hiu <mail@kisaragi-hiu.com>, 2023.
msgid ""
msgstr ""
"Project-Id-Version: kdecoration\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"POT-Creation-Date: 2024-02-10 00:40+0000\n"
"PO-Revision-Date: 2023-02-02 23:03+0900\n"
"Last-Translator: Kisaragi Hiu <mail@kisaragi-hiu.com>\n"
"Language-Team: Traditional Chinese <zh-l10n@linux.org.tw>\n"
"Language: zh_TW\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Lokalize 23.03.70\n"
#: decorationbutton.cpp:303
#, kde-format
msgid "More actions for this window"
msgstr "這個視窗的更多動作"
#: decorationbutton.cpp:305
#, kde-format
msgid "Application menu"
msgstr "應用程式選單"
#: decorationbutton.cpp:308
#, kde-format
msgid "On one desktop"
msgstr "僅在一個桌面上顯示"
#: decorationbutton.cpp:310
#, kde-format
msgid "On all desktops"
msgstr "在所有桌面上顯示"
#: decorationbutton.cpp:312
#, kde-format
msgid "Minimize"
msgstr "最小化"
#: decorationbutton.cpp:315
#, kde-format
msgid "Restore"
msgstr "回復大小"
#: decorationbutton.cpp:317
#, kde-format
msgid "Maximize"
msgstr "最大化"
#: decorationbutton.cpp:319
#, kde-format
msgid "Close"
msgstr "關閉"
#: decorationbutton.cpp:321
#, kde-format
msgid "Context help"
msgstr "內容說明"
#: decorationbutton.cpp:324
#, kde-format
msgid "Unshade"
msgstr "取消收起"
#: decorationbutton.cpp:326
#, kde-format
msgid "Shade"
msgstr "收起"
#: decorationbutton.cpp:329
#, kde-format
msgid "Don't keep below other windows"
msgstr "不要維持在其他視窗之下"
#: decorationbutton.cpp:331
#, kde-format
msgid "Keep below other windows"
msgstr "維持在其他視窗之下"
#: decorationbutton.cpp:334
#, kde-format
msgid "Don't keep above other windows"
msgstr "不要維持在其他視窗之上"
#: decorationbutton.cpp:336
#, kde-format
msgid "Keep above other windows"
msgstr "維持在其他視窗之上"
#~ msgid "Menu"
#~ msgstr "選單"
#~ msgid "Keep below"
#~ msgstr "保持於底部顯示"
#~ msgid "Keep above"
#~ msgstr "保持於頂部顯示"
@@ -0,0 +1,83 @@
add_definitions(-DTRANSLATION_DOMAIN=\"kdecoration\")
add_subdirectory(private)
set(libkdecoration3_SRCS
decoratedwindow.cpp
decoratedwindow.h
decoration.cpp
decoration.h
decoration_p.h
decorationbutton.cpp
decorationbutton.h
decorationbutton_p.h
decorationbuttongroup.cpp
decorationbuttongroup.h
decorationbuttongroup_p.h
decorationdefines.h
decorationsettings.cpp
decorationsettings.h
decorationshadow.cpp
decorationshadow.h
decorationshadow_p.h
decorationthemeprovider.cpp
decorationthemeprovider.h
)
add_library(kdecorations3 SHARED ${libkdecoration3_SRCS})
ecm_generate_export_header(kdecorations3
VERSION ${PROJECT_VERSION}
EXPORT_FILE_NAME kdecoration3/kdecoration3_export.h
DEPRECATION_VERSIONS 5.21
EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT}
)
add_library(KDecoration3::KDecoration ALIAS kdecorations3)
target_link_libraries(kdecorations3
PUBLIC
Qt::Core
Qt::Gui
PRIVATE
kdecorations3private
KF6::I18n
)
target_include_directories(kdecorations3 INTERFACE "$<INSTALL_INTERFACE:${KDECORATION3_INCLUDEDIR}>" )
set_target_properties(kdecorations3 PROPERTIES VERSION ${KDECORATION3_VERSION}
SOVERSION ${KDECORATION3_SOVERSION}
EXPORT_NAME KDecoration
)
ecm_generate_headers(KDecoration3_CamelCase_HEADERS
HEADER_NAMES
DecoratedWindow
Decoration
DecorationButton
DecorationButtonGroup
DecorationSettings
DecorationShadow
DecorationThemeProvider
ScaleHelpers
PREFIX
KDecoration3
REQUIRED_HEADERS KDecoration3_HEADERS
)
install(FILES ${KDecoration3_CamelCase_HEADERS}
DESTINATION ${KDECORATION3_INCLUDEDIR}/KDecoration3
COMPONENT Devel)
install(TARGETS kdecorations3 EXPORT KDecoration3Targets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/kdecoration3/kdecoration3_export.h
${KDecoration3_HEADERS}
decorationdefines.h
DESTINATION
${KDECORATION3_INCLUDEDIR}/kdecoration3
COMPONENT
Devel
)
@@ -0,0 +1,2 @@
#! /usr/bin/env bash
$XGETTEXT *.cpp -o $podir/kdecoration.pot
@@ -0,0 +1,226 @@
/*
* SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
*
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "decoratedwindow.h"
#include "private/decoratedwindowprivate.h"
#include "private/decorationbridge.h"
#include "scalehelpers.h"
#include <QColor>
namespace KDecoration3
{
DecoratedWindow::DecoratedWindow(Decoration *parent, DecorationBridge *bridge)
: QObject()
, d(bridge->createClient(this, parent))
{
}
DecoratedWindow::~DecoratedWindow() = default;
bool DecoratedWindow::isActive() const
{
return d->isActive();
}
QString DecoratedWindow::caption() const
{
return d->caption();
}
bool DecoratedWindow::isOnAllDesktops() const
{
return d->isOnAllDesktops();
}
bool DecoratedWindow::isShaded() const
{
return d->isShaded();
}
QIcon DecoratedWindow::icon() const
{
return d->icon();
}
bool DecoratedWindow::isMaximized() const
{
return d->isMaximized();
}
bool DecoratedWindow::isMaximizedHorizontally() const
{
return d->isMaximizedHorizontally();
}
bool DecoratedWindow::isMaximizedVertically() const
{
return d->isMaximizedVertically();
}
bool DecoratedWindow::isKeepAbove() const
{
return d->isKeepAbove();
}
bool DecoratedWindow::isKeepBelow() const
{
return d->isKeepBelow();
}
bool DecoratedWindow::isCloseable() const
{
return d->isCloseable();
}
bool DecoratedWindow::isMaximizeable() const
{
return d->isMaximizeable();
}
bool DecoratedWindow::isMinimizeable() const
{
return d->isMinimizeable();
}
bool DecoratedWindow::providesContextHelp() const
{
return d->providesContextHelp();
}
bool DecoratedWindow::isModal() const
{
return d->isModal();
}
bool DecoratedWindow::isShadeable() const
{
return d->isShadeable();
}
bool DecoratedWindow::isMoveable() const
{
return d->isMoveable();
}
bool DecoratedWindow::isResizeable() const
{
return d->isResizeable();
}
qreal DecoratedWindow::width() const
{
return d->width();
}
qreal DecoratedWindow::height() const
{
return d->height();
}
QSizeF DecoratedWindow::size() const
{
return d->size();
}
QPalette DecoratedWindow::palette() const
{
return d->palette();
}
Qt::Edges DecoratedWindow::adjacentScreenEdges() const
{
return d->adjacentScreenEdges();
}
QString DecoratedWindow::windowClass() const
{
return d->windowClass();
}
bool DecoratedWindow::hasApplicationMenu() const
{
return d->hasApplicationMenu();
}
bool DecoratedWindow::isApplicationMenuActive() const
{
return d->isApplicationMenuActive();
}
Decoration *DecoratedWindow::decoration() const
{
return d->decoration();
}
QColor DecoratedWindow::color(QPalette::ColorGroup group, QPalette::ColorRole role) const
{
return d->palette().color(group, role);
}
QColor DecoratedWindow::color(ColorGroup group, ColorRole role) const
{
return d->color(group, role);
}
void DecoratedWindow::showApplicationMenu(int actionId)
{
d->showApplicationMenu(actionId);
}
qreal DecoratedWindow::scale() const
{
return d->scale();
}
qreal DecoratedWindow::nextScale() const
{
return d->nextScale();
}
qreal DecoratedWindow::pixelSize() const
{
return ::KDecoration3::pixelSize(scale());
}
qreal DecoratedWindow::snapToPixelGrid(qreal value) const
{
return ::KDecoration3::snapToPixelGrid(value, d->scale());
}
QPointF DecoratedWindow::snapToPixelGrid(const QPointF &value) const
{
return ::KDecoration3::snapToPixelGrid(value, d->scale());
}
QSizeF DecoratedWindow::snapToPixelGrid(const QSizeF &value) const
{
return ::KDecoration3::snapToPixelGrid(value, d->scale());
}
QRectF DecoratedWindow::snapToPixelGrid(const QRectF &value) const
{
return ::KDecoration3::snapToPixelGrid(value, d->scale());
}
QString DecoratedWindow::applicationMenuServiceName() const
{
if (auto impl = dynamic_cast<DecoratedWindowPrivateV2 *>(d.get())) {
return impl->applicationMenuServiceName();
}
return QString();
}
QString DecoratedWindow::applicationMenuObjectPath() const
{
if (auto impl = dynamic_cast<DecoratedWindowPrivateV2 *>(d.get())) {
return impl->applicationMenuObjectPath();
}
return QString();
}
} // namespace
#include "moc_decoratedwindow.cpp"
@@ -0,0 +1,350 @@
/*
* SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
*
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#pragma once
#include "decoration.h"
#include "decorationdefines.h"
#include <kdecoration3/kdecoration3_export.h>
#include <QFont>
#include <QIcon>
#include <QObject>
#include <QPalette>
#include <QPointer>
#include <QtGui/qwindowdefs.h>
#include <memory>
namespace KDecoration3
{
class DecorationBridge;
class DecoratedWindowPrivate;
/**
* @brief The Client which gets decorated.
*
* The DecoratedWindow provides access to all the properties relevant for decorating the Client.
* Each DecoratedWindow is bound to one Decoration and each Decoration is bound to this one
* DecoratedWindow.
*
* The DecoratedWindow only exports properties, it does not provide any means to change the state.
* To change state one needs to call the methods on Decoration. This is as the backend might
* disallow state changes. Therefore any changes should be bound to the change signals of the
* DecoratedWindow and not be bound to state changes of input elements (such as a button).
*/
class KDECORATIONS3_EXPORT DecoratedWindow : public QObject
{
Q_OBJECT
/**
* The Decoration of this DecoratedWindow
**/
Q_PROPERTY(KDecoration3::Decoration *decoration READ decoration CONSTANT)
/**
* Whether the DecoratedWindow is active (has focus) or is inactive.
**/
Q_PROPERTY(bool active READ isActive NOTIFY activeChanged)
/**
* The caption of the DecoratedWindow.
**/
Q_PROPERTY(QString caption READ caption NOTIFY captionChanged)
/**
* Whether the DecoratedWindow is on all desktops or on just one.
**/
Q_PROPERTY(bool onAllDesktops READ isOnAllDesktops NOTIFY onAllDesktopsChanged)
/**
* Whether the DecoratedWindow is shaded. Shaded means that the actual content is
* not visible, only the Decoration is visible.
**/
Q_PROPERTY(bool shaded READ isShaded NOTIFY shadedChanged)
/**
* The icon of the DecoratedWindow. This can be used as the icon for the window menu button.
**/
Q_PROPERTY(QIcon icon READ icon NOTIFY iconChanged)
/**
* Whether the DecoratedWindow is maximized. A DecoratedWindow is maximized if it is both
* maximizedHorizontally and maximizedVertically. The Decoration of a maximized DecoratedWindow
* should only consist of the title bar area.
**/
Q_PROPERTY(bool maximized READ isMaximized NOTIFY maximizedChanged)
/**
* Whether the DecoratedWindow is maximized horizontally. A horizontally maximized DecoratedWindow
* uses the maximal possible width.
**/
Q_PROPERTY(bool maximizedHorizontally READ isMaximizedHorizontally NOTIFY maximizedHorizontallyChanged)
/**
* Whether the DecoratedWindow is maximized vertically. A vertically maximized DecoratedWindow
* uses the maximal possible height.
**/
Q_PROPERTY(bool maximizedVertically READ isMaximizedVertically NOTIFY maximizedVerticallyChanged)
/**
* Whether the DecoratedWindow is set to be kept above other DecoratedWindows. There can be multiple
* DecoratedWindows which are set to be kept above.
**/
Q_PROPERTY(bool keepAbove READ isKeepAbove NOTIFY keepAboveChanged)
/**
* Whether the DecoratedWindow is set to be kept below other DecoratedWindows. There can be multiple
* DecoratedWindows which are set to be kept below.
**/
Q_PROPERTY(bool keepBelow READ isKeepBelow NOTIFY keepBelowChanged)
/**
* Whether the DecoratedWindow can be closed. If this property is @c false a DecorationButton
* for closing the DecoratedWindow should be disabled.
**/
Q_PROPERTY(bool closeable READ isCloseable NOTIFY closeableChanged)
/**
* Whether the DecoratedWindow can be maximized. If this property is @c false a DecorationButton
* for maximizing the DecoratedWindow should be disabled.
**/
Q_PROPERTY(bool maximizeable READ isMaximizeable NOTIFY maximizeableChanged)
/**
* Whether the DecoratedWindow can be minimized. If this property is @c false a DecorationButton
* for minimizing the DecoratedWindow should be disabled.
**/
Q_PROPERTY(bool minimizeable READ isMinimizeable NOTIFY minimizeableChanged)
/**
* Whether the DecoratedWindow provides context help.
* The Decoration should only show a context help button if this property is @c true.
**/
Q_PROPERTY(bool providesContextHelp READ providesContextHelp NOTIFY providesContextHelpChanged)
/**
* Whether the DecoratedWindow is a modal dialog.
**/
Q_PROPERTY(bool modal READ isModal CONSTANT)
/**
* Whether the DecoratedWindow can be shaded. If this property is @c false a DecorationButton
* for shading the DecoratedWindow should be disabled.
**/
Q_PROPERTY(bool shadeable READ isShadeable NOTIFY shadeableChanged)
/**
* Whether the DecoratedWindow can be moved.
**/
Q_PROPERTY(bool moveable READ isMoveable NOTIFY moveableChanged)
/**
* Whether the DecoratedWindow can be resized.
**/
Q_PROPERTY(bool resizeable READ isResizeable NOTIFY resizeableChanged)
/**
* The width of the DecoratedWindow.
**/
Q_PROPERTY(qreal width READ width NOTIFY widthChanged)
/**
* The height of the DecoratedWindow.
**/
Q_PROPERTY(qreal height READ height NOTIFY heightChanged)
/**
* The size of the DecoratedWindow.
**/
Q_PROPERTY(QSizeF size READ size NOTIFY sizeChanged)
/**
* The palette this DecoratedWindow uses. The palette might be different for each
* DecoratedWindow and the Decoration should honor the palette.
**/
Q_PROPERTY(QPalette palette READ palette NOTIFY paletteChanged)
/**
* The Edges which are adjacent to a screen edge. E.g. for a maximized DecoratedWindow this
* will include all Edges. The Decoration can use this information to hide borders.
**/
Q_PROPERTY(Qt::Edges adjacentScreenEdges READ adjacentScreenEdges NOTIFY adjacentScreenEdgesChanged)
/**
* Whether the DecoratedWindow has an application menu
* @since 5.9
*/
Q_PROPERTY(bool hasApplicationMenu READ hasApplicationMenu NOTIFY hasApplicationMenuChanged)
/**
* Whether the application menu for this DecoratedWindow is currently shown to the user
* The Decoration can use this information to highlight the respective button.
* @since 5.9
*/
Q_PROPERTY(bool applicationMenuActive READ isApplicationMenuActive NOTIFY applicationMenuActiveChanged)
/**
* Returns the DBus service name of the application menu. If the window has no application
* menu associated with it, an empty string will be returned.
*
* @since 6.3.2
*/
Q_PROPERTY(QString applicationMenuServiceName READ applicationMenuServiceName NOTIFY applicationMenuChanged)
/**
* Returns the DBus object path of the application menu. If the window has no application
* menu associated with it, an empty string will be returned.
*
* @since 6.3.2
*/
Q_PROPERTY(QString applicationMenuObjectPath READ applicationMenuObjectPath NOTIFY applicationMenuChanged)
/**
* The current scale this decorated window is targeting.
* @since 6.3
*/
Q_PROPERTY(qreal scale READ scale NOTIFY scaleChanged);
/**
* The next scale this decorated window is going to target.
* @since 6.3
*/
Q_PROPERTY(qreal nextScale READ nextScale NOTIFY nextScaleChanged)
public:
DecoratedWindow() = delete;
~DecoratedWindow() override;
bool isActive() const;
QString caption() const;
bool isOnAllDesktops() const;
bool isShaded() const;
QIcon icon() const;
bool isMaximized() const;
bool isMaximizedHorizontally() const;
bool isMaximizedVertically() const;
bool isKeepAbove() const;
bool isKeepBelow() const;
bool isCloseable() const;
bool isMaximizeable() const;
bool isMinimizeable() const;
bool providesContextHelp() const;
bool isModal() const;
bool isShadeable() const;
bool isMoveable() const;
bool isResizeable() const;
Qt::Edges adjacentScreenEdges() const;
QString windowClass() const;
qreal width() const;
qreal height() const;
QSizeF size() const;
Decoration *decoration() const;
QPalette palette() const;
/**
* Used to get colors in QPalette.
* @param group The color group
* @param role The color role
* @return palette().color(group, role)
* @since 5.3
**/
QColor color(QPalette::ColorGroup group, QPalette::ColorRole role) const;
/**
* Used to get additional colors that are not in QPalette.
* @param group The color group
* @param role The color role
* @return The color if provided for combination of group and role, otherwise invalid QColor.
* @since 5.3
**/
QColor color(ColorGroup group, ColorRole role) const;
/**
* Whether the DecoratedWindow has an application menu
* @since 5.9
*/
bool hasApplicationMenu() const;
/**
* Returns the DBus service name of the application menu. If the window has no application
* menu associated with it, an empty string will be returned.
*
* @since 6.3.2
*/
QString applicationMenuServiceName() const;
/**
* Returns the DBus object path of the application menu. If the window has no application
* menu associated with it, an empty string will be returned.
*
* @since 6.3.2
*/
QString applicationMenuObjectPath() const;
/**
* Whether the application menu for this DecoratedWindow is currently shown to the user
* The Decoration can use this information to highlight the respective button.
* @since 5.9
*/
bool isApplicationMenuActive() const;
/**
* Request the application menu to be shown to the user
* @param actionId The DBus menu ID of the action that should be highlighted, 0 for none.
*/
void showApplicationMenu(int actionId);
/**
* Returns the current scale this decorated window is targeting
* @since 6.3
*/
qreal scale() const;
/**
* Returns the next scale this decorated window is going to target.
*/
qreal nextScale() const;
/**
* @returns the logical size of a device pixel with the current scale
* @since 6.3
*/
qreal pixelSize() const;
/**
* snaps the logical geometry value to a fractional logical geometry value
* that aligns to the pixel grid with the current scale factor
* @since 6.3
*/
qreal snapToPixelGrid(qreal value) const;
/**
* snaps the logical geometry value to a fractional logical geometry value
* that aligns to the pixel grid with the current scale factor
* @since 6.3
*/
QPointF snapToPixelGrid(const QPointF &value) const;
/**
* snaps the logical geometry value to a fractional logical geometry value
* that aligns to the pixel grid with the current scale factor
* @since 6.3
*/
QSizeF snapToPixelGrid(const QSizeF &value) const;
/**
* snaps the logical geometry value to a fractional logical geometry value
* that aligns to the pixel grid with the current scale factor
* @since 6.3
*/
QRectF snapToPixelGrid(const QRectF &value) const;
Q_SIGNALS:
void activeChanged(bool);
void captionChanged(QString);
void onAllDesktopsChanged(bool);
void shadedChanged(bool);
void iconChanged(QIcon);
void maximizedChanged(bool);
void maximizedHorizontallyChanged(bool);
void maximizedVerticallyChanged(bool);
void keepAboveChanged(bool);
void keepBelowChanged(bool);
void closeableChanged(bool);
void maximizeableChanged(bool);
void minimizeableChanged(bool);
void providesContextHelpChanged(bool);
void shadeableChanged(bool);
void moveableChanged(bool);
void resizeableChanged(bool);
void widthChanged(qreal);
void heightChanged(qreal);
void sizeChanged(const QSizeF &size);
void paletteChanged(const QPalette &palette);
void adjacentScreenEdgesChanged(Qt::Edges edges);
void hasApplicationMenuChanged(bool);
void applicationMenuActiveChanged(bool);
void scaleChanged();
void nextScaleChanged();
void applicationMenuChanged();
private:
friend class Decoration;
DecoratedWindow(Decoration *parent, DecorationBridge *bridge);
const std::unique_ptr<DecoratedWindowPrivate> d;
};
} // namespace
@@ -0,0 +1,572 @@
/*
* SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
*
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "decoration.h"
#include "decoratedwindow.h"
#include "decoration_p.h"
#include "decorationbutton.h"
#include "decorationsettings.h"
#include "private/decoratedwindowprivate.h"
#include "private/decorationbridge.h"
#include <QCoreApplication>
#include <QHoverEvent>
#include <cmath>
namespace KDecoration3
{
namespace
{
DecorationBridge *findBridge(const QVariantList &args)
{
for (const auto &arg : args) {
if (auto bridge = arg.toMap().value(QStringLiteral("bridge")).value<DecorationBridge *>()) {
return bridge;
}
}
Q_UNREACHABLE();
}
}
class DecorationStateData : public QSharedData
{
public:
QMarginsF borders;
};
DecorationState::DecorationState()
: d(new DecorationStateData)
{
}
DecorationState::DecorationState(const DecorationState &other)
: d(other.d)
{
}
DecorationState::~DecorationState()
{
}
std::shared_ptr<DecorationState> DecorationState::clone() const
{
return std::make_shared<DecorationState>(*this);
}
QMarginsF DecorationState::borders() const
{
return d->borders;
}
void DecorationState::setBorders(const QMarginsF &borders)
{
d->borders = borders;
}
Decoration::Private::Private(Decoration *deco, const QVariantList &args)
: sectionUnderMouse(Qt::NoSection)
, bridge(findBridge(args))
, client(std::shared_ptr<DecoratedWindow>(new DecoratedWindow(deco, bridge)))
, opaque(false)
, q(deco)
{
}
void Decoration::Private::setSectionUnderMouse(Qt::WindowFrameSection section)
{
if (sectionUnderMouse == section) {
return;
}
sectionUnderMouse = section;
Q_EMIT q->sectionUnderMouseChanged(sectionUnderMouse);
}
void Decoration::Private::updateSectionUnderMouse(const QPoint &mousePosition)
{
if (titleBar.toRect().contains(mousePosition)) {
setSectionUnderMouse(Qt::TitleBarArea);
return;
}
const QSizeF size = q->size();
const QMarginsF borders = current->borders();
const int corner = 2 * settings->largeSpacing();
const bool left = mousePosition.x() < borders.left();
const bool top = mousePosition.y() < borders.top();
const bool bottom = mousePosition.y() >= size.height() - borders.bottom();
const bool right = mousePosition.x() >= size.width() - borders.right();
if (left) {
if (top && mousePosition.y() < titleBar.top() + corner) {
setSectionUnderMouse(Qt::TopLeftSection);
} else if (mousePosition.y() >= size.height() - borders.bottom() - corner && mousePosition.y() >= titleBar.bottom()) {
setSectionUnderMouse(Qt::BottomLeftSection);
} else {
setSectionUnderMouse(Qt::LeftSection);
}
return;
}
if (right) {
if (top && mousePosition.y() < titleBar.top() + corner) {
setSectionUnderMouse(Qt::TopRightSection);
} else if (mousePosition.y() >= size.height() - borders.bottom() - corner && mousePosition.y() >= titleBar.bottom()) {
setSectionUnderMouse(Qt::BottomRightSection);
} else {
setSectionUnderMouse(Qt::RightSection);
}
return;
}
if (bottom) {
if (mousePosition.y() >= titleBar.bottom()) {
if (mousePosition.x() < borders.left() + corner) {
setSectionUnderMouse(Qt::BottomLeftSection);
} else if (mousePosition.x() >= size.width() - borders.right() - corner) {
setSectionUnderMouse(Qt::BottomRightSection);
} else {
setSectionUnderMouse(Qt::BottomSection);
}
} else {
setSectionUnderMouse(Qt::TitleBarArea);
}
return;
}
if (top) {
if (mousePosition.y() < titleBar.top()) {
if (mousePosition.x() < borders.left() + corner) {
setSectionUnderMouse(Qt::TopLeftSection);
} else if (mousePosition.x() >= size.width() - borders.right() - corner) {
setSectionUnderMouse(Qt::TopRightSection);
} else {
setSectionUnderMouse(Qt::TopSection);
}
} else {
setSectionUnderMouse(Qt::TitleBarArea);
}
return;
}
setSectionUnderMouse(Qt::NoSection);
}
void Decoration::Private::addButton(DecorationButton *button)
{
Q_ASSERT(!buttons.contains(button));
buttons << button;
QObject::connect(button, &QObject::destroyed, q, [this](QObject *o) {
auto it = buttons.begin();
while (it != buttons.end()) {
if (*it == static_cast<DecorationButton *>(o)) {
it = buttons.erase(it);
} else {
it++;
}
}
});
}
Decoration::Decoration(QObject *parent, const QVariantList &args)
: QObject(parent)
, d(new Private(this, args))
{
}
Decoration::~Decoration() = default;
DecoratedWindow *Decoration::window() const
{
return d->client.get();
}
void Decoration::requestClose()
{
d->client->d->requestClose();
}
void Decoration::requestContextHelp()
{
d->client->d->requestContextHelp();
}
void Decoration::requestMinimize()
{
d->client->d->requestMinimize();
}
void Decoration::requestToggleOnAllDesktops()
{
d->client->d->requestToggleOnAllDesktops();
}
void Decoration::requestToggleShade()
{
d->client->d->requestToggleShade();
}
void Decoration::requestToggleKeepAbove()
{
d->client->d->requestToggleKeepAbove();
}
void Decoration::requestToggleKeepBelow()
{
d->client->d->requestToggleKeepBelow();
}
#if KDECORATIONS3_ENABLE_DEPRECATED_SINCE(5, 21)
void Decoration::requestShowWindowMenu()
{
requestShowWindowMenu(QRect());
}
#endif
void Decoration::requestShowWindowMenu(const QRect &rect)
{
d->client->d->requestShowWindowMenu(rect);
}
void Decoration::requestShowToolTip(const QString &text)
{
d->client->d->requestShowToolTip(text);
}
void Decoration::requestHideToolTip()
{
d->client->d->requestHideToolTip();
}
void Decoration::requestToggleMaximization(Qt::MouseButtons buttons)
{
d->client->d->requestToggleMaximization(buttons);
}
void Decoration::showApplicationMenu(int actionId)
{
const auto it = std::find_if(d->buttons.constBegin(), d->buttons.constEnd(), [](DecorationButton *button) {
return button->type() == DecorationButtonType::ApplicationMenu;
});
if (it != d->buttons.constEnd()) {
requestShowApplicationMenu((*it)->geometry().toRect(), actionId);
}
}
void Decoration::requestShowApplicationMenu(const QRect &rect, int actionId)
{
d->client->d->requestShowApplicationMenu(rect, actionId);
}
void Decoration::setBlurRegion(const QRegion &region)
{
if (d->blurRegion != region) {
d->blurRegion = region;
Q_EMIT blurRegionChanged();
}
}
void Decoration::setBorders(const QMarginsF &borders)
{
if (d->next->borders() != borders) {
setState([borders](DecorationState *state) {
state->setBorders(borders);
});
}
}
void Decoration::setResizeOnlyBorders(const QMarginsF &borders)
{
if (d->resizeOnlyBorders != borders) {
d->resizeOnlyBorders = borders;
Q_EMIT resizeOnlyBordersChanged();
}
}
void Decoration::setTitleBar(const QRectF &rect)
{
if (d->titleBar != rect) {
d->titleBar = rect;
Q_EMIT titleBarChanged();
}
}
void Decoration::setOpaque(bool opaque)
{
if (d->opaque != opaque) {
d->opaque = opaque;
Q_EMIT opaqueChanged(opaque);
}
}
void Decoration::setShadow(const std::shared_ptr<DecorationShadow> &shadow)
{
if (d->shadow != shadow) {
d->shadow = shadow;
Q_EMIT shadowChanged(shadow);
}
}
QRegion Decoration::blurRegion() const
{
return d->blurRegion;
}
QMarginsF Decoration::borders() const
{
return d->current->borders();
}
QMarginsF Decoration::resizeOnlyBorders() const
{
return d->resizeOnlyBorders;
}
QRectF Decoration::titleBar() const
{
return d->titleBar;
}
Qt::WindowFrameSection Decoration::sectionUnderMouse() const
{
return d->sectionUnderMouse;
}
std::shared_ptr<DecorationShadow> Decoration::shadow() const
{
return d->shadow;
}
bool Decoration::isOpaque() const
{
return d->opaque;
}
qreal Decoration::borderLeft() const
{
return d->current->borders().left();
}
qreal Decoration::resizeOnlyBorderLeft() const
{
return d->resizeOnlyBorders.left();
}
qreal Decoration::borderRight() const
{
return d->current->borders().right();
}
qreal Decoration::resizeOnlyBorderRight() const
{
return d->resizeOnlyBorders.right();
}
qreal Decoration::borderTop() const
{
return d->current->borders().top();
}
qreal Decoration::resizeOnlyBorderTop() const
{
return d->resizeOnlyBorders.top();
}
qreal Decoration::borderBottom() const
{
return d->current->borders().bottom();
}
qreal Decoration::resizeOnlyBorderBottom() const
{
return d->resizeOnlyBorders.bottom();
}
QSizeF Decoration::size() const
{
const QMarginsF b = d->current->borders();
return QSizeF(d->client->width() + b.left() + b.right(), (d->client->isShaded() ? 0 : d->client->height()) + b.top() + b.bottom());
}
QRectF Decoration::rect() const
{
return QRectF(QPointF(0, 0), size());
}
bool Decoration::event(QEvent *event)
{
switch (event->type()) {
case QEvent::HoverEnter:
hoverEnterEvent(static_cast<QHoverEvent *>(event));
return true;
case QEvent::HoverLeave:
hoverLeaveEvent(static_cast<QHoverEvent *>(event));
return true;
case QEvent::HoverMove:
hoverMoveEvent(static_cast<QHoverEvent *>(event));
return true;
case QEvent::MouseButtonPress:
mousePressEvent(static_cast<QMouseEvent *>(event));
return true;
case QEvent::MouseButtonRelease:
mouseReleaseEvent(static_cast<QMouseEvent *>(event));
return true;
case QEvent::MouseMove:
mouseMoveEvent(static_cast<QMouseEvent *>(event));
return true;
case QEvent::Wheel:
wheelEvent(static_cast<QWheelEvent *>(event));
return true;
default:
return QObject::event(event);
}
}
void Decoration::hoverEnterEvent(QHoverEvent *event)
{
for (DecorationButton *button : d->buttons) {
QCoreApplication::instance()->sendEvent(button, event);
}
auto flooredPos = QPoint(std::floor(event->position().x()), std::floor(event->position().y()));
d->updateSectionUnderMouse(flooredPos);
}
void Decoration::hoverLeaveEvent(QHoverEvent *event)
{
for (DecorationButton *button : d->buttons) {
QCoreApplication::instance()->sendEvent(button, event);
}
d->setSectionUnderMouse(Qt::NoSection);
}
void Decoration::hoverMoveEvent(QHoverEvent *event)
{
for (DecorationButton *button : d->buttons) {
if (!button->isEnabled() || !button->isVisible()) {
continue;
}
const bool hovered = button->isHovered();
const bool contains = button->contains(event->position());
if (!hovered && contains) {
QHoverEvent e(QEvent::HoverEnter, event->position(), event->oldPosF(), event->modifiers());
QCoreApplication::instance()->sendEvent(button, &e);
} else if (hovered && !contains) {
QHoverEvent e(QEvent::HoverLeave, event->position(), event->oldPosF(), event->modifiers());
QCoreApplication::instance()->sendEvent(button, &e);
} else if (hovered && contains) {
QCoreApplication::instance()->sendEvent(button, event);
}
}
auto flooredPos = QPoint(std::floor(event->position().x()), std::floor(event->position().y()));
d->updateSectionUnderMouse(flooredPos);
}
void Decoration::mouseMoveEvent(QMouseEvent *event)
{
for (DecorationButton *button : d->buttons) {
if (button->isPressed()) {
QCoreApplication::instance()->sendEvent(button, event);
return;
}
}
// not handled, take care ourselves
}
void Decoration::mousePressEvent(QMouseEvent *event)
{
for (DecorationButton *button : d->buttons) {
if (button->isHovered()) {
if (button->acceptedButtons().testFlag(event->button())) {
QCoreApplication::instance()->sendEvent(button, event);
}
event->setAccepted(true);
return;
}
}
}
void Decoration::mouseReleaseEvent(QMouseEvent *event)
{
for (DecorationButton *button : d->buttons) {
if (button->isPressed() && button->acceptedButtons().testFlag(event->button())) {
QCoreApplication::instance()->sendEvent(button, event);
return;
}
}
// not handled, take care ourselves
d->updateSectionUnderMouse(event->pos());
}
void Decoration::wheelEvent(QWheelEvent *event)
{
for (DecorationButton *button : d->buttons) {
if (button->contains(event->position())) {
QCoreApplication::instance()->sendEvent(button, event);
event->setAccepted(true);
}
}
}
void Decoration::update(const QRectF &r)
{
Q_EMIT damaged(r.isNull() ? rect().toAlignedRect() : r.toAlignedRect());
}
void Decoration::update()
{
update(QRect());
}
void Decoration::setSettings(const std::shared_ptr<DecorationSettings> &settings)
{
d->settings = settings;
}
std::shared_ptr<DecorationSettings> Decoration::settings() const
{
return d->settings;
}
std::shared_ptr<DecorationState> Decoration::createState()
{
return std::make_shared<DecorationState>();
}
std::shared_ptr<DecorationState> Decoration::currentState() const
{
return d->current;
}
std::shared_ptr<DecorationState> Decoration::nextState() const
{
return d->next;
}
void Decoration::create()
{
d->next = createState();
d->current = createState();
}
void Decoration::setState(std::function<void(DecorationState *state)> callback)
{
callback(d->next.get());
Q_EMIT nextStateChanged(d->next);
}
void Decoration::apply(std::shared_ptr<DecorationState> state)
{
if (d->current == state) {
return;
}
const auto previous = d->current;
d->current = state;
update();
if (previous->borders() != state->borders()) {
Q_EMIT bordersChanged();
}
Q_EMIT currentStateChanged(state);
}
} // namespace
#include "moc_decoration.cpp"
@@ -0,0 +1,333 @@
/*
* SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
*
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#pragma once
#include "decorationshadow.h"
#include <kdecoration3/kdecoration3_export.h>
#include <QMarginsF>
#include <QObject>
#include <QRectF>
#include <QSharedDataPointer>
class QHoverEvent;
class QMouseEvent;
class QPainter;
class QWheelEvent;
/**
* @brief Framework for creating window decorations.
*
**/
namespace KDecoration3
{
class DecorationPrivate;
class DecoratedWindow;
class DecorationButton;
class DecorationSettings;
class DecorationStateData;
/**
* \brief Decoration state.
*
* The DecorationState type represents double bufferred state associated with a decoration.
*
* \note Sub-classes of DecorationState must override the clone() function.
*/
class KDECORATIONS3_EXPORT DecorationState
{
public:
DecorationState();
DecorationState(const DecorationState &other);
virtual ~DecorationState();
virtual std::shared_ptr<DecorationState> clone() const;
QMarginsF borders() const;
void setBorders(const QMarginsF &margins);
private:
QSharedDataPointer<DecorationStateData> d;
};
/**
* @brief Base class for the Decoration.
*
* To provide a Decoration one needs to inherit from this class. The framework will instantiate
* an instance of the inherited class for each DecoratedWindow.
*
* The main tasks of the Decoration is to provide borders around the DecoratedWindow. For this
* the Deocration provides border sizes: those should be adjusted depending on the state of the
* DecoratedWindow. E.g. commonly a maximized DecoratedWindow does not have borders on the side,
* only the title bar.
*
* Whenever the visual representation of the Decoration changes the slot @link Decoration::update @endlink
* should be invoked to request a repaint. The framework will in return invoke the
* @link Decoration::paint @endlink method. This method needs to be implemented by inheriting
* classes.
*
* A Decoration commonly provides buttons for interaction. E.g. a close button to close the
* DecoratedWindow. For such actions the Decoration provides slots which should be connected to
* the clicked signals of the buttons. For convenience the framework provides the @link DecorationButton @endlink
* and the @link DecorationButtonGroup @endlink for easier layout. It is not required to use those,
* if one uses different ways to represent the actions one needs to filter the events accordingly.
*
* @see DecoratedWindow
* @see DecorationButton
* @see DecorationButtonGroup
**/
class KDECORATIONS3_EXPORT Decoration : public QObject
{
Q_OBJECT
Q_PROPERTY(QMarginsF borders READ borders NOTIFY bordersChanged)
Q_PROPERTY(qreal borderLeft READ borderLeft NOTIFY bordersChanged)
Q_PROPERTY(qreal borderRight READ borderRight NOTIFY bordersChanged)
Q_PROPERTY(qreal borderTop READ borderTop NOTIFY bordersChanged)
Q_PROPERTY(qreal borderBottom READ borderBottom NOTIFY bordersChanged)
Q_PROPERTY(QMarginsF resizeOnlyBorders READ resizeOnlyBorders NOTIFY resizeOnlyBordersChanged)
Q_PROPERTY(qreal resizeOnlyBorderLeft READ resizeOnlyBorderLeft NOTIFY resizeOnlyBordersChanged)
Q_PROPERTY(qreal resizeOnlyBorderRight READ resizeOnlyBorderRight NOTIFY resizeOnlyBordersChanged)
Q_PROPERTY(qreal resizeOnlyBorderTop READ resizeOnlyBorderTop NOTIFY resizeOnlyBordersChanged)
Q_PROPERTY(qreal resizeOnlyBorderBottom READ resizeOnlyBorderBottom NOTIFY resizeOnlyBordersChanged)
/**
* This property denotes the part of the Decoration which is currently under the mouse pointer.
* It gets automatically updated whenever a QMouseEvent or QHoverEvent gets processed.
**/
Q_PROPERTY(Qt::WindowFrameSection sectionUnderMouse READ sectionUnderMouse NOTIFY sectionUnderMouseChanged)
/**
* The titleBar is the area inside the Decoration containing all controls (e.g. Buttons)
* and the caption. The titleBar is the main interaction area, while all other areas of the
* Decoration are normally used as resize areas.
**/
Q_PROPERTY(QRectF titleBar READ titleBar NOTIFY titleBarChanged)
/**
* Whether the Decoration is fully opaque. By default a Decoration is considered to
* use the alpha channel and this property has the value @c false. But for e.g. a maximized
* DecoratedWindow it is possible that the Decoration is fully opaque. In this case the
* Decoration should set this property to @c true.
**/
Q_PROPERTY(bool opaque READ isOpaque NOTIFY opaqueChanged)
public:
~Decoration() override;
/**
* The DecoratedWindow for this Decoration.
**/
DecoratedWindow *window() const;
QMarginsF borders() const;
qreal borderLeft() const;
qreal borderRight() const;
qreal borderTop() const;
qreal borderBottom() const;
QMarginsF resizeOnlyBorders() const;
qreal resizeOnlyBorderLeft() const;
qreal resizeOnlyBorderRight() const;
qreal resizeOnlyBorderTop() const;
qreal resizeOnlyBorderBottom() const;
Qt::WindowFrameSection sectionUnderMouse() const;
QRectF titleBar() const;
bool isOpaque() const;
/**
* DecorationShadow for this Decoration. It is recommended that multiple Decorations share
* the same DecorationShadow. E.g one DecorationShadow for all inactive Decorations and one
* for the active Decoration.
**/
std::shared_ptr<DecorationShadow> shadow() const;
/**
* The decoration's geometry in local coordinates.
*
* Basically the size of the DecoratedWindow combined with the borders.
**/
QRectF rect() const;
QSizeF size() const;
/**
* The decoration's blur region in local coordinates
*/
QRegion blurRegion() const;
/**
* Invoked by the framework to set the Settings for this Decoration before
* init is invoked.
* @internal
**/
void setSettings(const std::shared_ptr<DecorationSettings> &settings);
/**
* @returns The DecorationSettings used for this Decoration.
**/
std::shared_ptr<DecorationSettings> settings() const;
/**
* Implement this method in inheriting classes to provide the rendering.
*
* The @p painter is set up to paint on an internal QPaintDevice. The painting is
* implicitly double buffered.
*
* @param painter The painter which needs to be used for rendering
* @param repaintArea The region which needs to be repainted.
**/
virtual void paint(QPainter *painter, const QRectF &repaintArea) = 0;
bool event(QEvent *event) override;
/**
* \internal
*
* Allocates the resources associated with the decoration, for example state containers.
*
* \note This method gets invoked by the compositor before init(), the decoration implementation
* must not call it.
*/
void create();
/**
* \internal
*
* Make the specified \a state current.
*
* The decoration maintains a double-buffered state. If a double-buffered property needs
* to be changed, the next state will be updated and the nextStateChanged() signal will be
* emitted to notify the compositor about it.
*
* When the next state gets applied is subject to compositor policies. For example, the
* compositor may apply the new state immediately, or it can synchronize double-buffered
* decoration state with double-buffered toplevel state.
*
* \sa currentState(), nextState(), createState()
*/
void apply(std::shared_ptr<DecorationState> state);
/**
* Returns the currently applied state.
*
* \sa apply()
*/
std::shared_ptr<DecorationState> currentState() const;
/**
* Returns the next state, i.e. the state that the decoration implementation wants to be current.
*
* \sa apply()
*/
std::shared_ptr<DecorationState> nextState() const;
/**
* Notifies the framework that the decoration state has changed. When the new state is applied
* is subject to compositor policies. For example, the compositor may re-configure the window
* and apply the new state when the window is repainted.
*/
void setState(std::function<void(DecorationState *state)> callback);
public Q_SLOTS:
void requestClose();
void requestToggleMaximization(Qt::MouseButtons buttons);
void requestMinimize();
void requestContextHelp();
void requestToggleOnAllDesktops();
void requestToggleShade();
void requestToggleKeepAbove();
void requestToggleKeepBelow();
#if KDECORATIONS3_ENABLE_DEPRECATED_SINCE(5, 21)
/**
* @deprecated
* @see requestShowWindowMenu(const QRect &rect)
*/
KDECORATIONS3_DEPRECATED_VERSION(5, 21, "Use Decoration::requestShowWindowMenu(QRect)")
void requestShowWindowMenu();
#endif
/**
* @param rect the location at which to show the window menu
*/
void requestShowWindowMenu(const QRect &rect);
void requestShowToolTip(const QString &text);
void requestHideToolTip();
void showApplicationMenu(int actionId);
void requestShowApplicationMenu(const QRect &rect, int actionId);
void update(const QRectF &rect);
void update();
/**
* This method gets invoked from the framework once the Decoration is created and
* completely setup.
*
* An inheriting class should override this method and perform all initialization in
* this method instead of the constructor.
*
* @return true if initialization has been successful,
* false otherwise (for example, a QML component could not be loaded)
**/
virtual bool init() = 0;
Q_SIGNALS:
void blurRegionChanged();
void bordersChanged();
void resizeOnlyBordersChanged();
void sectionUnderMouseChanged(Qt::WindowFrameSection);
void titleBarChanged();
void opaqueChanged(bool);
void shadowChanged(const std::shared_ptr<DecorationShadow> &shadow);
void damaged(const QRegion &region);
void currentStateChanged(std::shared_ptr<DecorationState> state);
void nextStateChanged(std::shared_ptr<DecorationState> state);
protected:
/**
* Constructor for the Decoration.
*
* The @p args are used by the decoration framework to pass meta information
* to the Decoration. An inheriting class is supposed to pass the args to the
* parent class.
*
* @param parent The parent of the Decoration
* @param args Additional arguments passed in from the framework
**/
explicit Decoration(QObject *parent, const QVariantList &args);
void setBorders(const QMarginsF &borders);
void setResizeOnlyBorders(const QMarginsF &borders);
void setBlurRegion(const QRegion &region);
/**
* An implementation has to invoke this method whenever the area
* containing the controls and caption changes.
* @param rect The new geometry of the titleBar in Decoration coordinates
**/
void setTitleBar(const QRectF &rect);
void setOpaque(bool opaque);
void setShadow(const std::shared_ptr<DecorationShadow> &shadow);
virtual void hoverEnterEvent(QHoverEvent *event);
virtual void hoverLeaveEvent(QHoverEvent *event);
virtual void hoverMoveEvent(QHoverEvent *event);
virtual void mouseMoveEvent(QMouseEvent *event);
virtual void mousePressEvent(QMouseEvent *event);
virtual void mouseReleaseEvent(QMouseEvent *event);
virtual void wheelEvent(QWheelEvent *event);
/**
* Create a state container. The decoration implementation can override this method to attach
* its own properties to the decoration state.
*
* The default implementation simply creates an instance of the DecorationState type.
*
* \sa currentState(), nextState()
*/
virtual std::shared_ptr<DecorationState> createState();
private:
friend class DecorationButton;
class Private;
std::unique_ptr<Private> d;
};
} // namespace
Q_DECLARE_METATYPE(KDecoration3::Decoration *)
@@ -0,0 +1,58 @@
/*
* SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
*
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#pragma once
#include "decoration.h"
//
// W A R N I N G
// -------------
//
// This file is not part of the KDecoration3 API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
namespace KDecoration3
{
class Decoration;
class DecorationBridge;
class DecorationButton;
class DecoratedWindow;
class DecorationSettings;
class DecorationShadow;
class Q_DECL_HIDDEN Decoration::Private
{
public:
Private(Decoration *decoration, const QVariantList &args);
QMarginsF resizeOnlyBorders;
Qt::WindowFrameSection sectionUnderMouse;
void setSectionUnderMouse(Qt::WindowFrameSection section);
void updateSectionUnderMouse(const QPoint &mousePosition);
QRectF titleBar;
QRegion blurRegion;
void addButton(DecorationButton *button);
std::shared_ptr<DecorationSettings> settings;
DecorationBridge *bridge;
std::shared_ptr<DecoratedWindow> client;
bool opaque;
QList<DecorationButton *> buttons;
std::shared_ptr<DecorationShadow> shadow;
std::shared_ptr<DecorationState> next;
std::shared_ptr<DecorationState> current;
private:
Decoration *q;
};
} // namespace
@@ -0,0 +1,601 @@
/*
* SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
*
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "decorationbutton.h"
#include "decoratedwindow.h"
#include "decoration.h"
#include "decoration_p.h"
#include "decorationbutton_p.h"
#include "decorationsettings.h"
#include <KLocalizedString>
#include <QDebug>
#include <QElapsedTimer>
#include <QGuiApplication>
#include <QHoverEvent>
#include <QStyleHints>
#include <QTimer>
#include <cmath>
#ifndef K_DOXYGEN
size_t qHash(const KDecoration3::DecorationButtonType &type, size_t seed)
{
return qHash(uint(type), seed);
}
#endif
namespace KDecoration3
{
DecorationButton::Private::Private(DecorationButtonType type, const QPointer<Decoration> &decoration, DecorationButton *parent)
: decoration(decoration)
, type(type)
, hovered(false)
, enabled(true)
, checkable(false)
, checked(false)
, visible(true)
, acceptedButtons(Qt::LeftButton)
, doubleClickEnabled(false)
, pressAndHold(false)
, q(parent)
, m_pressed(Qt::NoButton)
{
init();
}
DecorationButton::Private::~Private() = default;
void DecorationButton::Private::init()
{
auto c = decoration->window();
auto settings = decoration->settings();
switch (type) {
case DecorationButtonType::Menu:
QObject::connect(
q,
&DecorationButton::clicked,
decoration.data(),
[this](Qt::MouseButton button) {
Q_UNUSED(button)
decoration->requestShowWindowMenu(q->geometry().toRect());
},
Qt::QueuedConnection);
QObject::connect(q, &DecorationButton::doubleClicked, decoration.data(), &Decoration::requestClose, Qt::QueuedConnection);
QObject::connect(
settings.get(),
&DecorationSettings::closeOnDoubleClickOnMenuChanged,
q,
[this](bool enabled) {
doubleClickEnabled = enabled;
setPressAndHold(enabled);
},
Qt::QueuedConnection);
doubleClickEnabled = settings->isCloseOnDoubleClickOnMenu();
setPressAndHold(settings->isCloseOnDoubleClickOnMenu());
setAcceptedButtons(Qt::LeftButton | Qt::RightButton);
break;
case DecorationButtonType::ApplicationMenu:
setVisible(c->hasApplicationMenu());
setCheckable(true); // will be "checked" whilst the menu is opened
// FIXME TODO connect directly and figure out the button geometry/offset stuff
QObject::connect(
q,
&DecorationButton::clicked,
decoration.data(),
[this] {
decoration->requestShowApplicationMenu(q->geometry().toRect(), 0 /* actionId */);
},
Qt::QueuedConnection); //&Decoration::requestShowApplicationMenu, Qt::QueuedConnection);
QObject::connect(c, &DecoratedWindow::hasApplicationMenuChanged, q, &DecorationButton::setVisible);
QObject::connect(c, &DecoratedWindow::applicationMenuActiveChanged, q, &DecorationButton::setChecked);
break;
case DecorationButtonType::OnAllDesktops:
setVisible(settings->isOnAllDesktopsAvailable());
setCheckable(true);
setChecked(c->isOnAllDesktops());
QObject::connect(q, &DecorationButton::clicked, decoration.data(), &Decoration::requestToggleOnAllDesktops, Qt::QueuedConnection);
QObject::connect(settings.get(), &DecorationSettings::onAllDesktopsAvailableChanged, q, &DecorationButton::setVisible);
QObject::connect(c, &DecoratedWindow::onAllDesktopsChanged, q, &DecorationButton::setChecked);
break;
case DecorationButtonType::Minimize:
setEnabled(c->isMinimizeable());
QObject::connect(q, &DecorationButton::clicked, decoration.data(), &Decoration::requestMinimize, Qt::QueuedConnection);
QObject::connect(c, &DecoratedWindow::minimizeableChanged, q, &DecorationButton::setEnabled);
break;
case DecorationButtonType::Maximize:
setEnabled(c->isMaximizeable());
setCheckable(true);
setChecked(c->isMaximized());
setAcceptedButtons(Qt::LeftButton | Qt::MiddleButton | Qt::RightButton);
QObject::connect(q, &DecorationButton::clicked, decoration.data(), &Decoration::requestToggleMaximization, Qt::QueuedConnection);
QObject::connect(c, &DecoratedWindow::maximizeableChanged, q, &DecorationButton::setEnabled);
QObject::connect(c, &DecoratedWindow::maximizedChanged, q, &DecorationButton::setChecked);
break;
case DecorationButtonType::Close:
setEnabled(c->isCloseable());
QObject::connect(q, &DecorationButton::clicked, decoration.data(), &Decoration::requestClose, Qt::QueuedConnection);
QObject::connect(c, &DecoratedWindow::closeableChanged, q, &DecorationButton::setEnabled);
break;
case DecorationButtonType::ContextHelp:
setVisible(c->providesContextHelp());
QObject::connect(q, &DecorationButton::clicked, decoration.data(), &Decoration::requestContextHelp, Qt::QueuedConnection);
QObject::connect(c, &DecoratedWindow::providesContextHelpChanged, q, &DecorationButton::setVisible);
break;
case DecorationButtonType::KeepAbove:
setCheckable(true);
setChecked(c->isKeepAbove());
QObject::connect(q, &DecorationButton::clicked, decoration.data(), &Decoration::requestToggleKeepAbove, Qt::QueuedConnection);
QObject::connect(c, &DecoratedWindow::keepAboveChanged, q, &DecorationButton::setChecked);
break;
case DecorationButtonType::KeepBelow:
setCheckable(true);
setChecked(c->isKeepBelow());
QObject::connect(q, &DecorationButton::clicked, decoration.data(), &Decoration::requestToggleKeepBelow, Qt::QueuedConnection);
QObject::connect(c, &DecoratedWindow::keepBelowChanged, q, &DecorationButton::setChecked);
break;
case DecorationButtonType::Shade:
setEnabled(c->isShadeable());
setCheckable(true);
setChecked(c->isShaded());
QObject::connect(q, &DecorationButton::clicked, decoration.data(), &Decoration::requestToggleShade, Qt::QueuedConnection);
QObject::connect(c, &DecoratedWindow::shadedChanged, q, &DecorationButton::setChecked);
QObject::connect(c, &DecoratedWindow::shadeableChanged, q, &DecorationButton::setEnabled);
break;
case DecorationButtonType::Spacer:
setEnabled(false);
break;
default:
// nothing
break;
}
}
void DecorationButton::Private::setHovered(bool set)
{
if (hovered == set) {
return;
}
hovered = set;
Q_EMIT q->hoveredChanged(hovered);
}
void DecorationButton::Private::setEnabled(bool set)
{
if (enabled == set) {
return;
}
enabled = set;
Q_EMIT q->enabledChanged(enabled);
if (!enabled) {
setHovered(false);
if (isPressed()) {
m_pressed = Qt::NoButton;
Q_EMIT q->pressedChanged(false);
}
}
}
void DecorationButton::Private::setVisible(bool set)
{
if (visible == set) {
return;
}
visible = set;
Q_EMIT q->visibilityChanged(set);
if (!visible) {
setHovered(false);
if (isPressed()) {
m_pressed = Qt::NoButton;
Q_EMIT q->pressedChanged(false);
}
}
}
void DecorationButton::Private::setChecked(bool set)
{
if (!checkable || checked == set) {
return;
}
checked = set;
Q_EMIT q->checkedChanged(checked);
}
void DecorationButton::Private::setCheckable(bool set)
{
if (checkable == set) {
return;
}
if (!set) {
setChecked(false);
}
checkable = set;
Q_EMIT q->checkableChanged(checkable);
}
void DecorationButton::Private::setPressed(Qt::MouseButton button, bool pressed)
{
if (pressed) {
m_pressed = m_pressed | button;
} else {
m_pressed = m_pressed & ~button;
}
Q_EMIT q->pressedChanged(isPressed());
}
void DecorationButton::Private::setAcceptedButtons(Qt::MouseButtons buttons)
{
if (acceptedButtons == buttons) {
return;
}
acceptedButtons = buttons;
Q_EMIT q->acceptedButtonsChanged(acceptedButtons);
}
void DecorationButton::Private::startDoubleClickTimer()
{
if (!doubleClickEnabled) {
return;
}
if (!m_doubleClickTimer) {
m_doubleClickTimer = std::make_unique<QElapsedTimer>();
}
m_doubleClickTimer->start();
}
void DecorationButton::Private::invalidateDoubleClickTimer()
{
if (!m_doubleClickTimer) {
return;
}
m_doubleClickTimer->invalidate();
}
bool DecorationButton::Private::wasDoubleClick() const
{
if (!m_doubleClickTimer || !m_doubleClickTimer->isValid()) {
return false;
}
return !m_doubleClickTimer->hasExpired(QGuiApplication::styleHints()->mouseDoubleClickInterval());
}
void DecorationButton::Private::setPressAndHold(bool enable)
{
if (pressAndHold == enable) {
return;
}
pressAndHold = enable;
if (!pressAndHold) {
m_pressAndHoldTimer.reset();
}
}
void DecorationButton::Private::startPressAndHold()
{
if (!pressAndHold) {
return;
}
if (!m_pressAndHoldTimer) {
m_pressAndHoldTimer.reset(new QTimer());
m_pressAndHoldTimer->setSingleShot(true);
QObject::connect(m_pressAndHoldTimer.get(), &QTimer::timeout, q, [this]() {
q->clicked(Qt::LeftButton);
});
}
m_pressAndHoldTimer->start(QGuiApplication::styleHints()->mousePressAndHoldInterval());
}
void DecorationButton::Private::stopPressAndHold()
{
if (m_pressAndHoldTimer) {
m_pressAndHoldTimer->stop();
}
}
QString DecorationButton::Private::typeToString(DecorationButtonType type)
{
switch (type) {
case DecorationButtonType::Menu:
return i18n("More actions for this window");
case DecorationButtonType::ApplicationMenu:
return i18n("Application menu");
case DecorationButtonType::OnAllDesktops:
if (this->q->isChecked())
return i18n("On one desktop");
else
return i18n("On all desktops");
case DecorationButtonType::Minimize:
return i18n("Minimize");
case DecorationButtonType::Maximize:
if (this->q->isChecked())
return i18n("Restore");
else
return i18n("Maximize");
case DecorationButtonType::Close:
return i18n("Close");
case DecorationButtonType::ContextHelp:
return i18n("Context help");
case DecorationButtonType::Shade:
if (this->q->isChecked())
return i18n("Unshade");
else
return i18n("Shade");
case DecorationButtonType::KeepBelow:
if (this->q->isChecked())
return i18n("Don't keep below other windows");
else
return i18n("Keep below other windows");
case DecorationButtonType::KeepAbove:
if (this->q->isChecked())
return i18n("Don't keep above other windows");
else
return i18n("Keep above other windows");
default:
return QString();
}
}
DecorationButton::DecorationButton(DecorationButtonType type, Decoration *decoration, QObject *parent)
: QObject(parent)
, d(new Private(type, decoration, this))
{
decoration->d->addButton(this);
connect(this, &DecorationButton::geometryChanged, this, static_cast<void (DecorationButton::*)(const QRectF &)>(&DecorationButton::update));
auto updateSlot = static_cast<void (DecorationButton::*)()>(&DecorationButton::update);
connect(this, &DecorationButton::hoveredChanged, this, updateSlot);
connect(this, &DecorationButton::hoveredChanged, this, [this](bool hovered) {
if (hovered) {
// TODO: show tooltip if hovered and hide if not
const QString type = this->d->typeToString(this->type());
this->decoration()->requestShowToolTip(type);
} else {
this->decoration()->requestHideToolTip();
}
});
connect(this, &DecorationButton::pressedChanged, this, updateSlot);
connect(this, &DecorationButton::pressedChanged, this, [this](bool pressed) {
if (pressed) {
this->decoration()->requestHideToolTip();
}
});
connect(this, &DecorationButton::checkedChanged, this, updateSlot);
connect(this, &DecorationButton::enabledChanged, this, updateSlot);
connect(this, &DecorationButton::visibilityChanged, this, updateSlot);
connect(this, &DecorationButton::hoveredChanged, this, [this](bool hovered) {
if (hovered) {
Q_EMIT pointerEntered();
} else {
Q_EMIT pointerLeft();
}
});
connect(this, &DecorationButton::pressedChanged, this, [this](bool p) {
if (p) {
Q_EMIT pressed();
} else {
Q_EMIT released();
}
});
}
DecorationButton::~DecorationButton() = default;
void DecorationButton::update(const QRectF &rect)
{
decoration()->update(rect.isNull() ? geometry().toRect() : rect.toRect());
}
void DecorationButton::update()
{
update(QRectF());
}
QSizeF DecorationButton::size() const
{
return d->geometry.size();
}
bool DecorationButton::isPressed() const
{
return d->isPressed();
}
bool DecorationButton::isHovered() const
{
return d->hovered;
}
bool DecorationButton::isEnabled() const
{
return d->enabled;
}
bool DecorationButton::isChecked() const
{
return d->checked;
}
bool DecorationButton::isCheckable() const
{
return d->checkable;
}
bool DecorationButton::isVisible() const
{
return d->visible;
}
QRectF DecorationButton::geometry() const
{
return d->geometry;
}
Decoration *DecorationButton::decoration() const
{
return d->decoration;
}
Qt::MouseButtons DecorationButton::acceptedButtons() const
{
return d->acceptedButtons;
}
DecorationButtonType DecorationButton::type() const
{
return d->type;
}
void DecorationButton::setAcceptedButtons(Qt::MouseButtons value)
{
d->setAcceptedButtons(value);
}
void DecorationButton::setEnabled(bool value)
{
d->setEnabled(value);
}
void DecorationButton::setChecked(bool value)
{
d->setChecked(value);
}
void DecorationButton::setCheckable(bool value)
{
d->setCheckable(value);
}
void DecorationButton::setVisible(bool value)
{
d->setVisible(value);
}
void DecorationButton::setGeometry(const QRectF &geometry)
{
if (d->geometry == geometry) {
return;
}
d->geometry = geometry;
Q_EMIT geometryChanged(d->geometry);
}
bool DecorationButton::contains(const QPointF &pos) const
{
auto flooredPoint = QPoint(std::floor(pos.x()), std::floor(pos.y()));
return d->geometry.toRect().contains(flooredPoint);
}
bool DecorationButton::event(QEvent *event)
{
switch (event->type()) {
case QEvent::HoverEnter:
hoverEnterEvent(static_cast<QHoverEvent *>(event));
return true;
case QEvent::HoverLeave:
hoverLeaveEvent(static_cast<QHoverEvent *>(event));
return true;
case QEvent::HoverMove:
hoverMoveEvent(static_cast<QHoverEvent *>(event));
return true;
case QEvent::MouseButtonPress:
mousePressEvent(static_cast<QMouseEvent *>(event));
return true;
case QEvent::MouseButtonRelease:
mouseReleaseEvent(static_cast<QMouseEvent *>(event));
return true;
case QEvent::MouseMove:
mouseMoveEvent(static_cast<QMouseEvent *>(event));
return true;
case QEvent::Wheel:
wheelEvent(static_cast<QWheelEvent *>(event));
return true;
default:
return QObject::event(event);
}
}
void DecorationButton::hoverEnterEvent(QHoverEvent *event)
{
if (!d->enabled || !d->visible || !contains(event->position())) {
return;
}
d->setHovered(true);
event->setAccepted(true);
}
void DecorationButton::hoverLeaveEvent(QHoverEvent *event)
{
if (!d->enabled || !d->visible || !d->hovered || contains(event->position())) {
return;
}
d->setHovered(false);
event->setAccepted(true);
}
void DecorationButton::hoverMoveEvent(QHoverEvent *event)
{
Q_UNUSED(event)
}
void DecorationButton::mouseMoveEvent(QMouseEvent *event)
{
if (!d->enabled || !d->visible || !d->hovered) {
return;
}
if (!contains(event->position())) {
d->setHovered(false);
event->setAccepted(true);
}
}
void DecorationButton::mousePressEvent(QMouseEvent *event)
{
if (!d->enabled || !d->visible || !contains(event->position()) || !d->acceptedButtons.testFlag(event->button())) {
return;
}
d->setPressed(event->button(), true);
event->setAccepted(true);
if (d->doubleClickEnabled && event->button() == Qt::LeftButton) {
// check for double click
if (d->wasDoubleClick()) {
event->setAccepted(true);
Q_EMIT doubleClicked();
}
d->invalidateDoubleClickTimer();
}
if (d->pressAndHold && event->button() == Qt::LeftButton) {
d->startPressAndHold();
}
}
void DecorationButton::mouseReleaseEvent(QMouseEvent *event)
{
if (!d->enabled || !d->visible || !d->isPressed(event->button())) {
return;
}
if (contains(event->position())) {
if (!d->pressAndHold || event->button() != Qt::LeftButton) {
Q_EMIT clicked(event->button());
} else {
d->stopPressAndHold();
}
}
d->setPressed(event->button(), false);
event->setAccepted(true);
if (d->doubleClickEnabled && event->button() == Qt::LeftButton) {
d->startDoubleClickTimer();
}
}
void DecorationButton::wheelEvent(QWheelEvent *event)
{
Q_UNUSED(event)
}
}
#include "moc_decorationbutton.cpp"
@@ -0,0 +1,179 @@
/*
* SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
*
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#pragma once
#include "decorationdefines.h"
#include <kdecoration3/kdecoration3_export.h>
#include <QObject>
#include <QRect>
class QHoverEvent;
class QMouseEvent;
class QPainter;
class QWheelEvent;
namespace KDecoration3
{
class DecorationButtonPrivate;
class Decoration;
/**
* @brief A button to be used in a Decoration.
*
* The DecorationButton is a simple Button which can be used (but doesn't have to) in a Decoration.
* It takes care of the input handling and triggers the correct state change methods on the
* Decoration.
*
* This simplifies the handling of DecorationButtons. A Decoration implementation just needs to
* subclass DecorationButton and implement the paint method. Everything else is handled by the
* DecorationButton.
*
* For positioning the DecorationButtons it's recommended to use a DecorationButtonGroup.
*
* @see Decoration
* @see DecorationButtonGroup
**/
class KDECORATIONS3_EXPORT DecorationButton : public QObject
{
Q_OBJECT
/**
* Whether the DecorationButton is visible. By default this is @c true, OnAllDesktops and
* QuickHelp depend on the DecoratedWindow's state.
**/
Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibilityChanged)
/**
* Whether the DecorationButton is currently pressed.
**/
Q_PROPERTY(bool pressed READ isPressed NOTIFY pressedChanged)
/**
* Whether the DecorationButton is currently hovered.
**/
Q_PROPERTY(bool hovered READ isHovered NOTIFY hoveredChanged)
/**
* Whether the DecorationButton is enabled. Only an enabled button accepts hover and mouse
* press events.
**/
Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged)
/**
* Whether the DecorationButton can be checked. This is used for state aware DecorationButtons
* like Maximize, Shade, KeepAbove, KeepBelow and OnAllDesktops.
**/
Q_PROPERTY(bool checkable READ isCheckable WRITE setCheckable NOTIFY checkableChanged)
/**
* Whether the DecorationButton is checked. A DecorationButton can only be checked if the
* DecorationButton is checkable. Note: the checked state is not changed by clicking the
* DecorationButton. It gets changed if the DecoratedWindow changes it's state, though.
**/
Q_PROPERTY(bool checked READ isChecked WRITE setChecked NOTIFY checkedChanged)
/**
* The geometry of the DecorationButton in Decoration-local coordinates.
**/
Q_PROPERTY(QRectF geometry READ geometry NOTIFY geometryChanged)
/**
* The mouse buttons the DecorationButton accepts. By default the Qt::LeftButton gets accepted,
* for some types more buttons are accepted.
**/
Q_PROPERTY(Qt::MouseButtons acceptedButtons READ acceptedButtons WRITE setAcceptedButtons NOTIFY acceptedButtonsChanged)
public:
~DecorationButton() override;
QRectF geometry() const;
QSizeF size() const;
void setGeometry(const QRectF &geometry);
bool isVisible() const;
bool isPressed() const;
bool isHovered() const;
bool isEnabled() const;
bool isChecked() const;
bool isCheckable() const;
DecorationButtonType type() const;
/**
* Returns @c true if @p pos is inside of the button, otherwise returns @c false.
**/
bool contains(const QPointF &pos) const;
Qt::MouseButtons acceptedButtons() const;
void setAcceptedButtons(Qt::MouseButtons buttons);
/**
* Invoked for painting this DecorationButtons. Implementing sub-classes need to implement
* this method. The coordinate system of the QPainter is set to Decoration coordinates.
*
* This method will be invoked from the rendering thread.
*
* @param painter The QPainter to paint this DecorationButton.
* @param repaintArea The area which is going to be repainted in Decoration coordinates
**/
virtual void paint(QPainter *painter, const QRectF &repaintArea) = 0;
Decoration *decoration() const;
bool event(QEvent *event) override;
public Q_SLOTS:
void setEnabled(bool enabled);
void setCheckable(bool checkable);
void setChecked(bool checked);
void setVisible(bool visible);
/**
* Schedules a repaint of the DecorationButton.
* Calling update will eventually result in paint being invoked.
*
* @param rect The area to repaint in Decoration local coordinates, a null QRect updates the complete geometry
* @see paint
**/
void update(const QRectF &rect);
/**
* Schedules a repaint of the DecorationButton.
*
* Overloaded method for convenience.
**/
void update();
Q_SIGNALS:
void clicked(Qt::MouseButton);
void pressed();
void released();
void pointerEntered();
void pointerLeft();
void doubleClicked();
void pressedChanged(bool);
void hoveredChanged(bool);
void enabledChanged(bool);
void checkableChanged(bool);
void checkedChanged(bool);
void geometryChanged(const QRectF &);
void acceptedButtonsChanged(Qt::MouseButtons);
void visibilityChanged(bool);
protected:
explicit DecorationButton(DecorationButtonType type, Decoration *decoration, QObject *parent = nullptr);
virtual void hoverEnterEvent(QHoverEvent *event);
virtual void hoverLeaveEvent(QHoverEvent *event);
virtual void hoverMoveEvent(QHoverEvent *event);
virtual void mouseMoveEvent(QMouseEvent *event);
virtual void mousePressEvent(QMouseEvent *event);
virtual void mouseReleaseEvent(QMouseEvent *event);
virtual void wheelEvent(QWheelEvent *event);
private:
class Private;
std::unique_ptr<Private> d;
};
} // namespace
#ifndef K_DOXYGEN
size_t KDECORATIONS3_EXPORT qHash(const KDecoration3::DecorationButtonType &type, size_t seed = 0);
#endif
Q_DECLARE_METATYPE(KDecoration3::DecorationButtonType)
@@ -0,0 +1,79 @@
/*
* SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
*
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#pragma once
#include "decorationbutton.h"
#include <QPointer>
class QElapsedTimer;
class QTimer;
//
// W A R N I N G
// -------------
//
// This file is not part of the KDecoration3 API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
namespace KDecoration3
{
class Q_DECL_HIDDEN DecorationButton::Private
{
public:
explicit Private(DecorationButtonType type, const QPointer<Decoration> &decoration, DecorationButton *parent);
~Private();
bool isPressed() const
{
return m_pressed != Qt::NoButton;
}
bool isPressed(Qt::MouseButton button) const
{
return m_pressed.testFlag(button);
}
void setHovered(bool hovered);
void setPressed(Qt::MouseButton, bool pressed);
void setAcceptedButtons(Qt::MouseButtons buttons);
void setEnabled(bool enabled);
void setChecked(bool checked);
void setCheckable(bool checkable);
void setVisible(bool visible);
void startDoubleClickTimer();
void invalidateDoubleClickTimer();
bool wasDoubleClick() const;
void setPressAndHold(bool enable);
void startPressAndHold();
void stopPressAndHold();
QString typeToString(DecorationButtonType type);
QPointer<Decoration> decoration;
DecorationButtonType type;
QRectF geometry;
bool hovered;
bool enabled;
bool checkable;
bool checked;
bool visible;
Qt::MouseButtons acceptedButtons;
bool doubleClickEnabled;
bool pressAndHold;
private:
void init();
DecorationButton *q;
Qt::MouseButtons m_pressed;
std::unique_ptr<QElapsedTimer> m_doubleClickTimer;
std::unique_ptr<QTimer> m_pressAndHoldTimer;
};
}
@@ -0,0 +1,244 @@
/*
* SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
*
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "decorationbuttongroup.h"
#include "decoration.h"
#include "decorationbuttongroup_p.h"
#include "decorationsettings.h"
#include <QDebug>
#include <QGuiApplication>
namespace KDecoration3
{
DecorationButtonGroup::Private::Private(Decoration *decoration, DecorationButtonGroup *parent)
: decoration(decoration)
, spacing(0.0)
, q(parent)
{
}
DecorationButtonGroup::Private::~Private() = default;
void DecorationButtonGroup::Private::setGeometry(const QRectF &geo)
{
if (geometry == geo) {
return;
}
geometry = geo;
Q_EMIT q->geometryChanged(geometry);
}
namespace
{
static bool s_layoutRecursion = false;
}
void DecorationButtonGroup::Private::updateLayout()
{
if (s_layoutRecursion) {
return;
}
s_layoutRecursion = true;
const QPointF &pos = geometry.topLeft();
// first calculate new size
qreal height = 0;
qreal width = 0;
for (auto it = buttons.constBegin(); it != buttons.constEnd(); ++it) {
if (!(*it)->isVisible()) {
continue;
}
height = qMax(height, qreal((*it)->size().height()));
width += (*it)->size().width();
if (it + 1 != buttons.constEnd()) {
width += spacing;
}
}
setGeometry(QRectF(pos, QSizeF(width, height)));
QGuiApplication* app = qobject_cast<QGuiApplication*>(QCoreApplication::instance());
const auto layoutDirection = app ? app->layoutDirection() : Qt::LeftToRight;
qreal leftPosition = pos.x();
qreal rightPosition = pos.x() + width;
if (layoutDirection == Qt::LeftToRight)
for (auto button : std::as_const(buttons)) {
if (!button->isVisible()) {
continue;
}
const auto size = button->size();
const auto buttonPos = QPointF(leftPosition, pos.y());
button->setGeometry(QRectF(buttonPos, size));
leftPosition += size.width() + spacing;
}
else if (layoutDirection == Qt::RightToLeft)
for (auto button : std::as_const(buttons)) {
if (!button->isVisible()) {
continue;
}
const auto size = button->size();
const auto buttonPos = QPointF(rightPosition - size.width(), pos.y());
button->setGeometry(QRectF(buttonPos, size));
rightPosition -= size.width() + spacing;
}
else {
qCritical() << "There's an unhandled layout direction! This is likely an issue of KDecoration3 not being updated to handle it\n"
<< "or the application having an invalid layout direction set. Either way, this is a critical bug.";
}
s_layoutRecursion = false;
}
DecorationButtonGroup::DecorationButtonGroup(Decoration *parent)
: QObject(parent)
, d(new Private(parent, this))
{
}
DecorationButtonGroup::DecorationButtonGroup(DecorationButtonGroup::Position type,
Decoration *parent,
std::function<DecorationButton *(DecorationButtonType, Decoration *, QObject *)> buttonCreator)
: QObject(parent)
, d(new Private(parent, this))
{
auto createButtons = [this, buttonCreator, type] {
const Qt::LayoutDirection layoutDirection = QGuiApplication::layoutDirection();
const DecorationSettings *settings = d->decoration->settings().get();
const auto &buttons =
(type == Position::Left) ?
(layoutDirection == Qt::LeftToRight ? settings->decorationButtonsLeft() : settings->decorationButtonsRight()) :
(layoutDirection == Qt::LeftToRight ? settings->decorationButtonsRight() : settings->decorationButtonsLeft());
for (DecorationButtonType type : buttons) {
if (DecorationButton *b = buttonCreator(type, d->decoration, this)) {
addButton(b);
}
}
};
createButtons();
auto changed = type == Position::Left ? &DecorationSettings::decorationButtonsLeftChanged : &DecorationSettings::decorationButtonsRightChanged;
connect(parent->settings().get(), changed, this, [this, createButtons] {
qDeleteAll(d->buttons);
d->buttons.clear();
createButtons();
});
}
DecorationButtonGroup::~DecorationButtonGroup() = default;
Decoration *DecorationButtonGroup::decoration() const
{
return d->decoration;
}
QRectF DecorationButtonGroup::geometry() const
{
return d->geometry;
}
bool DecorationButtonGroup::hasButton(DecorationButtonType type) const
{
// TODO: check for deletion of button
auto it = std::find_if(d->buttons.begin(), d->buttons.end(), [type](DecorationButton *button) {
return button->type() == type;
});
return it != d->buttons.end();
}
qreal DecorationButtonGroup::spacing() const
{
return d->spacing;
}
QPointF DecorationButtonGroup::pos() const
{
return d->geometry.topLeft();
}
void DecorationButtonGroup::setPos(const QPointF &pos)
{
if (d->geometry.topLeft() == pos) {
return;
}
d->setGeometry(QRectF(pos, d->geometry.size()));
d->updateLayout();
}
void DecorationButtonGroup::setSpacing(qreal spacing)
{
if (d->spacing == spacing) {
return;
}
d->spacing = spacing;
Q_EMIT spacingChanged(d->spacing);
d->updateLayout();
}
void DecorationButtonGroup::addButton(DecorationButton *button)
{
Q_ASSERT(button);
connect(button, &DecorationButton::visibilityChanged, this, [this]() {
d->updateLayout();
});
connect(button, &DecorationButton::geometryChanged, this, [this]() {
d->updateLayout();
});
d->buttons.append(button);
d->updateLayout();
}
QList<DecorationButton *> DecorationButtonGroup::buttons() const
{
return d->buttons;
}
void DecorationButtonGroup::removeButton(DecorationButtonType type)
{
bool needUpdate = false;
auto it = d->buttons.begin();
while (it != d->buttons.end()) {
if ((*it)->type() == type) {
it = d->buttons.erase(it);
needUpdate = true;
} else {
it++;
}
}
if (needUpdate) {
d->updateLayout();
}
}
void DecorationButtonGroup::removeButton(DecorationButton *button)
{
bool needUpdate = false;
auto it = d->buttons.begin();
while (it != d->buttons.end()) {
if (*it == button) {
it = d->buttons.erase(it);
needUpdate = true;
} else {
it++;
}
}
if (needUpdate) {
d->updateLayout();
}
}
void DecorationButtonGroup::paint(QPainter *painter, const QRectF &repaintArea)
{
const auto &buttons = d->buttons;
for (auto button : buttons) {
if (!button->isVisible()) {
continue;
}
button->paint(painter, repaintArea);
}
}
} // namespace
#include "moc_decorationbuttongroup.cpp"

Some files were not shown because too many files have changed in this diff Show More