pppc/pppc.h

45 lines
1.2 KiB
C++

#ifndef PPPC_H
#define PPPC_H
#include "Config.h"
#include <vector>
#define APP_NAME "Parallel Port Power Controller"
#define WM_ICON_NOTIFY (WM_APP + 42)
class PPPC
{
public:
enum ConfigEntryMode { AUTO, MANUAL_OFF, MANUAL_ON };
static const char * ConfigEntryCaptions[3];
PPPC(HINSTANCE hInstance, const char * config_file = NULL);
~PPPC();
BOOL mainLoop();
protected:
void event_start();
void event_exit();
void event_lock();
void event_unlock();
void update_pins();
void updateConfigMenus(int i);
Config m_config;
HWND m_hWnd;
NOTIFYICONDATA m_nid;
unsigned char m_pins;
unsigned char m_previous_pins;
HMENU m_popupMenu;
std::vector<HMENU> m_menus;
std::vector<ConfigEntryMode> m_modes;
};
/* non class-member functions */
void addMenuItem(HMENU hMenu, const CHAR * itemstr, WORD id);
HMENU addMenuSubMenu(HMENU hMenu, const CHAR * itemstr, WORD id);
void updateMenuInfo(HMENU hMenu, int index, const CHAR * itemstr, WORD id, bool checked);
#endif