diff --git a/Gtkmm3/gtk113_file_gtkmm/meson.build b/Gtkmm3/gtk113_file_gtkmm/meson.build new file mode 100644 index 0000000..f6768a8 --- /dev/null +++ b/Gtkmm3/gtk113_file_gtkmm/meson.build @@ -0,0 +1,35 @@ +#A Simple Project Test +project('gtk113', 'cpp', + default_options : ['c_std=c17', 'cpp_std=c++17']) + +#Initalize variants +gnome=import('gnome') + +#Compile Resource +# gresources = gnome.compile_resources( +# 'resources', 'res/gtk112.gresource.xml', +# source_dir: 'res', +# c_name: 'resources' +# ) + +#compile schemas +# app_schemas = gnome.compile_schemas(depend_files: 'org.gtk.daleclack.gschema.xml') + +#The Gtkmm Library as a dependency +gtkdep = dependency('gtkmm-3.0') + +#Additional include dirs +dir_include = include_directories('..') + +#source files +src = ['src/main.cc', 'src/FileWindow.cc'] + +#Use Different Build Opinions in windows and Linux +if host_machine.system() == 'windows' + win=import('windows') + icon_res=win.compile_resources('../icon.rc') + executable('gtk113', icon_res, src, dependencies : gtkdep, + win_subsystem : 'windows', include_directories : dir_include) +else + executable('gtk113', src, dependencies : gtkdep, include_directories : dir_include) +endif diff --git a/Gtkmm3/gtk113_file_gtkmm/src/FileWindow.cc b/Gtkmm3/gtk113_file_gtkmm/src/FileWindow.cc new file mode 100644 index 0000000..be47e42 --- /dev/null +++ b/Gtkmm3/gtk113_file_gtkmm/src/FileWindow.cc @@ -0,0 +1,3 @@ +#include "FileWindow.hh" + +FileWindow::FileWindow(){} diff --git a/Gtkmm3/gtk113_file_gtkmm/src/FileWindow.hh b/Gtkmm3/gtk113_file_gtkmm/src/FileWindow.hh new file mode 100644 index 0000000..69a9cd0 --- /dev/null +++ b/Gtkmm3/gtk113_file_gtkmm/src/FileWindow.hh @@ -0,0 +1,8 @@ +#pragma once + +#include + +class FileWindow : public Gtk::Window{ +public: + FileWindow(); +}; \ No newline at end of file diff --git a/Gtkmm3/gtk113_file_gtkmm/src/main.cc b/Gtkmm3/gtk113_file_gtkmm/src/main.cc new file mode 100644 index 0000000..a3ed506 --- /dev/null +++ b/Gtkmm3/gtk113_file_gtkmm/src/main.cc @@ -0,0 +1,7 @@ +#include "FileWindow.hh" + +int main(int argc,char **argv){ + auto app = Gtk::Application::create(argc,argv,"org.gtk.daleclack"); + FileWindow window; + return app->run(window); +} diff --git a/Gtkmm3/vscode_meson/c_cpp_properties.json b/Gtkmm3/vscode_meson/c_cpp_properties.json new file mode 100644 index 0000000..2cea04d --- /dev/null +++ b/Gtkmm3/vscode_meson/c_cpp_properties.json @@ -0,0 +1,49 @@ +//The configurations are for vscode with meson extension +//See configurations in "compileCommands" +{ + "configurations": [ + { + "name": "Linux", + "includePath": [ + "${default}", + "${workspaceFolder}/**", + "${workspaceFolder}/src/**" + ], + "compilerPath": "/usr/bin/gcc", + "cStandard": "c17", + "cppStandard": "c++17", + "intelliSenseMode": "linux-gcc-x64", + "compileCommands": "${workspaceFolder}/builddir/compile_commands.json" + }, + { + "name": "win32", + "includePath": [ + "${default}", + "${workspaceFolder}/**", + "${workspaceFolder}/src/**" + ], + "defines": [], + "compilerPath": "D:/msys64/MinGW64/bin/gcc.exe", + "cStandard": "c17", + "cppStandard": "c++17", + "intelliSenseMode": "windows-gcc-x64", + "compileCommands": "${workspaceFolder}/builddir_win32/compile_commands.json" + }, + { + "name": "Mac", + "includePath": [ + "${default}", + "${workspaceFolder}/**", + "${workspaceFolder}/src/**" + ], + "defines": [], + "macFrameworkPath": [], + "compilerPath": "/usr/bin/clang", + "cStandard": "gnu17", + "cppStandard": "gnu++17", + "intelliSenseMode": "macos-clang-x64", + "compileCommands": "${workspaceFolder}/builddir/compile_commands.json" + } + ], + "version": 4 +} diff --git a/Gtkmm3/vscode_meson/launch.json b/Gtkmm3/vscode_meson/launch.json index c60d9d6..ef60df2 100644 --- a/Gtkmm3/vscode_meson/launch.json +++ b/Gtkmm3/vscode_meson/launch.json @@ -8,7 +8,7 @@ "name": "(gdb) 启动", "type": "cppdbg", "request": "launch", - "program": "${workspaceFolder}/builddir/gtk91", + "program": "${workspaceFolder}/builddir/gtk108", "args": [], "stopAtEntry": false, "cwd": "${fileDirname}", @@ -23,6 +23,41 @@ "ignoreFailures": true } ] + }, + { + "name": "(gdb) 启动(win32)", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/builddir_win32/gtk108", + "args": [], + "stopAtEntry": false, + "cwd": "${fileDirname}", + "environment": [], + "externalConsole": false, + "preLaunchTask": "Meson: Build target", + "MIMode": "gdb", + "setupCommands": [ + { + "description": "为 gdb 启用整齐打印", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ], + "miDebuggerPath": "D:/msys64/mingw64/bin/gdb.exe" + }, + { + "name": "(lldb) 启动", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/builddir/gtk108", + "args": [], + "stopAtEntry": false, + "cwd": "${fileDirname}", + "environment": [], + "externalConsole": false, + "preLaunchTask": "Meson: Build target", + "MIMode": "lldb", + "setupCommands": [] } ] -} \ No newline at end of file +} diff --git a/Gtkmm3/vscode_meson/settings.json b/Gtkmm3/vscode_meson/settings.json new file mode 100644 index 0000000..208afcc --- /dev/null +++ b/Gtkmm3/vscode_meson/settings.json @@ -0,0 +1,5 @@ +{ + "C_Cpp.errorSquiggles": "Disabled", + "cmake.configureOnOpen": false, + "C_Cpp.dimInactiveRegions": false +} \ No newline at end of file diff --git a/Gtkmm3/vscode_meson/tasks.json b/Gtkmm3/vscode_meson/tasks.json index 8e31391..d45a6e2 100644 --- a/Gtkmm3/vscode_meson/tasks.json +++ b/Gtkmm3/vscode_meson/tasks.json @@ -2,7 +2,7 @@ "tasks": [ { "type": "meson", - "target": "gtk91", + //"target": "gtk91", "mode": "build", "group": "build", "problemMatcher": [], @@ -10,4 +10,4 @@ } ], "version": "2.0.0" -} \ No newline at end of file +}