Skip to content

Commit 0bc1aa9

Browse files
committed
some ddcutil squeleton
1 parent 68a39bd commit 0bc1aa9

4 files changed

Lines changed: 34 additions & 1 deletion

File tree

src/panel/panel.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ class WayfirePanel::impl
177177
std::cerr << "Built without wireplumber support, mixer widget "
178178
" is not available." << std::endl;
179179
#endif
180+
}
181+
180182
if (name == "light")
181183
{
182184
return Widget(new WayfireLight(output));
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,29 @@
1+
extern "C"{
2+
#include <ddcutil_c_api.h>
3+
#include <ddcutil_status_codes.h>
4+
}
15

6+
#include "light.hpp"
7+
8+
class WfLightDdcaControl : public WfLightControl
9+
{
10+
friend class DdcaSurveillor;
11+
12+
private:
13+
DDCA_Display_Ref ref;
14+
};
15+
16+
class DdcaSurveillor {
17+
private:
18+
DdcaSurveillor(){
19+
ddca_enable_verify(true);
20+
DDCA_Display_Info_List *display_list = NULL;
21+
ddca_get_display_info_list2(false, &display_list);
22+
23+
for (int i = 0 ; i < display_list->ct ; i++){
24+
display_refs.push_back(display_list[i]);
25+
}
26+
}
27+
28+
std::vector<DDCA_Display_Info> display_refs;
29+
}

src/panel/widgets/light/light.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ void WayfireLight::init(Gtk::Box *container){
120120
container->append(*button);
121121

122122
setup_sysfs();
123+
#ifdef HAVE_DDCUTIL
124+
setup_ddc();
125+
#endif
123126

124127
update_icon();
125128
}

src/panel/widgets/light/sysfs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class WfLightSysfsControl: public WfLightControl
2020
// if we exist, it means we can just read/write, as the files and permissions
2121
// have already been checked and are being monitored with inotify
2222

23-
protected:
23+
private:
2424
std::string path, connector_name;
2525

2626
int get_max(){

0 commit comments

Comments
 (0)