Skip to content

Commit

Permalink
Splitted Functions in Files
Browse files Browse the repository at this point in the history
  • Loading branch information
Electroner committed Oct 1, 2022
1 parent ae10018 commit 4e05710
Show file tree
Hide file tree
Showing 52 changed files with 6,724 additions and 13,268 deletions.
File renamed without changes.
20 changes: 20 additions & 0 deletions Directories/pathwork.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#ifndef PATHWORK
#define PATHWORK

#include "../GUI/feathergui.h"

std::string getCurrentPath();

std::string getNormalizedPath();

#ifdef WINDOWS_SO
std::string browseFile(HWND hwnd);
std::string browseFolder(HWND hwnd, int _option);
#endif

#ifdef LINUX_SO
std::string browse();
#endif


#endif
Binary file removed Feather.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion Feather.rc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ END

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
FEATHER_ICON ICON "Images\\Feather.ico"
FEATHER_ICON ICON "resources\\Images\\Feather.ico"

#endif // Espa�ol (Espa�a, alfabetizaci�n internacional) resources
/////////////////////////////////////////////////////////////////////////////
Expand Down
26 changes: 20 additions & 6 deletions Feather.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>C:\Users\carlo\Documents\LibC\glfw-3.3.7.bin.WIN64\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<LanguageStandard>stdcpp20</LanguageStandard>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand All @@ -139,7 +140,21 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="feathergui.cpp" />
<ClCompile Include="Directories\pathwork.cpp" />
<ClCompile Include="GUI\ExternGUI\ConfigMenu.cpp" />
<ClCompile Include="GUI\ExternGUI\DebugConsole.cpp" />
<ClCompile Include="GUI\ExternGUI\ErrorWindows.cpp" />
<ClCompile Include="GUI\ExternGUI\ImageSaveLoad.cpp" />
<ClCompile Include="GUI\ExternGUI\newImage.cpp" />
<ClCompile Include="GUI\feathergui.cpp" />
<ClCompile Include="GUI\MainGUI\ImageDisplayers.cpp" />
<ClCompile Include="GUI\MainGUI\Info.cpp" />
<ClCompile Include="GUI\MainGUI\Layers.cpp" />
<ClCompile Include="GUI\MainGUI\Menu.cpp" />
<ClCompile Include="GUI\MainGUI\Properties.cpp" />
<ClCompile Include="GUI\MainGUI\ToolProperties.cpp" />
<ClCompile Include="GUI\MainGUI\Tools.cpp" />
<ClCompile Include="ImageIO\stb.cpp" />
<ClCompile Include="ImageWork.cpp" />
<ClCompile Include="imgui\imgui.cpp" />
<ClCompile Include="imgui\imgui_demo.cpp" />
Expand All @@ -149,17 +164,16 @@
<ClCompile Include="imgui\imgui_tables.cpp" />
<ClCompile Include="imgui\imgui_widgets.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="pathwork.cpp" />
<ClCompile Include="stb.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="feathergui.h" />
<ClInclude Include="Directories\pathwork.h" />
<ClInclude Include="GUI\feathergui.h" />
<ClInclude Include="GUI\IconsFontAwesome.h" />
<ClInclude Include="IconsFontAwesome.h" />
<ClInclude Include="ImageWork.h" />
<ClInclude Include="pathwork.h" />
<ClInclude Include="ImageIO\stb_image.h" />
<ClInclude Include="ImageIO\stb_image_resize.h" />
<ClInclude Include="ImageIO\stb_image_write.h" />
<ClInclude Include="ImageWork\ImageWork.h" />
<ClInclude Include="imgui\imconfig.h" />
<ClInclude Include="imgui\imgui.h" />
<ClInclude Include="imgui\imgui_impl_glfw.h" />
Expand Down
111 changes: 81 additions & 30 deletions Feather.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,35 @@
<Filter Include="Archivos de origen\Imgui">
<UniqueIdentifier>{963cb797-1d92-4463-99cc-12deca6daaaf}</UniqueIdentifier>
</Filter>
<Filter Include="Archivos de encabezado\ImageIO">
<UniqueIdentifier>{075a36a7-932d-48d1-9ae3-d14737ba6156}</UniqueIdentifier>
<Filter Include="Archivos de origen\ImageWork">
<UniqueIdentifier>{278c0ad6-5a61-41d2-995f-752fe44f6ddb}</UniqueIdentifier>
</Filter>
<Filter Include="Archivos de origen\ImageIO">
<UniqueIdentifier>{afbdcc1e-6263-4c18-96c0-1af75522bf41}</UniqueIdentifier>
<Filter Include="Archivos de encabezado\GUI">
<UniqueIdentifier>{bf78892e-33aa-4186-be87-9185908c982c}</UniqueIdentifier>
</Filter>
<Filter Include="Archivos de origen\GUI">
<UniqueIdentifier>{e9cfdd78-d384-48f4-ab19-308976b53c99}</UniqueIdentifier>
</Filter>
<Filter Include="Archivos de encabezado\Directories">
<UniqueIdentifier>{b50a1d50-8bc0-4025-be08-36dc2f6bd438}</UniqueIdentifier>
<UniqueIdentifier>{dbf196c5-adc3-40d7-a0b9-0fbbc5dcaf7e}</UniqueIdentifier>
</Filter>
<Filter Include="Archivos de origen\Directories">
<UniqueIdentifier>{266a3c1a-74f8-452d-927d-0bfffedd6297}</UniqueIdentifier>
<UniqueIdentifier>{81ae82e3-0c7f-42d9-9382-f6ea79ee1559}</UniqueIdentifier>
</Filter>
<Filter Include="Archivos de origen\ImageIO">
<UniqueIdentifier>{ba448c00-060f-49f4-b3da-e4af87c17b33}</UniqueIdentifier>
</Filter>
<Filter Include="Archivos de encabezado\ImageIO">
<UniqueIdentifier>{be8968ff-d790-4055-80b0-79f385e53a7f}</UniqueIdentifier>
</Filter>
<Filter Include="Archivos de encabezado\ImageWork">
<UniqueIdentifier>{bd86191c-be4a-4508-8021-984ae8879f03}</UniqueIdentifier>
<UniqueIdentifier>{8a8014b5-d0aa-4430-a660-f8c91aa353ce}</UniqueIdentifier>
</Filter>
<Filter Include="Archivos de origen\ImageWork">
<UniqueIdentifier>{278c0ad6-5a61-41d2-995f-752fe44f6ddb}</UniqueIdentifier>
<Filter Include="Archivos de origen\GUI\MainGUI">
<UniqueIdentifier>{b5e6329c-40b4-4635-8cd5-9ae888ca72f7}</UniqueIdentifier>
</Filter>
<Filter Include="Archivos de origen\GUI\ExternGUI">
<UniqueIdentifier>{ea7dd477-c572-4ddc-9883-6901cbe7ce0c}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -63,17 +75,53 @@
<ClCompile Include="main.cpp">
<Filter>Archivos de origen</Filter>
</ClCompile>
<ClCompile Include="stb.cpp">
<Filter>Archivos de origen\ImageIO</Filter>
<ClCompile Include="ImageWork.cpp">
<Filter>Archivos de origen\ImageWork</Filter>
</ClCompile>
<ClCompile Include="GUI\feathergui.cpp">
<Filter>Archivos de origen\GUI</Filter>
</ClCompile>
<ClCompile Include="pathwork.cpp">
<ClCompile Include="Directories\pathwork.cpp">
<Filter>Archivos de origen\Directories</Filter>
</ClCompile>
<ClCompile Include="feathergui.cpp">
<Filter>Archivos de origen</Filter>
<ClCompile Include="ImageIO\stb.cpp">
<Filter>Archivos de origen\ImageIO</Filter>
</ClCompile>
<ClCompile Include="ImageWork.cpp">
<Filter>Archivos de origen\ImageWork</Filter>
<ClCompile Include="GUI\MainGUI\ImageDisplayers.cpp">
<Filter>Archivos de origen\GUI\MainGUI</Filter>
</ClCompile>
<ClCompile Include="GUI\MainGUI\Info.cpp">
<Filter>Archivos de origen\GUI\MainGUI</Filter>
</ClCompile>
<ClCompile Include="GUI\MainGUI\Layers.cpp">
<Filter>Archivos de origen\GUI\MainGUI</Filter>
</ClCompile>
<ClCompile Include="GUI\MainGUI\Menu.cpp">
<Filter>Archivos de origen\GUI\MainGUI</Filter>
</ClCompile>
<ClCompile Include="GUI\MainGUI\Properties.cpp">
<Filter>Archivos de origen\GUI\MainGUI</Filter>
</ClCompile>
<ClCompile Include="GUI\MainGUI\Tools.cpp">
<Filter>Archivos de origen\GUI\MainGUI</Filter>
</ClCompile>
<ClCompile Include="GUI\ExternGUI\ConfigMenu.cpp">
<Filter>Archivos de origen\GUI\ExternGUI</Filter>
</ClCompile>
<ClCompile Include="GUI\ExternGUI\DebugConsole.cpp">
<Filter>Archivos de origen\GUI\ExternGUI</Filter>
</ClCompile>
<ClCompile Include="GUI\ExternGUI\newImage.cpp">
<Filter>Archivos de origen\GUI\ExternGUI</Filter>
</ClCompile>
<ClCompile Include="GUI\MainGUI\ToolProperties.cpp">
<Filter>Archivos de origen\GUI\MainGUI</Filter>
</ClCompile>
<ClCompile Include="GUI\ExternGUI\ErrorWindows.cpp">
<Filter>Archivos de origen\GUI\ExternGUI</Filter>
</ClCompile>
<ClCompile Include="GUI\ExternGUI\ImageSaveLoad.cpp">
<Filter>Archivos de origen\GUI\ExternGUI</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -104,28 +152,31 @@
<ClInclude Include="imgui\imgui_impl_opengl3_loader.h">
<Filter>Archivos de encabezado\Imgui</Filter>
</ClInclude>
<ClInclude Include="ImageIO\stb_image_resize.h">
<Filter>Archivos de encabezado\ImageIO</Filter>
<ClInclude Include="resource.h">
<Filter>Archivos de encabezado</Filter>
</ClInclude>
<ClInclude Include="ImageIO\stb_image_write.h">
<Filter>Archivos de encabezado\ImageIO</Filter>
<ClInclude Include="IconsFontAwesome.h">
<Filter>Archivos de encabezado\Imgui</Filter>
</ClInclude>
<ClInclude Include="ImageIO\stb_image.h">
<Filter>Archivos de encabezado\ImageIO</Filter>
<ClInclude Include="GUI\feathergui.h">
<Filter>Archivos de encabezado\GUI</Filter>
</ClInclude>
<ClInclude Include="GUI\IconsFontAwesome.h">
<Filter>Archivos de encabezado\GUI</Filter>
</ClInclude>
<ClInclude Include="pathwork.h">
<ClInclude Include="Directories\pathwork.h">
<Filter>Archivos de encabezado\Directories</Filter>
</ClInclude>
<ClInclude Include="resource.h">
<Filter>Archivos de encabezado</Filter>
<ClInclude Include="ImageIO\stb_image.h">
<Filter>Archivos de encabezado\ImageIO</Filter>
</ClInclude>
<ClInclude Include="feathergui.h">
<Filter>Archivos de encabezado</Filter>
<ClInclude Include="ImageIO\stb_image_resize.h">
<Filter>Archivos de encabezado\ImageIO</Filter>
</ClInclude>
<ClInclude Include="IconsFontAwesome.h">
<Filter>Archivos de encabezado\Imgui</Filter>
<ClInclude Include="ImageIO\stb_image_write.h">
<Filter>Archivos de encabezado\ImageIO</Filter>
</ClInclude>
<ClInclude Include="ImageWork.h">
<ClInclude Include="ImageWork\ImageWork.h">
<Filter>Archivos de encabezado\ImageWork</Filter>
</ClInclude>
</ItemGroup>
Expand Down
38 changes: 38 additions & 0 deletions GUI/ExternGUI/ConfigMenu.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#include "../feathergui.h"

void FeatherGUI::BuildConfigMenu() {
//PLACEMENT CONFIG WINDOW
ImGui::Begin("Placement Config", &this->placementConfig, ImGuiWindowFlags_AlwaysAutoResize);
//Create a slider for the toolsPanelPercentage
ImGui::SliderInt("Tools Panel Pixels", &this->toolsPanelPixels, 32, 128);
//Create a slider for the propertiesPanelPercentage
ImGui::SliderInt("Properties Panel Pixels", &this->propertiesPanelPixels, 128, 512);

float color[4] = { GetBackGroundColor().r,GetBackGroundColor().g, GetBackGroundColor().b, 1.0F };
//Change background color
ImGui::ColorEdit3("Background Color", color);
SetBackGroundColor(color[0], color[1], color[2]);

//Separator
ImGui::Separator();
ImGui::Text("Rounding Options");
ImGui::SliderFloat("windowRounding", &this->windowRounding, 0.0F, 10.0F);
ImGui::SameLine();
HelpMarker("Disable rounding by setting this to 0.0");
//Disable options rounding
ImGui::Checkbox("Options Rounding", &this->disableOptionsRounding);
if (this->disableOptionsRounding) {
ImGui::GetStyle().FrameRounding = 0.0F;
}
else
{
ImGui::GetStyle().FrameRounding = 5.0F;
}
//Enable/disable sync
bool tempsync = this->Vsync;
ImGui::Checkbox("Vertical Sync", &tempsync);
if (tempsync != this->Vsync) {
this->SetSync(tempsync);
}
ImGui::End();
}
38 changes: 38 additions & 0 deletions GUI/ExternGUI/DebugConsole.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#include "../feathergui.h"

void FeatherGUI::BuildConsoleDebugMenu() {
//DEBUG CONSOLE WINDOW
//Set max size of the window to 1/4 of the screen
ImGui::SetNextWindowSize(ImVec2(this->io->DisplaySize.x / 4, this->io->DisplaySize.y / 2), ImGuiCond_Always);
ImGui::Begin("Debug Console", &this->debugConsole, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_AlwaysAutoResize);
//FPS
ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate);
//Print the mouse
ImGui::Text("Mouse Position: (%d, %d)", this->MouseImagePositionX, this->MouseImagePositionY);
//Slider int
ImGui::Text("Movement X: %d", this->imageShiftX);
ImGui::Text("Movement Y: %d", this->imageShiftY);
//Print the zoom
ImGui::Text("Zoom: %.2f", this->zoom);
//Print the maximun zoom
ImGui::Text("Max Zoom: %.2f", this->maxZoom);
//Print the minimun zoom
ImGui::Text("Min Zoom: %.2f", this->minZoom);


ImGui::Separator();

//if (ss.str().c_str() != NULL) {
// //Get time and add a time mark using localtime_s
// time_t rawtime;
// struct tm now;
// char timeMark[80];
// time(&rawtime);
// localtime_s(&now, &rawtime);
// strftime(timeMark, 80, "%H:%M:%S", &now);
//}


ImGui::Text("%s", ss.str().c_str());
ImGui::End();
}
24 changes: 24 additions & 0 deletions GUI/ExternGUI/ErrorWindows.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include "../feathergui.h"

void FeatherGUI::ErrorWindowCreateImage() {
if (this->errorWindowCreateImage) {
ImGui::OpenPopup("Error Creating Image");
// Always center this window when appearing
ImVec2 center = ImGui::GetMainViewport()->GetCenter();
ImGui::SetNextWindowPos(center, ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));

//Show a BeginPopupModal dialog with error message "The size of the Image must be greater than 0. Also it need to have a name!\n\n"
if (ImGui::BeginPopupModal("Error Creating Image", NULL, ImGuiWindowFlags_AlwaysAutoResize))
{
ImGui::SetItemDefaultFocus();
ImGui::Text("Some of the following things were wrong: \n\n-> The size of the Image must be greater than 0.\n-> It need to have a name.\n\n");
//ImGui::Separator();

if (ImGui::Button("OK")) {
this->errorWindowCreateImage = false;
ImGui::CloseCurrentPopup();
}
ImGui::EndPopup();
}
}
}
Loading

0 comments on commit 4e05710

Please sign in to comment.