aboutsummaryrefslogtreecommitdiff
path: root/src/tray.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tray.c')
-rw-r--r--src/tray.c144
1 files changed, 108 insertions, 36 deletions
diff --git a/src/tray.c b/src/tray.c
index d30dd1e..a710941 100644
--- a/src/tray.c
+++ b/src/tray.c
@@ -38,14 +38,18 @@ static void LayoutTray(TrayType *tp, int *variableSize,
/***************************************************************************
***************************************************************************/
-void InitializeTray() {
+void
+InitializeTray()
+{
trays = NULL;
supportingWindow = None;
}
/***************************************************************************
***************************************************************************/
-void StartupTray() {
+void
+StartupTray()
+{
XSetWindowAttributes attr;
unsigned long attrMask;
@@ -146,7 +150,9 @@ void StartupTray() {
/***************************************************************************
***************************************************************************/
-void ShutdownTray() {
+void
+ShutdownTray()
+{
TrayType *tp;
TrayComponentType *cp;
@@ -170,7 +176,9 @@ void ShutdownTray() {
/***************************************************************************
***************************************************************************/
-void DestroyTray() {
+void
+DestroyTray()
+{
TrayType *tp;
TrayComponentType *cp;
@@ -263,7 +271,9 @@ TrayComponentType *CreateTrayComponent() {
/***************************************************************************
***************************************************************************/
-void AddTrayComponent(TrayType *tp, TrayComponentType *cp) {
+void
+AddTrayComponent(TrayType *tp, TrayComponentType *cp)
+{
Assert(tp);
Assert(cp);
@@ -283,7 +293,9 @@ void AddTrayComponent(TrayType *tp, TrayComponentType *cp) {
/***************************************************************************
* Compute the max component width.
***************************************************************************/
-int ComputeMaxWidth(TrayType *tp) {
+int
+ComputeMaxWidth(TrayType *tp)
+{
TrayComponentType *cp;
int result;
@@ -306,7 +318,9 @@ int ComputeMaxWidth(TrayType *tp) {
/***************************************************************************
***************************************************************************/
-int ComputeTotalWidth(TrayType *tp) {
+int
+ComputeTotalWidth(TrayType *tp)
+{
TrayComponentType *cp;
int result;
@@ -323,7 +337,9 @@ int ComputeTotalWidth(TrayType *tp) {
/***************************************************************************
* Compute the max component height.
***************************************************************************/
-int ComputeMaxHeight(TrayType *tp) {
+int
+ComputeMaxHeight(TrayType *tp)
+{
TrayComponentType *cp;
int result;
@@ -346,7 +362,9 @@ int ComputeMaxHeight(TrayType *tp) {
/***************************************************************************
***************************************************************************/
-int ComputeTotalHeight(TrayType *tp) {
+int
+ComputeTotalHeight(TrayType *tp)
+{
TrayComponentType *cp;
int result;
@@ -362,7 +380,9 @@ int ComputeTotalHeight(TrayType *tp) {
/***************************************************************************
***************************************************************************/
-int CheckHorizontalFill(TrayType *tp) {
+int
+CheckHorizontalFill(TrayType *tp)
+{
TrayComponentType *cp;
@@ -378,7 +398,9 @@ int CheckHorizontalFill(TrayType *tp) {
/***************************************************************************
***************************************************************************/
-int CheckVerticalFill(TrayType *tp) {
+int
+CheckVerticalFill(TrayType *tp)
+{
TrayComponentType *cp;
@@ -394,7 +416,9 @@ int CheckVerticalFill(TrayType *tp) {
/***************************************************************************
***************************************************************************/
-void ComputeTraySize(TrayType *tp) {
+void
+ComputeTraySize(TrayType *tp)
+{
TrayComponentType *cp;
@@ -496,7 +520,9 @@ void ComputeTraySize(TrayType *tp) {
/***************************************************************************
***************************************************************************/
-void ShowTray(TrayType *tp) {
+void
+ShowTray(TrayType *tp)
+{
Window win1, win2;
int winx, winy;
@@ -518,7 +544,9 @@ void ShowTray(TrayType *tp) {
/***************************************************************************
***************************************************************************/
-void HideTray(TrayType *tp) {
+void
+HideTray(TrayType *tp)
+{
int x, y;
@@ -554,7 +582,9 @@ void HideTray(TrayType *tp) {
/***************************************************************************
***************************************************************************/
-int ProcessTrayEvent(const XEvent *event) {
+int
+ProcessTrayEvent(const XEvent *event)
+{
TrayType *tp;
@@ -585,7 +615,9 @@ int ProcessTrayEvent(const XEvent *event) {
/***************************************************************************
***************************************************************************/
-void SignalTray(const TimeType *now, int x, int y) {
+void
+SignalTray(const TimeType *now, int x, int y)
+{
TrayType *tp;
@@ -602,7 +634,9 @@ void SignalTray(const TimeType *now, int x, int y) {
/***************************************************************************
***************************************************************************/
-void HandleTrayExpose(TrayType *tp, const XExposeEvent *event) {
+void
+HandleTrayExpose(TrayType *tp, const XExposeEvent *event)
+{
DrawSpecificTray(tp);
@@ -610,7 +644,9 @@ void HandleTrayExpose(TrayType *tp, const XExposeEvent *event) {
/***************************************************************************
***************************************************************************/
-void HandleTrayEnterNotify(TrayType *tp, const XCrossingEvent *event) {
+void
+HandleTrayEnterNotify(TrayType *tp, const XCrossingEvent *event)
+{
ShowTray(tp);
@@ -618,7 +654,9 @@ void HandleTrayEnterNotify(TrayType *tp, const XCrossingEvent *event) {
/***************************************************************************
***************************************************************************/
-void HandleTrayButtonPress(TrayType *tp, const XButtonEvent *event) {
+void
+HandleTrayButtonPress(TrayType *tp, const XButtonEvent *event)
+{
TrayComponentType *cp;
int xoffset, yoffset;
@@ -652,7 +690,9 @@ void HandleTrayButtonPress(TrayType *tp, const XButtonEvent *event) {
/***************************************************************************
***************************************************************************/
-void HandleTrayMotionNotify(TrayType *tp, const XMotionEvent *event) {
+void
+HandleTrayMotionNotify(TrayType *tp, const XMotionEvent *event)
+{
TrayComponentType *cp;
int xoffset, yoffset;
@@ -686,7 +726,9 @@ void HandleTrayMotionNotify(TrayType *tp, const XMotionEvent *event) {
/***************************************************************************
***************************************************************************/
-void DrawTray() {
+void
+DrawTray()
+{
TrayType *tp;
@@ -702,7 +744,9 @@ void DrawTray() {
/***************************************************************************
***************************************************************************/
-void DrawSpecificTray(const TrayType *tp) {
+void
+DrawSpecificTray(const TrayType *tp)
+{
TrayComponentType *cp;
int x;
@@ -747,7 +791,9 @@ void DrawSpecificTray(const TrayType *tp) {
/***************************************************************************
***************************************************************************/
-void UpdateSpecificTray(const TrayType *tp, const TrayComponentType *cp) {
+void
+UpdateSpecificTray(const TrayType *tp, const TrayComponentType *cp)
+{
if(cp->pixmap != None && !shouldExit) {
JXCopyArea(display, cp->pixmap, tp->window, rootGC, 0, 0,
@@ -758,7 +804,9 @@ void UpdateSpecificTray(const TrayType *tp, const TrayComponentType *cp) {
/***************************************************************************
***************************************************************************/
-void LayoutTray(TrayType *tp, int *variableSize, int *variableRemainder) {
+void
+LayoutTray(TrayType *tp, int *variableSize, int *variableRemainder)
+{
TrayComponentType *cp;
int variableCount;
@@ -828,7 +876,9 @@ void LayoutTray(TrayType *tp, int *variableSize, int *variableRemainder) {
/***************************************************************************
***************************************************************************/
-void ResizeTray(TrayType *tp) {
+void
+ResizeTray(TrayType *tp)
+{
TrayComponentType *cp;
int variableSize;
@@ -908,7 +958,9 @@ TrayType *GetTrays() {
/***************************************************************************
***************************************************************************/
-Window GetSupportingWindow() {
+Window
+GetSupportingWindow()
+{
if(trays) {
return trays->window;
@@ -924,14 +976,18 @@ Window GetSupportingWindow() {
/***************************************************************************
***************************************************************************/
-void SetAutoHideTray(TrayType *tp, int v) {
+void
+SetAutoHideTray(TrayType *tp, int v)
+{
Assert(tp);
tp->autoHide = v;
}
/***************************************************************************
***************************************************************************/
-void SetTrayX(TrayType *tp, const char *str) {
+void
+SetTrayX(TrayType *tp, const char *str)
+{
Assert(tp);
Assert(str);
tp->x = atoi(str);
@@ -939,7 +995,9 @@ void SetTrayX(TrayType *tp, const char *str) {
/***************************************************************************
***************************************************************************/
-void SetTrayY(TrayType *tp, const char *str) {
+void
+SetTrayY(TrayType *tp, const char *str)
+{
Assert(tp);
Assert(str);
tp->y = atoi(str);
@@ -947,7 +1005,9 @@ void SetTrayY(TrayType *tp, const char *str) {
/***************************************************************************
***************************************************************************/
-void SetTrayWidth(TrayType *tp, const char *str) {
+void
+SetTrayWidth(TrayType *tp, const char *str)
+{
int width;
@@ -966,7 +1026,9 @@ void SetTrayWidth(TrayType *tp, const char *str) {
/***************************************************************************
***************************************************************************/
-void SetTrayHeight(TrayType *tp, const char *str) {
+void
+SetTrayHeight(TrayType *tp, const char *str)
+{
int height;
@@ -986,7 +1048,9 @@ void SetTrayHeight(TrayType *tp, const char *str) {
/***************************************************************************
***************************************************************************/
-void SetTrayLayout(TrayType *tp, const char *str) {
+void
+SetTrayLayout(TrayType *tp, const char *str)
+{
Assert(tp);
@@ -1023,7 +1087,9 @@ void SetTrayLayout(TrayType *tp, const char *str) {
/***************************************************************************
***************************************************************************/
-void SetTrayLayer(TrayType *tp, const char *str) {
+void
+SetTrayLayer(TrayType *tp, const char *str)
+{
int temp;
@@ -1042,7 +1108,9 @@ void SetTrayLayer(TrayType *tp, const char *str) {
/***************************************************************************
***************************************************************************/
-void SetTrayBorder(TrayType *tp, const char *str) {
+void
+SetTrayBorder(TrayType *tp, const char *str)
+{
int temp;
@@ -1061,7 +1129,9 @@ void SetTrayBorder(TrayType *tp, const char *str) {
/***************************************************************************
***************************************************************************/
-void SetTrayHorizontalAlignment(TrayType *tp, const char *str) {
+void
+SetTrayHorizontalAlignment(TrayType *tp, const char *str)
+{
Assert(tp);
@@ -1082,7 +1152,9 @@ void SetTrayHorizontalAlignment(TrayType *tp, const char *str) {
/***************************************************************************
***************************************************************************/
-void SetTrayVerticalAlignment(TrayType *tp, const char *str) {
+void
+SetTrayVerticalAlignment(TrayType *tp, const char *str)
+{
Assert(tp);