Skip to content

Commit

Permalink
Teste GTK
Browse files Browse the repository at this point in the history
  • Loading branch information
Milton Maldonado Jr committed Jun 24, 2020
1 parent f32c8dd commit 3d45f11
Show file tree
Hide file tree
Showing 5 changed files with 176 additions and 25 deletions.
82 changes: 81 additions & 1 deletion .cproject
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@

</option>

<option id="gnu.c.compiler.option.misc.other.1341720000" name="Other flags" superClass="gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-c -fmessage-length=0 -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include" valueType="string"/>

<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.281853885" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>

</tool>
Expand All @@ -79,6 +81,30 @@

<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.link.option.libs.1966460485" name="Libraries (-l)" superClass="gnu.c.link.option.libs" useByScannerDiscovery="false" valueType="libs">

<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="gtk-3"/>

<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="gdk-3"/>

<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="pangocairo-1.0"/>

<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="pango-1.0"/>

<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="harfbuzz"/>

<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="atk-1.0"/>

<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="cairo-gobject"/>

<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="cairo"/>

<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="gdk_pixbuf-2.0"/>

<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="gio-2.0"/>

<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="gobject-2.0"/>

<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="glib-2.0"/>

<listOptionValue builtIn="false" value="ncurses"/>

<listOptionValue builtIn="false" value="pthread"/>
Expand All @@ -87,6 +113,10 @@

<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.c.link.option.paths.1355541007" name="Library search path (-L)" superClass="gnu.c.link.option.paths" useByScannerDiscovery="false" valueType="libPaths"/>

<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.c.link.option.other.1630954935" name="Other options (-Xlinker [option])" superClass="gnu.c.link.option.other" useByScannerDiscovery="false" valueType="stringList"/>

<option id="gnu.c.link.option.ldflags.828129114" name="Linker flags" superClass="gnu.c.link.option.ldflags" useByScannerDiscovery="false" value="" valueType="string"/>

<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.786565219" superClass="cdt.managedbuild.tool.gnu.c.linker.input">

<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
Expand Down Expand Up @@ -119,7 +149,57 @@

</storageModule>

<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings">

<externalSettings containerId="org.eclipse.cdt.managedbuilder.pkgconfig.extSettings" factoryId="org.eclipse.cdt.core.extension.container.factory">

<externalSetting contentTypes="org.eclipse.cdt.managedbuilder.core.compiledObjectFile">

<entry flags="UNDEFINED" kind="libraryFile" name="gtk-3" srcPrefixMapping="" srcRootPath=""/>

<entry flags="UNDEFINED" kind="libraryFile" name="gdk-3" srcPrefixMapping="" srcRootPath=""/>

<entry flags="UNDEFINED" kind="libraryFile" name="pangocairo-1.0" srcPrefixMapping="" srcRootPath=""/>

<entry flags="UNDEFINED" kind="libraryFile" name="pango-1.0" srcPrefixMapping="" srcRootPath=""/>

<entry flags="UNDEFINED" kind="libraryFile" name="harfbuzz" srcPrefixMapping="" srcRootPath=""/>

<entry flags="UNDEFINED" kind="libraryFile" name="atk-1.0" srcPrefixMapping="" srcRootPath=""/>

<entry flags="UNDEFINED" kind="libraryFile" name="cairo-gobject" srcPrefixMapping="" srcRootPath=""/>

<entry flags="UNDEFINED" kind="libraryFile" name="cairo" srcPrefixMapping="" srcRootPath=""/>

<entry flags="UNDEFINED" kind="libraryFile" name="gdk_pixbuf-2.0" srcPrefixMapping="" srcRootPath=""/>

<entry flags="UNDEFINED" kind="libraryFile" name="gio-2.0" srcPrefixMapping="" srcRootPath=""/>

<entry flags="UNDEFINED" kind="libraryFile" name="gobject-2.0" srcPrefixMapping="" srcRootPath=""/>

<entry flags="UNDEFINED" kind="libraryFile" name="glib-2.0" srcPrefixMapping="" srcRootPath=""/>

</externalSetting>

<externalSetting contentTypes="org.eclipse.cdt.core.cSource:org.eclipse.cdt.core.cxxSource">

<entry flags="NONE" kind="includePath" name="/usr/include/gtk-3.0"/>

<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/${ProjName}/src"/>

<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/${ProjName}/src/computer"/>

<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/${ProjName}/src/tests"/>

<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/${ProjName}/src/parts"/>

</externalSetting>

</externalSettings>

</storageModule>

<storageModule adwaita-icon-theme="false" applewmproto="false" atk="false" atk-bridge-2.0="false" atspi-2="false" bash-completion="false" bigreqsproto="false" blkid="false" cairo="false" cairo-fc="false" cairo-ft="false" cairo-gobject="false" cairo-pdf="false" cairo-png="false" cairo-ps="false" cairo-script="false" cairo-svg="false" cairo-tee="false" cairo-xcb="false" cairo-xcb-shm="false" cairo-xlib="false" cairo-xlib-xrender="false" compositeproto="false" damageproto="false" datrie-0.2="false" dbus-1="false" dmxproto="false" dri2proto="false" dri3proto="false" egl="false" epoxy="false" expat="false" fixesproto="false" fontconfig="false" fontsproto="false" fontutil="false" form="false" formw="false" freetype2="false" fribidi="false" gcalc-2="false" gci-1="false" gdk-3.0="false" gdk-broadway-3.0="false" gdk-pixbuf-2.0="false" gdk-pixbuf-xlib-2.0="false" gdk-wayland-3.0="false" gdk-x11-3.0="false" geoclue-2.0="false" gio-2.0="false" gio-unix-2.0="false" gl="false" glesv1_cm="false" glesv2="false" glib-2.0="false" glproto="false" glx="false" gmodule-2.0="false" gmodule-export-2.0="false" gmodule-no-export-2.0="false" gnome-system-tools="false" gobject-2.0="false" graphite2="false" grilo-plugins-0.3="false" gthread-2.0="false" gtkplus-3.0="true" gtkplus-broadway-3.0="false" gtkplus-unix-print-3.0="false" gtkplus-wayland-3.0="false" gtkplus-x11-3.0="false" harfbuzz="false" harfbuzz-gobject="false" harfbuzz-icu="false" ibus-table="false" ice="false" icu-i18n="false" icu-io="false" icu-uc="false" inputproto="false" iso-codes="false" json-c="false" kbproto="false" libcrypt="false" libcrypto="false" libffi="false" libglvnd="false" libpcre="false" libpcre16="false" libpcre2-16="false" libpcre2-32="false" libpcre2-8="false" libpcre2-posix="false" libpcre32="false" libpcrecpp="false" libpcreposix="false" libpng="false" libpng16="false" libselinux="false" libsepol="false" libssl="false" libthai="false" libxcrypt="false" libxfce4sensors-1.0="false" menu="false" menuw="false" mobile-broadband-provider-info="false" moduleId="packages" mount="false" mysqlclient="false" ncurses="false" ncursesplusplus="false" ncursesplusplusw="false" ncursesw="false" opengl="false" openssl="false" panel="false" panelw="false" pango="false" pangocairo="false" pangoft2="false" pangoxft="false" pixman-1="false" poppler-data="false" presentproto="false" pthread-stubs="false" randrproto="false" recordproto="false" renderproto="false" resourceproto="false" scrnsaverproto="false" shared-mime-info="false" sm="false" systemd="false" tic="false" tinfo="false" udev="false" uuid="false" videoproto="false" wayland-client="false" wayland-cursor="false" wayland-egl="false" wayland-protocols="false" wayland-scanner="false" wayland-server="false" x11="false" xau="false" xbitmaps="false" xcb="false" xcb-render="false" xcb-shm="false" xcmiscproto="false" xcomposite="false" xcursor="false" xdamage="false" xdmcp="false" xext="false" xextproto="false" xf86bigfontproto="false" xf86dgaproto="false" xf86driproto="false" xf86vidmodeproto="false" xfixes="false" xft="false" xi="false" xinerama="false" xineramaproto="false" xkbcommon="false" xkbcomp="false" xkeyboard-config="false" xorg-sgml-doctools="false" xorg-wacom="false" xproto="false" xrandr="false" xrender="false" xtrans="false" xtst="false" yelp-xsl="false" zlib="false"/>

</cconfiguration>

Expand Down
2 changes: 1 addition & 1 deletion .project
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>tlsim</name>
<name>tlsim2</name>
<comment></comment>
<projects>
</projects>
Expand Down
67 changes: 45 additions & 22 deletions .settings/language.settings.xml
Original file line number Diff line number Diff line change
@@ -1,25 +1,48 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project>
<configuration id="cdt.managedbuild.config.gnu.exe.debug.769796154" name="Debug">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-569688907015518406" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
</extension>
</configuration>
<configuration id="cdt.managedbuild.config.gnu.exe.release.391794649" name="Release">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-569688907015518406" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
</extension>
</configuration>

<configuration id="cdt.managedbuild.config.gnu.exe.debug.769796154" name="Debug">

<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">

<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>

<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>

<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>

<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-1370420024531137949" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">

<language-scope id="org.eclipse.cdt.core.gcc"/>

<language-scope id="org.eclipse.cdt.core.g++"/>

</provider>

</extension>

</configuration>

<configuration id="cdt.managedbuild.config.gnu.exe.release.391794649" name="Release">

<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">

<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>

<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>

<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>

<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-1370420024531137949" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">

<language-scope id="org.eclipse.cdt.core.gcc"/>

<language-scope id="org.eclipse.cdt.core.g++"/>

</provider>

</extension>

</configuration>

</project>
3 changes: 3 additions & 0 deletions .settings/org.eclipse.cdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
eclipse.preferences.version=1
environment/project/cdt.managedbuild.config.gnu.exe.debug.769796154/append=true
environment/project/cdt.managedbuild.config.gnu.exe.debug.769796154/appendContributed=true
47 changes: 46 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
#include "board.h"
#include "tests.h"
#include "computer.h"
#include <gtk/gtk.h>

////////////////////////////////////////////////////////////////////////////////
int main (int argc, char *argv[]){
int __main (int argc, char *argv[]){

//gatetest();

Expand All @@ -25,3 +26,47 @@ int main (int argc, char *argv[]){

return 0;
}

////////////////////////////////////////////////////////////////////////////////
static void
print_hello (GtkWidget *widget,
gpointer data)
{
g_print ("Hello World\n");
}

////////////////////////////////////////////////////////////////////////////////
static void
activate (GtkApplication* app,
gpointer user_data)
{

GtkWidget *window = gtk_application_window_new (app);
gtk_window_set_title (GTK_WINDOW (window), "Window");
gtk_window_set_default_size (GTK_WINDOW (window), 400, 200);


GtkWidget *button_box = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
gtk_container_add (GTK_CONTAINER (window), button_box);

GtkWidget *button = gtk_button_new_with_label ("Hello World");

g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL);
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window);
gtk_container_add (GTK_CONTAINER (button_box), button);

gtk_widget_show_all (window);
}

////////////////////////////////////////////////////////////////////////////////
int main (int argc, char **argv)
{
int status;

GtkApplication *app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE);
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
status = g_application_run (G_APPLICATION (app), argc, argv);
g_object_unref (app);

return status;
}

0 comments on commit 3d45f11

Please sign in to comment.