Commit 73e3f6f1 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

plug-ins/dbbrowser/Makefile.am removed again...

2005-05-19  Michael Natterer  <mitch@gimp.org>

	* plug-ins/dbbrowser/Makefile.am
	* plug-ins/dbbrowser/gimpbrowser.[ch]: removed again...

	* libgimpwidgets/Makefile.am
	* libgimpwidgets/gimpwidgetstypes.h
	* libgimpwidgets/gimpwidgets.h
	* libgimpwidgets/gimpwidgetsmarshal.list
	* libgimpwidgets/gimpwidgets.def
	* libgimpwidgets/gimpbrowser.[ch]: ...and added here.

	* plug-ins/dbbrowser/gimpprocbrowser.c
	* plug-ins/dbbrowser/plugin-browser.c: changed accordingly.

	* plug-ins/dbbrowser/gimpprocbrowser.c: fixed searching by help.
parent 9aa2efcb
2005-05-19 Michael Natterer <mitch@gimp.org>
* plug-ins/dbbrowser/Makefile.am
* plug-ins/dbbrowser/gimpbrowser.[ch]: removed again...
* libgimpwidgets/Makefile.am
* libgimpwidgets/gimpwidgetstypes.h
* libgimpwidgets/gimpwidgets.h
* libgimpwidgets/gimpwidgetsmarshal.list
* libgimpwidgets/gimpwidgets.def
* libgimpwidgets/gimpbrowser.[ch]: ...and added here.
* plug-ins/dbbrowser/gimpprocbrowser.c
* plug-ins/dbbrowser/plugin-browser.c: changed accordingly.
* plug-ins/dbbrowser/gimpprocbrowser.c: fixed searching by help.
2005-05-19 Sven Neumann <sven@gimp.org>
* app/widgets/gimpdasheditor.c: use code from gimpdashpattern.c
......
......@@ -32,7 +32,6 @@
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
#include "gimpbrowser.h"
#include "gimpprocbrowser.h"
#include "gimpprocview.h"
......@@ -102,6 +101,7 @@ static void browser_row_activated (GtkTreeView *treeview,
static void browser_show_procedure (GimpDBBrowser *browser,
gchar *proc_name);
static void browser_search (GimpBrowser *browser,
const gchar *query_text,
gint search_type,
GimpDBBrowser *db_browser);
static void browser_response (GtkWidget *widget,
......@@ -231,7 +231,8 @@ gimp_proc_browser_dialog_new (gboolean scheme_names,
browser->return_vals = NULL;
/* first search (all procedures) */
browser_search (GIMP_BROWSER (browser->browser), SEARCH_TYPE_ALL, browser);
browser_search (GIMP_BROWSER (browser->browser), "", SEARCH_TYPE_ALL,
browser);
return browser->dialog;
}
......@@ -314,16 +315,14 @@ browser_show_procedure (GimpDBBrowser *browser,
static void
browser_search (GimpBrowser *gimp_browser,
const gchar *query_text,
gint search_type,
GimpDBBrowser *browser)
{
const gchar *query_text;
gchar **proc_list;
gint num_procs;
gchar *str;
query_text = gtk_entry_get_text (GTK_ENTRY (gimp_browser->search_entry));
if (search_type == SEARCH_TYPE_NAME)
{
GString *query;
......@@ -356,6 +355,14 @@ browser_search (GimpBrowser *gimp_browser,
gimp_procedural_db_query (".*", query_text, ".*", ".*", ".*", ".*", ".*",
&num_procs, &proc_list);
}
else if (search_type == SEARCH_TYPE_HELP)
{
gimp_browser_show_message (GIMP_BROWSER (browser->browser),
_("Searching by help - please wait"));
gimp_procedural_db_query (".*", ".*", query_text, ".*", ".*", ".*", ".*",
&num_procs, &proc_list);
}
else if (search_type == SEARCH_TYPE_AUTHOR)
{
gimp_browser_show_message (GIMP_BROWSER (browser->browser),
......
......@@ -63,6 +63,8 @@ libgimpwidgets_2_0_la_sources = \
gimpwidgets.c \
gimpwidgets.h \
gimpwidgetstypes.h \
gimpbrowser.c \
gimpbrowser.h \
gimpbutton.c \
gimpbutton.h \
gimpcellrenderercolor.c \
......@@ -162,6 +164,7 @@ libgimpwidgets_2_0_la_SOURCES = \
libgimpwidgetsinclude_HEADERS = \
gimpwidgets.h \
gimpwidgetstypes.h \
gimpbrowser.h \
gimpbutton.h \
gimpcellrenderercolor.h \
gimpcellrenderertoggle.h\
......
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* gimpbrowser.c
* Copyright (C) 2005 Michael Natterer <mitch@gimp.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* This library 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.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
......@@ -25,17 +26,13 @@
#include <gtk/gtk.h>
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
#include "gimpwidgetstypes.h"
#include "gimpbrowser.h"
#include "gimpintcombobox.h"
#include "gimpwidgetsmarshal.h"
#include "libgimp/stdplugins-intl.h"
#define DBL_LIST_WIDTH 250
#define DBL_WIDTH (DBL_LIST_WIDTH + 400)
#define DBL_HEIGHT 250
#include "libgimp/libgimp-intl.h"
enum
......@@ -101,8 +98,9 @@ gimp_browser_class_init (GimpBrowserClass *klass)
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GimpBrowserClass, search),
NULL, NULL,
g_cclosure_marshal_VOID__INT,
G_TYPE_NONE, 1,
_gimp_widgets_marshal_VOID__STRING_INT,
G_TYPE_NONE, 2,
G_TYPE_STRING,
G_TYPE_INT);
gtk_object_class->destroy = gimp_browser_destroy;
......@@ -306,13 +304,21 @@ static gboolean
gimp_browser_search_timeout (gpointer data)
{
GimpBrowser *browser = GIMP_BROWSER (data);
const gchar *search_string;
GDK_THREADS_ENTER();
search_string = gtk_entry_get_text (GTK_ENTRY (browser->search_entry));
if (! search_string)
search_string = "";
g_signal_emit (browser, browser_signals[SEARCH], 0,
browser->search_type);
GDK_THREADS_LEAVE();
search_string, browser->search_type);
browser->search_timeout_id = 0;
GDK_THREADS_LEAVE();
return FALSE;
}
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* gimpbrowser.h
* Copyright (C) 2005 Michael Natterer <mitch@gimp.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* This library 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.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_BROWSER_H__
#define __GIMP_BROWSER_H__
#include <gtk/gtkhpaned.h>
G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
#define GIMP_TYPE_BROWSER (gimp_browser_get_type ())
#define GIMP_BROWSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_BROWSER, GimpBrowser))
......@@ -34,7 +38,6 @@
#define GIMP_BROWSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_BROWSER, GimpBrowserClass))
typedef struct _GimpBrowser GimpBrowser;
typedef struct _GimpBrowserClass GimpBrowserClass;
struct _GimpBrowser
......@@ -59,6 +62,7 @@ struct _GimpBrowserClass
GtkHPanedClass parent_class;
void (* search) (GimpBrowser *browser,
const gchar *search_string,
gint search_type);
};
......@@ -78,4 +82,6 @@ void gimp_browser_show_message (GimpBrowser *browser,
const gchar *message);
G_END_DECLS
#endif /* __GIMP_BROWSER_H__ */
EXPORTS
gimp_browser_add_search_types
gimp_browser_get_type
gimp_browser_new
gimp_browser_set_widget
gimp_browser_show_message
gimp_button_extended_clicked
gimp_button_get_type
gimp_button_new
......
......@@ -26,6 +26,7 @@
#include <libgimpwidgets/gimpwidgetstypes.h>
#include <libgimpwidgets/gimpbrowser.h>
#include <libgimpwidgets/gimpbutton.h>
#include <libgimpwidgets/gimpcellrenderercolor.h>
#include <libgimpwidgets/gimpcellrenderertoggle.h>
......
......@@ -28,5 +28,6 @@ VOID: OBJECT
VOID: OBJECT, INT
VOID: POINTER, POINTER
VOID: STRING, FLAGS
VOID: STRING, INT
BOOLEAN: POINTER
......@@ -55,6 +55,7 @@ typedef enum
} GimpSizeEntryUpdatePolicy;
typedef struct _GimpBrowser GimpBrowser;
typedef struct _GimpButton GimpButton;
typedef struct _GimpCellRendererColor GimpCellRendererColor;
typedef struct _GimpCellRendererToggle GimpCellRendererToggle;
......
......@@ -31,7 +31,6 @@
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
#include "gimpbrowser.h"
#include "gimpprocview.h"
#include "libgimp/stdplugins-intl.h"
......@@ -374,10 +373,10 @@ insert_into_tree_view (PluginBrowser *browser,
static void
browser_search (GimpBrowser *gimp_browser,
const gchar *search_text,
gint search_type,
PluginBrowser *browser)
{
const gchar *search_text;
GimpParam *return_vals;
gint nreturn_vals;
gint num_plugins;
......@@ -385,11 +384,6 @@ browser_search (GimpBrowser *gimp_browser,
GtkListStore *list_store;
GtkTreeStore *tree_store;
search_text = gtk_entry_get_text (GTK_ENTRY (gimp_browser->search_entry));
if (! search_text)
search_text = "";
gimp_browser_show_message (GIMP_BROWSER (browser->browser),
_("Searching by name - please wait"));
......@@ -708,7 +702,7 @@ browser_dialog_new (void)
DBL_WIDTH - DBL_LIST_WIDTH, -1);
/* now build the list */
browser_search (GIMP_BROWSER (browser->browser), 0, browser);
browser_search (GIMP_BROWSER (browser->browser), "", 0, browser);
gtk_widget_show (browser->dialog);
......
......@@ -20,8 +20,6 @@ noinst_LTLIBRARIES = libgimpprocbrowser.la
libexec_PROGRAMS = plugin-browser procedure-browser
libgimpprocbrowser_la_SOURCES = \
gimpbrowser.c \
gimpbrowser.h \
gimpprocbrowser.c \
gimpprocbrowser.h \
gimpprocview.c \
......
......@@ -32,7 +32,6 @@
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
#include "gimpbrowser.h"
#include "gimpprocbrowser.h"
#include "gimpprocview.h"
......@@ -102,6 +101,7 @@ static void browser_row_activated (GtkTreeView *treeview,
static void browser_show_procedure (GimpDBBrowser *browser,
gchar *proc_name);
static void browser_search (GimpBrowser *browser,
const gchar *query_text,
gint search_type,
GimpDBBrowser *db_browser);
static void browser_response (GtkWidget *widget,
......@@ -231,7 +231,8 @@ gimp_proc_browser_dialog_new (gboolean scheme_names,
browser->return_vals = NULL;
/* first search (all procedures) */
browser_search (GIMP_BROWSER (browser->browser), SEARCH_TYPE_ALL, browser);
browser_search (GIMP_BROWSER (browser->browser), "", SEARCH_TYPE_ALL,
browser);
return browser->dialog;
}
......@@ -314,16 +315,14 @@ browser_show_procedure (GimpDBBrowser *browser,
static void
browser_search (GimpBrowser *gimp_browser,
const gchar *query_text,
gint search_type,
GimpDBBrowser *browser)
{
const gchar *query_text;
gchar **proc_list;
gint num_procs;
gchar *str;
query_text = gtk_entry_get_text (GTK_ENTRY (gimp_browser->search_entry));
if (search_type == SEARCH_TYPE_NAME)
{
GString *query;
......@@ -356,6 +355,14 @@ browser_search (GimpBrowser *gimp_browser,
gimp_procedural_db_query (".*", query_text, ".*", ".*", ".*", ".*", ".*",
&num_procs, &proc_list);
}
else if (search_type == SEARCH_TYPE_HELP)
{
gimp_browser_show_message (GIMP_BROWSER (browser->browser),
_("Searching by help - please wait"));
gimp_procedural_db_query (".*", ".*", query_text, ".*", ".*", ".*", ".*",
&num_procs, &proc_list);
}
else if (search_type == SEARCH_TYPE_AUTHOR)
{
gimp_browser_show_message (GIMP_BROWSER (browser->browser),
......
......@@ -31,7 +31,6 @@
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
#include "gimpbrowser.h"
#include "gimpprocview.h"
#include "libgimp/stdplugins-intl.h"
......@@ -374,10 +373,10 @@ insert_into_tree_view (PluginBrowser *browser,
static void
browser_search (GimpBrowser *gimp_browser,
const gchar *search_text,
gint search_type,
PluginBrowser *browser)
{
const gchar *search_text;
GimpParam *return_vals;
gint nreturn_vals;
gint num_plugins;
......@@ -385,11 +384,6 @@ browser_search (GimpBrowser *gimp_browser,
GtkListStore *list_store;
GtkTreeStore *tree_store;
search_text = gtk_entry_get_text (GTK_ENTRY (gimp_browser->search_entry));
if (! search_text)
search_text = "";
gimp_browser_show_message (GIMP_BROWSER (browser->browser),
_("Searching by name - please wait"));
......@@ -708,7 +702,7 @@ browser_dialog_new (void)
DBL_WIDTH - DBL_LIST_WIDTH, -1);
/* now build the list */
browser_search (GIMP_BROWSER (browser->browser), 0, browser);
browser_search (GIMP_BROWSER (browser->browser), "", 0, browser);
gtk_widget_show (browser->dialog);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment