summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Tox_GUI.sln20
-rw-r--r--Tox_GUI.v11.suobin0 -> 27136 bytes
-rw-r--r--Tox_GUI/Tox_GUI.vcxproj94
-rw-r--r--Tox_GUI/Tox_GUI.vcxproj.filters28
-rw-r--r--Tox_GUI/Tox_GUI.vcxproj.user4
-rw-r--r--Tox_GUI/gui/Main.cpp33
-rw-r--r--Tox_GUI/gui/home/Home.cpp28
-rw-r--r--Tox_GUI/gui/home/Home.h13
-rw-r--r--core/DHT.c14
-rw-r--r--core/DHT.h11
10 files changed, 232 insertions, 13 deletions
diff --git a/Tox_GUI.sln b/Tox_GUI.sln
new file mode 100644
index 00000000..51ef00c6
--- /dev/null
+++ b/Tox_GUI.sln
@@ -0,0 +1,20 @@
1
2Microsoft Visual Studio Solution File, Format Version 12.00
3# Visual Studio 2012
4Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tox_GUI", "Tox_GUI\Tox_GUI.vcxproj", "{0A768946-CC65-422E-8F77-47A82452F980}"
5EndProject
6Global
7 GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 Debug|Win32 = Debug|Win32
9 Release|Win32 = Release|Win32
10 EndGlobalSection
11 GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 {0A768946-CC65-422E-8F77-47A82452F980}.Debug|Win32.ActiveCfg = Debug|Win32
13 {0A768946-CC65-422E-8F77-47A82452F980}.Debug|Win32.Build.0 = Debug|Win32
14 {0A768946-CC65-422E-8F77-47A82452F980}.Release|Win32.ActiveCfg = Release|Win32
15 {0A768946-CC65-422E-8F77-47A82452F980}.Release|Win32.Build.0 = Release|Win32
16 EndGlobalSection
17 GlobalSection(SolutionProperties) = preSolution
18 HideSolutionNode = FALSE
19 EndGlobalSection
20EndGlobal
diff --git a/Tox_GUI.v11.suo b/Tox_GUI.v11.suo
new file mode 100644
index 00000000..be722f47
--- /dev/null
+++ b/Tox_GUI.v11.suo
Binary files differ
diff --git a/Tox_GUI/Tox_GUI.vcxproj b/Tox_GUI/Tox_GUI.vcxproj
new file mode 100644
index 00000000..5941230a
--- /dev/null
+++ b/Tox_GUI/Tox_GUI.vcxproj
@@ -0,0 +1,94 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup Label="ProjectConfigurations">
4 <ProjectConfiguration Include="Debug|Win32">
5 <Configuration>Debug</Configuration>
6 <Platform>Win32</Platform>
7 </ProjectConfiguration>
8 <ProjectConfiguration Include="Release|Win32">
9 <Configuration>Release</Configuration>
10 <Platform>Win32</Platform>
11 </ProjectConfiguration>
12 </ItemGroup>
13 <PropertyGroup Label="Globals">
14 <ProjectGuid>{0A768946-CC65-422E-8F77-47A82452F980}</ProjectGuid>
15 <Keyword>Win32Proj</Keyword>
16 <RootNamespace>Tox_GUI</RootNamespace>
17 </PropertyGroup>
18 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
19 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
20 <ConfigurationType>Application</ConfigurationType>
21 <UseDebugLibraries>true</UseDebugLibraries>
22 <PlatformToolset>v110</PlatformToolset>
23 <CharacterSet>Unicode</CharacterSet>
24 </PropertyGroup>
25 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
26 <ConfigurationType>Application</ConfigurationType>
27 <UseDebugLibraries>false</UseDebugLibraries>
28 <PlatformToolset>v110</PlatformToolset>
29 <WholeProgramOptimization>true</WholeProgramOptimization>
30 <CharacterSet>Unicode</CharacterSet>
31 </PropertyGroup>
32 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
33 <ImportGroup Label="ExtensionSettings">
34 </ImportGroup>
35 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
36 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
37 </ImportGroup>
38 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
39 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
40 </ImportGroup>
41 <PropertyGroup Label="UserMacros" />
42 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
43 <LinkIncremental>true</LinkIncremental>
44 <IncludePath>H:\PC\Libraries\wxWidgets-2.9.4\include;H:\PC\Libraries\wxWidgets-2.9.4\include\msvc\wx;$(IncludePath)</IncludePath>
45 <LibraryPath>H:\PC\Libraries\wxWidgets-2.9.4\lib;H:\PC\Libraries\wxWidgets-2.9.4\lib\vc_lib;$(LibraryPath)</LibraryPath>
46 <SourcePath>H:\PC\Libraries\wxWidgets-2.9.4\src;$(SourcePath)</SourcePath>
47 </PropertyGroup>
48 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
49 <LinkIncremental>false</LinkIncremental>
50 </PropertyGroup>
51 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
52 <ClCompile>
53 <PrecompiledHeader>
54 </PrecompiledHeader>
55 <WarningLevel>Level3</WarningLevel>
56 <Optimization>Disabled</Optimization>
57 <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
58 </ClCompile>
59 <Link>
60 <SubSystem>Windows</SubSystem>
61 <GenerateDebugInformation>true</GenerateDebugInformation>
62 <AdditionalDependencies>wxmsw29ud_core.lib;wxbase29ud.lib;wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;winspool.lib;winmm.lib;shell32.lib;comctl32.lib;ole32.lib;oleaut32.lib;uuid.lib;rpcrt4.lib;advapi32.lib;wsock32.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>
63 </Link>
64 </ItemDefinitionGroup>
65 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
66 <ClCompile>
67 <WarningLevel>Level3</WarningLevel>
68 <PrecompiledHeader>
69 </PrecompiledHeader>
70 <Optimization>MaxSpeed</Optimization>
71 <FunctionLevelLinking>true</FunctionLevelLinking>
72 <IntrinsicFunctions>true</IntrinsicFunctions>
73 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
74 </ClCompile>
75 <Link>
76 <SubSystem>Windows</SubSystem>
77 <GenerateDebugInformation>true</GenerateDebugInformation>
78 <EnableCOMDATFolding>true</EnableCOMDATFolding>
79 <OptimizeReferences>true</OptimizeReferences>
80 </Link>
81 </ItemDefinitionGroup>
82 <ItemGroup>
83 <ClInclude Include="..\core\DHT.h" />
84 <ClInclude Include="gui\home\Home.h" />
85 </ItemGroup>
86 <ItemGroup>
87 <ClCompile Include="..\core\DHT.c" />
88 <ClCompile Include="gui\home\Home.cpp" />
89 <ClCompile Include="gui\Main.cpp" />
90 </ItemGroup>
91 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
92 <ImportGroup Label="ExtensionTargets">
93 </ImportGroup>
94</Project> \ No newline at end of file
diff --git a/Tox_GUI/Tox_GUI.vcxproj.filters b/Tox_GUI/Tox_GUI.vcxproj.filters
new file mode 100644
index 00000000..ac77112e
--- /dev/null
+++ b/Tox_GUI/Tox_GUI.vcxproj.filters
@@ -0,0 +1,28 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup>
4 <Filter Include="core">
5 <UniqueIdentifier>{0ed343d6-25f7-4c1f-bc25-dbfc0daf81a6}</UniqueIdentifier>
6 </Filter>
7 <Filter Include="home">
8 <UniqueIdentifier>{7095580a-1c7e-48ef-921c-e0ec00efec1c}</UniqueIdentifier>
9 </Filter>
10 </ItemGroup>
11 <ItemGroup>
12 <ClInclude Include="gui\home\Home.h">
13 <Filter>home</Filter>
14 </ClInclude>
15 <ClInclude Include="..\core\DHT.h">
16 <Filter>core</Filter>
17 </ClInclude>
18 </ItemGroup>
19 <ItemGroup>
20 <ClCompile Include="gui\Main.cpp" />
21 <ClCompile Include="gui\home\Home.cpp">
22 <Filter>home</Filter>
23 </ClCompile>
24 <ClCompile Include="..\core\DHT.c">
25 <Filter>core</Filter>
26 </ClCompile>
27 </ItemGroup>
28</Project> \ No newline at end of file
diff --git a/Tox_GUI/Tox_GUI.vcxproj.user b/Tox_GUI/Tox_GUI.vcxproj.user
new file mode 100644
index 00000000..a375ae35
--- /dev/null
+++ b/Tox_GUI/Tox_GUI.vcxproj.user
@@ -0,0 +1,4 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <PropertyGroup />
4</Project> \ No newline at end of file
diff --git a/Tox_GUI/gui/Main.cpp b/Tox_GUI/gui/Main.cpp
new file mode 100644
index 00000000..42feecfa
--- /dev/null
+++ b/Tox_GUI/gui/Main.cpp
@@ -0,0 +1,33 @@
1#include <wx\wx.h>
2#include "home\Home.h"
3
4class Tox : public wxApp
5{
6 public:
7 virtual bool OnInit();
8};
9
10
11
12bool Tox::OnInit()
13{
14 Home *home = new Home(wxT("Tox"));
15 home->Show(true);
16
17 return true;
18}
19
20int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE prevInstance, LPWSTR lpCmdLine, int nShowCmd)
21{
22 char *buf;
23
24 buf = new char[wcslen(lpCmdLine) + 1];
25
26 wcstombs(buf, lpCmdLine, wcslen(lpCmdLine) +1);
27
28 wxApp::SetInstance( new Tox());
29
30 wxEntry(hInstance, prevInstance, buf, nShowCmd);
31
32 wxEntryCleanup();
33} \ No newline at end of file
diff --git a/Tox_GUI/gui/home/Home.cpp b/Tox_GUI/gui/home/Home.cpp
new file mode 100644
index 00000000..f30f8af3
--- /dev/null
+++ b/Tox_GUI/gui/home/Home.cpp
@@ -0,0 +1,28 @@
1#include <wx\textdlg.h>
2#include "Home.h"
3
4Home::Home(const wxString& title)
5 : wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(750, 450))
6{
7 wxPanel * panel = new wxPanel(this, -1);
8
9 wxBoxSizer *hbox = new wxBoxSizer(wxHORIZONTAL);
10
11 netlogList = new wxListBox(panel, ID_LISTBOX,
12 wxPoint(-1, -1), wxSize(-1, -1));
13
14 hbox->Add(netlogList, 3, wxEXPAND | wxALL, 20);
15
16 panel->SetSizer(hbox);
17
18 Centre();
19
20 netlogList->Append("Testing...");
21}
22
23void Home::AddNew(wxCommandEvent& event)
24{
25 wxString str = wxGetTextFromUser(wxT("Add new item"));
26 if (str.Len() > 0)
27 netlogList->Append(str);
28} \ No newline at end of file
diff --git a/Tox_GUI/gui/home/Home.h b/Tox_GUI/gui/home/Home.h
new file mode 100644
index 00000000..a3832136
--- /dev/null
+++ b/Tox_GUI/gui/home/Home.h
@@ -0,0 +1,13 @@
1#include <wx\wx.h>
2
3class Home : public wxFrame
4{
5public:
6 Home(const wxString& title);
7
8 void AddNew(wxCommandEvent& event);
9
10 wxListBox *netlogList;
11};
12
13const int ID_LISTBOX = 1; \ No newline at end of file
diff --git a/core/DHT.c b/core/DHT.c
index 1b82b860..c6ea6a22 100644
--- a/core/DHT.c
+++ b/core/DHT.c
@@ -16,10 +16,10 @@ int ping(IP_Port ip_port)
16 char data[37]; 16 char data[37];
17 data[0] = 00; 17 data[0] = 00;
18 memcpy(data + 5, self_client_id, 32); 18 memcpy(data + 5, self_client_id, 32);
19 ADDR addr = {.family = AF_INET, .ip = ip_port.ip, .port = ip_port.port}; 19//ADDR addr = {.family = AF_INET, .ip = ip_port.ip, .port = ip_port.port};
20 20
21 return sendto(sock, data, sizeof(data) - 1, 0, (struct sockaddr *)&addr, addrlen); 21//return sendto(sock, data, sizeof(data) - 1, 0, (struct sockaddr *)&addr, addrlen);
22 //sendto(int socket_descriptor, char *buffer, int buffer_length, int flags, struct sockaddr *destination_address, int address_length); 22 //sendto(int socket_descriptor, char *buffer, int buffer_length, int flags, struct sockaddr *destination_address, int address_length);
23} 23}
24 24
25 25
@@ -36,7 +36,7 @@ void addfriend(char * client_id)
36 36
37 37
38 38
39char delfriend(char * client_id); 39char delfriend(char * client_id)
40{ 40{
41 41
42 42
@@ -60,8 +60,7 @@ IP_Port getfriendip(char * client_id)
60 60
61void DHT_recvpacket(char * packet, uint32_t length) 61void DHT_recvpacket(char * packet, uint32_t length)
62{ 62{
63 63
64
65} 64}
66 65
67 66
@@ -83,4 +82,5 @@ void bootstrap(IP_Port ip_port)
83 82
84 83
85 84
86} \ No newline at end of file 85}
86
diff --git a/core/DHT.h b/core/DHT.h
index f1d2e5ae..f0ccd184 100644
--- a/core/DHT.h
+++ b/core/DHT.h
@@ -4,13 +4,10 @@
4#include <string.h> 4#include <string.h>
5#include <time.h> 5#include <time.h>
6 6
7#ifdef WIN32 7#ifdef WIN32 //Put win32 includes here
8 8
9
10//Put win32 includes here
11#include <windows.h>
12#include <winsock2.h> 9#include <winsock2.h>
13 10#include <windows.h>
14 11
15#else //Linux includes 12#else //Linux includes
16 13
@@ -116,4 +113,6 @@ uint16_t num_friends;
116//TODO: make this more efficient looping up to 128 times is a bit... 113//TODO: make this more efficient looping up to 128 times is a bit...
117Pinged pings[128]; 114Pinged pings[128];
118 115
119Pinged send_nodes[64]; \ No newline at end of file 116Pinged send_nodes[64];
117
118