GTK 프로그래밍 ( 1 ) SNSLAB 발표 : 문동규
GNOME ? GNOME GNU Network Object Model Environment GNOME의 기본 툴킷 - GTK+ (GIMP toolkit)
GNOME Architecture
Qt Architecture
GTK ? object oriented application programmers interface Multi-platform toolkit for creating graphical user interfaces . C로 구현 클래스 개념, callback 함수사용 Ada, C++, Pascal, Perl 등과 결합
GTK 구성요소 Glib GIMP 툴킷 GDK Xlib X 네트워크 프로토콜
GTK history GTK original GTK+ 1.2 GTK+ 2.x libglib libgdk libgtk GLib GObject Pango ATK GdkPixbuf
Gtk+ 2.0 libraries Glib A general-purpose utility library Pango internationalized text handling ATK Accessibility Toolkit GdkPixbuf image data or image files
Gtk+ 2.0 libraries (계속) GDK Provides drawing and window system facilities. GTK + Contains widgets.
GLIB 데이터형 자체적인 기본데이터형을 정의 GLIB의 데이터형 C의 데이터형 gchar gshort glong gint gboolean gpointer char short long int boolean void*
Widget 계층구조 Widget ? GtkObject +--- GtkWidget +-- GtkContainer +-- GtkBin +-- GtkWindow +--GnomeApp
GTK – 어플리케이션 내부 계층구조
GTK+ installed 필요 libraries pkg-config (pkg-config Site) GNU make (GNU make Site) JPEG, PNG and TIFF image libraries (GTK+ Site) FreeType (FreeType Site) fontconfig (fontconfig Site) GNU libiconv library (GNU libiconv Site) GNU gettext (GTK+ Site) GLib (GTK+ Site) Pango (GTK+ Site) ATK (GTK+ Site) GTK+ (GTK+ Site)
gcc example.c –o example ‘pkg-config –libs –cflags’ Compile pkg-config 유틸리티 명령제공 pkg-config 옵션 gcc example.c –o example ‘pkg-config –libs –cflags’ 옵션 설명 --prefix 설치 디렉토리 설정 --version 설치되어 있는 버전 --libs 필요한 라이브러리 지정 --cflags 필요한 컴파일러 옵션 지정
Compile 예제
참고자료 GTK+ 만든 Applications GIMP (http://www.gimp.org/), an image manipulation program AbiWord (http://www.abiword.com/), a professional word processor Dia (http://www.lysator.liu.se/~alla/dia/dia.html), a diagram creation program Gnu Cash (http://www.gnucash.org/), a personal finance manager Gnumeric (http://www.gnome.org/projects/gnumeric/), the GNOME spreadsheet application Glade (http://glade.gnome.org/), a GTK+ based RAD tool which produces GTK+ and GNOME applications Anjuta (http://anjuta.sourceforge.net/), a versatile Integrated Development Environment (IDE) using C and C++ for GTK+ and GIMP