-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
147 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#pragma once | ||
|
||
#include <iostream> | ||
#include "../List/List.hh" | ||
|
||
namespace CGui | ||
{ | ||
class DeleteOnQuit | ||
{ | ||
public: | ||
DeleteOnQuit(const DeleteOnQuit&) = delete; | ||
DeleteOnQuit(const DeleteOnQuit&&) = delete; | ||
DeleteOnQuit& operator=(const DeleteOnQuit&) = delete; | ||
DeleteOnQuit& operator=(const DeleteOnQuit&&) = delete; | ||
DeleteOnQuit& operator==(const DeleteOnQuit&) = delete; | ||
DeleteOnQuit& operator==(const DeleteOnQuit&&) = delete; | ||
|
||
static DeleteOnQuit& GetInstance() | ||
{ | ||
static DeleteOnQuit instance; | ||
return instance; | ||
} | ||
|
||
void Add(void* data) | ||
{ | ||
l_instance->Insert(data); | ||
} | ||
|
||
void ForEach(void(*func)(void*)) | ||
{ | ||
l_instance->ForEach(func); | ||
} | ||
|
||
Single::List<void*>* list() | ||
{ | ||
return l_instance; | ||
} | ||
|
||
~DeleteOnQuit() | ||
{ | ||
l_instance->ForEach([](void* data) -> void | ||
{ | ||
delete data; | ||
}); | ||
delete l_instance; | ||
} | ||
|
||
private: | ||
DeleteOnQuit() : l_instance{ new Single::List<void*> } | ||
{ | ||
} | ||
|
||
Single::List<void*>* l_instance; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include "./EventBox.hh" | ||
|
||
namespace CGui | ||
{ | ||
EventBox::EventBox() : Container(this), Handler(this) | ||
{ | ||
widget = gtk_event_box_new(); | ||
this->SetContext(widget); | ||
} | ||
|
||
EventBox::EventBox(Widget& w) : Container(this), Handler(this) | ||
{ | ||
widget = gtk_event_box_new(); | ||
this->SetContext(widget); | ||
this->Add(w); | ||
} | ||
|
||
void EventBox::VisibleWindow(bool visible) | ||
{ | ||
gtk_event_box_set_visible_window(GTK_EVENT_BOX(widget), visible); | ||
} | ||
|
||
bool EventBox::VisibleWindow() | ||
{ | ||
return gtk_event_box_get_visible_window(GTK_EVENT_BOX(widget)); | ||
} | ||
|
||
void EventBox::AboveChild(bool above) | ||
{ | ||
gtk_event_box_set_above_child(GTK_EVENT_BOX(widget), above); | ||
} | ||
|
||
bool EventBox::AboveChild() | ||
{ | ||
return gtk_event_box_get_above_child(GTK_EVENT_BOX(widget)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#pragma once | ||
|
||
#include "../Widget.hh" | ||
#include "../Container.hh" | ||
#include "../Handler.hh" | ||
|
||
namespace CGui | ||
{ | ||
class EventBox : public Widget, public Container<EventBox>, public Handler<EventBox> | ||
{ | ||
public: | ||
EventBox(); | ||
EventBox(Widget& w); | ||
void VisibleWindow(bool visible); | ||
bool VisibleWindow(); | ||
void AboveChild(bool above); | ||
bool AboveChild(); | ||
}; | ||
} |
Oops, something went wrong.