From d71e49df9261a6968e7ffab33c6306914ac1d1c0 Mon Sep 17 00:00:00 2001 From: martin-s Date: Wed, 4 Jul 2007 22:44:46 +0000 Subject: Merge with modular_map git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit/src@255 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- gui.c | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 gui.c (limited to 'gui.c') diff --git a/gui.c b/gui.c new file mode 100644 index 00000000..f47856ee --- /dev/null +++ b/gui.c @@ -0,0 +1,106 @@ +#include +#include "gui.h" +#include "statusbar.h" +#include "menu.h" +#include "plugin.h" + +struct gui * +gui_new(struct navit *nav, const char *type, int w, int h) +{ + struct gui *this_; + struct gui_priv *(*guitype_new)(struct navit *nav, struct gui_methods *meth, int w, int h); + + guitype_new=plugin_get_gui_type(type); + if (! guitype_new) + return NULL; + + this_=g_new0(struct gui, 1); + this_->priv=guitype_new(nav, &this_->meth, w, h); + return this_; +} + +struct statusbar * +gui_statusbar_new(struct gui *gui) +{ + struct statusbar *this_; + if (! gui->meth.statusbar_new) + return NULL; + this_=g_new0(struct statusbar, 1); + this_->priv=gui->meth.statusbar_new(gui->priv, &this_->meth); + if (! this_->priv) { + g_free(this_); + return NULL; + } + return this_; +} + +struct menu * +gui_menubar_new(struct gui *gui) +{ + struct menu *this_; + if (! gui->meth.menubar_new) + return NULL; + this_=g_new0(struct menu, 1); + this_->priv=gui->meth.menubar_new(gui->priv, &this_->meth); + if (! this_->priv) { + g_free(this_); + return NULL; + } + return this_; +} + + +struct menu * +gui_toolbar_new(struct gui *gui) +{ + struct menu *this_; + if (! gui->meth.toolbar_new) + return NULL; + this_=g_new0(struct menu, 1); + this_->priv=gui->meth.toolbar_new(gui->priv, &this_->meth); + if (! this_->priv) { + g_free(this_); + return NULL; + } + return this_; +} + +struct menu * +gui_popup_new(struct gui *gui) +{ + struct menu *this_; + if (! gui->meth.popup_new) + return NULL; + this_=g_new0(struct menu, 1); + this_->priv=gui->meth.popup_new(gui->priv, &this_->meth); + if (! this_->priv) { + g_free(this_); + return NULL; + } + return this_; +} + +int +gui_set_graphics(struct gui *this_, struct graphics *gra) +{ + if (! this_->meth.set_graphics) + return 1; + return this_->meth.set_graphics(this_->priv, gra); +} + +int +gui_has_main_loop(struct gui *this_) +{ + if (! this_->meth.run_main_loop) + return 0; + return 1; +} + +int +gui_run_main_loop(struct gui *this_) +{ + if (! gui_has_main_loop(this_)) + return 1; + return this_->meth.run_main_loop(this_->priv); +} + -- cgit v1.2.1 From 0028098b100ec0253bf083c2dd545b1bba8e83eb Mon Sep 17 00:00:00 2001 From: martin-s Date: Thu, 12 Jul 2007 14:25:24 +0000 Subject: Loads of bugfixes and minor improvements git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit/src@316 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- gui.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'gui.c') diff --git a/gui.c b/gui.c index f47856ee..87e3cf82 100644 --- a/gui.c +++ b/gui.c @@ -2,6 +2,7 @@ #include "gui.h" #include "statusbar.h" #include "menu.h" +#include "data_window.h" #include "plugin.h" struct gui * @@ -80,6 +81,21 @@ gui_popup_new(struct gui *gui) return this_; } +struct datawindow * +gui_datawindow_new(struct gui *gui, char *name, struct callback *click, struct callback *close) +{ + struct datawindow *this_; + if (! gui->meth.datawindow_new) + return NULL; + this_=g_new0(struct datawindow, 1); + this_->priv=gui->meth.datawindow_new(gui->priv, name, click, close, &this_->meth); + if (! this_->priv) { + g_free(this_); + return NULL; + } + return this_; +} + int gui_set_graphics(struct gui *this_, struct graphics *gra) { -- cgit v1.2.1 From 5f604527929ed18dc85a39c0889ebb68a02c9ad0 Mon Sep 17 00:00:00 2001 From: martin-s Date: Fri, 13 Jul 2007 11:48:12 +0000 Subject: Improved bookmark support git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit/src@333 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- gui.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'gui.c') diff --git a/gui.c b/gui.c index 87e3cf82..63a68d65 100644 --- a/gui.c +++ b/gui.c @@ -1,4 +1,5 @@ #include +#include "debug.h" #include "gui.h" #include "statusbar.h" #include "menu.h" @@ -96,6 +97,19 @@ gui_datawindow_new(struct gui *gui, char *name, struct callback *click, struct c return this_; } +int +gui_add_bookmark(struct gui *gui, struct coord *c, char *description) +{ + int ret; + dbg(2,"enter\n"); + if (! gui->meth.add_bookmark) + return 0; + ret=gui->meth.add_bookmark(gui->priv, c, description); + + dbg(2,"ret=%d\n", ret); + return ret; +} + int gui_set_graphics(struct gui *this_, struct graphics *gra) { -- cgit v1.2.1 From 92fdb3c02c4568962db0ce0f68f2a612ec1e000b Mon Sep 17 00:00:00 2001 From: martin-s Date: Tue, 28 Aug 2007 17:31:21 +0000 Subject: Changed api for gui and graphics git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit/src@393 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- gui.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gui.c') diff --git a/gui.c b/gui.c index 63a68d65..bddc9162 100644 --- a/gui.c +++ b/gui.c @@ -7,17 +7,17 @@ #include "plugin.h" struct gui * -gui_new(struct navit *nav, const char *type, int w, int h) +gui_new(struct navit *nav, const char *type, struct attr **attrs) { struct gui *this_; - struct gui_priv *(*guitype_new)(struct navit *nav, struct gui_methods *meth, int w, int h); + struct gui_priv *(*guitype_new)(struct navit *nav, struct gui_methods *meth, struct attr **attrs); guitype_new=plugin_get_gui_type(type); if (! guitype_new) return NULL; this_=g_new0(struct gui, 1); - this_->priv=guitype_new(nav, &this_->meth, w, h); + this_->priv=guitype_new(nav, &this_->meth, attrs); return this_; } -- cgit v1.2.1 From f63255ecd34afe5d329a4465d37d4c1a5540bddd Mon Sep 17 00:00:00 2001 From: zaxl Date: Sun, 25 Nov 2007 01:32:15 +0000 Subject: Fix bookmarks with projections, add /usr/X11R6/lib/X11/fonts/TTF to font path and check for luximbi.ttf, remove useless coord iterations from track and some shame from the code there git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit/src@587 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- gui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gui.c') diff --git a/gui.c b/gui.c index bddc9162..afc1e244 100644 --- a/gui.c +++ b/gui.c @@ -98,7 +98,7 @@ gui_datawindow_new(struct gui *gui, char *name, struct callback *click, struct c } int -gui_add_bookmark(struct gui *gui, struct coord *c, char *description) +gui_add_bookmark(struct gui *gui, struct pcoord *c, char *description) { int ret; dbg(2,"enter\n"); -- cgit v1.2.1 From dd1623192d70df1f408017817acf27ae3c0a97e1 Mon Sep 17 00:00:00 2001 From: horwitz Date: Mon, 17 Mar 2008 23:46:41 +0000 Subject: Core:Fix:Cleanup and reorganisation of gui_gtk centric code. git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit/src@946 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- gui.c | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'gui.c') diff --git a/gui.c b/gui.c index afc1e244..5c4c80c8 100644 --- a/gui.c +++ b/gui.c @@ -1,7 +1,6 @@ #include #include "debug.h" #include "gui.h" -#include "statusbar.h" #include "menu.h" #include "data_window.h" #include "plugin.h" @@ -21,21 +20,6 @@ gui_new(struct navit *nav, const char *type, struct attr **attrs) return this_; } -struct statusbar * -gui_statusbar_new(struct gui *gui) -{ - struct statusbar *this_; - if (! gui->meth.statusbar_new) - return NULL; - this_=g_new0(struct statusbar, 1); - this_->priv=gui->meth.statusbar_new(gui->priv, &this_->meth); - if (! this_->priv) { - g_free(this_); - return NULL; - } - return this_; -} - struct menu * gui_menubar_new(struct gui *gui) { @@ -51,22 +35,6 @@ gui_menubar_new(struct gui *gui) return this_; } - -struct menu * -gui_toolbar_new(struct gui *gui) -{ - struct menu *this_; - if (! gui->meth.toolbar_new) - return NULL; - this_=g_new0(struct menu, 1); - this_->priv=gui->meth.toolbar_new(gui->priv, &this_->meth); - if (! this_->priv) { - g_free(this_); - return NULL; - } - return this_; -} - struct menu * gui_popup_new(struct gui *gui) { -- cgit v1.2.1 From db24a12bca08d55232a611a58287eeba889786e7 Mon Sep 17 00:00:00 2001 From: horwitz Date: Tue, 18 Mar 2008 08:49:13 +0000 Subject: Core:Cleanup:Remove statusbar.h. It's not needed anymore git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit/src@948 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- gui.c | 1 + 1 file changed, 1 insertion(+) (limited to 'gui.c') diff --git a/gui.c b/gui.c index 5c4c80c8..f63d3307 100644 --- a/gui.c +++ b/gui.c @@ -1,4 +1,5 @@ #include +#include #include "debug.h" #include "gui.h" #include "menu.h" -- cgit v1.2.1 From 58ed3ce563495388e5dd3f00e3c3216cd7002007 Mon Sep 17 00:00:00 2001 From: martin-s Date: Thu, 10 Apr 2008 22:45:40 +0000 Subject: Fix:Core:Cleaned up attribute handling a bit git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit/src@1000 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- gui.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'gui.c') diff --git a/gui.c b/gui.c index f63d3307..45fa5abb 100644 --- a/gui.c +++ b/gui.c @@ -4,8 +4,15 @@ #include "gui.h" #include "menu.h" #include "data_window.h" +#include "item.h" #include "plugin.h" +struct gui { + struct gui_methods meth; + struct gui_priv *priv; + struct attr **attrs; +}; + struct gui * gui_new(struct navit *nav, const char *type, struct attr **attrs) { @@ -18,9 +25,16 @@ gui_new(struct navit *nav, const char *type, struct attr **attrs) this_=g_new0(struct gui, 1); this_->priv=guitype_new(nav, &this_->meth, attrs); + this_->attrs=attr_list_dup(attrs); return this_; } +int +gui_get_attr(struct gui *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter) +{ + return attr_generic_get_attr(this_->attrs, type, attr, iter); +} + struct menu * gui_menubar_new(struct gui *gui) { -- cgit v1.2.1 From 9f93d75a7079813817e3c9d4ebf581669b23fcb4 Mon Sep 17 00:00:00 2001 From: martin-s Date: Thu, 24 Apr 2008 08:35:41 +0000 Subject: Fix:Core:More cleanups git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit/src@1026 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- gui.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'gui.c') diff --git a/gui.c b/gui.c index 45fa5abb..cc854e2b 100644 --- a/gui.c +++ b/gui.c @@ -14,17 +14,21 @@ struct gui { }; struct gui * -gui_new(struct navit *nav, const char *type, struct attr **attrs) +gui_new(struct attr *parent, struct attr **attrs) { struct gui *this_; + struct attr *type_attr; struct gui_priv *(*guitype_new)(struct navit *nav, struct gui_methods *meth, struct attr **attrs); + if (! (type_attr=attr_search(attrs, NULL, attr_type))) { + return NULL; + } - guitype_new=plugin_get_gui_type(type); + guitype_new=plugin_get_gui_type(type_attr->u.str); if (! guitype_new) return NULL; this_=g_new0(struct gui, 1); - this_->priv=guitype_new(nav, &this_->meth, attrs); + this_->priv=guitype_new(parent->u.navit, &this_->meth, attrs); this_->attrs=attr_list_dup(attrs); return this_; } -- cgit v1.2.1 From cf57c17b71bf495f4048479c56f5db8fb6a47142 Mon Sep 17 00:00:00 2001 From: horwitz Date: Thu, 5 Jun 2008 21:56:14 +0000 Subject: Add license files and headers git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit/navit@1100 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- gui.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'gui.c') diff --git a/gui.c b/gui.c index cc854e2b..072e0261 100644 --- a/gui.c +++ b/gui.c @@ -1,3 +1,22 @@ +/** + * Navit, a modular navigation system. + * Copyright (C) 2005-2008 Navit Team + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + #include #include #include "debug.h" -- cgit v1.2.1 From 07bbee1a329c53be019e636fd5f6a87c3864d2e8 Mon Sep 17 00:00:00 2001 From: martin-s Date: Sun, 21 Sep 2008 18:38:29 +0000 Subject: Fix:Core:Cleaned up map api a bit git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit/navit@1391 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- gui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gui.c') diff --git a/gui.c b/gui.c index 072e0261..662fa388 100644 --- a/gui.c +++ b/gui.c @@ -55,7 +55,7 @@ gui_new(struct attr *parent, struct attr **attrs) int gui_get_attr(struct gui *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter) { - return attr_generic_get_attr(this_->attrs, type, attr, iter); + return attr_generic_get_attr(this_->attrs, NULL, type, attr, iter); } struct menu * -- cgit v1.2.1 From 1aa0a370b61d2171ed7bf70f97fec5e8b0c80550 Mon Sep 17 00:00:00 2001 From: martin-s Date: Sun, 1 Feb 2009 16:07:50 +0000 Subject: Add:Core:Added c style command evaluation for more flexible osds git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit/navit@1987 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- gui.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gui.c') diff --git a/gui.c b/gui.c index 662fa388..28b2132c 100644 --- a/gui.c +++ b/gui.c @@ -20,6 +20,7 @@ #include #include #include "debug.h" +#include "callback.h" #include "gui.h" #include "menu.h" #include "data_window.h" @@ -38,6 +39,7 @@ gui_new(struct attr *parent, struct attr **attrs) struct gui *this_; struct attr *type_attr; struct gui_priv *(*guitype_new)(struct navit *nav, struct gui_methods *meth, struct attr **attrs); + struct attr cbl; if (! (type_attr=attr_search(attrs, NULL, attr_type))) { return NULL; } @@ -47,8 +49,11 @@ gui_new(struct attr *parent, struct attr **attrs) return NULL; this_=g_new0(struct gui, 1); - this_->priv=guitype_new(parent->u.navit, &this_->meth, attrs); this_->attrs=attr_list_dup(attrs); + cbl.type=attr_callback_list; + cbl.u.callback_list=callback_list_new(); + this_->attrs=attr_generic_add_attr(this_->attrs, &cbl); + this_->priv=guitype_new(parent->u.navit, &this_->meth, this_->attrs); return this_; } -- cgit v1.2.1 From 7b7fc6c7a6c835e1c390d70955f835e60f73cbe3 Mon Sep 17 00:00:00 2001 From: martin-s Date: Fri, 6 Feb 2009 14:20:00 +0000 Subject: Add:Core:Initial support for preventing going to suspend git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit/navit@2021 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- gui.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gui.c') diff --git a/gui.c b/gui.c index 28b2132c..3f4b9316 100644 --- a/gui.c +++ b/gui.c @@ -129,6 +129,13 @@ gui_set_graphics(struct gui *this_, struct graphics *gra) return this_->meth.set_graphics(this_->priv, gra); } +void +gui_disable_suspend(struct gui *this_) +{ + if (this_->meth.disable_suspend) + this_->meth.disable_suspend(this_->priv); +} + int gui_has_main_loop(struct gui *this_) { -- cgit v1.2.1