Skip to content

Commit 8bbdce7

Browse files
committed
Implemented ws::IDisplay::get_file_descriptor method for obtaining event loop descriptor for Unix-based systems that use X11 protocol
1 parent a440451 commit 8bbdce7

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
=== 1.0.29 ===
66
* Implemented AudioEnvelope widget and it's integration into AudioSample.
7+
* Implemented ws::IDisplay::get_file_descriptor method for obtaining event loop
8+
descriptor for Unix-based systems that use X11 protocol
79

810
=== 1.0.28 ===
911
* Added support of background color, brightness and background brightness for

include/lsp-plug.in/tk/sys/Display.h

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/>
3-
* (C) 2023 Vladimir Sadovnikov <sadko4u@gmail.com>
2+
* Copyright (C) 2025 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2025 Vladimir Sadovnikov <sadko4u@gmail.com>
44
*
55
* This file is part of lsp-tk-lib
66
* Created on: 19 июн. 2017 г.
@@ -47,9 +47,6 @@ namespace lsp
4747
class Display: public Atoms
4848
{
4949
private:
50-
Display & operator = (const Display &);
51-
Display(const Display &);
52-
5350
friend class Schema;
5451

5552
protected:
@@ -88,6 +85,10 @@ namespace lsp
8885
* @param settings additional display settings
8986
*/
9087
explicit Display(display_settings_t *settings = NULL);
88+
Display(const Display &) = delete;
89+
Display(Display &&) = delete;
90+
Display & operator = (const Display &) = delete;
91+
Display & operator = (Display &&) = delete;
9192

9293
/** Destructor
9394
*
@@ -363,6 +364,16 @@ namespace lsp
363364
* @return previous value of the idle interval
364365
*/
365366
size_t set_idle_interval(size_t interval);
367+
368+
/**
369+
* Obtain the file descriptor of the connection associated with the event loop
370+
* if it is supported (usually Unix-based systems with X11 protocol).
371+
*
372+
* @param fd pointer to store file descriptor
373+
* @return status of operation, STATUS_NOT_SUPPORTED if platform does
374+
* not support file desciptors for event loops
375+
*/
376+
status_t get_file_descriptor(int *fd);
366377
};
367378

368379
} /* namespace tk */

src/main/sys/Display.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/>
3-
* (C) 2023 Vladimir Sadovnikov <sadko4u@gmail.com>
2+
* Copyright (C) 2025 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2025 Vladimir Sadovnikov <sadko4u@gmail.com>
44
*
55
* This file is part of lsp-tk-lib
66
* Created on: 19 июн. 2017 г.
@@ -469,5 +469,10 @@ namespace lsp
469469
return pDisplay->set_idle_interval(interval);
470470
}
471471

472+
status_t Display::get_file_descriptor(int *fd)
473+
{
474+
return pDisplay->get_file_descriptor(fd);
475+
}
476+
472477
} /* namespace tk */
473478
} /* namespace lsp */

0 commit comments

Comments
 (0)