forked from Mirrors/openclonk
Rename WITH_DEVELOPER_MODE to USE_GTK
This mirrors USE_WIN32_WINDOWS, USE_SDL_MAINLOOP and USE_COCOA.objectmenu
parent
d09ed41eea
commit
11bbeb2a5b
|
@ -289,7 +289,6 @@ SET(HAVE_LIBREADLINE ${READLINE_FOUND} CACHE INTERNAL "libreadline available")
|
|||
|
||||
find_package(GTK3 COMPONENTS gthread gio gobject glib OPTIONAL_COMPONENTS gtksourceview)
|
||||
if(USE_GTK)
|
||||
SET(WITH_DEVELOPER_MODE ${GTK3_FOUND})
|
||||
SET(WITH_GLIB ${GTK3_FOUND})
|
||||
include_directories(SYSTEM ${GTK3_INCLUDE_DIRS})
|
||||
# Set GTK link directory. This needs to be done before add_executable,
|
||||
|
|
|
@ -94,6 +94,7 @@
|
|||
|
||||
/* Define to 1 if the X Window System is used */
|
||||
#cmakedefine USE_X11 1
|
||||
#cmakedefine USE_GTK 1
|
||||
|
||||
/* Use Apple Cocoa for the UI */
|
||||
#cmakedefine USE_COCOA 1
|
||||
|
@ -101,9 +102,6 @@
|
|||
/* Enable automatic update system */
|
||||
#cmakedefine WITH_AUTOMATIC_UPDATE 1
|
||||
|
||||
/* Developer mode */
|
||||
#cmakedefine WITH_DEVELOPER_MODE 1
|
||||
|
||||
/* Define to 1 if the userParam parameter to GLDEBUGPROCARB is const, as the
|
||||
spec requires. */
|
||||
#cmakedefine GLDEBUGPROCARB_USERPARAM_IS_CONST 1
|
||||
|
@ -131,8 +129,8 @@
|
|||
#undef USE_COCOA
|
||||
#undef USE_SDL_MAINLOOP
|
||||
#undef USE_X11
|
||||
#undef USE_GTK 1
|
||||
#undef WITH_AUTOMATIC_UPDATE
|
||||
#undef WITH_DEVELOPER_MODE
|
||||
|
||||
#undef AUDIO_TK
|
||||
#define AUDIO_TK AUDIO_TK_NONE
|
||||
|
|
|
@ -557,7 +557,7 @@ void C4Console::RegisterRecentInput(const char *input, RecentScriptInputLists se
|
|||
mru.erase(mru.begin());
|
||||
}
|
||||
|
||||
#if !(defined(USE_WIN32_WINDOWS) || defined(USE_COCOA) || defined(WITH_DEVELOPER_MODE))
|
||||
#if !(defined(USE_WIN32_WINDOWS) || defined(USE_COCOA) || defined(USE_GTK))
|
||||
class C4ConsoleGUI::State: public C4ConsoleGUI::InternalState<class C4ConsoleGUI>
|
||||
{
|
||||
public: State(C4ConsoleGUI *console): Super(console) {}
|
||||
|
|
|
@ -19,15 +19,15 @@
|
|||
#ifndef INC_C4DevmodeDlg
|
||||
#define INC_C4DevmodeDlg
|
||||
|
||||
#ifdef WITH_DEVELOPER_MODE
|
||||
#ifdef USE_GTK
|
||||
#include <gtk/gtk.h>
|
||||
#endif // WITH_DEVELOPER_MODE
|
||||
#endif // USE_GTK
|
||||
|
||||
// TODO: Threadsafety?
|
||||
class C4DevmodeDlg
|
||||
{
|
||||
// Make sure all developer tools are held in the same window
|
||||
#ifdef WITH_DEVELOPER_MODE
|
||||
#ifdef USE_GTK
|
||||
private:
|
||||
static GtkWidget* window;
|
||||
static GtkWidget* notebook;
|
||||
|
@ -43,7 +43,7 @@ public:
|
|||
static void SwitchPage(GtkWidget* widget);
|
||||
|
||||
static void SetTitle(GtkWidget* widget, const char* title);
|
||||
#endif // WITH_DEVELOPER_MODE
|
||||
#endif // USE_GTK
|
||||
};
|
||||
|
||||
#endif //INC_C4DevmodeDlg
|
||||
|
|
|
@ -36,10 +36,8 @@
|
|||
#include "resource.h"
|
||||
#endif
|
||||
|
||||
#ifdef WITH_DEVELOPER_MODE
|
||||
# include <C4Language.h>
|
||||
|
||||
# include <gtk/gtk.h>
|
||||
#ifdef USE_GTK
|
||||
#include <gtk/gtk.h>
|
||||
#endif
|
||||
|
||||
C4EditCursor::C4EditCursor()
|
||||
|
@ -84,8 +82,7 @@ bool C4EditCursor::Init()
|
|||
#ifdef USE_WIN32_WINDOWS
|
||||
if (!(hMenu = LoadMenu(Application.GetInstance(),MAKEINTRESOURCE(IDR_CONTEXTMENUS))))
|
||||
return false;
|
||||
#else // _WIN32
|
||||
#ifdef WITH_DEVELOPER_MODE
|
||||
#elif defined(USE_GTK)
|
||||
menuContext = gtk_menu_new();
|
||||
|
||||
itemDelete = gtk_menu_item_new_with_label(LoadResStr("IDS_MNU_DELETE"));
|
||||
|
@ -101,8 +98,7 @@ bool C4EditCursor::Init()
|
|||
g_signal_connect(G_OBJECT(itemGrabContents), "activate", G_CALLBACK(OnGrabContents), this);
|
||||
|
||||
gtk_widget_show_all(menuContext);
|
||||
#endif // WITH_DEVELOPER_MODe
|
||||
#endif // _WIN32
|
||||
#endif
|
||||
Console.UpdateModeCtrls(Mode);
|
||||
|
||||
return true;
|
||||
|
@ -741,7 +737,7 @@ void C4EditCursor::AppendMenuItem(int num, const StdStrBuf & label)
|
|||
AppendMenu(GetSubMenu(hMenu,0), MF_STRING, IDM_VPORTDYN_FIRST + num, label.GetWideChar());
|
||||
else
|
||||
AppendMenu(GetSubMenu(hMenu,0), MF_SEPARATOR, IDM_VPORTDYN_FIRST, NULL);
|
||||
#elif defined(WITH_DEVELOPER_MODE)
|
||||
#elif defined(USE_GTK)
|
||||
GtkWidget * wdg;
|
||||
if (num)
|
||||
wdg = gtk_menu_item_new_with_label(label.getData());
|
||||
|
@ -766,7 +762,7 @@ bool C4EditCursor::DoContextMenu(DWORD dwKeyState)
|
|||
SetMenuItemText(hContext,IDM_VIEWPORT_DELETE,LoadResStr("IDS_MNU_DELETE"));
|
||||
SetMenuItemText(hContext,IDM_VIEWPORT_DUPLICATE,LoadResStr("IDS_MNU_DUPLICATE"));
|
||||
SetMenuItemText(hContext,IDM_VIEWPORT_CONTENTS,LoadResStr("IDS_MNU_CONTENTS"));
|
||||
#elif defined(WITH_DEVELOPER_MODE)
|
||||
#elif defined(USE_GTK)
|
||||
gtk_widget_set_sensitive(itemDelete, fObjectSelected && Console.Editing);
|
||||
gtk_widget_set_sensitive(itemDuplicate, fObjectSelected && Console.Editing);
|
||||
gtk_widget_set_sensitive(itemGrabContents, fObjectSelected && Selection.GetObject()->Contents.ObjectCount() && Console.Editing);
|
||||
|
@ -873,7 +869,7 @@ bool C4EditCursor::DoContextMenu(DWORD dwKeyState)
|
|||
break;
|
||||
}
|
||||
ObjselectDelItems();
|
||||
#elif defined(WITH_DEVELOPER_MODE)
|
||||
#elif defined(USE_GTK)
|
||||
gtk_widget_show_all(menuContext);
|
||||
gtk_menu_popup(GTK_MENU(menuContext), NULL, NULL, NULL, NULL, 3, gtk_get_current_event_time());
|
||||
#endif
|
||||
|
@ -1035,7 +1031,7 @@ void C4EditCursor::EMControl(C4PacketType eCtrlType, C4ControlPacket *pCtrl)
|
|||
::Control.DoInput(eCtrlType, pCtrl, CDT_Decide);
|
||||
}
|
||||
|
||||
#ifdef WITH_DEVELOPER_MODE
|
||||
#ifdef USE_GTK
|
||||
// GTK+ callbacks
|
||||
void C4EditCursor::OnDelete(GtkWidget* widget, gpointer data)
|
||||
{
|
||||
|
@ -1079,7 +1075,7 @@ void C4EditCursor::ObjselectDelItems() {
|
|||
if(!itemsObjselect.size()) return;
|
||||
std::vector<ObjselItemDt>::iterator it = itemsObjselect.begin();
|
||||
while(it != itemsObjselect.end()) {
|
||||
#if defined(WITH_DEVELOPER_MODE)
|
||||
#if defined(USE_GTK)
|
||||
gtk_widget_destroy(it->MenuItem);
|
||||
#elif defined(USE_WIN32_WINDOWS)
|
||||
if(!it->ItemId) { ++it; continue; }
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include "C4Rect.h"
|
||||
#include <vector>
|
||||
|
||||
#ifdef WITH_DEVELOPER_MODE
|
||||
#ifdef USE_GTK
|
||||
#include <gtk/gtk.h>
|
||||
#endif
|
||||
|
||||
|
@ -47,14 +47,14 @@ protected:
|
|||
StdCopyStrBuf Command;
|
||||
#if defined(USE_WIN32_WINDOWS)
|
||||
UINT_PTR ItemId;
|
||||
#elif defined(WITH_DEVELOPER_MODE)
|
||||
#elif defined(USE_GTK)
|
||||
GtkWidget* MenuItem;
|
||||
#endif
|
||||
};
|
||||
std::vector<ObjselItemDt> itemsObjselect;
|
||||
#ifdef USE_WIN32_WINDOWS
|
||||
HMENU hMenu;
|
||||
#elif defined(WITH_DEVELOPER_MODE)
|
||||
#elif defined(USE_GTK)
|
||||
GtkWidget* menuContext;
|
||||
GtkWidget* itemDelete;
|
||||
GtkWidget* itemDuplicate;
|
||||
|
@ -116,7 +116,7 @@ protected:
|
|||
bool RemoveFromSelection(C4Object *remove_obj); // remove object from selection and do script callback. return true if object was in selection before. Doesn't do OnSelectionChanged().
|
||||
void ClearSelection(C4Object *next_selection=NULL); // remove all objects from selection and do script callback. if next_selection is non-null, passes that to the deselection callbacks. Doesn't do OnSelectionChanged().
|
||||
|
||||
#ifdef WITH_DEVELOPER_MODE
|
||||
#ifdef USE_GTK
|
||||
static void OnDelete(GtkWidget* widget, gpointer data);
|
||||
static void OnDuplicate(GtkWidget* widget, gpointer data);
|
||||
static void OnGrabContents(GtkWidget* widget, gpointer data);
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include <C4GameObjects.h>
|
||||
|
||||
|
||||
#ifdef WITH_DEVELOPER_MODE
|
||||
#ifdef USE_GTK
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
|
||||
|
|
|
@ -19,9 +19,9 @@
|
|||
#ifndef INC_C4ObjectListDlg
|
||||
#define INC_C4ObjectListDlg
|
||||
|
||||
#ifdef WITH_DEVELOPER_MODE
|
||||
#ifdef USE_GTK
|
||||
#include <gtk/gtk.h>
|
||||
#endif // WITH_DEVELOPER_MODE
|
||||
#endif // USE_GTK
|
||||
|
||||
#include "C4ObjectList.h"
|
||||
|
||||
|
@ -38,7 +38,7 @@ public:
|
|||
virtual void OnObjectAdded(C4ObjectList * pList, C4ObjectLink * pLnk);
|
||||
virtual void OnObjectRename(C4ObjectList * pList, C4ObjectLink * pLnk);
|
||||
|
||||
#ifdef WITH_DEVELOPER_MODE
|
||||
#ifdef USE_GTK
|
||||
private:
|
||||
GtkWidget * window;
|
||||
GtkWidget * treeview;
|
||||
|
@ -48,7 +48,7 @@ private:
|
|||
static void OnDestroy(GtkWidget * widget, C4ObjectListDlg * dlg);
|
||||
static void OnRowActivated(GtkTreeView * tree_view, GtkTreePath * path, GtkTreeViewColumn * column, C4ObjectListDlg * dlg);
|
||||
static void OnSelectionChanged(GtkTreeSelection * selection, C4ObjectListDlg * dlg);
|
||||
#endif // WITH_DEVELOPER_MODE
|
||||
#endif // USE_GTK
|
||||
};
|
||||
|
||||
#endif //INC_C4ObjectListDlg
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#ifndef INC_C4ToolsDlg
|
||||
#define INC_C4ToolsDlg
|
||||
|
||||
#ifdef WITH_DEVELOPER_MODE
|
||||
#ifdef USE_GTK
|
||||
#include <gtk/gtk.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include <C4Landscape.h>
|
||||
#include <C4PlayerList.h>
|
||||
|
||||
#ifdef WITH_DEVELOPER_MODE
|
||||
#ifdef USE_GTK
|
||||
#include <gtk/gtk.h>
|
||||
#endif
|
||||
|
||||
|
@ -97,7 +97,7 @@ bool C4Viewport::ScrollBarsByViewPosition()
|
|||
return true;
|
||||
}
|
||||
|
||||
#elif defined(WITH_DEVELOPER_MODE)
|
||||
#elif defined(USE_GTK)
|
||||
bool C4Viewport::TogglePlayerLock()
|
||||
{
|
||||
if (PlayerLock)
|
||||
|
@ -160,7 +160,7 @@ bool C4Viewport::ViewPositionByScrollBars()
|
|||
return true;
|
||||
}
|
||||
|
||||
#endif // WITH_DEVELOPER_MODE
|
||||
#endif // USE_GTK
|
||||
|
||||
void C4ViewportWindow::PerformUpdate()
|
||||
{
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include <C4Window.h>
|
||||
|
||||
#ifdef WITH_DEVELOPER_MODE
|
||||
#ifdef USE_GTK
|
||||
#include <gtk/gtk.h>
|
||||
#endif
|
||||
#define C4ViewportWindowStyle (WS_VISIBLE | WS_POPUP | WS_SYSMENU | WS_CAPTION | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_SIZEBOX)
|
||||
|
@ -33,7 +33,7 @@ class C4ViewportWindow: public C4Window
|
|||
public:
|
||||
C4Viewport * cvp;
|
||||
C4ViewportWindow(C4Viewport * cvp): cvp(cvp) { }
|
||||
#if defined(WITH_DEVELOPER_MODE)
|
||||
#if defined(USE_GTK)
|
||||
GtkWidget* h_scrollbar;
|
||||
GtkWidget* v_scrollbar;
|
||||
#endif
|
||||
|
|
|
@ -50,7 +50,7 @@ bool C4Viewport::UpdateOutputSize()
|
|||
// Output size
|
||||
C4Rect rect;
|
||||
|
||||
#ifdef WITH_DEVELOPER_MODE
|
||||
#ifdef USE_GTK
|
||||
GtkAllocation allocation;
|
||||
gtk_widget_get_allocation(GTK_WIDGET(pWindow->render_widget), &allocation);
|
||||
|
||||
|
|
Loading…
Reference in New Issue