From 3797f3766bd262af671ea4fc8ca84f4b8655a60e Mon Sep 17 00:00:00 2001 From: Kemal Hadimli Date: Sat, 20 Oct 2007 04:05:57 +0000 Subject: [PATCH] Initial Chinook port. Requires libwpeditor-plus. Menu/Tools/Color doesn't work. git-svn-id: https://vcs.maemo.org/svn/maemopadplus/trunk/it2008@46 5e5308f7-2816-0410-9b18-d3ce14e03fc0 --- configure.in | 8 ++++---- debian/changelog | 7 +++++++ debian/control | 7 +++---- debian/files | 2 +- debian/postinst | 8 ++++---- debian/rules | 2 +- debian/substvars | 2 +- src/main.c | 4 ++-- src/ui/callbacks.c | 33 +++++++++++++++------------------ src/ui/interface.c | 10 +++++----- src/ui/interface.h | 8 ++++---- src/ui/sketchwidget.c | 9 +++++++-- 12 files changed, 54 insertions(+), 46 deletions(-) rewrite debian/substvars (100%) diff --git a/configure.in b/configure.in index 60f7f01..0ad9aca 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ AC_INIT(Makefile.am) -AM_INIT_AUTOMAKE(maemopadplus, 0.32) +AM_INIT_AUTOMAKE(maemopadplus, 0.32-test1) AM_CONFIG_HEADER(config.h) AC_CANONICAL_HOST @@ -25,7 +25,7 @@ else fi # Hildon library dependencies -PKG_CHECK_MODULES(HILDON, hildon-libs >= 0.9.50 hildon-fm libossohelp) +PKG_CHECK_MODULES(HILDON, hildon-1 hildon-fm-2) AC_SUBST(HILDON_LIBS) AC_SUBST(HILDON_CFLAGS) @@ -47,8 +47,8 @@ PKG_CHECK_MODULES(SQL3, sqlite3 >= 3.0) AC_SUBST(SQL3_LIBS) AC_SUBST(SQL3_CFLAGS) -# libwpeditor -PKG_CHECK_MODULES(WPEDITOR, wpeditor) +# libwpeditor-plus +PKG_CHECK_MODULES(WPEDITOR, libwpeditor-plus) AC_SUBST(WPEDITOR_LIBS) AC_SUBST(WPEDITOR_CFLAGS) diff --git a/debian/changelog b/debian/changelog index a30714c..f330ea8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +maemopadplus (0.32-test1) unstable; urgency=low + + Chinook test release. + + -- Kemal 'disq' Hadimli Thu, 20 Oct 2007 06:00:00 +0300 + + maemopadplus (0.32) unstable; urgency=low checklist support! diff --git a/debian/control b/debian/control index d134ef2..24c466c 100644 --- a/debian/control +++ b/debian/control @@ -2,13 +2,12 @@ Source: maemopadplus Section: user/accessories Priority: optional Maintainer: Kemal 'disq' Hadimli -Build-Depends: debhelper (>= 4.0.0), intltool, hildon-base-lib-dev, hildon-libs-dev, hildon-fm-dev, libgtk2.0-dev, libosso-gnomevfs2-dev, libglib2.0-dev, libdbus-glib-1-dev, libosso-dev, libsqlite3-dev, wpeditor-dev -Standards-Version: 3.6.0 +Build-Depends: debhelper (>= 4.0.0), intltool, libhildon1-dev, libgtk2.0-dev, libosso-gnomevfs2-dev, libglib2.0-dev, libdbus-glib-1-dev, libosso-dev, libsqlite3-dev, libwpeditor-plus-dev +Standards-Version: 3.6.1 Package: maemopadplus Architecture: any -Pre-Depends: maemo-select-menu-location -Depends: libsqlite3-0 (>= 3.0), wpeditor (>=1.01-1) +Depends: libsqlite3-0 (>= 3.0), libwpeditor-plus (>=1.0-0) Description: Tree-based note/sketch application. Requires sqlite3 to work. XB-Maemo-Icon-26: iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAACXBIWXMAAAsT AAALEwEAmpwYAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6JQAAgIMAAPn/ diff --git a/debian/files b/debian/files index b9ef588..f88aee4 100644 --- a/debian/files +++ b/debian/files @@ -1 +1 @@ -maemopadplus_0.32_armel.deb user/accessories optional +maemopadplus_0.32-test1_i386.deb user/accessories optional diff --git a/debian/postinst b/debian/postinst index 69ca0cb..93640a7 100755 --- a/debian/postinst +++ b/debian/postinst @@ -8,10 +8,10 @@ gtk-update-icon-cache -f /usr/share/icons/hicolor # Now we are ready to let the user move the entry around, but only if # this is a new install -oldversion="$2" -if [ -z "$oldversion" ]; then - maemo-select-menu-location maemopadplus.desktop -fi +#oldversion="$2" +#if [ -z "$oldversion" ]; then +# maemo-select-menu-location maemopadplus.desktop +#fi #DEBHELPER# diff --git a/debian/rules b/debian/rules index 3e05e28..995070e 100644 --- a/debian/rules +++ b/debian/rules @@ -14,7 +14,7 @@ DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) CFLAGS = -Wall -g -PACKAGENAME = maemopad+ +PACKAGENAME = maemopadplus ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 diff --git a/debian/substvars b/debian/substvars dissimilarity index 100% index b8747da..0e628ca 100644 --- a/debian/substvars +++ b/debian/substvars @@ -1 +1 @@ -shlibs:Depends=hildon-fm1 (>= 1.14-1), hildon-libs0 (>= 0.14.11-1), libatk1.0-0 (>= 1.9.0), libc6 (>= 2.3.5-1), libdbus-1-2 (>= 0.61), libdbus-glib-1-2 (>= 0.61), libgconf2-6 (>= 2.6.4.15), libglib2.0-0 (>= 2.8.6-1osso1), libgtk2.0-0 (>= 2:2.6.10-1.osso8), libosso-gnomevfs2-0, libosso-help0 (>= 2.0.8), libosso1 (>= 1.20-1), libpango1.0-0 (>= 1.8.1), libsqlite3-0 (>= 3.3.8), libxml2 (>= 2.6.16), wpeditor, zlib1g (>= 1:1.2.1) +shlibs:Depends=libatk1.0-0 (>= 1.12.2), libc6 (>= 2.5.0-1), libcairo2 (>= 1.4.10), libdbus-1-3 (>= 0.94), libdbus-glib-1-2 (>= 0.74), libgconf2-6 (>= 2.13.5), libglib2.0-0 (>= 2.12.12-1osso3), libgtk2.0-0 (>= 2:2.10.12-0osso13), libhildon1 (>= 1.0.11), libhildonfm2 (>= 1:1.9.38), libosso-gnomevfs2-0, libosso1 (>= 2.13), libpango1.0-0 (>= 1.16.4), libsqlite3-0 (>= 3.4.1), libwpeditor-plus diff --git a/src/main.c b/src/main.c index 059a405..3a8a220 100644 --- a/src/main.c +++ b/src/main.c @@ -26,8 +26,8 @@ #include -#include -#include +#include +#include #include #include diff --git a/src/ui/callbacks.c b/src/ui/callbacks.c index 7fa9e0f..88ac109 100644 --- a/src/ui/callbacks.c +++ b/src/ui/callbacks.c @@ -34,11 +34,11 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include -#include +#include #include @@ -2377,13 +2377,8 @@ void callback_eraser(GtkAction * action, MainView * mainview) } else { - GdkColor *col = hildon_color_button_get_color(HILDON_COLOR_BUTTON(mainview->colorbutton)); - GdkColor c2; - - c2.red = col->red; - c2.green = col->green; - c2.blue = col->blue; + hildon_color_button_get_color(HILDON_COLOR_BUTTON(mainview->colorbutton), &c2); mainview->sk->pressuresensitivity=gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(mainview->tools_pressure)); @@ -2488,11 +2483,8 @@ void callback_color(HildonColorButton * colorButton, MainView * mainview) nodeData *nd = getSelectedNode(mainview); if (nd == NULL) return; - GdkColor *col = hildon_color_button_get_color(colorButton); GdkColor c2; - c2.red = col->red; - c2.green = col->green; - c2.blue = col->blue; + hildon_color_button_get_color(colorButton, &c2); if (nd->typ == NODE_SKETCH) { @@ -2529,9 +2521,13 @@ void callback_color_invoke(GtkAction * action, gpointer data) MainView *mainview = (MainView *) data; g_assert(mainview != NULL && mainview->data != NULL); - HildonColorButton *hc = HILDON_COLOR_BUTTON(mainview->colorbutton); +/* FIXME: this doesn't work? */ + hildon_color_button_get_popup_shown(HILDON_COLOR_BUTTON(mainview->colorbutton)); +/* + HildonColorButton *hc = HILDON_COLOR_BUTTON(mainview->colorbutton); gtk_button_clicked(GTK_BUTTON(&hc->button)); +*/ } @@ -3569,9 +3565,10 @@ void write_buffer_to_file(MainView * mainview) snprintf(tq, sizeof(tq), "INSERT INTO %s VALUES('brushSize', '%d');", misctable_name, bsize); sqlite3_exec(mainview->db, tq, NULL, NULL, NULL); - GdkColor *col = hildon_color_button_get_color(HILDON_COLOR_BUTTON(mainview->colorbutton)); - unsigned long bcol=((col->red >> 8) << 16) | ((col->green >> 8) << 8) | (col->blue >> 8); -/* fprintf(stderr, "BRUSHCOLOR is %d (%d,%d,%d)\n", bcol, col->red, col->green, col->blue);*/ + GdkColor col; + hildon_color_button_get_color(HILDON_COLOR_BUTTON(mainview->colorbutton), &col); + unsigned long bcol=((col.red >> 8) << 16) | ((col.green >> 8) << 8) | (col.blue >> 8); +/* fprintf(stderr, "BRUSHCOLOR is %d (%d,%d,%d)\n", bcol, col.red, col.green, col.blue);*/ snprintf(tq, sizeof(tq), "INSERT INTO %s VALUES('brushColor', '%lu');", misctable_name, bcol); sqlite3_exec(mainview->db, tq, NULL, NULL, NULL); diff --git a/src/ui/interface.c b/src/ui/interface.c index 9431bf2..3904a01 100644 --- a/src/ui/interface.c +++ b/src/ui/interface.c @@ -30,11 +30,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* * Privates: diff --git a/src/ui/interface.h b/src/ui/interface.h index 499c356..8709880 100644 --- a/src/ui/interface.h +++ b/src/ui/interface.h @@ -23,13 +23,13 @@ #define INTERFACE_H #include -#include +#include #include #include #include -#include -#include -#include +#include +#include +#include #include "config.h" diff --git a/src/ui/sketchwidget.c b/src/ui/sketchwidget.c index e0012dd..7baf07e 100755 --- a/src/ui/sketchwidget.c +++ b/src/ui/sketchwidget.c @@ -20,7 +20,7 @@ */ #include -#include +#include /* * SketchWidget's "Privates" @@ -1375,18 +1375,22 @@ if (hildon_button_event_is_finger(event)) gdouble pressure; if (!gdk_event_get_axis ((GdkEvent *)event, GDK_AXIS_PRESSURE, &pressure)) pressure=1; +/* +incompatible with chinook if ((pressure!=1 && pressure>HILDON_FINGER_PRESSURE_THRESHOLD) || event->button==2 || event->button==8 || (event->button==1 && event->state&GDK_MOD4_MASK)) +*/ +if (hildon_helper_event_button_is_finger(event)) { #ifdef NOTIFY_COORDS fprintf(stderr, "GOT FINGERPRESS (%d,%d)\n", (int)event->x, (int)event->y); #endif if (sk->callback_finger != NULL) (sk->callback_finger) (sk, (int)event->x, (int)event->y, pressure, sk->callback_finger_data); + return TRUE; } if (event->button == 1 && sk->pixmap != NULL) { - if (event->x<0 || event->y<0 || event->x>=sk->sizex || event->y>=sk->sizey) return TRUE; #ifdef NOTIFY_COORDS @@ -1395,6 +1399,7 @@ if (event->button == 1 && sk->pixmap != NULL) if (sk->shape == SKETCHSHAPE_FREEHAND) { + sketchundo_new(sk); sketch_draw_brush(widget, event->x, event->y, pressure, sk); -- 2.11.4.GIT