Enhancement: Fixes #271, Draft shell APIs
88
shell/cpl/printers/CMakeLists.txt
Normal file
@@ -0,0 +1,88 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
project(
|
||||
libwintc-cpl-printers
|
||||
VERSION 1.0
|
||||
DESCRIPTION "Windows Total Conversion 'Printers and Faxes' Control Panel applet."
|
||||
LANGUAGES C
|
||||
)
|
||||
|
||||
set(PROJECT_ANYARCH false)
|
||||
set(PROJECT_FREESTATUS true)
|
||||
set(PROJECT_MAINTAINER "Rory Fewell <roryf@oddmatics.uk>")
|
||||
|
||||
set(PROJECT_ROOT ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
include(../../../packaging/cmake-inc/common/CMakeLists.txt)
|
||||
include(../../../packaging/cmake-inc/libraries/CMakeLists.txt)
|
||||
include(../../../packaging/cmake-inc/linking/CMakeLists.txt)
|
||||
include(../../../packaging/cmake-inc/packaging/CMakeLists.txt)
|
||||
|
||||
wintc_resolve_library(glib-2.0 GLIB)
|
||||
wintc_resolve_library(gtk+-3.0 GTK3)
|
||||
wintc_resolve_library(wintc-comgtk WINTC_COMGTK)
|
||||
wintc_resolve_library(wintc-shcommon WINTC_SHCOMMON)
|
||||
wintc_resolve_library(wintc-shell WINTC_SHELL)
|
||||
wintc_resolve_library(wintc-shellext WINTC_SHELLEXT)
|
||||
|
||||
add_library(
|
||||
libwintc-cpl-printers
|
||||
src/shext.c
|
||||
src/shext.h
|
||||
src/vwprntrs.c
|
||||
src/vwprntrs.h
|
||||
)
|
||||
|
||||
target_compile_options(
|
||||
libwintc-cpl-printers
|
||||
PRIVATE ${WINTC_COMPILE_OPTIONS}
|
||||
)
|
||||
|
||||
target_include_directories(
|
||||
libwintc-cpl-printers
|
||||
SYSTEM
|
||||
BEFORE
|
||||
PRIVATE ${GLIB_INCLUDE_DIRS}
|
||||
PRIVATE ${GTK3_INCLUDE_DIRS}
|
||||
PRIVATE ${WINTC_COMGTK_INCLUDE_DIRS}
|
||||
PRIVATE ${WINTC_SHCOMMON_INCLUDE_DIRS}
|
||||
PRIVATE ${WINTC_SHELL_INCLUDE_DIRS}
|
||||
PRIVATE ${WINTC_SHELLEXT_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
target_link_directories(
|
||||
libwintc-cpl-printers
|
||||
PRIVATE ${GLIB_LIBRARY_DIRS}
|
||||
PRIVATE ${GTK3_LIBRARY_DIRS}
|
||||
PRIVATE ${WINTC_COMGTK_LIBRARY_DIRS}
|
||||
PRIVATE ${WINTC_SHCOMMON_LIBRARY_DIRS}
|
||||
PRIVATE ${WINTC_SHELL_LIBRARY_DIRS}
|
||||
PRIVATE ${WINTC_SHELLEXT_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
libwintc-cpl-printers
|
||||
PRIVATE ${GLIB_LIBRARIES}
|
||||
PRIVATE ${GTK3_LIBRARIES}
|
||||
PRIVATE ${WINTC_COMGTK_LIBRARIES}
|
||||
PRIVATE ${WINTC_SHCOMMON_LIBRARIES}
|
||||
PRIVATE ${WINTC_SHELL_LIBRARIES}
|
||||
PRIVATE ${WINTC_SHELLEXT_LIBRARIES}
|
||||
)
|
||||
|
||||
#
|
||||
# Installation
|
||||
#
|
||||
wintc_configure_and_install_packaging()
|
||||
wintc_install_icons_into_package()
|
||||
|
||||
install(
|
||||
FILES printers.desktop
|
||||
DESTINATION share/wintc/cpl
|
||||
)
|
||||
install(
|
||||
TARGETS libwintc-cpl-printers
|
||||
DESTINATION ${LIB_DIR}/wintc/shext
|
||||
)
|
||||
2
shell/cpl/printers/README.MD
Normal file
@@ -0,0 +1,2 @@
|
||||
# libwintc-cpl-printers
|
||||
This directory contains the source code for the *Printers and Faxes* Control Panel applet.
|
||||
5
shell/cpl/printers/deps
Normal file
@@ -0,0 +1,5 @@
|
||||
bt,rt:glib2
|
||||
bt,rt:gtk3
|
||||
bt,rt:wintc-comgtk
|
||||
bt,rt:wintc-shell
|
||||
bt,rt:wintc-shellext
|
||||
|
After Width: | Height: | Size: 703 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
5
shell/cpl/printers/printers.desktop
Normal file
@@ -0,0 +1,5 @@
|
||||
[CplApplet]
|
||||
Name=Printers and Faxes
|
||||
Comments=Shows installed printers and fax printers and helps you add new ones.
|
||||
Exec=::{2ea9a9c1-bea4-41aa-a263-7fca5e22ced0}
|
||||
Icon=uk.co.oddmatics.wintc.cpl-printers
|
||||
49
shell/cpl/printers/src/shext.c
Normal file
@@ -0,0 +1,49 @@
|
||||
#include <glib.h>
|
||||
#include <wintc/comgtk.h>
|
||||
#include <wintc/shcommon.h>
|
||||
#include <wintc/shellext.h>
|
||||
|
||||
#include "shext.h"
|
||||
#include "vwprntrs.h"
|
||||
|
||||
//
|
||||
// FORWARD DECLARATIONS
|
||||
//
|
||||
static WinTCIShextView* factory_view_cpl_printers(
|
||||
WinTCShextViewAssoc assoc,
|
||||
const gchar* assoc_str,
|
||||
const gchar* url
|
||||
);
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
gboolean shext_init(
|
||||
WinTCShextHost* shext_host
|
||||
)
|
||||
{
|
||||
WINTC_RETURN_VAL_IF_FAIL(
|
||||
wintc_shext_host_register_view(
|
||||
shext_host,
|
||||
WINTC_SH_GUID_PRINTERS,
|
||||
factory_view_cpl_printers
|
||||
),
|
||||
FALSE
|
||||
);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//
|
||||
// CALLBACKS
|
||||
//
|
||||
static WinTCIShextView* factory_view_cpl_printers(
|
||||
WINTC_UNUSED(WinTCShextViewAssoc assoc),
|
||||
WINTC_UNUSED(const gchar* assoc_str),
|
||||
WINTC_UNUSED(const gchar* url)
|
||||
)
|
||||
{
|
||||
WINTC_LOG_DEBUG("%s", "cpl-prntrs: create new cpl printers view");
|
||||
|
||||
return wintc_cpl_view_printers_new();
|
||||
}
|
||||
14
shell/cpl/printers/src/shext.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef __SHEXT_H__
|
||||
#define __SHEXT_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <wintc/shellext.h>
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
gboolean shext_init(
|
||||
WinTCShextHost* shext_host
|
||||
);
|
||||
|
||||
#endif
|
||||
185
shell/cpl/printers/src/vwprntrs.c
Normal file
@@ -0,0 +1,185 @@
|
||||
#include <glib.h>
|
||||
#include <wintc/comgtk.h>
|
||||
#include <wintc/shcommon.h>
|
||||
#include <wintc/shell.h>
|
||||
#include <wintc/shellext.h>
|
||||
|
||||
#include "vwprntrs.h"
|
||||
|
||||
//
|
||||
// STATIC DATA
|
||||
//
|
||||
|
||||
// FIXME: Temporary, until we display printers
|
||||
//
|
||||
static WinTCShextViewItem s_temp_items[] = {
|
||||
{ "FPO", "printer", TRUE, NULL }
|
||||
};
|
||||
|
||||
//
|
||||
// FORWARD DECLARATIONS
|
||||
//
|
||||
static void wintc_cpl_view_printers_ishext_view_interface_init(
|
||||
WinTCIShextViewInterface* iface
|
||||
);
|
||||
|
||||
WinTCShextPathInfo* wintc_cpl_view_printers_activate_item(
|
||||
WinTCIShextView* view,
|
||||
WinTCShextViewItem* item,
|
||||
GError** error
|
||||
);
|
||||
|
||||
void wintc_cpl_view_printers_refresh_items(
|
||||
WinTCIShextView* view
|
||||
);
|
||||
|
||||
void wintc_cpl_view_printers_get_actions_for_item(
|
||||
WinTCIShextView* view,
|
||||
WinTCShextViewItem* item
|
||||
);
|
||||
|
||||
void wintc_cpl_view_printers_get_actions_for_view(
|
||||
WinTCIShextView* view
|
||||
);
|
||||
|
||||
const gchar* wintc_cpl_view_printers_get_display_name(
|
||||
WinTCIShextView* view
|
||||
);
|
||||
|
||||
const gchar* wintc_cpl_view_printers_get_parent_path(
|
||||
WinTCIShextView* view
|
||||
);
|
||||
|
||||
const gchar* wintc_cpl_view_printers_get_path(
|
||||
WinTCIShextView* view
|
||||
);
|
||||
|
||||
//
|
||||
// GLIB OOP/CLASS INSTANCE DEFINITIONS
|
||||
//
|
||||
struct _WinTCCplViewPrintersClass
|
||||
{
|
||||
GObjectClass __parent__;
|
||||
};
|
||||
|
||||
struct _WinTCCplViewPrinters
|
||||
{
|
||||
GObject __parent__;
|
||||
};
|
||||
|
||||
//
|
||||
// GLIB TYPE DEFINITIONS & CTORS
|
||||
//
|
||||
G_DEFINE_TYPE_WITH_CODE(
|
||||
WinTCCplViewPrinters,
|
||||
wintc_cpl_view_printers,
|
||||
G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE(
|
||||
WINTC_TYPE_ISHEXT_VIEW,
|
||||
wintc_cpl_view_printers_ishext_view_interface_init
|
||||
)
|
||||
)
|
||||
|
||||
static void wintc_cpl_view_printers_class_init(
|
||||
WINTC_UNUSED(WinTCCplViewPrintersClass* klass)
|
||||
) {}
|
||||
|
||||
static void wintc_cpl_view_printers_init(
|
||||
WINTC_UNUSED(WinTCCplViewPrinters* self)
|
||||
) {}
|
||||
|
||||
static void wintc_cpl_view_printers_ishext_view_interface_init(
|
||||
WinTCIShextViewInterface* iface
|
||||
)
|
||||
{
|
||||
iface->activate_item = wintc_cpl_view_printers_activate_item;
|
||||
iface->refresh_items = wintc_cpl_view_printers_refresh_items;
|
||||
iface->get_actions_for_item = wintc_cpl_view_printers_get_actions_for_item;
|
||||
iface->get_actions_for_view = wintc_cpl_view_printers_get_actions_for_view;
|
||||
iface->get_display_name = wintc_cpl_view_printers_get_display_name;
|
||||
iface->get_parent_path = wintc_cpl_view_printers_get_parent_path;
|
||||
iface->get_path = wintc_cpl_view_printers_get_path;
|
||||
}
|
||||
|
||||
//
|
||||
// INTERFACE METHODS
|
||||
//
|
||||
WinTCShextPathInfo* wintc_cpl_view_printers_activate_item(
|
||||
WINTC_UNUSED(WinTCIShextView* view),
|
||||
WINTC_UNUSED(WinTCShextViewItem* item),
|
||||
GError** error
|
||||
)
|
||||
{
|
||||
WINTC_SAFE_REF_CLEAR(error);
|
||||
g_critical("%s Not Implemented", __func__);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void wintc_cpl_view_printers_refresh_items(
|
||||
WinTCIShextView* view
|
||||
)
|
||||
{
|
||||
WINTC_LOG_DEBUG("%s", "cpl-prntrs: refresh printers view");
|
||||
|
||||
// Emit the FPO printer for now
|
||||
// TODO: Implement this!
|
||||
//
|
||||
WinTCShextViewItemsAddedData items = {
|
||||
&(s_temp_items[0]),
|
||||
G_N_ELEMENTS(s_temp_items),
|
||||
TRUE
|
||||
};
|
||||
|
||||
_wintc_ishext_view_items_added(view, &items);
|
||||
}
|
||||
|
||||
void wintc_cpl_view_printers_get_actions_for_item(
|
||||
WINTC_UNUSED(WinTCIShextView* view),
|
||||
WINTC_UNUSED(WinTCShextViewItem* item)
|
||||
)
|
||||
{
|
||||
g_critical("%s Not Implemented", __func__);
|
||||
}
|
||||
|
||||
void wintc_cpl_view_printers_get_actions_for_view(
|
||||
WINTC_UNUSED(WinTCIShextView* view)
|
||||
)
|
||||
{
|
||||
g_critical("%s Not Implemented", __func__);
|
||||
}
|
||||
|
||||
const gchar* wintc_cpl_view_printers_get_display_name(
|
||||
WINTC_UNUSED(WinTCIShextView* view)
|
||||
)
|
||||
{
|
||||
// FIXME: Use shlang
|
||||
//
|
||||
return "Printers and Faxes";
|
||||
}
|
||||
|
||||
const gchar* wintc_cpl_view_printers_get_parent_path(
|
||||
WINTC_UNUSED(WinTCIShextView* view)
|
||||
)
|
||||
{
|
||||
return wintc_sh_get_place_path(WINTC_SH_PLACE_CONTROLPANEL);
|
||||
}
|
||||
|
||||
const gchar* wintc_cpl_view_printers_get_path(
|
||||
WINTC_UNUSED(WinTCIShextView* view)
|
||||
)
|
||||
{
|
||||
return wintc_sh_get_place_path(WINTC_SH_PLACE_PRINTERS);
|
||||
}
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
WinTCIShextView* wintc_cpl_view_printers_new(void)
|
||||
{
|
||||
return WINTC_ISHEXT_VIEW(
|
||||
g_object_new(
|
||||
WINTC_TYPE_CPL_VIEW_PRINTERS,
|
||||
NULL
|
||||
)
|
||||
);
|
||||
}
|
||||
27
shell/cpl/printers/src/vwprntrs.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef __VWPRNTRS_H__
|
||||
#define __VWPRNTRS_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <wintc/shellext.h>
|
||||
|
||||
//
|
||||
// GTK OOP BOILERPLATE
|
||||
//
|
||||
typedef struct _WinTCCplViewPrintersClass WinTCCplViewPrintersClass;
|
||||
typedef struct _WinTCCplViewPrinters WinTCCplViewPrinters;
|
||||
|
||||
#define WINTC_TYPE_CPL_VIEW_PRINTERS (wintc_cpl_view_printers_get_type())
|
||||
#define WINTC_CPL_VIEW_PRINTERS(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WINTC_TYPE_CPL_VIEW_PRINTERS, WinTCCplViewPrinters))
|
||||
#define WINTC_CPL_VIEW_PRINTERS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WINTC_TYPE_CPL_VIEW_PRINTERS, WinTCCplViewPrintersClass))
|
||||
#define IS_WINTC_CPL_VIEW_PRINTERS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WINTC_TYPE_CPL_VIEW_PRINTERS))
|
||||
#define IS_WINTC_CPL_VIEW_PRINTERS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WINTC_TYPE_CPL_VIEW_PRINTERS))
|
||||
#define WINTC_CPL_VIEW_PRINTERS_GET_CLASS(obj) (G_TYPE_INSANCE_GET_CLASS((obj), WINTC_TYPE_CPL_VIEW_PRINTERS, WinTCCplViewPrinters))
|
||||
|
||||
GType wintc_cpl_view_printers_get_type(void) G_GNUC_CONST;
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
WinTCIShextView* wintc_cpl_view_printers_new(void);
|
||||
|
||||
#endif
|
||||
108
shell/cpl/sysdm/CMakeLists.txt
Normal file
@@ -0,0 +1,108 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
project(
|
||||
wintc-cpl-sysdm
|
||||
VERSION 1.0
|
||||
DESCRIPTION "Windows Total Conversion System Control Panel applet."
|
||||
LANGUAGES C
|
||||
)
|
||||
|
||||
set(PROJECT_ANYARCH false)
|
||||
set(PROJECT_FREESTATUS true)
|
||||
set(PROJECT_MAINTAINER "Rory Fewell <roryf@oddmatics.uk>")
|
||||
|
||||
set(PROJECT_ROOT ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
include(../../../packaging/cmake-inc/common/CMakeLists.txt)
|
||||
include(../../../packaging/cmake-inc/linking/CMakeLists.txt)
|
||||
include(../../../packaging/cmake-inc/locale/CMakeLists.txt)
|
||||
include(../../../packaging/cmake-inc/packaging/CMakeLists.txt)
|
||||
include(../../../packaging/cmake-inc/resources/CMakeLists.txt)
|
||||
|
||||
wintc_resolve_library(glib-2.0 GLIB)
|
||||
wintc_resolve_library(gtk+-3.0 GTK3)
|
||||
wintc_resolve_library(wintc-comctl WINTC_COMCTL)
|
||||
wintc_resolve_library(wintc-comgtk WINTC_COMGTK)
|
||||
wintc_resolve_library(wintc-shcommon WINTC_SHCOMMON)
|
||||
wintc_resolve_library(wintc-shlang WINTC_SHLANG)
|
||||
|
||||
wintc_compile_resources()
|
||||
wintc_create_meta_h()
|
||||
|
||||
add_executable(
|
||||
wintc-cpl-sysdm
|
||||
src/application.c
|
||||
src/application.h
|
||||
src/main.c
|
||||
src/meta.h
|
||||
src/resources.c
|
||||
src/window.c
|
||||
src/window.h
|
||||
)
|
||||
|
||||
set_target_properties(
|
||||
wintc-cpl-sysdm
|
||||
PROPERTIES
|
||||
OUTPUT_NAME sysdm.cpl
|
||||
)
|
||||
|
||||
target_compile_options(
|
||||
wintc-cpl-sysdm
|
||||
PRIVATE ${WINTC_COMPILE_OPTIONS}
|
||||
)
|
||||
|
||||
target_include_directories(
|
||||
wintc-cpl-sysdm
|
||||
SYSTEM
|
||||
PRIVATE ${GLIB_INCLUDE_DIRS}
|
||||
PRIVATE ${GTK3_INCLUDE_DIRS}
|
||||
PRIVATE ${WINTC_COMCTL_INCLUDE_DIRS}
|
||||
PRIVATE ${WINTC_COMGTK_INCLUDE_DIRS}
|
||||
PRIVATE ${WINTC_SHCOMMON_INCLUDE_DIRS}
|
||||
PRIVATE ${WINTC_SHLANG_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
target_link_directories(
|
||||
wintc-cpl-sysdm
|
||||
PRIVATE ${GLIB_LIBRARY_DIRS}
|
||||
PRIVATE ${GTK3_LIBRARY_DIRS}
|
||||
PRIVATE ${WINTC_COMCTL_LIBRARY_DIRS}
|
||||
PRIVATE ${WINTC_COMGTK_LIBRARY_DIRS}
|
||||
PRIVATE ${WINTC_SHCOMMON_LIBRARY_DIRS}
|
||||
PRIVATE ${WINTC_SHLANG_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
wintc-cpl-sysdm
|
||||
PRIVATE ${GLIB_LIBRARIES}
|
||||
PRIVATE ${GTK3_LIBRARIES}
|
||||
PRIVATE ${WINTC_COMCTL_LIBRARIES}
|
||||
PRIVATE ${WINTC_COMGTK_LIBRARIES}
|
||||
PRIVATE ${WINTC_SHCOMMON_LIBRARIES}
|
||||
PRIVATE ${WINTC_SHLANG_LIBRARIES}
|
||||
)
|
||||
|
||||
add_dependencies(
|
||||
wintc-cpl-sysdm
|
||||
build-gresources
|
||||
)
|
||||
|
||||
# Installation
|
||||
#
|
||||
wintc_configure_and_install_packaging()
|
||||
wintc_install_icons_into_package()
|
||||
|
||||
install(
|
||||
FILES sysdm.desktop
|
||||
DESTINATION share/wintc/cpl
|
||||
)
|
||||
install(
|
||||
FILES uk.co.oddmatics.wintc.cpl-sysdm.desktop
|
||||
DESTINATION share/applications
|
||||
)
|
||||
install(
|
||||
TARGETS wintc-cpl-sysdm
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
4
shell/cpl/sysdm/README.MD
Normal file
@@ -0,0 +1,4 @@
|
||||
# sysdm.cpl
|
||||
This directory contains the source code for the *System* Control Panel applet.
|
||||
|
||||

|
||||
6
shell/cpl/sysdm/deps
Normal file
@@ -0,0 +1,6 @@
|
||||
bt,rt:glib2
|
||||
bt,rt:gtk3
|
||||
bt,rt:wintc-comctl
|
||||
bt,rt:wintc-comgtk
|
||||
bt,rt:wintc-shcommon
|
||||
bt,rt:wintc-shlang
|
||||
BIN
shell/cpl/sysdm/icons/16x16/uk.co.oddmatics.wintc.cpl-sysdm.png
Normal file
|
After Width: | Height: | Size: 864 B |
BIN
shell/cpl/sysdm/icons/32x32/uk.co.oddmatics.wintc.cpl-sysdm.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
shell/cpl/sysdm/icons/48x48/uk.co.oddmatics.wintc.cpl-sysdm.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
97
shell/cpl/sysdm/src/application.c
Normal file
@@ -0,0 +1,97 @@
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <wintc/comctl.h>
|
||||
#include <wintc/comgtk.h>
|
||||
|
||||
#include "application.h"
|
||||
#include "window.h"
|
||||
|
||||
//
|
||||
// CONSTANTS
|
||||
//
|
||||
static const gchar* S_APP_ID = "uk.co.oddmatics.wintc.cpl-sysdm";
|
||||
|
||||
//
|
||||
// GTK OOP CLASS/INSTANCE DEFINITIONS
|
||||
//
|
||||
struct _WinTCCplSysdmApplicationClass
|
||||
{
|
||||
GtkApplicationClass __parent__;
|
||||
};
|
||||
|
||||
struct _WinTCCplSysdmApplication
|
||||
{
|
||||
GtkApplication __parent__;
|
||||
};
|
||||
|
||||
//
|
||||
// FORWARD DECLARATIONS
|
||||
//
|
||||
static void wintc_cpl_sysdm_application_activate(
|
||||
GApplication* application
|
||||
);
|
||||
static void wintc_cpl_sysdm_application_startup(
|
||||
GApplication* application
|
||||
);
|
||||
|
||||
//
|
||||
// GTK TYPE DEFINITIONS & CTORS
|
||||
//
|
||||
G_DEFINE_TYPE(
|
||||
WinTCCplSysdmApplication,
|
||||
wintc_cpl_sysdm_application,
|
||||
GTK_TYPE_APPLICATION
|
||||
)
|
||||
|
||||
static void wintc_cpl_sysdm_application_class_init(
|
||||
WinTCCplSysdmApplicationClass* klass
|
||||
)
|
||||
{
|
||||
GApplicationClass* application_class = G_APPLICATION_CLASS(klass);
|
||||
|
||||
application_class->activate = wintc_cpl_sysdm_application_activate;
|
||||
application_class->startup = wintc_cpl_sysdm_application_startup;
|
||||
}
|
||||
|
||||
static void wintc_cpl_sysdm_application_init(
|
||||
WINTC_UNUSED(WinTCCplSysdmApplication* self)
|
||||
) { }
|
||||
|
||||
//
|
||||
// CLASS VIRTUAL METHODS
|
||||
//
|
||||
static void wintc_cpl_sysdm_application_activate(
|
||||
GApplication* application
|
||||
)
|
||||
{
|
||||
GtkWidget* new_window =
|
||||
wintc_cpl_sysdm_window_new(WINTC_CPL_SYSDM_APPLICATION(application));
|
||||
|
||||
gtk_widget_show_all(new_window);
|
||||
}
|
||||
|
||||
static void wintc_cpl_sysdm_application_startup(
|
||||
GApplication* application
|
||||
)
|
||||
{
|
||||
(G_APPLICATION_CLASS(wintc_cpl_sysdm_application_parent_class))
|
||||
->startup(application);
|
||||
|
||||
g_set_prgname(S_APP_ID);
|
||||
|
||||
wintc_ctl_install_default_styles();
|
||||
}
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
WinTCCplSysdmApplication* wintc_cpl_sysdm_application_new(void)
|
||||
{
|
||||
return WINTC_CPL_SYSDM_APPLICATION(
|
||||
g_object_new(
|
||||
wintc_cpl_sysdm_application_get_type(),
|
||||
"application-id", S_APP_ID,
|
||||
NULL
|
||||
)
|
||||
);
|
||||
}
|
||||
27
shell/cpl/sysdm/src/application.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef __APPLICATION_H__
|
||||
#define __APPLICATION_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
//
|
||||
// GTK OOP BOILERPLATE
|
||||
//
|
||||
typedef struct _WinTCCplSysdmApplicationClass WinTCCplSysdmApplicationClass;
|
||||
typedef struct _WinTCCplSysdmApplication WinTCCplSysdmApplication;
|
||||
|
||||
#define WINTC_TYPE_CPL_SYSDM_APPLICATION (wintc_cpl_sysdm_application_get_type())
|
||||
#define WINTC_CPL_SYSDM_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WINTC_TYPE_CPL_SYSDM_APPLICATION, WinTCCplSysdmApplication))
|
||||
#define WINTC_CPL_SYSDM_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WINTC_TYPE_CPL_SYSDM_APPLICATION, WinTCCplSysdmApplicationClass))
|
||||
#define IS_WINTC_CPL_SYSDM_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WINTC_TYPE_CPL_SYSDM_APPLICATION))
|
||||
#define IS_WINTC_CPL_SYSDM_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WINTC_TYPE_CPL_SYSDM_APPLICATION))
|
||||
#define WINTC_CPL_SYSDM_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WINTC_TYPE_CPL_SYSDM_APPLICATION, WinTCCplSysdmApplicationClass))
|
||||
|
||||
GType wintc_cpl_sysdm_application_get_type(void) G_GNUC_CONST;
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
WinTCCplSysdmApplication* wintc_cpl_sysdm_application_new(void);
|
||||
|
||||
#endif
|
||||
32
shell/cpl/sysdm/src/main.c
Normal file
@@ -0,0 +1,32 @@
|
||||
#include <glib.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <locale.h>
|
||||
#include <wintc/shlang.h>
|
||||
|
||||
#include "application.h"
|
||||
#include "meta.h"
|
||||
|
||||
int main(
|
||||
int argc,
|
||||
char* argv[]
|
||||
)
|
||||
{
|
||||
// Set up locales
|
||||
//
|
||||
setlocale(LC_ALL, "");
|
||||
bindtextdomain(PKG_NAME, WINTC_LOCALE_DIR);
|
||||
textdomain(PKG_NAME);
|
||||
|
||||
// Launch application
|
||||
//
|
||||
WinTCCplSysdmApplication* app = wintc_cpl_sysdm_application_new();
|
||||
int status;
|
||||
|
||||
g_set_application_name("System");
|
||||
|
||||
status = g_application_run(G_APPLICATION(app), argc, argv);
|
||||
|
||||
g_object_unref(app);
|
||||
|
||||
return status;
|
||||
}
|
||||
BIN
shell/cpl/sysdm/src/res/comphi.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
shell/cpl/sysdm/src/res/complow.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
130
shell/cpl/sysdm/src/res/page-gen.ui
Normal file
@@ -0,0 +1,130 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.24"/>
|
||||
<object class="GtkLabel" id="label-title">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="label" translatable="yes">General</property>
|
||||
</object>
|
||||
<object class="GtkBox" id="page-box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
|
||||
<!-- Windows version box -->
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="resource">/uk/oddmatics/wintc/cpl-sysdm/comphi.png</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">System:</property>
|
||||
<property name="xalign">0.0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="no">WINTC_PROJECT_NAME</property>
|
||||
<property name="xalign">0.0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="no">WINTC_SKU</property>
|
||||
<property name="xalign">0.0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="no">Version 2002</property>
|
||||
<property name="xalign">0.0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<!-- Computer info box -->
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
9
shell/cpl/sysdm/src/res/resources.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<gresources>
|
||||
<gresource prefix="/uk/oddmatics/wintc/cpl-sysdm">
|
||||
<file>sysdm.ui</file>
|
||||
<file>page-gen.ui</file>
|
||||
<file>comphi.png</file>
|
||||
<file>complow.png</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
80
shell/cpl/sysdm/src/res/sysdm.ui
Normal file
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.40.0 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.24"/>
|
||||
<object class="GtkBox" id="main-box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkNotebook" id="main-notebook">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="button-apply">
|
||||
<property name="label" translatable="yes">Apply</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack-type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="button-cancel">
|
||||
<property name="label" translatable="yes">Cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="action-name">win.close</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack-type">end</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="button-ok">
|
||||
<property name="label" translatable="yes">OK</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="action-name">win.close</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack-type">end</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<style>
|
||||
<class name="wintc-button-box"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
181
shell/cpl/sysdm/src/window.c
Normal file
@@ -0,0 +1,181 @@
|
||||
#include <glib.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <wintc/comgtk.h>
|
||||
#include <wintc/shlang.h>
|
||||
|
||||
#include "application.h"
|
||||
#include "window.h"
|
||||
|
||||
//
|
||||
// FORWARD DECLARATIONS
|
||||
//
|
||||
static void add_sysdm_page(
|
||||
GtkNotebook* notebook_main,
|
||||
gchar* resource_path
|
||||
);
|
||||
|
||||
static void action_close(
|
||||
GSimpleAction* action,
|
||||
GVariant* parameter,
|
||||
gpointer user_data
|
||||
);
|
||||
|
||||
//
|
||||
// STATIC DATA
|
||||
//
|
||||
static GActionEntry s_window_actions[] = {
|
||||
{
|
||||
.name = "close",
|
||||
.activate = action_close,
|
||||
.parameter_type = NULL,
|
||||
.state = NULL,
|
||||
.change_state = NULL
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
// GTK OOP CLASS/INSTANCE DEFINITIONS
|
||||
//
|
||||
struct _WinTCCplSysdmWindowClass
|
||||
{
|
||||
GtkApplicationWindowClass __parent__;
|
||||
};
|
||||
|
||||
struct _WinTCCplSysdmWindow
|
||||
{
|
||||
GtkApplicationWindow __parent__;
|
||||
|
||||
// UI
|
||||
//
|
||||
GtkWidget* notebook_main;
|
||||
};
|
||||
|
||||
//
|
||||
// GTK TYPE DEFINITION & CTORS
|
||||
//
|
||||
G_DEFINE_TYPE(
|
||||
WinTCCplSysdmWindow,
|
||||
wintc_cpl_sysdm_window,
|
||||
GTK_TYPE_APPLICATION_WINDOW
|
||||
)
|
||||
|
||||
static void wintc_cpl_sysdm_window_class_init(
|
||||
WINTC_UNUSED(WinTCCplSysdmWindowClass* klass)
|
||||
) {}
|
||||
|
||||
static void wintc_cpl_sysdm_window_init(
|
||||
WinTCCplSysdmWindow* self
|
||||
)
|
||||
{
|
||||
GtkBuilder* builder;
|
||||
GtkWidget* main_box;
|
||||
|
||||
gtk_widget_set_size_request(
|
||||
GTK_WIDGET(self),
|
||||
414, // Approx.
|
||||
454
|
||||
);
|
||||
gtk_window_set_resizable(
|
||||
GTK_WINDOW(self),
|
||||
FALSE
|
||||
);
|
||||
gtk_window_set_skip_taskbar_hint(
|
||||
GTK_WINDOW(self),
|
||||
TRUE
|
||||
);
|
||||
|
||||
// Define GActions
|
||||
//
|
||||
g_action_map_add_action_entries(
|
||||
G_ACTION_MAP(self),
|
||||
s_window_actions,
|
||||
G_N_ELEMENTS(s_window_actions),
|
||||
self
|
||||
);
|
||||
|
||||
// Initialize UI
|
||||
//
|
||||
builder =
|
||||
gtk_builder_new_from_resource(
|
||||
"/uk/oddmatics/wintc/cpl-sysdm/sysdm.ui"
|
||||
);
|
||||
|
||||
wintc_lc_builder_preprocess_widget_text(builder);
|
||||
|
||||
main_box = GTK_WIDGET(gtk_builder_get_object(builder, "main-box"));
|
||||
|
||||
gtk_container_add(GTK_CONTAINER(self), main_box);
|
||||
|
||||
// Pull out widgets
|
||||
//
|
||||
self->notebook_main = GTK_WIDGET(
|
||||
gtk_builder_get_object(builder, "main-notebook")
|
||||
);
|
||||
|
||||
g_object_unref(G_OBJECT(builder));
|
||||
|
||||
// Init pages
|
||||
//
|
||||
add_sysdm_page(
|
||||
GTK_NOTEBOOK(self->notebook_main),
|
||||
"/uk/oddmatics/wintc/cpl-sysdm/page-gen.ui"
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
GtkWidget* wintc_cpl_sysdm_window_new(
|
||||
WinTCCplSysdmApplication* app
|
||||
)
|
||||
{
|
||||
return GTK_WIDGET(
|
||||
g_object_new(
|
||||
WINTC_TYPE_CPL_SYSDM_WINDOW,
|
||||
"application", GTK_APPLICATION(app),
|
||||
"title", _("System Properties"),
|
||||
NULL
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// PRIVATE FUNCTIONS
|
||||
//
|
||||
static void add_sysdm_page(
|
||||
GtkNotebook* notebook_main,
|
||||
gchar* resource_path
|
||||
)
|
||||
{
|
||||
GtkBuilder* builder;
|
||||
GtkWidget* box_page;
|
||||
GtkWidget* label_title;
|
||||
|
||||
builder = gtk_builder_new_from_resource(resource_path);
|
||||
|
||||
wintc_lc_builder_preprocess_widget_text(builder);
|
||||
|
||||
box_page = GTK_WIDGET(gtk_builder_get_object(builder, "page-box"));
|
||||
label_title = GTK_WIDGET(gtk_builder_get_object(builder, "label-title"));
|
||||
|
||||
gtk_notebook_append_page(
|
||||
notebook_main,
|
||||
box_page,
|
||||
label_title
|
||||
);
|
||||
|
||||
g_object_unref(G_OBJECT(builder));
|
||||
}
|
||||
|
||||
//
|
||||
// CALLBACKS
|
||||
//
|
||||
static void action_close(
|
||||
WINTC_UNUSED(GSimpleAction* action),
|
||||
WINTC_UNUSED(GVariant* parameter),
|
||||
gpointer user_data
|
||||
)
|
||||
{
|
||||
gtk_window_close(GTK_WINDOW(user_data));
|
||||
}
|
||||
31
shell/cpl/sysdm/src/window.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef __WINDOW_H__
|
||||
#define __WINDOW_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "application.h"
|
||||
|
||||
//
|
||||
// GTK OOP BOILERPLATE
|
||||
//
|
||||
typedef struct _WinTCCplSysdmWindowClass WinTCCplSysdmWindowClass;
|
||||
typedef struct _WinTCCplSysdmWindow WinTCCplSysdmWindow;
|
||||
|
||||
#define WINTC_TYPE_CPL_SYSDM_WINDOW (wintc_cpl_sysdm_window_get_type())
|
||||
#define WINTC_CPL_SYSDM_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WINTC_TYPE_CPL_SYSDM_WINDOW, WinTCCplSysdmWindow))
|
||||
#define WINTC_CPL_SYSDM_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WINTC_TYPE_CPL_SYSDM_WINDOW, WinTCCplSysdmWindowClass))
|
||||
#define IS_WINTC_CPL_SYSDM_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WINTC_TYPE_CPL_SYSDM_WINDOW))
|
||||
#define IS_WINTC_CPL_SYSDM_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WINTC_TYPE_CPL_SYSDM_WINDOW))
|
||||
#define WINTC_CPL_SYSDM_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WINTC_TYPE_CPL_SYSDM_WINDOW, WinTCCplSysdmWindowClass))
|
||||
|
||||
GType wintc_cpl_sysdm_window_get_type(void) G_GNUC_CONST;
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
GtkWidget* wintc_cpl_sysdm_window_new(
|
||||
WinTCCplSysdmApplication* app
|
||||
);
|
||||
|
||||
#endif
|
||||
5
shell/cpl/sysdm/sysdm.desktop
Normal file
@@ -0,0 +1,5 @@
|
||||
[CplApplet]
|
||||
Name=System
|
||||
Comment=See information about your computer system, and change settings for hardware, performance, and automatic updates.
|
||||
Exec=sysdm.cpl
|
||||
Icon=uk.co.oddmatics.wintc.cpl-sysdm
|
||||
10
shell/cpl/sysdm/uk.co.oddmatics.wintc.cpl-sysdm.desktop
Normal file
@@ -0,0 +1,10 @@
|
||||
[Desktop Entry]
|
||||
Name=System
|
||||
Comment=See information about your computer system, and change settings for hardware, performance, and automatic updates.
|
||||
Exec=sysdm.cpl
|
||||
Icon=uk.co.oddmatics.wintc.cpl-sysdm
|
||||
Terminal=false
|
||||
StartupNotify=false
|
||||
Type=Application
|
||||
Categories=Settings;GTK;
|
||||
OnlyShowIn=WINTC;
|
||||
104
shell/explorer/CMakeLists.txt
Normal file
@@ -0,0 +1,104 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
project(
|
||||
wintc-explorer
|
||||
VERSION 1.0
|
||||
DESCRIPTION "Windows Total Conversion Explorer application."
|
||||
LANGUAGES C
|
||||
)
|
||||
|
||||
set(PROJECT_ANYARCH false)
|
||||
set(PROJECT_FREESTATUS true)
|
||||
set(PROJECT_MAINTAINER "Rory Fewell <roryf@oddmatics.uk>")
|
||||
|
||||
set(PROJECT_ROOT ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
include(../../packaging/cmake-inc/common/CMakeLists.txt)
|
||||
include(../../packaging/cmake-inc/linking/CMakeLists.txt)
|
||||
include(../../packaging/cmake-inc/packaging/CMakeLists.txt)
|
||||
include(../../packaging/cmake-inc/resources/CMakeLists.txt)
|
||||
|
||||
wintc_resolve_library(glib-2.0 GLIB)
|
||||
wintc_resolve_library(gtk+-3.0 GTK3)
|
||||
wintc_resolve_library(wintc-comctl WINTC_COMCTL)
|
||||
wintc_resolve_library(wintc-comgtk WINTC_COMGTK)
|
||||
wintc_resolve_library(wintc-shcommon WINTC_SHCOMMON)
|
||||
wintc_resolve_library(wintc-shell WINTC_SHELL)
|
||||
wintc_resolve_library(wintc-shellext WINTC_SHELLEXT)
|
||||
wintc_resolve_library(wintc-shlang WINTC_SHLANG)
|
||||
|
||||
wintc_compile_resources()
|
||||
|
||||
add_executable(
|
||||
wintc-explorer
|
||||
src/application.c
|
||||
src/application.h
|
||||
src/main.c
|
||||
src/resources.c
|
||||
src/window.c
|
||||
src/window.h
|
||||
)
|
||||
|
||||
set_target_properties(
|
||||
wintc-explorer
|
||||
PROPERTIES
|
||||
OUTPUT_NAME explorer
|
||||
)
|
||||
|
||||
target_compile_options(
|
||||
wintc-explorer
|
||||
PRIVATE ${WINTC_COMPILE_OPTIONS}
|
||||
)
|
||||
|
||||
target_include_directories(
|
||||
wintc-explorer
|
||||
SYSTEM
|
||||
PRIVATE ${GLIB_INCLUDE_DIRS}
|
||||
PRIVATE ${GTK3_INCLUDE_DIRS}
|
||||
PRIVATE ${WINTC_COMCTL_INCLUDE_DIRS}
|
||||
PRIVATE ${WINTC_COMGTK_INCLUDE_DIRS}
|
||||
PRIVATE ${WINTC_SHCOMMON_INCLUDE_DIRS}
|
||||
PRIVATE ${WINTC_SHELL_INCLUDE_DIRS}
|
||||
PRIVATE ${WINTC_SHELLEXT_INCLUDE_DIRS}
|
||||
PRIVATE ${WINTC_SHLANG_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
target_link_directories(
|
||||
wintc-explorer
|
||||
PRIVATE ${GLIB_LIBRARY_DIRS}
|
||||
PRIVATE ${GTK3_LIBRARY_DIRS}
|
||||
PRIVATE ${WINTC_COMCTL_LIBRARY_DIRS}
|
||||
PRIVATE ${WINTC_COMGTK_LIBRARY_DIRS}
|
||||
PRIVATE ${WINTC_SHCOMMON_LIBRARY_DIRS}
|
||||
PRIVATE ${WINTC_SHELL_LIBRARY_DIRS}
|
||||
PRIVATE ${WINTC_SHELLEXT_LIBRARY_DIRS}
|
||||
PRIVATE ${WINTC_SHLANG_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
wintc-explorer
|
||||
PRIVATE ${GLIB_LIBRARIES}
|
||||
PRIVATE ${GTK3_LIBRARIES}
|
||||
PRIVATE ${WINTC_COMCTL_LIBRARIES}
|
||||
PRIVATE ${WINTC_COMGTK_LIBRARIES}
|
||||
PRIVATE ${WINTC_SHCOMMON_LIBRARIES}
|
||||
PRIVATE ${WINTC_SHELL_LIBRARIES}
|
||||
PRIVATE ${WINTC_SHELLEXT_LIBRARIES}
|
||||
PRIVATE ${WINTC_SHLANG_LIBRARIES}
|
||||
)
|
||||
|
||||
# Installation
|
||||
#
|
||||
wintc_configure_and_install_packaging()
|
||||
wintc_install_icons_into_package()
|
||||
|
||||
install(
|
||||
FILES explorer.desktop
|
||||
DESTINATION share/applications
|
||||
)
|
||||
install(
|
||||
TARGETS wintc-explorer
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
4
shell/explorer/README.MD
Normal file
@@ -0,0 +1,4 @@
|
||||
# explorer
|
||||
This directory contains the source code for *Explorer*.
|
||||
|
||||

|
||||
8
shell/explorer/deps
Normal file
@@ -0,0 +1,8 @@
|
||||
bt,rt:glib2
|
||||
bt,rt:gtk3
|
||||
bt,rt:wintc-comctl
|
||||
bt,rt:wintc-comgtk
|
||||
bt,rt:wintc-shcommon
|
||||
bt,rt:wintc-shell
|
||||
bt,rt:wintc-shellext
|
||||
bt,rt:wintc-shlang
|
||||
9
shell/explorer/explorer.desktop
Normal file
@@ -0,0 +1,9 @@
|
||||
[Desktop Entry]
|
||||
Name=Windows Explorer
|
||||
Comment=Displays the files and folders on your computer.
|
||||
Exec=explorer
|
||||
Icon=explorer
|
||||
Terminal=false
|
||||
StartupNotify=false
|
||||
Type=Application
|
||||
Categories=Utility;GTK;
|
||||
BIN
shell/explorer/icons/16x16/explorer.png
Normal file
|
After Width: | Height: | Size: 647 B |
BIN
shell/explorer/icons/32x32/explorer.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
shell/explorer/icons/48x48/explorer.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
118
shell/explorer/src/application.c
Normal file
@@ -0,0 +1,118 @@
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <wintc/comctl.h>
|
||||
#include <wintc/comgtk.h>
|
||||
#include <wintc/shell.h>
|
||||
#include <wintc/shellext.h>
|
||||
|
||||
#include "application.h"
|
||||
#include "window.h"
|
||||
|
||||
//
|
||||
// GTK OOP CLASS/INSTANCE DEFINITIONS
|
||||
//
|
||||
struct _WinTCExplorerApplicationClass
|
||||
{
|
||||
GtkApplicationClass __parent__;
|
||||
};
|
||||
|
||||
struct _WinTCExplorerApplication
|
||||
{
|
||||
GtkApplication __parent__;
|
||||
|
||||
// Application state
|
||||
//
|
||||
WinTCShextHost* shext_host;
|
||||
};
|
||||
|
||||
//
|
||||
// FORWARD DECLARATIONS
|
||||
//
|
||||
static void wintc_explorer_application_activate(
|
||||
GApplication* application
|
||||
);
|
||||
static void wintc_explorer_application_startup(
|
||||
GApplication* application
|
||||
);
|
||||
|
||||
//
|
||||
// GTK TYPE DEFINITIONS & CTORS
|
||||
//
|
||||
G_DEFINE_TYPE(
|
||||
WinTCExplorerApplication,
|
||||
wintc_explorer_application,
|
||||
GTK_TYPE_APPLICATION
|
||||
)
|
||||
|
||||
static void wintc_explorer_application_class_init(
|
||||
WinTCExplorerApplicationClass* klass
|
||||
)
|
||||
{
|
||||
GApplicationClass* application_class = G_APPLICATION_CLASS(klass);
|
||||
|
||||
application_class->activate = wintc_explorer_application_activate;
|
||||
application_class->startup = wintc_explorer_application_startup;
|
||||
}
|
||||
|
||||
static void wintc_explorer_application_init(
|
||||
WINTC_UNUSED(WinTCExplorerApplication* self)
|
||||
) { }
|
||||
|
||||
//
|
||||
// CLASS VIRTUAL METHODS
|
||||
//
|
||||
static void wintc_explorer_application_activate(
|
||||
GApplication* application
|
||||
)
|
||||
{
|
||||
WinTCExplorerApplication* explorer_app =
|
||||
WINTC_EXPLORER_APPLICATION(application);
|
||||
|
||||
GtkWidget* new_window =
|
||||
wintc_explorer_window_new(
|
||||
explorer_app,
|
||||
explorer_app->shext_host
|
||||
);
|
||||
|
||||
gtk_widget_show_all(new_window);
|
||||
}
|
||||
|
||||
static void wintc_explorer_application_startup(
|
||||
GApplication* application
|
||||
)
|
||||
{
|
||||
WinTCExplorerApplication* explorer_app =
|
||||
WINTC_EXPLORER_APPLICATION(application);
|
||||
|
||||
(G_APPLICATION_CLASS(wintc_explorer_application_parent_class))
|
||||
->startup(application);
|
||||
|
||||
// Init comctl
|
||||
//
|
||||
wintc_ctl_install_default_styles();
|
||||
|
||||
// Create shext host instance
|
||||
//
|
||||
explorer_app->shext_host = wintc_shext_host_new();
|
||||
|
||||
wintc_sh_init_builtin_extensions(explorer_app->shext_host);
|
||||
wintc_shext_host_load_extensions(
|
||||
explorer_app->shext_host,
|
||||
WINTC_SHEXT_LOAD_DEFAULT,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
WinTCExplorerApplication* wintc_explorer_application_new(void)
|
||||
{
|
||||
return WINTC_EXPLORER_APPLICATION(
|
||||
g_object_new(
|
||||
wintc_explorer_application_get_type(),
|
||||
"application-id", "uk.co.oddmatics.wintc.explorer",
|
||||
NULL
|
||||
)
|
||||
);
|
||||
}
|
||||
27
shell/explorer/src/application.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef __APPLICATION_H__
|
||||
#define __APPLICATION_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
//
|
||||
// GTK OOP BOILERPLATE
|
||||
//
|
||||
typedef struct _WinTCExplorerApplicationClass WinTCExplorerApplicationClass;
|
||||
typedef struct _WinTCExplorerApplication WinTCExplorerApplication;
|
||||
|
||||
#define WINTC_TYPE_EXPLORER_APPLICATION (wintc_explorer_application_get_type())
|
||||
#define WINTC_EXPLORER_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WINTC_TYPE_EXPLORER_APPLICATION, WinTCExplorerApplication))
|
||||
#define WINTC_EXPLORER_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WINTC_TYPE_EXPLORER_APPLICATION, WinTCExplorerApplicationClass))
|
||||
#define IS_WINTC_EXPLORER_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WINTC_TYPE_EXPLORER_APPLICATION))
|
||||
#define IS_WINTC_EXPLORER_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WINTC_TYPE_EXPLORER_APPLICATION))
|
||||
#define WINTC_EXPLORER_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WINTC_TYPE_EXPLORER_APPLICATION, WinTCExplorerApplicationClass))
|
||||
|
||||
GType wintc_explorer_application_get_type(void) G_GNUC_CONST;
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
WinTCExplorerApplication* wintc_explorer_application_new(void);
|
||||
|
||||
#endif
|
||||
20
shell/explorer/src/main.c
Normal file
@@ -0,0 +1,20 @@
|
||||
#include <glib.h>
|
||||
|
||||
#include "application.h"
|
||||
|
||||
int main(
|
||||
int argc,
|
||||
char* argv[]
|
||||
)
|
||||
{
|
||||
WinTCExplorerApplication* app = wintc_explorer_application_new();
|
||||
int status;
|
||||
|
||||
g_set_application_name("Explorer");
|
||||
|
||||
status = g_application_run(G_APPLICATION(app), argc, argv);
|
||||
|
||||
g_object_unref(app);
|
||||
|
||||
return status;
|
||||
}
|
||||
832
shell/explorer/src/res/explorer.ui
Normal file
@@ -0,0 +1,832 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<object class="GtkBox" id="main-box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<child>
|
||||
<object class="GtkMenuBar">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
|
||||
<!-- FILE MENU -->
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="no">%CTL_FILEMENU%</property>
|
||||
<!-- Child submenu is dynamic - based on view -->
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- EDIT MENU -->
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="no">%CTL_EDITMENU%</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="no">%CTL_UNDO%</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="no">%CTL_CUT%</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="no">%CTL_COPY%</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="no">%CTL_PASTE%</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Paste Shortcut</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Copy To Folder...</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Move To Folder...</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Select All</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Invert Selection</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- VIEW MENU -->
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="no">%CTL_VIEWMENU%</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<!-- Toolbars -->
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Toolbars</property>
|
||||
<property name="use-underline">True</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Standard Buttons</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Address Bar</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Links</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Lock the Toolbars</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">%PUNC_MOREINPUT%%CTL_CUSTOMIZE%</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Status Bar</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Explorer Bar</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Thumbnails</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Tiles</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Icons</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">List</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Details</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Arrange Icons by</property>
|
||||
<property name="use-underline">True</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Name</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Size</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Type</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Modified</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Show in Groups</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Auto Arrange</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Align to Grid</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Choose Details...</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="no">%CTL_GOTO%</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Refresh</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- FAVOURITES MENU -->
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Favorites</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Add to Favorites...</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Organize Favorites...</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- TOOLS MENU -->
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="no">%CTL_TOOLSMENU%</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Map Network Drive...</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Disconnect Network Drive...</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Synchronize...</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Folder Options...</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- HELP MENU -->
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="no">%CTL_HELPMENU%</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Help and Support Center</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Is this copy of Windows legal?</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">About Windows</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="WinTCCtlAnimation" id="throbber">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkToolbar">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="receives-default">False</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="icon-name">go-previous</property>
|
||||
<property name="icon-size">3</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label">Back</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="receives-default">False</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="icon-name">go-next</property>
|
||||
<property name="icon-size">3</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="button-nav-up">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="receives-default">False</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="icon-name">go-up</property>
|
||||
<property name="icon-size">3</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorToolItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="receives-default">False</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="icon-name">system-search</property>
|
||||
<property name="icon-size">3</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label">Search</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="receives-default">False</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="icon-name">folders</property>
|
||||
<property name="icon-size">3</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label">Folders</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkToolbar">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="sensitive">False</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Address</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="homogeneous">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkComboBoxText">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="receives-default">False</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label">Go</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkPaned">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
|
||||
<!-- FIXME: Placing folder view directly in for now -->
|
||||
<child>
|
||||
<object class="GtkTreeView">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="resize">False</property>
|
||||
<property name="shrink">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<!-- FIXME: Placing shell view directly in for now -->
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="shadow-type">in</property>
|
||||
<child>
|
||||
<object class="GtkIconView" id="browse-view">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="margin">6</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="resize">True</property>
|
||||
<property name="shrink">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
6
shell/explorer/src/res/resources.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<gresources>
|
||||
<gresource prefix="/uk/oddmatics/wintc/explorer">
|
||||
<file>explorer.ui</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
257
shell/explorer/src/window.c
Normal file
@@ -0,0 +1,257 @@
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <wintc/comctl.h>
|
||||
#include <wintc/comgtk.h>
|
||||
#include <wintc/shell.h>
|
||||
#include <wintc/shellext.h>
|
||||
#include <wintc/shlang.h>
|
||||
|
||||
#include "application.h"
|
||||
#include "window.h"
|
||||
|
||||
//
|
||||
// PRIVATE ENUMS
|
||||
//
|
||||
enum
|
||||
{
|
||||
PROP_SHEXT_HOST = 1
|
||||
};
|
||||
|
||||
//
|
||||
// FORWARD DECLARATIONS
|
||||
//
|
||||
static void wintc_explorer_window_constructed(
|
||||
GObject* object
|
||||
);
|
||||
static void wintc_explorer_window_dispose(
|
||||
GObject* object
|
||||
);
|
||||
static void wintc_explorer_window_set_property(
|
||||
GObject* object,
|
||||
guint prop_id,
|
||||
const GValue* value,
|
||||
GParamSpec* pspec
|
||||
);
|
||||
|
||||
static void on_button_nav_up_clicked(
|
||||
GtkButton* self,
|
||||
gpointer user_data
|
||||
);
|
||||
|
||||
//
|
||||
// GTK OOP CLASS/INSTANCE DEFINITIONS
|
||||
//
|
||||
struct _WinTCExplorerWindowClass
|
||||
{
|
||||
GtkApplicationWindowClass __parent__;
|
||||
};
|
||||
|
||||
struct _WinTCExplorerWindow
|
||||
{
|
||||
GtkApplicationWindow __parent__;
|
||||
|
||||
// Shell stuff
|
||||
//
|
||||
WinTCShBrowser* browser;
|
||||
WinTCShextHost* shext_host;
|
||||
|
||||
// UI
|
||||
//
|
||||
WinTCShIconViewBehaviour* behaviour_icons;
|
||||
GtkWidget* iconview_browser;
|
||||
|
||||
GtkWidget* button_nav_up;
|
||||
};
|
||||
|
||||
//
|
||||
// GTK TYPE DEFINITION & CTORS
|
||||
//
|
||||
G_DEFINE_TYPE(
|
||||
WinTCExplorerWindow,
|
||||
wintc_explorer_window,
|
||||
GTK_TYPE_APPLICATION_WINDOW
|
||||
)
|
||||
|
||||
static void wintc_explorer_window_class_init(
|
||||
WinTCExplorerWindowClass* klass
|
||||
)
|
||||
{
|
||||
GObjectClass* object_class = G_OBJECT_CLASS(klass);
|
||||
|
||||
object_class->constructed = wintc_explorer_window_constructed;
|
||||
object_class->dispose = wintc_explorer_window_dispose;
|
||||
object_class->set_property = wintc_explorer_window_set_property;
|
||||
|
||||
g_object_class_install_property(
|
||||
object_class,
|
||||
PROP_SHEXT_HOST,
|
||||
g_param_spec_object(
|
||||
"shext-host",
|
||||
"ShextHost",
|
||||
"The shell extension host object to use.",
|
||||
WINTC_TYPE_SHEXT_HOST,
|
||||
G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
static void wintc_explorer_window_init(
|
||||
WinTCExplorerWindow* self
|
||||
)
|
||||
{
|
||||
GtkBuilder* builder;
|
||||
GtkWidget* main_box;
|
||||
|
||||
// FIXME: Don't know what the default size should be
|
||||
//
|
||||
gtk_window_set_default_size(
|
||||
GTK_WINDOW(self),
|
||||
500,
|
||||
350
|
||||
);
|
||||
|
||||
// Initialize UI
|
||||
//
|
||||
g_type_ensure(WINTC_TYPE_CTL_ANIMATION);
|
||||
|
||||
builder =
|
||||
gtk_builder_new_from_resource(
|
||||
"/uk/oddmatics/wintc/explorer/explorer.ui"
|
||||
);
|
||||
|
||||
wintc_lc_builder_preprocess_widget_text(builder);
|
||||
|
||||
main_box = GTK_WIDGET(gtk_builder_get_object(builder, "main-box"));
|
||||
|
||||
self->iconview_browser =
|
||||
GTK_WIDGET(gtk_builder_get_object(builder, "browse-view"));
|
||||
|
||||
self->button_nav_up =
|
||||
GTK_WIDGET(gtk_builder_get_object(builder, "button-nav-up"));
|
||||
|
||||
gtk_container_add(GTK_CONTAINER(self), main_box);
|
||||
|
||||
// Link up UI
|
||||
// FIXME: This is temp, use GActions!
|
||||
//
|
||||
g_signal_connect(
|
||||
self->button_nav_up,
|
||||
"clicked",
|
||||
G_CALLBACK(on_button_nav_up_clicked),
|
||||
self
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// CLASS VIRTUAL METHODS
|
||||
//
|
||||
static void wintc_explorer_window_constructed(
|
||||
GObject* object
|
||||
)
|
||||
{
|
||||
WinTCExplorerWindow* wnd = WINTC_EXPLORER_WINDOW(object);
|
||||
|
||||
if (!wnd->shext_host)
|
||||
{
|
||||
g_critical("%s", "explorer: window has no shext host");
|
||||
return;
|
||||
}
|
||||
|
||||
// Set up shell browser
|
||||
//
|
||||
wnd->browser = wintc_sh_browser_new(wnd->shext_host);
|
||||
|
||||
// Link up with UI
|
||||
//
|
||||
wnd->behaviour_icons =
|
||||
wintc_sh_icon_view_behaviour_new(
|
||||
GTK_ICON_VIEW(wnd->iconview_browser),
|
||||
wnd->browser
|
||||
);
|
||||
|
||||
// Navigate to desktop
|
||||
// FIXME: Need to check if we were initialised with a path in future!
|
||||
//
|
||||
gchar* desktop_path = g_strdup_printf("::{%s}", WINTC_SH_GUID_DESKTOP);
|
||||
GError* error = NULL;
|
||||
|
||||
wintc_sh_browser_set_location(
|
||||
wnd->browser,
|
||||
desktop_path,
|
||||
&error
|
||||
);
|
||||
|
||||
if (error)
|
||||
{
|
||||
wintc_display_error_and_clear(&error);
|
||||
}
|
||||
|
||||
g_free(desktop_path);
|
||||
|
||||
(G_OBJECT_CLASS(wintc_explorer_window_parent_class))->constructed(object);
|
||||
}
|
||||
|
||||
static void wintc_explorer_window_dispose(
|
||||
GObject* object
|
||||
)
|
||||
{
|
||||
WinTCExplorerWindow* wnd = WINTC_EXPLORER_WINDOW(object);
|
||||
|
||||
g_clear_object(&(wnd->behaviour_icons));
|
||||
g_clear_object(&(wnd->browser));
|
||||
g_clear_object(&(wnd->shext_host));
|
||||
|
||||
(G_OBJECT_CLASS(wintc_explorer_window_parent_class))->dispose(object);
|
||||
}
|
||||
|
||||
static void wintc_explorer_window_set_property(
|
||||
GObject* object,
|
||||
guint prop_id,
|
||||
const GValue* value,
|
||||
GParamSpec* pspec
|
||||
)
|
||||
{
|
||||
WinTCExplorerWindow* wnd = WINTC_EXPLORER_WINDOW(object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_SHEXT_HOST:
|
||||
wnd->shext_host = g_value_dup_object(value);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
GtkWidget* wintc_explorer_window_new(
|
||||
WinTCExplorerApplication* app,
|
||||
WinTCShextHost* shext_host
|
||||
)
|
||||
{
|
||||
return GTK_WIDGET(
|
||||
g_object_new(
|
||||
WINTC_TYPE_EXPLORER_WINDOW,
|
||||
"application", GTK_APPLICATION(app),
|
||||
"shext-host", shext_host,
|
||||
NULL
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// CALLBACKS
|
||||
//
|
||||
static void on_button_nav_up_clicked(
|
||||
WINTC_UNUSED(GtkButton* self),
|
||||
gpointer user_data
|
||||
)
|
||||
{
|
||||
WinTCExplorerWindow* wnd = WINTC_EXPLORER_WINDOW(user_data);
|
||||
|
||||
wintc_sh_browser_navigate_to_parent(wnd->browser);
|
||||
}
|
||||
33
shell/explorer/src/window.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef __WINDOW_H__
|
||||
#define __WINDOW_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <wintc/shellext.h>
|
||||
|
||||
#include "application.h"
|
||||
|
||||
//
|
||||
// GTK OOP BOILERPLATE
|
||||
//
|
||||
typedef struct _WinTCExplorerWindowClass WinTCExplorerWindowClass;
|
||||
typedef struct _WinTCExplorerWindow WinTCExplorerWindow;
|
||||
|
||||
#define WINTC_TYPE_EXPLORER_WINDOW (wintc_explorer_window_get_type())
|
||||
#define WINTC_EXPLORER_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WINTC_TYPE_EXPLORER_WINDOW, WinTCExplorerWindow))
|
||||
#define WINTC_EXPLORER_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WINTC_TYPE_EXPLORER_WINDOW, WinTCExplorerWindowClass))
|
||||
#define IS_WINTC_EXPLORER_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WINTC_TYPE_EXPLORER_WINDOW))
|
||||
#define IS_WINTC_EXPLORER_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WINTC_TYPE_EXPLORER_WINDOW))
|
||||
#define WINTC_EXPLORER_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WINTC_TYPE_EXPLORER_WINDOW, WinTCExplorerWindowClass))
|
||||
|
||||
GType wintc_explorer_window_get_type(void) G_GNUC_CONST;
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
GtkWidget* wintc_explorer_window_new(
|
||||
WinTCExplorerApplication* app,
|
||||
WinTCShextHost* shext_host
|
||||
);
|
||||
|
||||
#endif
|
||||
@@ -20,13 +20,14 @@ include(../../packaging/cmake-inc/linking/CMakeLists.txt)
|
||||
include(../../packaging/cmake-inc/locale/CMakeLists.txt)
|
||||
include(../../packaging/cmake-inc/packaging/CMakeLists.txt)
|
||||
|
||||
wintc_resolve_library(gdk-3.0 GDK)
|
||||
wintc_resolve_library(glib-2.0 GLIB)
|
||||
wintc_resolve_library(gtk+-3.0 GTK3)
|
||||
wintc_resolve_library(wintc-comctl WINTC_COMCTL)
|
||||
wintc_resolve_library(wintc-comgtk WINTC_COMGTK)
|
||||
wintc_resolve_library(wintc-exec WINTC_EXEC)
|
||||
wintc_resolve_library(wintc-shlang WINTC_SHLANG)
|
||||
wintc_resolve_library(gdk-3.0 GDK)
|
||||
wintc_resolve_library(glib-2.0 GLIB)
|
||||
wintc_resolve_library(gtk+-3.0 GTK3)
|
||||
wintc_resolve_library(wintc-comctl WINTC_COMCTL)
|
||||
wintc_resolve_library(wintc-comgtk WINTC_COMGTK)
|
||||
wintc_resolve_library(wintc-exec WINTC_EXEC)
|
||||
wintc_resolve_library(wintc-shcommon WINTC_SHCOMMON)
|
||||
wintc_resolve_library(wintc-shlang WINTC_SHLANG)
|
||||
|
||||
wintc_create_meta_h()
|
||||
|
||||
@@ -63,6 +64,7 @@ target_include_directories(
|
||||
PRIVATE ${WINTC_COMCTL_INCLUDE_DIRS}
|
||||
PRIVATE ${WINTC_COMGTK_INCLUDE_DIRS}
|
||||
PRIVATE ${WINTC_EXEC_INCLUDE_DIRS}
|
||||
PRIVATE ${WINTC_SHCOMMON_INCLUDE_DIRS}
|
||||
PRIVATE ${WINTC_SHLANG_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
@@ -74,6 +76,7 @@ target_link_directories(
|
||||
PRIVATE ${WINTC_COMCTL_LIBRARY_DIRS}
|
||||
PRIVATE ${WINTC_COMGTK_LIBRARY_DIRS}
|
||||
PRIVATE ${WINTC_EXEC_LIBRARY_DIRS}
|
||||
PRIVATE ${WINTC_SHCOMMON_LIBRARY_DIRS}
|
||||
PRIVATE ${WINTC_SHLANG_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
@@ -85,6 +88,7 @@ target_link_libraries(
|
||||
PRIVATE ${WINTC_COMCTL_LIBRARIES}
|
||||
PRIVATE ${WINTC_COMGTK_LIBRARIES}
|
||||
PRIVATE ${WINTC_EXEC_LIBRARIES}
|
||||
PRIVATE ${WINTC_SHCOMMON_LIBRARIES}
|
||||
PRIVATE ${WINTC_SHLANG_LIBRARIES}
|
||||
)
|
||||
|
||||
|
||||
@@ -3,4 +3,5 @@ bt,rt:gtk3
|
||||
bt,rt:wintc-comctl
|
||||
bt,rt:wintc-comgtk
|
||||
bt,rt:wintc-exec
|
||||
bt,rt:wintc-shcommon
|
||||
bt,rt:wintc-shlang
|
||||
|
||||
@@ -28,6 +28,7 @@ wintc_resolve_library(glib-2.0 GLIB)
|
||||
wintc_resolve_library(gtk+-3.0 GTK3)
|
||||
wintc_resolve_library(wintc-comgtk WINTC_COMGTK)
|
||||
wintc_resolve_library(wintc-exec WINTC_EXEC)
|
||||
wintc_resolve_library(wintc-shcommon WINTC_SHCOMMON)
|
||||
wintc_resolve_library(wintc-shelldpa WINTC_SHELLDPA)
|
||||
wintc_resolve_library(wintc-shlang WINTC_SHLANG)
|
||||
wintc_resolve_library(wintc-sndapi WINTC_SNDAPI)
|
||||
@@ -89,6 +90,7 @@ target_include_directories(
|
||||
PRIVATE ${GTK3_INCLUDE_DIRS}
|
||||
PRIVATE ${WINTC_COMGTK_INCLUDE_DIRS}
|
||||
PRIVATE ${WINTC_EXEC_INCLUDE_DIRS}
|
||||
PRIVATE ${WINTC_SHCOMMON_INCLUDE_DIRS}
|
||||
PRIVATE ${WINTC_SHELLDPA_INCLUDE_DIRS}
|
||||
PRIVATE ${WINTC_SHLANG_INCLUDE_DIRS}
|
||||
PRIVATE ${WINTC_SNDAPI_INCLUDE_DIRS}
|
||||
@@ -103,6 +105,7 @@ target_link_directories(
|
||||
PRIVATE ${GTK3_LIBRARY_DIRS}
|
||||
PRIVATE ${WINTC_COMGTK_LIBRARY_DIRS}
|
||||
PRIVATE ${WINTC_EXEC_LIBRARY_DIRS}
|
||||
PRIVATE ${WINTC_SHCOMMON_LIBRARY_DIRS}
|
||||
PRIVATE ${WINTC_SHELLDPA_LIBRARY_DIRS}
|
||||
PRIVATE ${WINTC_SHLANG_LIBRARY_DIRS}
|
||||
PRIVATE ${WINTC_SNDAPI_LIBRARY_DIRS}
|
||||
@@ -117,6 +120,7 @@ target_link_libraries(
|
||||
PRIVATE ${GTK3_LIBRARIES}
|
||||
PRIVATE ${WINTC_COMGTK_LIBRARIES}
|
||||
PRIVATE ${WINTC_EXEC_LIBRARIES}
|
||||
PRIVATE ${WINTC_SHCOMMON_LIBRARIES}
|
||||
PRIVATE ${WINTC_SHELLDPA_LIBRARIES}
|
||||
PRIVATE ${WINTC_SHLANG_LIBRARIES}
|
||||
PRIVATE ${WINTC_SNDAPI_LIBRARIES}
|
||||
|
||||
@@ -5,6 +5,7 @@ bt,rt:glib2
|
||||
bt,rt:gtk3
|
||||
bt,rt:wintc-comgtk
|
||||
bt,rt:wintc-exec
|
||||
bt,rt:wintc-shcommon
|
||||
bt,rt:wintc-shelldpa
|
||||
bt,rt:wintc-shlang
|
||||
bt,rt:wintc-sndapi
|
||||
|
||||