aboutsummaryrefslogtreecommitdiff
path: root/lumina-wm-INCOMPLETE/LWindow.cpp
blob: 3d15393d7d88bf83e71e6b485a9bc90553752ea4 (plain)
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
101
102
103
104
105
//===========================================
//  Lumina-DE source code
//  Copyright (c) 2015, Ken Moore
//  Available under the 3-clause BSD license
//  See the LICENSE file for full details
//===========================================
#include "LWindow.h"

LWindow::LWindow(WId client) : QFrame(){
  activeState = LWindow::Normal;
  this->setMouseTracking(true); //need this to determine mouse location when not clicked
  this->setObjectName("LWindowFrame");
  this->setWindowFlags(Qt::Window | Qt::X11BypassWindowManagerHint); //ensure that this frame does not get a frame itself
  InitWindow(); //initially create all the child widgets
  updateAppearance(); //this loads the appearance based on window/theme settings
}

LWindow::~LWindow(){
	
}

// =================
//         PUBLIC
// =================
//Return the ID of the managed window for the current graphics system (X11/Wayland/other)
WId LWindow::clientID(){ return CID; }

bool LWindow::hasFrame(){ return this->isEnabled(); }

// =================
//        PRIVATE
// =================
void LWindow::InitWindow(){
	titleBar = new QLabel(this); //This is the "container" for all the title buttons/widgets
	  titleBar->setObjectName("TitleBar");
	title = new QLabel(this); //Shows the window title/text
	  title->setObjectName("Title");
	  title->setCursor(Qt::SizeAllCursor);
	icon = new QLabel(this); //Contains the window icon
	  icon->setObjectName("Icon");
	minB = new QToolButton(this); //Minimize Button
	  minB->setObjectName("Minimize");
	  connect(minB, SIGNAL(clicked()), this, SLOT(minClicked()) );
	maxB = new QToolButton(this); //Maximize Button
	  maxB->setObjectName("Maximize");
	  connect(maxB, SIGNAL(clicked()), this, SLOT(maxClicked()) );
	closeB = new QToolButton(this);
	  closeB->setObjectName("Close");
	  connect(closeB, SIGNAL(clicked()), this, SLOT(closeClicked()) );
	otherB = new QToolButton(this); //Button to place any other actions
	  otherB->setObjectName("Options");
	  otherB->setToolButtonPopupMode(QToolButton::InstantPopup);
	otherM = new QMenu(this); //menu of "other" actions for the window
	  otherB->setMenu(otherM);
	  connect(otherM, SIGNAL(triggered(QAction*)), this, SLOT(otherClicked(QAction*)) );
}

ModStatus LWindow::getStateAtPoint(QPoint pt){

}

void LWindow::setMouseCursor(ModStatus state){
	
}

// =================
//    PUBLIC SLOTS
// =================
void LWindow::updateAppearance(){
	
}

// =================
//    PRIVATE SLOTS
// =================
void LWindow::closeClicked(){
	
}

void LWindow::minClicked(){
	
}

void LWindow::maxClicked(){
	
}

void LWindow::otherClicked(QAction* act){
	
}

// =====================
//         PROTECTED
// =====================
void LWindow::mousePressEvent(QMouseEvent *ev){
	
}

void LWindow::mouseMoveEvent(QMouseEvent *ev){
	
}

void LWindow::mouseReleaseEvent(QMouseEvent *ev){
	
}
bgstack15