From: caprice Date: Tue, 31 Dec 2013 05:11:36 +0000 (+0900) Subject: 未完成状態、コンパイルも通らない状態でコミット… X-Git-Url: http://git.osdn.net/view?p=gikomona%2Fpnuts.git;a=commitdiff_plain;h=1501740c2f1d1ff6b69b46738a22ac02b697dd5b 未完成状態、コンパイルも通らない状態でコミット… --- 1501740c2f1d1ff6b69b46738a22ac02b697dd5b diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3428565 --- /dev/null +++ b/.gitignore @@ -0,0 +1,240 @@ +# Created by http://gitignore.io + +### Linux ### +.* +!.gitignore +!.git* +*~ + +### OSX ### +.DS_Store +.AppleDouble +.LSOverride +Icon + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +### Windows ### +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +### C++ ### +# Compiled Object files +*.slo +*.lo +*.o + +# Compiled Dynamic libraries +*.so +*.dylib + +# Compiled Static libraries +*.lai +*.la +*.a + +### Xcode ### +*.xcodeproj/* + +### Eclipse ### +*.pydevproject +.project +.metadata +bin/** +tmp/** +tmp/**/* +*.tmp +*.bak +*.swp +*~.nib +local.properties +.classpath +.settings/ +.loadpath + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# PDT-specific +.buildpath + +### VisualStudio ### +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results + +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +x64/ +#build/ +[Bb]in/ +[Oo]bj/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.log +*.scc + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.Publish.xml +*.pubxml + +# NuGet Packages Directory +## TODO: If you have NuGet Package Restore enabled, uncomment the next line +#packages/ + +# Windows Azure Build Output +csx +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.[Pp]ublish.xml +*.pfx +*.publishsettings + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +App_Data/*.mdf +App_Data/*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# ========================= +# Windows detritus +# ========================= + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Mac crap +.DS_Store + +### CMake ### +CMakeCache.txt +CMakeFiles +Makefile +cmake_install.cmake +install_manifest.txt diff --git a/build/build-pnuts.sh b/build/build-pnuts.sh new file mode 100644 index 0000000..dc07fe9 --- /dev/null +++ b/build/build-pnuts.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +# bootstrap + +echo "now loading..." + +BUILD_DIR=`pwd` +ROOT=${BUILD_DIR}/../ +LIB_DIR=${ROOT}/lib + +function check_dir() { + if [ -d $1 ] ; then + echo "\$1 does not find." + exit 1 + fi +} + +check_dir ${LIB_DIR}/core +check_dir ${LIB_DIR}/libbbs +check_dir ${LIB_DIR}/lua +check_dir ${LIB_DIR}/sqlite3 + +LIBCORE_DIR=${LIB_DIR}/core +LIBBBS_DIR=${LIB_DIR}/libbbs +LIBLUA_DIR=${LIB_DIR}/lua +LIBSQLITE3_DIR=${LIB_DIR}/sqlite3 + +cd LIBLUA_DIR +if [ ! -f LIBLUA_DIR/bin/lua ] ; then + if [ ! -f LIBLUA_DIR/bin/lua.exe ] ; then + make + fi +fi + +LUA=LIBLUA_DIR/bin/lua + +echo "bootstrap stage finished." + +cd BUILD_DIR + +LUA ./lake.lua lake-build diff --git a/include/pnuts.hpp b/include/pnuts.hpp new file mode 100644 index 0000000..cb0a268 --- /dev/null +++ b/include/pnuts.hpp @@ -0,0 +1,36 @@ +#ifndef GIKOMONA_PNUTS_HPP +#define GIKOMONA_PNUTS_HPP + +#include + +#include "core/GikoMona.hpp" + +namespace GikoMona { +namespace pnuts {} +} + +#define PNUTS_VERSION_MAJOR 1 +#define PNUTS_VERSION_MINOR 0 +#define PNUTS_VERSION_STATE 0 + +#define PNUTS_VERSION PNUTS_VERSION_MAJOR . \ + PNUTS_VERSION_MINOR . \ + PNUTS_VERSION_STATE + +#define PNUTS_VERSION_STR BOOST_STRINGNIZE(PNUTS_VERSION) + +// wxrc generate. +extern void InitXmlResource(); + +namespace GikoMona { +namespace pnuts { + +class application : public wxApp { + bool OnInit(); + int OnExit(); +}; + +} +} + +#endif diff --git a/src/pnuts.cpp b/src/pnuts.cpp new file mode 100644 index 0000000..7f58289 --- /dev/null +++ b/src/pnuts.cpp @@ -0,0 +1,59 @@ + +#include "pnuts.hpp" + +namespace GikoMona { +namespace pnuts { + +bool application::OnInit() { + wxXmlResource::Get()->InitAllHandlers(); + // init embedded resources. + InitXmlResources(); + // init changeable resources. + wxXmlResource::Get()->LoadAllFiles("resource"); + + config = new config; +#ifdef ENABLE_TWITTER + auto res = config.post_query("?:twitter/service=enable"); + if(res) { + auto id_password + = config.post_query( + ">:twitter/user/{id & password}" + ); + twitter::login(id_password<0>, id_password<1>); + } +#endif + + controller = new controller; + model = new model; + main_window = new main_window; + model.main_window = main_window; + main_window->PushEventHandler(controller); + + auto is_first_executation + = config.post_query( + "?:app/last-executation-time=inavailable" + ); + + if(is_first_executation) { + show_welcome(); + main_window->Show(); + return true; + } else { + thread_window = new threaad_window; + model.thread_window = thread_window; + thread_window->PushEventHandler(controller); + + thread_window->Show(); + return true; + } +} + +int application::OnExit() { + config.post_query( + "<:app/last-executation-time", "$:NOW" + ); + return 0; +} + +} +}