button-handler: Add power button actions

Create match handlers for the following power button signals:

1) 'Released'
* If the system is off, then power it on.
* If the system is on, then soft power it off.

2) 'PressedLong' (Really means long press released)
* If the system is on, do an immediate power off.
* If the system is off, do nothing.

It only installs the match objects for these if the power button
object exists on D-Bus.  This is done so that systems that don't
implement a certain button won't still have watches on their
signals.

Tested:  Pushed buttons and watched the magic happen.

Change-Id: I6d17529d0dafc237f90a0e6a121e4b5da1204f81
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f5c3078..c4e8483 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,12 +12,17 @@
 set(ID_DBUS_OBJECT_NAME "xyz/openbmc_project/Chassis/Buttons/ID")
 set(GPIO_BASE_LABEL_NAME "1e780000.gpio")
 set(LONG_PRESS_TIME_MS 3000)
+set(CHASSIS_STATE_OBJECT_NAME "xyz/openbmc_project/state/chassis")
+set(HOST_STATE_OBJECT_NAME "xyz/openbmc_project/state/host")
 
 add_definitions(-DPOWER_DBUS_OBJECT_NAME="/${POWER_DBUS_OBJECT_NAME}0")
 add_definitions(-DRESET_DBUS_OBJECT_NAME="/${RESET_DBUS_OBJECT_NAME}0")
 add_definitions(-DID_DBUS_OBJECT_NAME="/${ID_DBUS_OBJECT_NAME}0")
 add_definitions(-DGPIO_BASE_LABEL_NAME="${GPIO_BASE_LABEL_NAME}")
 add_definitions(-DLONG_PRESS_TIME_MS=${LONG_PRESS_TIME_MS})
+add_definitions(-DHOST_STATE_OBJECT_NAME="/${HOST_STATE_OBJECT_NAME}0")
+add_definitions(-DCHASSIS_STATE_OBJECT_NAME="/${CHASSIS_STATE_OBJECT_NAME}0")
+
 set(SRC_FILES src/power_button.cpp
     src/reset_button.cpp
     src/id_button.cpp