Skip to content

Commit

Permalink
Move to new library structure
Browse files Browse the repository at this point in the history
  • Loading branch information
rilian-la-te committed Jan 15, 2018
1 parent 483a489 commit 0f7d419
Show file tree
Hide file tree
Showing 88 changed files with 506 additions and 233 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
path = cmake
url = https://github.com/rilian-la-te/cmake-vala.git
[submodule "lib/dbusmenu"]
path = lib/dbusmenu
path = dbusmenu
url = https://github.com/rilian-la-te/vala-dbusmenu
57 changes: 21 additions & 36 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required (VERSION 2.8)
cmake_policy (VERSION 2.8)
cmake_minimum_required (VERSION 3.3)
cmake_policy (VERSION 3.3)
project (vala-panel C)
enable_testing ()
include(GNUInstallDirs)
Expand Down Expand Up @@ -72,7 +72,7 @@ endif(RPMTools_FOUND)

add_custom_target (dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
# Configuration
configure_file (${CMAKE_SOURCE_DIR}/lib/config.h.in ${CMAKE_BINARY_DIR}/lib/config.h)
configure_file (${CMAKE_SOURCE_DIR}/util/config.h.in ${CMAKE_BINARY_DIR}/config.h)
configure_file (${CMAKE_SOURCE_DIR}/${APPNAME}.pc.cmake ${CMAKE_BINARY_DIR}/${APPNAME}.pc)

# Some definitions
Expand All @@ -86,46 +86,29 @@ include (ValaPrecompile)

add_definitions(-DVALA_VERSION="${VALA_SHORTVER}")
#add_definitions(-w) #Suppress all GCC warnings
add_definitions(-Wall -Wno-unused # Vala loves to create variables
# -pedantic
-Wno-ignored-qualifiers
-Wno-incompatible-pointer-types
-Wno-missing-field-initializers
-Wno-discarded-qualifiers
-Wno-sign-compare
-Wextra
-fstack-protector -fstack-protector-all
add_definitions(-Wall -Wextra
-Wno-unused
-Wno-unused-parameter# Vala loves to create variables
#-pedantic
-Wno-ignored-qualifiers
-Wno-incompatible-pointer-types
-Wno-missing-field-initializers
-Wno-discarded-qualifiers
-Wno-sign-compare
) #Vala often forgot cast to GtkWidget or gpointer
find_package (PkgConfig)

pkg_check_modules (A
gtk+-3.0>=3.22)

pkg_check_modules (B
glib-2.0>=2.50)

pkg_check_modules (C
gio-2.0>=2.50
)
find_package(GLib REQUIRED COMPONENTS goblect gio gmodule gthread VERSION 2.50)
find_package(GTK3 REQUIRED VERSION 3.22)

pkg_check_modules (GLIB_OLD QUIET
gio-2.0<=2.52
)

pkg_check_modules (D
gio-unix-2.0>=2.50)

pkg_check_modules (E
gthread-2.0>=2.50)

pkg_check_modules (F
pkg_check_modules (PEAS
libpeas-1.0>=1.14)

pkg_check_modules (G
libpeas-gtk-1.0>=1.14)

pkg_check_modules (H
gmodule-2.0>=2.50)
set(CORE_LIBRARIES ${GLIB_LIBRARIES} ${GLIB_GIO_LIBRARIES} ${GLIB_GOBJECT_LIBRARIES} ${GLIB_GMODULE_LIBRARIES} ${GLIB_GTHREAD_LIBRARIES} ${GTK3_LIBRARIES} ${PEAS_LIBRARIES})
set(CORE_INCLUDE_DIRS ${GLIB_INCLUDE_DIRS} ${GTK_INCLUDE_DIRS} ${PEAS_INCLUDE_DIRS})

pkg_check_modules (CORE REQUIRED QUIET
gtk+-3.0>=3.22
Expand Down Expand Up @@ -164,8 +147,10 @@ include_directories(${CMAKE_BINARY_DIR}/lib)
set(TARGET_GLIB ${GLIB_VERSION_MAJOR}.${GLIB_VERSION_MINOR})

ADD_SUBDIRECTORY(po)
ADD_SUBDIRECTORY(lib)
ADD_SUBDIRECTORY(app)
ADD_SUBDIRECTORY(util)
ADD_SUBDIRECTORY(runner)
add_subdirectory(dbusmenu)
ADD_SUBDIRECTORY(ui)
ADD_SUBDIRECTORY(app)
ADD_SUBDIRECTORY(applets)
ADD_SUBDIRECTORY(data)
8 changes: 7 additions & 1 deletion app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ set(APP_SOURCES
application.c application.h)
add_executable(${APPNAME} ${APP_SOURCES} )
target_link_libraries (${APPNAME} ${LIBNAME} ${CORE_LIBRARIES})
target_include_directories(${APPNAME} PRIVATE ${CORE_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/lib/c-lib ${CMAKE_SOURCE_DIR}/lib ${CMAKE_BINARY_DIR}/lib)
target_include_directories(${APPNAME} PRIVATE
${CORE_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}/ui
${CMAKE_SOURCE_DIR}/util
${CMAKE_BINARY_DIR}/ui)

install (TARGETS ${APPNAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT bin)
Empty file modified app/app-pref.ui
100755 → 100644
Empty file.
8 changes: 3 additions & 5 deletions app/application.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@
#include "config.h"

#include "application.h"
#include "lib/css.h"
#include "lib/definitions.h"
#include "lib/launcher.h"
#include "lib/misc.h"
#include "lib/panel-platform.h"
#include "server.h"
#include "vala-panel-compat.h"
#include "vala-panel-platform-standalone-x11.h"

Expand Down Expand Up @@ -466,6 +462,8 @@ static inline void file_chooser_helper(GtkFileChooser *self, ValaPanelApplicatio
g_object_set(app, VALA_PANEL_KEY_CSS, file, NULL);
}

/* TODO: Move activate_menu to hidden toplevel interface, it is not X11-specific */

static void activate_menu(GSimpleAction *simple, GVariant *param, gpointer data)
{
GtkApplication *app = GTK_APPLICATION(data);
Expand Down
6 changes: 2 additions & 4 deletions app/vala-panel-platform-standalone-x11.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@
#include "config.h"

#include "applet-widget.h"
#include "definitions.h"
#include "gio/gsettingsbackend.h"
#include "lib/definitions.h"
#include "lib/settings-manager.h"
//#include "lib/toplevel.h"
#include "vala-panel-compat.h"
#include "server.h"
#include "vala-panel-platform-standalone-x11.h"

struct _ValaPanelPlatformX11
Expand Down
2 changes: 1 addition & 1 deletion applets/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/lib)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/util ${CMAKE_SOURCE_DIR}/ui ${CMAKE_BINARY_DIR}/ui)
add_subdirectory(core)
add_subdirectory(drawing)
add_subdirectory(wnck)
Empty file modified applets/core/menumodel/system-menus.ui
100755 → 100644
Empty file.
7 changes: 4 additions & 3 deletions applets/wnck/tasklist-xfce/tasklist-widget.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@
#include <gdk/gdkx.h>
#endif

#include "lib/css.h"
#include "lib/definitions.h"
#include "lib/vala-panel-compat.h"
#include "definitions.h"
#include "tasklist-widget.h"
#include "util-gtk.h"
#include "util.h"
#include "vala-panel-compat.h"
#include "xfce-arrow-button.h"

#define DEFAULT_BUTTON_SIZE (25)
Expand Down
3 changes: 2 additions & 1 deletion applets/wnck/tasklist-xfce/xfce-arrow-button.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@

#include <gtk/gtk.h>

#include "lib/css.h"
#include "util-gtk.h"
#include "util.h"
#include "xfce-arrow-button.h"

/**
Expand Down
2 changes: 1 addition & 1 deletion cmake
Submodule cmake updated 2 files
+102 −0 FindGLib.cmake
+82 −0 FindGTK3.cmake
Empty file modified data/gschemas/org.valapanel.gschema.xml
100755 → 100644
Empty file.
Empty file modified data/gschemas/org.valapanel.toplevel.gschema.xml
100755 → 100644
Empty file.
Empty file modified data/ui/panel-menus.ui
100755 → 100644
Empty file.
Empty file modified data/ui/pref.ui
100755 → 100644
Empty file.
1 change: 1 addition & 0 deletions dbusmenu
Submodule dbusmenu added at a55628
1 change: 0 additions & 1 deletion lib/dbusmenu
Submodule dbusmenu deleted from 079172
20 changes: 7 additions & 13 deletions runner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ INCLUDE(GResource)
set(RUNNER_SOURCES
runner.c
runner.h
info-data.c
info-data.h
boxed-wrapper.c
boxed-wrapper.h
glistmodel-filter.c
glistmodel-filter.h
runner-app.c
runner-app.h
)
add_definitions(-DG_SETTINGS_ENABLE_BACKEND)
glib_compile_resources(GLIB_RESOURCES_APP
Expand All @@ -20,11 +16,9 @@ glib_compile_resources(GLIB_RESOURCES_APP
#####
add_executable(${APPNAME}-runner
${GLIB_RESOURCES_APP}
${RUNNER_SOURCES}
runner-app.c
runner-app.h
${CMAKE_SOURCE_DIR}/lib/css.c
${CMAKE_SOURCE_DIR}/lib/launcher.c)
target_link_libraries (${APPNAME}-runner ${CORE_LIBRARIES} m)
target_include_directories(${APPNAME}-runner PRIVATE ${CORE_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
${RUNNER_SOURCES})
add_dependencies(${APPNAME}-runner util-gtk)
target_link_libraries(${APPNAME}-runner util-gtk)
target_link_libraries (${APPNAME}-runner ${GTK3_LIBRARIES} ${GLIB_LIBRARIES} ${GLIB_GIO_LIBRARIES} ${GLIB_GOBJECT_LIBRARIES} ${GLIB_GMODULE_LIBRARIES} ${GLIB_GTHREAD_LIBRARIES} m)
target_include_directories(${APPNAME}-runner PRIVATE ${CORE_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/util ${CMAKE_BINARY_DIR})
install (TARGETS ${APPNAME}-runner RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT bin)
8 changes: 3 additions & 5 deletions runner/runner-app.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@
*/

#include "runner-app.h"
#include "lib/config.h"
#include "lib/definitions.h"
#include "config.h"
#include "runner.h"
#include <locale.h>

#include "util.h"
#include <locale.h>

struct _ValaPanelRunApplication
Expand Down Expand Up @@ -52,7 +50,7 @@ static void vala_panel_run_application_activate(GApplication *application)

static void vala_panel_run_application_finalize(GObject *app)
{
gtk_widget_destroy0(VALA_PANEL_RUN_APPLICATION(app)->run_dialog);
g_clear_pointer(&VALA_PANEL_RUN_APPLICATION(app)->run_dialog, gtk_widget_destroy);
(*G_OBJECT_CLASS(vala_panel_run_application_parent_class)->finalize)(app);
}
static void vala_panel_run_application_init(ValaPanelRunApplication *self)
Expand Down
30 changes: 14 additions & 16 deletions runner/runner.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "runner.h"
#include "boxed-wrapper.h"
#include "glistmodel-filter.h"
#include "info-data.h"
#include "lib/css.h"
#include "lib/definitions.h"
#include "lib/launcher.h"
#include <gio/gdesktopappinfo.h>
#include <stdbool.h>
#include <string.h>

#include "config.h"

#include "runner.h"
#include "util-gtk.h"

#define MAX_SEARCH_RESULTS 30

struct _ValaPanelRunner
Expand Down Expand Up @@ -122,7 +120,7 @@ static void vala_panel_runner_response(GtkDialog *dlg, gint response)
launch = false;
if (!launch)
{
g_object_unref0(app_info);
g_clear_pointer(&app_info, g_object_unref);
g_autoptr(GError) err = NULL;
app_info = g_app_info_create_from_commandline(
gtk_entry_get_text(GTK_ENTRY(self->main_entry)),
Expand Down Expand Up @@ -331,14 +329,14 @@ static void vala_panel_runner_destroy(GtkWidget *obj)
G_TYPE_CHECK_INSTANCE_CAST(obj, vala_panel_runner_get_type(), ValaPanelRunner);
gtk_window_set_application((GtkWindow *)self, NULL);
g_cancellable_cancel(self->cancellable);
g_object_unref0(self->cancellable);
g_object_unref0(self->task);
gtk_widget_destroy0(self->main_entry);
gtk_widget_destroy0(self->bottom_revealer);
gtk_widget_destroy0(self->app_box);
gtk_widget_destroy0(self->terminal_button);
g_object_unref0(self->model);
g_object_unref0(self->filter);
g_clear_pointer(&self->cancellable, g_object_unref);
g_clear_pointer(&self->task, g_object_unref);
g_clear_pointer(&self->main_entry, gtk_widget_destroy);
g_clear_pointer(&self->bottom_revealer, gtk_widget_destroy);
g_clear_pointer(&self->app_box, gtk_widget_destroy);
g_clear_pointer(&self->terminal_button, gtk_widget_destroy);
g_clear_pointer(&self->model, g_object_unref);
g_clear_pointer(&self->filter, g_object_unref);
GTK_WIDGET_CLASS(vala_panel_runner_parent_class)->destroy(obj);
}

Expand Down
22 changes: 6 additions & 16 deletions lib/CMakeLists.txt → ui/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
add_subdirectory(applets-new)
add_subdirectory(c-lib)
add_subdirectory(dbusmenu)
include(GLibHelpers)
set(ENUM_FILES
panel-platform.h
Expand All @@ -13,38 +12,29 @@ if (ENABLE_NEW_INTERFACE)
set(NEW_DEFINE -D NEW)
endif()
set(LIBVALAPANEL_HEADERS
client.h
server.h
applet-widget-api.h
applet-widget.h
${CMAKE_CURRENT_BINARY_DIR}/config.h
constants.h
misc.h
misc-gtk.h
menu-maker.h
css.h
launcher.h
generic-config-dialog.h
settings-manager.h
panel-platform.h
toplevel.h
toplevel-config.h
${ENUMSH})
set(LIBVALAPANEL_C_SOURCES
misc.c
misc-gtk.c
menu-maker.c
css.c
toplevel-config.c
launcher.c
generic-config-dialog.c
settings-manager.c
panel-platform.c
applet-widget.c
toplevel.c
${ENUMSC})
INCLUDE(GResource)
if(GLIB_OLD_FOUND)
list(APPEND LIBVALAPANEL_C_SOURCES
guuid.c
guuid.h)
endif()
set(VALA_FILES
configurator.vala
applet-holder.vala
Expand Down Expand Up @@ -79,7 +69,7 @@ glib_compile_resources(GLIB_RESOURCES_LIB
# Build library for plugins and application
set (LIBS ${CORE_LIBRARIES} -lm)
set (LIB_PATHS ${CORE_LIBRARY_DIRS})
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/lib)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/util; ${CMAKE_SOURCE_DIR}/ui)
link_directories (${LIB_PATHS})

set (LIB_FILES ${VALA_C})
Expand All @@ -93,7 +83,7 @@ add_library (${LIBNAME} SHARED
definitions.h
)

target_link_libraries (${LIBNAME} ${LIBS})
target_link_libraries (${LIBNAME} ${LIBS} util util-gtk)
target_include_directories(${LIBNAME} PRIVATE ${CORE_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})

set_target_properties (${LIBNAME} PROPERTIES
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set (LIBS ${CORE_LIBRARIES} -lm)
set (LIB_PATHS ${CORE_LIBRARY_DIRS})
link_directories (${LIB_PATHS})
target_link_libraries (applet-api-new ${LIBS})
target_include_directories(applet-api-new PRIVATE ${CORE_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/lib)
target_include_directories(applet-api-new PRIVATE ${CORE_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/ui)
set_target_properties (applet-api-new PROPERTIES
VERSION ${VERSION}
SOVERSION ${SOVERSION})
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "applet-info.h"
#include "lib/definitions.h"
#include "definitions.h"

#define G_SETTINGS_ENABLE_BACKEND
#include <gio/gsettingsbackend.h>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 0f7d419

Please sign in to comment.