File: mimenu.h

package info (click to toggle)
miwm 1.1-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 1,296 kB
  • ctags: 910
  • sloc: cpp: 8,179; sh: 231; makefile: 148
file content (100 lines) | stat: -rw-r--r-- 2,583 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
//-*-c++-*-
// -------------------------------------------
// RCS data:
// $Date: 2003/07/03 20:12:44 $
// $Revision: 1.2 $
// $Source: /cvsroot/miwm/miwm/miwm/mimenu.h,v $
// $Id: mimenu.h,v 1.2 2003/07/03 20:12:44 sgbeal Exp $
// $RCSfile: mimenu.h,v $
// -------------------------------------------
// Copyright by Ben Paul Wise.
// -------------------------------------------
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
// -------------------------------------------
// very simple menu-ing. specialized to miwm.
// -------------------------------------------

#ifndef MIMENU_H
#define MIMENU_H

// -------------------------------------------
#include <string>
#include "miwm.h"

class Menu;
class MenuItem;
// -------------------------------------------

class Menu {
 public:
  Menu();
  ~Menu();

  void startMenuing(XButtonEvent* xbe);
  void motionNotify(XEvent* xe);
  void buttonRelease();
  void expose();
  int whichMenuItem();


  // things to do the the data of each item
  void  (*enterAction)(void*);
  void (*exitAction)(void*);
  void (*releaseAction)(void*);

  void raise();
  void lower();

  NodeList* items; // data of type MenuItem
  void setDimensions();

  int currItem; // you should set this at creation time

 protected:
  int prevItem; // will become the same at currItem, at the start
  MenuItem *currMI;
  MenuItem *prevMI;
  int length; // number of items
  int x; // root coords
  int y; // root coords
  int mWidth; // menu width
  int mHeight; // menu height
  int iWidth; // item width
  int iHeight; // item height

 private:

};


class MenuItem {
public:
  MenuItem();
  MenuItem(const char*, const void *);
  ~MenuItem();

  std::string label;
  const void* data; // Client*, WorkSpace*, etc.

protected:

private:

};
// -------------------------------------------
#endif
// -------------------------------------------
// end of mimenu.h
// -------------------------------------------