1. 24 Dec, 2001 1 commit
    • Jody Goldberg's avatar
      define G_OBJECT_GET_CLASS to simplify porting to 2.0 · 89aa026e
      Jody Goldberg authored
      2001-12-24  Jody Goldberg <jody@gnome.org>
      
      	* src/gnumeric.h : define G_OBJECT_GET_CLASS to simplify porting to 2.0
      
      	For Yukihiro Nakai  <nakai@gnome.gr.jp>
      	* src/stf-parse.c (stf_parse_is_valid_data) : check for multi-byte
      	  before using locale specific isprint.
      89aa026e
  2. 21 Dec, 2001 1 commit
  3. 13 Dec, 2001 1 commit
    • Jody Goldberg's avatar
      back port some gnome2 work. · 9036243f
      Jody Goldberg authored
      2001-12-13  Jody Goldberg <jody@gnome.org>
      
      	s/gnome-xml/libxml/
      
      	* src/workbook.c (workbook_set_filename) : const.
      
      	* src/workbook-control-gui.c (wb_control_gui_focus_cur_sheet) : back
      	  port some gnome2 fixes.
      	(cb_notebook_switch_page) : ditto.
      
      	* src/workbook-edit.c (auto_complete_matches) : Use
      	  gtk_editable_get_position.
      
      	* src/plugin-loader.h (gnumeric_plugin_loader_get_type) : fix return type.
      
      	* src/plugin-loader.c : Use PL_GET_CLASS.
      
      	* src/item-bar.c (item_bar_translate) : delete useless.
      	* src/item-cursor.c (item_cursor_translate) : delete useless.
      	* src/item-edit.c (item_edit_translate) : delete useless.
      	(point_is_inside_range) : Use gtk_editable_get_position.
      
      	* src/gui-file.c (gui_file_import) : const.
      
      	* src/complete-sheet.c (free_search) : unused.
      	(complete_sheet_finalize) : protect.
      	(complete_sheet_destroy) : delete.
      
      	* configure.in : explicitly add gdk_pixbuf just in case gnome-print
      	  doesn't.
      
      	* src/sheet-autofill.c (sheet_autofill) : pass singleton_increment to.
      	(sheet_autofill_dir) : here.
      	(autofill_create_fill_items) : here.
      	(autofill_compute_delta) : and here. Use singleton_increment.  Handle
      	  singleton date fills.
      
      2001-12-13  Jody Goldberg <jody@gnome.org>
      
      	* src/workbook.c (workbook_set_filename) : const.
      
      	* src/gui-file.c (gui_file_import) : const.
      9036243f
  4. 31 Mar, 2001 1 commit
    • Chyla Zbigniew's avatar
      Replaced PLUGIN_MESSAGE macro with plugin_message function to avoid · f9ad8cb6
      Chyla Zbigniew authored
      
      * src/plugin.[ch]: Replaced PLUGIN_MESSAGE macro with plugin_message
      function to avoid portability problems (some compilers don't support
      vararg macros), added "level" argument.
      
      * src/plugin-loader.c (gnumeric_plugin_loader_load,
      gnumeric_plugin_loader_unload): Adjusted to plugin.h.
      f9ad8cb6
  5. 20 Mar, 2001 1 commit
    • Chyla Zbigniew's avatar
      Added support for plugin dependencies + some fixes. · 99ad3568
      Chyla Zbigniew authored
      
      Added support for plugin dependencies + some fixes.
      
      * src/gutils.h (g_list_to_vector, g_vector_free_custom):
      New macros. (used macros instead of functions to avoid casting and
      pointer size problems - ANSI C doesn't guarantee that
      sizeof (void *) == sizeof (something_else *).
      
      * src/plugin-loader.c
      (gnumeric_plugin_loader_load): Load required plugin dependencies
      before the plugin itself, increment n_deps for every loaded
      dependency (by calling plugin_dependencies_inc_dependants).
      (gnumeric_plugin_loader_unload): New function.
      (gnumeric_plugin_loader_load_service): Increment number of loaded
      services if loaded succesfully.
      (gnumeric_plugin_loader_unload_service): Decrement number of loaded
      services if unloaded succesfully, unload plugin if it reaches zero.
      
      * src/plugin-loader.h
      (struct _GnumericPluginLoader): Added n_loaded_services.
      (gnumeric_plugin_loader_unload): New function.
      
      * src/plugin-service.c:
      (plugin_service_file_opener_open_func,
      plugin_service_file_saver_save_func):
      Used gnumeric_io_error_occurred (and gnumeric_io_clear_error) when
      checking for error.
      
      * src/plugin.c:
      (plugins_active_by_default): Array containing ids of "standard"
      plugins. These will be active by default.
      (struct _PluginDependency): New struct.
      (struct _PluginInfo): Added dependencies_v, d_deps. Replaced
      service_list with services_v (vector in place of list).
      (plugin_info_get_config_prefix, plugin_dependency_get_plugin_info,
      plugin_info_read_dependency_list, plugin_dependency_free,
      plugin_inc_dependants, plugin_dec_dependants,
      plugin_dependencies_inc_dependants,
      plugin_dependencies_dec_dependants,
      plugin_load_dependencies):
      New functions.
      (plugin_info_provides_loader_by_type_str, plugin_info_free):
      Adjusted to service_list -> services_v change.
      (plugin_info_read): Read (optional) dependencies, adjusted to
      service_list -> services_v change.
      (activate_plugin):
      Activate required dependencies before the plugin itself.
      Increment n_deps for every activated dependency (by calling
      plugin_dependencies_inc_dependants).
      Adjusted to service_list -> services_v change.
      (deactivate_plugin):
      Decrement n_deps for every activated dependency (by calling
      plugin_dependencies_dec_dependants).
      Adjusted to service_list -> services_v change.
      (plugin_can_deactivate):
      Return FALSE if any of n_deps > 0.
      Adjusted to service_list -> services_v change.
      (plugin_list_sort_by_dependency): Removed.
      (plugin_db_activate_plugin_list): Removed sorting.
      (plugin_db_init): Always activate new plugin if it's defined in
      plugins_active_by_default array.
      
      * src/plugin.h:
      (PluginDependencyType): New enum.
      (plugin_load_dependencies,
      plugin_inc_dependants, plugin_dec_dependants,
      plugin_dependencies_inc_dependants,
      plugin_dependencies_dec_dependants,
      plugin_info_get_config_prefix): New functions.
      99ad3568
  6. 03 Mar, 2001 1 commit
    • Chyla Zbigniew's avatar
      Plugin code cleanup (removed unnecessary function arguments) + small · ed7ceda2
      Chyla Zbigniew authored
      
      Plugin code cleanup (removed unnecessary function arguments) + small
      fixes.
      
      * src/func.[ch]
      (struct _FunctionDefinition):
      Removed get_full_info_callback_data field.
      (function_add_name_only): Removed callback_data argument.
      (function_def_get_full_info_if_needed, FunctionGetFullInfoCallback):
      Now we just pass fn_def instead of name + callback_data.
      (function_call_with_list):
      Added missing function_def_get_full_info_if_needed() call.
      
      * src/plugin-loader.[ch]
      (gnumeric_plugin_loader_load_service,
      gnumeric_plugin_loader_unload_service):
      Return error (instead of crashing) if service is not supported.
      (gnumeric_plugin_loader_is_loaded): New function.
      
      * src/plugin-service.h
      (struct _PluginServiceGeneral, struct _PluginServiceFileOpener,
      struct _PluginServiceFileSaver, _PluginServicePluginLoader):
      Removed unneeded plugin argument from every function.
      
      * src/plugin-service.c
      (plugin_service_function_group_get_full_info_callback): Get fn_def
      arg instead of fn_name + callback_data.
      (plugin_service_function_group_initialize): Store pointer to service
      in fn_def's user_data.
      Adjusted to plugin-service.h (removed plugin argument).
      
      * src/plugin-loader-module.c
      (gnumeric_plugin_loader_module_func_init,
      gnumeric_plugin_loader_module_func_can_deactivate,
      gnumeric_plugin_loader_module_func_cleanup,
      gnumeric_plugin_loader_module_func_file_probe,
      gnumeric_plugin_loader_module_func_file_open,
      gnumeric_plugin_loader_module_func_file_save,
      gnumeric_plugin_loader_module_func_get_full_function_info,
      gnumeric_plugin_loader_module_func_get_loader_type):
      Adjusted to plugin-service.h (removed plugin argument).
      
      * src/plugin.[ch]
      s/plugin_load_loader_if_needed/plugin_get_loader_if_needed
      (plugin_info_get_extra_info_list): Get loader if it's not available.
      (plugin_info_is_loaded, plugin_info_get_loader): New functions.
      ed7ceda2
  7. 24 Feb, 2001 1 commit
    • Chyla Zbigniew's avatar
      Added files: plugin-service.[ch], plugin-loader.[ch], · a924975e
      Chyla Zbigniew authored
      
      * src/Makefile.am: Added files:  plugin-service.[ch],
      plugin-loader.[ch], plugin-loader-module.[ch], module-plugin-defs.h.
      
      * src/error-info.[ch] (error_info_new_from_errno): New function.
      
      * src/file.c
      (struct _FileOpener, struct _FileSaver): Moved from file.h
      (file_opener_get_format_description, file_opener_has_probe,
      file_saver_get_extension,  file_saver_get_format_description):
      New accessor functions.
      (file_opener_probe, file_opener_open, file_saver_save,
      file_opener_set_user_data, file_opener_get_user_data,
      file_saver_set_user_data, file_saver_get_user_data): New
      functions.
      (get_file_opener_by_id, get_file_saver_by_id): Removed
      Now using FileOpener*/FileSaver* instead of FileOpenerId/FileSaverId
      everywhere.
      
      * src/file.h
      (struct _FileOpener, struct _FileSaver): Moved to file.c.
      Adjusted to file.c.
      
      * src/gui-file.c: Adjusted to file.[ch], now FileSaver.extension
      field should contain real extension (without a dot).
      
      * src/func.[ch]
      (enum FunctionFlags, struct _FunctionDefinition): Moved from func.h
      to func.c.
      (struct _FunctionCategory): Added "internal_name" and "display_name"
      in place of "name" field.
      (function_get_category_with_translation,
      function_category_remove_func, func_get_ref_count, function_remove,
      function_add_name_only): New functions.
      Now it's possible to load function implementation on demand (after
      registering function using function_add_name_only() and providing
      function of type FunctionGetFullInfoCallback).
      Rename fd and fndef to fn_def for consistency.
      
      * src/functions/fn-database.c (database_functions_init),
      src/functions/fn-date.c (date_functions_init),
      src/functions/fn-eng.c (eng_functions_init),
      src/functions/fn-financial.c (finance_functions_init),
      src/functions/fn-information.c (information_functions_init),
      src/functions/fn-logical.c (logical_functions_init),
      src/functions/fn-lookup.c (lookup_functions_init),
      src/functions/fn-math.c (math_functions_init),
      src/functions/fn-sheet.c (sheet_functions_init),
      src/functions/fn-stat.c (stat_functions_init),
      src/functions/fn-string.c (string_functions_init):
      Use function_get_category_with_translation, instead of
      function_get_category.
      
      * src/plugin.[ch]
      (struct _PluginInfo): Removed many fields.
      (plugin_info_get_extra_info_list):
      Just call gnumeric_plugin_loader_get_extra_info_list.
      (plugin_info_peek_services_data, plugin_info_peek_loader_type_str):
      New accessor functions.
      (plugin_info_read_service_list, plugin_info_read_loader,
      plugin_info_read):
      Read services and loader info, use functions from
      gal/util/e-xml-utils.h everywhere.
      (activate_plugin, deactivate_plugin): Just activate/deactivate all
      plugin services.
      (plugin_can_deactivate): Ask plugin services.
      (plugin_load_service, plugin_unload_service,
      plugin_info_offers_loader_by_type_str,
      plugin_loader_register_type, plugin_loader_register_id_only,
      plugin_loader_get_by_id, plugin_loader_is_available_by_id,
      plugin_list_sort_by_dependency):
      New functions.
      (plugin_db_activate_plugin_list): Activate plugins in correct order,
      using plugin_list_sort_by_dependency function.
      (plugin_info_print): Removed.
      (module_plugin_print_info, module_plugin_info_get_extra_info_list,
      module_plugin_free, module_plugin_info_read, module_plugin_activate,
      module_plugin_deactivate, module_plugin_can_deactivate): Removed,
      most code  moved to plugin-loader.c and plugin-loader-module.c.
      
      * src/plugin-service.[ch]: New files, support for plugin services
      (five types of these so far).
      
      * src/plugin-loader.[ch]: New files, base class for plugin loaders.
      
      * src/plugin-loader-module.[ch]: New files, support for "g_module"
      plugins.
      
      * src/plugin-util.[ch] (gnumeric_fopen_error_info,
      gnumeric_open_error_info, gnumeric_mmap_error_info): New functions.
      
      * src/gutils.[ch] (g_list_free_custom, g_slist_free_custom,
      gnumeric_time_counter_push, gnumeric_time_counter_pop):
      New functions.
      
      * src/io-context-priv.h (struct _IOContext): Added error_info field.
      
      * src/io-context.[ch] (gnumeric_io_context_new,
      gnumeric_io_context_free, gnumeric_io_error_info_set,
      gnumeric_io_error_info_push, gnumeric_io_error_info_pop,
      gnumeric_io_error_info_clear, gnumeric_io_error_info_display,
      gnumeric_io_has_error_info): New functions, quick hack to add
      support for ErrorInfo.
      
      * src/module-plugin-defs.h: New file, should be included be every
      g_module plugin.
      
      * src/auto-format.c: Use accessor function from func.h.
      
      * src/bonobo-io.c (gnumeric_bonobo_write_workbook,
      gnumeric_bonobo_read_workbook, gnumeric_bonobo_io_probe),
      src/stf.c (stf_read_workbook, stf_write_workbook),
      src/xml-io.[ch] (xml_probe, gnumeric_xml_read_workbook,
      gnumeric_xml_write_workbook):
      Signature changes.
      
      * src/workbook.c: Adjusted to
      workbook_load_from/gnumeric_xml_write_workbook signature change.
      
      * src/dialogs/dialog-function-select.c: Adjust to func.[ch].
      
      * src/dialogs/dialog-plugin-manager.c
      Adjust to plugin.[ch].
      (cb_pm_button_activate_plugin_clicked): Check if loader for current
      plugin is available, suggest activating loader plugin otherwise.
      a924975e