mirror of
				https://github.com/rad4day/Waybar.git
				synced 2025-10-24 22:52:32 +02:00 
			
		
		
		
	Added all callbacks
This commit is contained in:
		| @@ -42,6 +42,9 @@ | ||||
| #ifdef HAVE_LIBEVDEV | ||||
| #include "modules/keyboard_state.hpp" | ||||
| #endif | ||||
| #ifdef HAVE_UPOWER | ||||
| #include "modules/upower/upower.hpp" | ||||
| #endif | ||||
| #ifdef HAVE_LIBPULSE | ||||
| #include "modules/pulseaudio.hpp" | ||||
| #endif | ||||
|   | ||||
							
								
								
									
										43
									
								
								include/modules/upower/upower.hpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								include/modules/upower/upower.hpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,43 @@ | ||||
| #pragma once | ||||
|  | ||||
| #include <libupower-glib/upower.h> | ||||
|  | ||||
| #include <algorithm> | ||||
| #include <iostream> | ||||
| #include <map> | ||||
| #include <string> | ||||
| #include <vector> | ||||
|  | ||||
| #include "ALabel.hpp" | ||||
| #include "gtkmm/box.h" | ||||
| #include "gtkmm/image.h" | ||||
| #include "gtkmm/label.h" | ||||
|  | ||||
| namespace waybar::modules { | ||||
|  | ||||
| class UPower : public AModule { | ||||
|  public: | ||||
|   UPower(const std::string &, const Json::Value &); | ||||
|   ~UPower(); | ||||
|   auto update() -> void; | ||||
|  | ||||
|  private: | ||||
|   static void deviceAdded_cb(UpClient *client, UpDevice *device, gpointer data); | ||||
|   static void deviceRemoved_cb(UpClient *client, const gchar *object_path, gpointer data); | ||||
|   static void deviceNotify_cb(gpointer data); | ||||
|   void        removeDevice(const std::string devicePath); | ||||
|   void        addDevice(UpDevice *device); | ||||
|   void        setDisplayDevice(); | ||||
|   void        resetDevices(); | ||||
|   static void clicked(); | ||||
|  | ||||
|   Gtk::Box   box_; | ||||
|   Gtk::Image icon_; | ||||
|   Gtk::Label label_; | ||||
|  | ||||
|   UpClient                         *client = NULL; | ||||
|   UpDevice                         *displayDevice = NULL; | ||||
|   std::map<std::string, UpDevice *> devices; | ||||
| }; | ||||
|  | ||||
| }  // namespace waybar::modules | ||||
		Reference in New Issue
	
	Block a user
	 Erik Reider
					Erik Reider