diff options
Diffstat (limited to 'src/analysis/binary.c')
| -rw-r--r-- | src/analysis/binary.c | 67 | 
1 files changed, 24 insertions, 43 deletions
diff --git a/src/analysis/binary.c b/src/analysis/binary.c index 2b23eff..ddd2e30 100644 --- a/src/analysis/binary.c +++ b/src/analysis/binary.c @@ -63,7 +63,7 @@  /* Description de fichier binaire (instance) */  struct _GLoadedBinary  { -    GObject parent;                         /* A laisser en premier        */ +    GLoadedContent parent;                  /* A laisser en premier        */      bool use_remote;                        /* Enregistrements distants ?  */      char *remote_host;                      /* Nom du serveur distant      */ @@ -91,7 +91,7 @@ struct _GLoadedBinary  /* Description de fichier binaire (classe) */  struct _GLoadedBinaryClass  { -    GObjectClass parent;                    /* A laisser en premier        */ +    GLoadedContentClass parent;             /* A laisser en premier        */  }; @@ -102,9 +102,6 @@ static void g_loaded_binary_class_init(GLoadedBinaryClass *);  /* Initialise une description de fichier binaire. */  static void g_loaded_binary_init(GLoadedBinary *); -/* Procède à l'initialisation de l'interface de contenu chargé. */ -static void g_loaded_binary_interface_init(GLoadedContentInterface *); -  /* Supprime toutes les références externes. */  static void g_loaded_binary_dispose(GLoadedBinary *); @@ -197,9 +194,7 @@ static GDisplayOptions *g_loaded_binary_get_display_options(const GLoadedBinary  /* Indique le type défini pour une description de fichier binaire. */ -G_DEFINE_TYPE_WITH_CODE(GLoadedBinary, g_loaded_binary, G_TYPE_OBJECT, -                        G_IMPLEMENT_INTERFACE(G_TYPE_LOADED_CONTENT, g_loaded_binary_interface_init) -                        G_IMPLEMENT_INTERFACE(G_TYPE_NAMED_WIDGET, g_loaded_content_named_interface_init)); +G_DEFINE_TYPE(GLoadedBinary, g_loaded_binary, G_TYPE_LOADED_CONTENT);  /****************************************************************************** @@ -217,12 +212,33 @@ G_DEFINE_TYPE_WITH_CODE(GLoadedBinary, g_loaded_binary, G_TYPE_OBJECT,  static void g_loaded_binary_class_init(GLoadedBinaryClass *klass)  {      GObjectClass *object;                   /* Autre version de la classe  */ +    GLoadedContentClass *loaded;            /* Forme parente de la classe  */      object = G_OBJECT_CLASS(klass);      object->dispose = (GObjectFinalizeFunc/* ! */)g_loaded_binary_dispose;      object->finalize = (GObjectFinalizeFunc)g_loaded_binary_finalize; +    loaded = G_LOADED_CONTENT_CLASS(klass); + +    loaded->restore = (restore_content_fc)g_loaded_binary_restore; +    loaded->save = (save_content_fc)g_loaded_binary_save; + +    loaded->get_content = (get_content_fc)g_loaded_binary_get_content; +    loaded->get_format_name = (get_format_name_fc)g_loaded_binary_get_format_name; + +    loaded->analyze = (analyze_loaded_fc)g_loaded_binary_analyze; + +    loaded->describe = (describe_loaded_fc)g_loaded_binary_describe; + +    loaded->count_views = (count_loaded_views_fc)g_loaded_binary_count_views; +    loaded->get_view_name = (get_loaded_view_name_fc)g_loaded_binary_get_view_name; +    loaded->build_def_view = (build_loaded_def_view_fc)g_loaded_binary_build_default_view; +    loaded->build_view = (build_loaded_view_fc)g_loaded_binary_build_view; +    loaded->get_view_index = (get_loaded_view_index_fc)g_loaded_binary_get_view_index; + +    loaded->get_options = (get_loaded_options_fc)g_loaded_binary_get_display_options; +  } @@ -270,41 +286,6 @@ static void g_loaded_binary_init(GLoadedBinary *binary)  /******************************************************************************  *                                                                             * -*  Paramètres  : iface = interface GLib à initialiser.                        * -*                                                                             * -*  Description : Procède à l'initialisation de l'interface de contenu chargé. * -*                                                                             * -*  Retour      : -                                                            * -*                                                                             * -*  Remarques   : -                                                            * -*                                                                             * -******************************************************************************/ - -static void g_loaded_binary_interface_init(GLoadedContentInterface *iface) -{ -    iface->restore = (restore_content_fc)g_loaded_binary_restore; -    iface->save = (save_content_fc)g_loaded_binary_save; - -    iface->get_content = (get_content_fc)g_loaded_binary_get_content; -    iface->get_format_name = (get_format_name_fc)g_loaded_binary_get_format_name; - -    iface->analyze = (analyze_loaded_fc)g_loaded_binary_analyze; - -    iface->describe = (describe_loaded_fc)g_loaded_binary_describe; - -    iface->count_views = (count_loaded_views_fc)g_loaded_binary_count_views; -    iface->get_view_name = (get_loaded_view_name_fc)g_loaded_binary_get_view_name; -    iface->build_def_view = (build_loaded_def_view_fc)g_loaded_binary_build_default_view; -    iface->build_view = (build_loaded_view_fc)g_loaded_binary_build_view; -    iface->get_view_index = (get_loaded_view_index_fc)g_loaded_binary_get_view_index; - -    iface->get_options = (get_loaded_options_fc)g_loaded_binary_get_display_options; - -} - - -/****************************************************************************** -*                                                                             *  *  Paramètres  : binary = instance d'objet GLib à traiter.                    *  *                                                                             *  *  Description : Supprime toutes les références externes.                     *  | 
