diff --git a/gnucash/gnome/CMakeLists.txt b/gnucash/gnome/CMakeLists.txt index 873c79aa11..6c57f5f917 100644 --- a/gnucash/gnome/CMakeLists.txt +++ b/gnucash/gnome/CMakeLists.txt @@ -140,7 +140,7 @@ target_link_libraries(gnc-gnome gnc-gnome-search gnc-ledger-core gncmod-report - gncmod-register-gnome + gnc-register-gnome gnc-register-core gnc-gnome-utils gnc-engine diff --git a/gnucash/gnucash-bin.c b/gnucash/gnucash-bin.c index 34cab744ca..ce0e780f1c 100644 --- a/gnucash/gnucash-bin.c +++ b/gnucash/gnucash-bin.c @@ -55,6 +55,7 @@ #include "dialog-new-user.h" #include "gnc-session.h" #include "gnc-engine-guile.h" +#include "gnucash-register.h" #include "swig-runtime.h" #include "guile-mappings.h" #include "search-core-type.h" @@ -488,7 +489,6 @@ load_gnucash_modules() gboolean optional; } modules[] = { - { "gnucash/register/register-gnome", 0, FALSE }, { "gnucash/import-export/qif-import", 0, FALSE }, { "gnucash/import-export/ofx", 0, TRUE }, { "gnucash/import-export/csv-import", 0, TRUE }, @@ -611,6 +611,7 @@ inner_main (void *closure, int argc, char **argv) gnc_gnome_utils_init(); gnc_search_core_initialize (); gnc_hook_add_dangler(HOOK_UI_SHUTDOWN, (GFunc)gnc_search_core_finalize, NULL, NULL); + gnucash_register_add_cell_types (); load_gnucash_modules(); diff --git a/gnucash/import-export/aqb/CMakeLists.txt b/gnucash/import-export/aqb/CMakeLists.txt index c18ddd98b4..fa867e75e4 100644 --- a/gnucash/import-export/aqb/CMakeLists.txt +++ b/gnucash/import-export/aqb/CMakeLists.txt @@ -56,7 +56,7 @@ if(WITH_AQBANKING) target_link_libraries(gncmod-aqbanking gnc-gnome gnc-gnome-utils gnc-generic-import gnc-register-core - gncmod-register-gnome gnc-ledger-core gnc-engine gwengui-gtk3 + gnc-register-gnome gnc-ledger-core gnc-engine gwengui-gtk3 ${AQB_EXPORT_SYMBOLS} ${AQBANKING_LDFLAGS} ${GWENHYWFAR_LDFLAGS} ${GWEN_GTK3_LDFLAGS} ${GNOME_LDFLAGS} ${AQB_LIBSTDCXX}) diff --git a/gnucash/import-export/csv-exp/CMakeLists.txt b/gnucash/import-export/csv-exp/CMakeLists.txt index 8ebb8a052f..0da151bae6 100644 --- a/gnucash/import-export/csv-exp/CMakeLists.txt +++ b/gnucash/import-export/csv-exp/CMakeLists.txt @@ -18,7 +18,7 @@ set(csv_export_noinst_HEADERS add_library(gncmod-csv-export ${csv_export_noinst_HEADERS} ${csv_export_SOURCES}) -target_link_libraries(gncmod-csv-export gncmod-register-gnome gnc-register-core gnc-ledger-core gnc-engine +target_link_libraries(gncmod-csv-export gnc-register-gnome gnc-register-core gnc-ledger-core gnc-engine gnc-module gnc-gnome-utils gnc-gnome gnc-app-utils gnc-core-utils) target_compile_definitions(gncmod-csv-export PRIVATE -DG_LOG_DOMAIN=\"gnc.export.csv\") diff --git a/gnucash/register/ledger-core/CMakeLists.txt b/gnucash/register/ledger-core/CMakeLists.txt index 71c2fb951c..c66ad1a860 100644 --- a/gnucash/register/ledger-core/CMakeLists.txt +++ b/gnucash/register/ledger-core/CMakeLists.txt @@ -43,7 +43,7 @@ set_source_files_properties (${ledger_core_SOURCES} PROPERTIES OBJECT_DEPENDS ${ add_library (gnc-ledger-core ${ledger_core_SOURCES} ${ledger_core_HEADERS}) -target_link_libraries(gnc-ledger-core gncmod-register-gnome gnc-register-core gnc-gnome-utils +target_link_libraries(gnc-ledger-core gnc-register-gnome gnc-register-core gnc-gnome-utils gnc-engine gnc-core-utils PkgConfig::GTK3) target_compile_definitions (gnc-ledger-core PRIVATE -DG_LOG_DOMAIN=\"gnc.register.ledger\") diff --git a/gnucash/register/register-gnome/CMakeLists.txt b/gnucash/register/register-gnome/CMakeLists.txt index 6181d2c1f1..80014e019e 100644 --- a/gnucash/register/register-gnome/CMakeLists.txt +++ b/gnucash/register/register-gnome/CMakeLists.txt @@ -2,7 +2,6 @@ add_subdirectory(test) include(CheckSymbolExists) set (register_gnome_SOURCES - gncmod-register-gnome.c combocell-gnome.c datecell-gnome.c formulacell-gnome.c @@ -43,22 +42,22 @@ set (register_gnome_noinst_HEADERS # Add dependency on config.h set_source_files_properties (${register_gnome_SOURCES} PROPERTIES OBJECT_DEPENDS ${CONFIG_H}) -add_library (gncmod-register-gnome ${register_gnome_SOURCES} ${register_gnome_noinst_HEADERS}) +add_library (gnc-register-gnome ${register_gnome_SOURCES} ${register_gnome_noinst_HEADERS}) -target_link_libraries(gncmod-register-gnome gnc-register-core PkgConfig::GTK3) +target_link_libraries(gnc-register-gnome gnc-register-core PkgConfig::GTK3) -target_compile_definitions(gncmod-register-gnome PRIVATE -DG_LOG_DOMAIN=\"gnc.register.gnome\") +target_compile_definitions(gnc-register-gnome PRIVATE -DG_LOG_DOMAIN=\"gnc.register.gnome\") -target_include_directories(gncmod-register-gnome +target_include_directories(gnc-register-gnome PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_SOURCE_DIR}/gnucash/register/ledger-core ) if (APPLE) - set_target_properties (gncmod-register-gnome PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/gnucash") + set_target_properties (gnc-register-gnome PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/gnucash") endif() -install(TARGETS gncmod-register-gnome +install(TARGETS gnc-register-gnome LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/gnucash ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/gnucash RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/gnucash/register/register-gnome/gncmod-register-gnome.c b/gnucash/register/register-gnome/gncmod-register-gnome.c deleted file mode 100644 index 9047dbf8f4..0000000000 --- a/gnucash/register/register-gnome/gncmod-register-gnome.c +++ /dev/null @@ -1,87 +0,0 @@ -/********************************************************************* - * gncmod-register-gnome.c - * module definition/initialization for Gnome parts of register - * - * Copyright (c) 2001 Linux Developers Group, Inc. - *********************************************************************/ -/********************************************************************\ - * 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 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * - * Boston, MA 02110-1301, USA gnu@gnu.org * - * * -\********************************************************************/ - - -#include - -#include - -#include "combocell.h" -#include "datecell.h" -#include "gnc-module-api.h" -#include "gnc-module.h" -#include "formulacell-gnome.h" -#include "pricecell-gnome.h" -#include "quickfillcell-gnome.h" -#include "register-common.h" -#include "table-gnome.h" - -GNC_MODULE_API_DECL(libgncmod_register_gnome) - -/* version of the gnc module system interface we require */ -int libgncmod_register_gnome_gnc_module_system_interface = 0; - -/* module versioning uses libtool semantics. */ -int libgncmod_register_gnome_gnc_module_current = 0; -int libgncmod_register_gnome_gnc_module_revision = 0; -int libgncmod_register_gnome_gnc_module_age = 0; - - -char * -libgncmod_register_gnome_gnc_module_path(void) -{ - return g_strdup("gnucash/register/register-gnome"); -} - -char * -libgncmod_register_gnome_gnc_module_description(void) -{ - return g_strdup("Gnome GUI for ledger-like table displays"); -} - -int -libgncmod_register_gnome_gnc_module_init(int refcount) -{ - if (refcount == 0) - { - gnc_register_add_cell_type (COMBO_CELL_TYPE_NAME, gnc_combo_cell_new); - - gnc_register_add_cell_type (DATE_CELL_TYPE_NAME, gnc_date_cell_new); - - gnc_register_add_cell_type (PRICE_CELL_TYPE_NAME, - gnc_price_cell_gnome_new); - - gnc_register_add_cell_type (QUICKFILL_CELL_TYPE_NAME, - gnc_quickfill_cell_gnome_new); - - gnc_register_add_cell_type( FORMULA_CELL_TYPE_NAME, - gnc_formula_cell_gnome_new ); - - gnc_table_gnome_init (); - } - - return TRUE; -} diff --git a/gnucash/register/register-gnome/gnucash-register.c b/gnucash/register/register-gnome/gnucash-register.c index 98a57de8e8..d072acc56a 100644 --- a/gnucash/register/register-gnome/gnucash-register.c +++ b/gnucash/register/register-gnome/gnucash-register.c @@ -46,6 +46,13 @@ #include "gnc-prefs.h" #include "gnc-state.h" +#include "combocell.h" +#include "datecell.h" +#include "formulacell-gnome.h" +#include "pricecell-gnome.h" +#include "quickfillcell-gnome.h" +#include "table-gnome.h" + /* Register signals */ enum @@ -88,6 +95,20 @@ struct _GnucashRegisterClass /** Implementation *****************************************************/ +void +gnucash_register_add_cell_types (void) +{ + gnc_register_add_cell_type (COMBO_CELL_TYPE_NAME, gnc_combo_cell_new); + gnc_register_add_cell_type (DATE_CELL_TYPE_NAME, gnc_date_cell_new); + gnc_register_add_cell_type (PRICE_CELL_TYPE_NAME, + gnc_price_cell_gnome_new); + gnc_register_add_cell_type (QUICKFILL_CELL_TYPE_NAME, + gnc_quickfill_cell_gnome_new); + gnc_register_add_cell_type( FORMULA_CELL_TYPE_NAME, + gnc_formula_cell_gnome_new ); + gnc_table_gnome_init (); +} + gboolean gnucash_register_has_selection (GnucashRegister *reg) { diff --git a/gnucash/register/register-gnome/gnucash-register.h b/gnucash/register/register-gnome/gnucash-register.h index fc3ceb74c1..8fb4f7c1f7 100644 --- a/gnucash/register/register-gnome/gnucash-register.h +++ b/gnucash/register/register-gnome/gnucash-register.h @@ -47,6 +47,12 @@ typedef struct _GnucashRegisterClass GnucashRegisterClass; GType gnucash_register_get_type (void); +/** Add cell types defined by gnucash_register to gnc_register + * + * Should be called before any table layout is created using + * these new types */ +void gnucash_register_add_cell_types (void); + /** this already has scrollbars attached */ GtkWidget *gnucash_register_new (Table *table, gchar *state_section); diff --git a/po/POTFILES.in b/po/POTFILES.in index 90fbf65382..6268cd9a66 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -388,7 +388,6 @@ gnucash/register/register-core/table-model.c gnucash/register/register-gnome/combocell-gnome.c gnucash/register/register-gnome/datecell-gnome.c gnucash/register/register-gnome/formulacell-gnome.c -gnucash/register/register-gnome/gncmod-register-gnome.c gnucash/register/register-gnome/gnucash-color.c gnucash/register/register-gnome/gnucash-cursor.c gnucash/register/register-gnome/gnucash-date-picker.c