Some style fixes
This commit is contained in:
parent
1cc46c315d
commit
dbd6fcaf3e
@ -4,6 +4,12 @@
|
||||
#include "sugar-marshal.h"
|
||||
#include "sugar-browser-chandler.h"
|
||||
|
||||
enum {
|
||||
HANDLE_CONTENT,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
static guint signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
G_DEFINE_TYPE(SugarBrowserChandler, sugar_browser_chandler, G_TYPE_OBJECT)
|
||||
|
||||
SugarBrowserChandler *browserChandler = NULL;
|
||||
@ -16,27 +22,27 @@ sugar_browser_chandler_init(SugarBrowserChandler *browserChandler)
|
||||
static void
|
||||
sugar_browser_chandler_class_init(SugarBrowserChandlerClass *browser_chandler_class)
|
||||
{
|
||||
browser_chandler_class->handle_content_signal_id =
|
||||
g_signal_new ("handle-content",
|
||||
G_OBJECT_CLASS_TYPE (browser_chandler_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (SugarBrowserChandlerClass, handle_content),
|
||||
NULL, NULL,
|
||||
sugar_marshal_VOID__STRING_STRING_STRING_STRING,
|
||||
G_TYPE_NONE, 4,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_STRING);
|
||||
signals[HANDLE_CONTENT] =
|
||||
g_signal_new ("handle-content",
|
||||
G_OBJECT_CLASS_TYPE (browser_chandler_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (SugarBrowserChandlerClass, handle_content),
|
||||
NULL, NULL,
|
||||
sugar_marshal_VOID__STRING_STRING_STRING_STRING,
|
||||
G_TYPE_NONE, 4,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_STRING);
|
||||
}
|
||||
|
||||
SugarBrowserChandler *
|
||||
sugar_get_browser_chandler()
|
||||
{
|
||||
if(browserChandler == NULL)
|
||||
browserChandler = g_object_new(SUGAR_TYPE_BROWSER_CHANDLER, NULL);
|
||||
if(browserChandler == NULL)
|
||||
browserChandler = g_object_new(SUGAR_TYPE_BROWSER_CHANDLER, NULL);
|
||||
|
||||
return browserChandler;
|
||||
return browserChandler;
|
||||
}
|
||||
|
||||
void
|
||||
@ -47,8 +53,7 @@ sugar_browser_chandler_handle_content (SugarBrowserChandler *browser_chandler,
|
||||
const char *tmp_file_name)
|
||||
{
|
||||
g_signal_emit(browser_chandler,
|
||||
SUGAR_BROWSER_CHANDLER_GET_CLASS(
|
||||
browser_chandler)->handle_content_signal_id,
|
||||
signals[HANDLE_CONTENT],
|
||||
0 /* details */,
|
||||
url,
|
||||
suggested_file_name,
|
||||
|
@ -9,25 +9,12 @@ G_BEGIN_DECLS
|
||||
typedef struct _SugarBrowserChandler SugarBrowserChandler;
|
||||
typedef struct _SugarBrowserChandlerClass SugarBrowserChandlerClass;
|
||||
|
||||
#define SUGAR_TYPE_BROWSER_CHANDLER ( \
|
||||
sugar_browser_chandler_get_type())
|
||||
#define SUGAR_BROWSER_CHANDLER(object) ( \
|
||||
G_TYPE_CHECK_INSTANCE_CAST((object), \
|
||||
SUGAR_TYPE_BROWSER_CHANDLER, SugarBrowserChandler))
|
||||
#define SUGAR_BROWSER_CHANDLER_CLASS(klass) ( \
|
||||
G_TYPE_CHECK_CLASS_CAST((klass), \
|
||||
SUGAR_TYPE_BROWSER_CHANDLER, \
|
||||
SugarBrowserChandlerClass))
|
||||
#define SUGAR_IS_BROWSER_CHANDLER(object) ( \
|
||||
G_TYPE_CHECK_INSTANCE_TYPE((object), \
|
||||
SUGAR_TYPE_BROWSER_CHANDLER))
|
||||
#define SUGAR_IS_BROWSER_CHANDLER_CLASS(klass) ( \
|
||||
G_TYPE_CHECK_CLASS_TYPE((klass), \
|
||||
SUGAR_TYPE_BROWSER_CHANDLER))
|
||||
#define SUGAR_BROWSER_CHANDLER_GET_CLASS(object) ( \
|
||||
G_TYPE_INSTANCE_GET_CLASS((object), \
|
||||
SUGAR_TYPE_BROWSER_CHANDLER, \
|
||||
SugarBrowserChandlerClass))
|
||||
#define SUGAR_TYPE_BROWSER_CHANDLER (sugar_browser_chandler_get_type())
|
||||
#define SUGAR_BROWSER_CHANDLER(object) (G_TYPE_CHECK_INSTANCE_CAST((object), SUGAR_TYPE_BROWSER_CHANDLER, SugarBrowserChandler))
|
||||
#define SUGAR_BROWSER_CHANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), SUGAR_TYPE_BROWSER_CHANDLER, SugarBrowserChandlerClass))
|
||||
#define SUGAR_IS_BROWSER_CHANDLER(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), SUGAR_TYPE_BROWSER_CHANDLER))
|
||||
#define SUGAR_IS_BROWSER_CHANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), SUGAR_TYPE_BROWSER_CHANDLER))
|
||||
#define SUGAR_BROWSER_CHANDLER_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), SUGAR_TYPE_BROWSER_CHANDLER, SugarBrowserChandlerClass))
|
||||
|
||||
struct _SugarBrowserChandler {
|
||||
GObject base_instance;
|
||||
@ -36,20 +23,17 @@ struct _SugarBrowserChandler {
|
||||
struct _SugarBrowserChandlerClass {
|
||||
GObjectClass base_class;
|
||||
|
||||
guint handle_content_signal_id;
|
||||
|
||||
void (* handle_content) (char *url, char *tmp_file_name);
|
||||
|
||||
};
|
||||
|
||||
GType sugar_browser_chandler_get_type (void);
|
||||
SugarBrowserChandler *sugar_get_browser_chandler ();
|
||||
void sugar_browser_chandler_handle_content (
|
||||
SugarBrowserChandler *browser_chandler,
|
||||
const char *url,
|
||||
const char *suggested_file_name,
|
||||
const char *mime_type,
|
||||
const char *tmp_file_name);
|
||||
GType sugar_browser_chandler_get_type (void);
|
||||
SugarBrowserChandler *sugar_get_browser_chandler (void);
|
||||
void sugar_browser_chandler_handle_content (SugarBrowserChandler *chandler,
|
||||
const char *url,
|
||||
const char *suggested_file_name,
|
||||
const char *mime_type,
|
||||
const char *tmp_file_name);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user